pccommand_list.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. ---> PC Command List
  2. ------> Here's a list of scripts that can be triggered by PC actions and what they do.
  3. ------> Configuration is found at conf/script_athena.conf
  4. ------> There are two methods to define the script to be use (event_script_type)
  5. ------> 0 - By NPC. There has to be an NPC named in the same manner as the event
  6. ------> 1 - By Label. Every label from every NPC with the event name will be
  7. executed (note that in this case the event HAS to start with the
  8. word 'On', eg: 'OnPCBaseLvUpEvent:')
  9. + PCCommand: OnPCLoginEvent
  10. + Code by: (davidsiaw)
  11. + How it works:
  12. When a player logs in, the NPC will run as if he just clicked it. Which means
  13. if the script is like this:
  14. + Sample:
  15. prontera,0,0,0 script OnPCLoginEvent -1,{
  16. mes "lmao";
  17. close;
  18. }
  19. + Explaination:
  20. every player who logs in will receive a message 'lmao' in their face as soon
  21. as they can see the map.
  22. + Note:
  23. 1) The name of the NPC has to match the one specified in scripts_athena.conf
  24. 2) I made it invisible because you don't need to see it. Its an abstract NPC
  25. 3) If you don't want it, simply delete it
  26. 4) If you have more than one only the first found will be execute (when using
  27. event_script_type 0)
  28. 5) You can put this script in ANY file.
  29. 6) I put an end; there because that just makes it do nothing.
  30. 7) Modify this script to your liking and give your players a surprise
  31. 8) Remember: IT RUNS LIKE A NORMAL NPC. BUT THE ONLY WAY TO 'CLICK' IT IS BY
  32. LOGGING ON
  33. 9) There are 2 ways to use this - check the examples below!
  34. -----------------------------------------------------------------------------
  35. + PCCommand: OnPcBaseLvUpEvent
  36. + Code by: lordalfa
  37. + How it works:
  38. When a player Base level increases, the NPC will run as if he just clicked it. Which means
  39. if the script is like this:
  40. + Sample:
  41. - Script OnPCBaseLvUpEvent -1,{
  42. mes "zomfg....";
  43. close;
  44. }
  45. + Explanation:
  46. whenever a player level ups his/her base level, the words zomfg will pop up
  47. in his face.
  48. + Note:
  49. 1) This script runs every moment the player gains a level. It is adviced if
  50. you want to repeatedly use this script, to use a sort of filter.
  51. 2) If a player gains multiple levels from a single kill, the script will be
  52. only called once at the end.
  53. -----------------------------------------------------------------------------
  54. + PCCommand: OnPcJobLvUpEvent
  55. + Code by: lordalfa
  56. + How it works:
  57. It's exactly the same as OnPcBaseLvUpEvent, except it triggers when leveling job.
  58. -----------------------------------------------------------------------------
  59. + PCCommand: OnOnNPCKillEvent
  60. + Code by: lordalfa
  61. + How it works:
  62. When a player kills a monster, the NPC will run as if he just clicked it. Which means
  63. if the script is like this:
  64. + Sample:
  65. - script OnNPCKillEvent -1,{
  66. mes "Holy shit";
  67. close;
  68. }
  69. + Explaination:
  70. whenever a player kills a monster on the map, the words "Holy Shit" will appear
  71. on the guy's face.
  72. + Note:
  73. 1) This script runs everytime a player kills a monster It is adviced if
  74. you want to repeatedly use this script, to use a sort of filter.
  75. 2) The var "KilledRid" is set on the killer, this can be used in
  76. strmobinfo to find out info about the Monster that was killed
  77. -----------------------------------------------------------------------------
  78. + PCCommand: OnPCKillEvent
  79. + Code by: zbuffer aka Lance
  80. + How it works:
  81. It is exactly the same as OnNPCKillEvent, except it triggers when a player kills another player.
  82. -----------------------------------------------------------------------------
  83. + PCCommand: OnPCLoadMapEvent
  84. + Code by: zbuffer aka Lance
  85. + How it works:
  86. When a player logs in on the map, the NPC will run as if he just clicked it. Which means
  87. if the script is like this:
  88. + Sample:
  89. prontera,159,192,2 script OnPCLoadMapEvent 101,{
  90. mes "Holy shit";
  91. close;
  92. }
  93. ----or--->
  94. OnPCLoadMapEvent:
  95. announce " " strcharinfo(0) + " has changed map!", 16;
  96. end;
  97. + Note:
  98. 1) Both types will execute regardless of map.
  99. 2) The event will only trigger on maps where you enable the 'loadevent' mapflag.
  100. -----------------------------------------------------------------------------
  101. + PCCommand: OnPCDieEvent
  102. + Code by: Unknown
  103. + How it works:
  104. When a player dies, the event will be run as if a npc were clicked. The RID of the person killed
  105. will be attached. Simple. It can to be used as a floating npc or as a npc placed on a map.
  106. Notice that this event is server-wide if used as a floating npc, so if you try running it for
  107. more than one map, and want to make a single npc, you'll have to use some sort of filter, which
  108. can be getmapxy, something like this:
  109. - script PCDieEvent -1,{
  110. if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
  111. if (@mapname$ == "valkyrie") || (@mapname$ == "amatsu") {
  112. killmonster "valkyrie","All";
  113. announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
  114. if (killtest != 0) enablenpc "Outern Voices";
  115. if (killedonce == 1) end;
  116. set killedonce,1;
  117. } else
  118. end;
  119. L_Finish:
  120. end;
  121. }
  122. ----or---->
  123. OnPCDieEvent:
  124. if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
  125. if (@mapname$ == "valkyrie") || (@mapname$ == "amatsu") {
  126. killmonster "valkyrie","All";
  127. announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
  128. if (killtest != 0) enablenpc "Outern Voices";
  129. if (killedonce == 1) end;
  130. set killedonce,1;
  131. } else
  132. end;
  133. L_Finish:
  134. end;
  135. We're using getmapxy to obtain the mapname, then adjust our commands and actions depending on the
  136. map. We could also use the command to find if the player died inside a wished area.
  137. -----------------------------------------------------------------------------