pccommand_list.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ---> PC Command List
  2. ------> Here's a list of PC commands and what they do.
  3. + PCCommand: PCLoginEvent
  4. + Code by: (davidsiaw)
  5. + How it works:
  6. When a player logs in, the NPC will run as if he just clicked it. Which means
  7. if the script is like this:
  8. + Sample:
  9. prontera.gat,0,0,0 script PCLoginEvent -1,{
  10. mes "lmao";
  11. close;
  12. }
  13. + Explaination:
  14. every player who logs in will recieve a message 'lmao' in their face as soon
  15. as they can see the map.
  16. + Note:
  17. 1) This NPC will only run if its name is 'PCLoginEvent'
  18. 2) I made it invisible because you don't need to see it. Its an abstract NPC
  19. 3) If you don't want it, simply delete it
  20. 4) If you have more than one PCLoginEvent NPC, strange things will happen.
  21. 5) You can put this script in ANY file.
  22. 6) I put an end; there because that just makes it do nothing.
  23. 7) Modify this script to your liking and give your players a surprise
  24. 8) Remember: IT RUNS LIKE A NORMAL NPC. BUT THE ONLY WAY TO 'CLICK' IT IS BY
  25. LOGGING ON
  26. 9) There are 2 ways to use this - check the examples below!
  27. -----------------------------------------------------------------------------
  28. + PCCommand: PcBaseUpEvent
  29. + Code by: lordalfa
  30. + How it works:
  31. When a player Base level increases, the NPC will run as if he just clicked it. Which means
  32. if the script is like this:
  33. + Sample:
  34. - Script PCBaseUpEvent -1,{
  35. mes "zomfg....";
  36. close;
  37. }
  38. + Explaination:
  39. whenever a player level ups his/her base level, the words zomfg will pop up
  40. in his face.
  41. + Note:
  42. 1) This script runs every moment the player gains a level. It is adviced if
  43. you want to repeatedly use this script, to use a sort of filter.
  44. -----------------------------------------------------------------------------
  45. + PCCommand: NPCKillEvent
  46. + Code by: lordalfa
  47. + How it works:
  48. When a player kills a monster, the NPC will run as if he just clicked it. Which means
  49. if the script is like this:
  50. + Sample:
  51. - script NPCKillEvent -1,{
  52. mes "Holy shit";
  53. close;
  54. }
  55. + Explaination:
  56. whenever a player kills a monster on the map, the words "Holy Shit" will appear
  57. on the guy's face.
  58. + Note:
  59. 1) This script runs everytime a player kills a monster It is adviced if
  60. you want to repeatedly use this script, to use a sort of filter.
  61. 2) The var "KilledRid" is set on the killer, this can be used in
  62. strmobinfo to find out info about the Monster that was killed
  63. -----------------------------------------------------------------------------
  64. + PCCommand: PCLoadMapEvent
  65. + Code by: zbuffer aka Lance
  66. + How it works:
  67. When a player logs in on the map, the NPC will run as if he just clicked it. Which means
  68. if the script is like this:
  69. + Sample:
  70. prontera.gat,159,192,2 script PCLoadMapEvent 101,{
  71. mes "Holy shit";
  72. close;
  73. }
  74. ----or--->
  75. OnPCLoadMapEvent:
  76. announce " " strcharinfo(0) + " has changed map!", 16;
  77. end;
  78. + Note:
  79. 1) The first event command would make the npc trigger if the player goes on the map.
  80. 2) The second one would make the trigger work on all maps reguardless of script definations.
  81. 3) It is not recommended to use the second one as it is not optimised and will cause
  82. unessecery lag.
  83. 1) And as usual... This script runs everytime a player kills a monster It is adviced if
  84. you want to repeatedly use this script, to use a sort of filter.
  85. -----------------------------------------------------------------------------
  86. + PCCommand: PCDieEvent
  87. + Code by: Unknown
  88. + How it works:
  89. When a player dies, the event will be run as if a npc were clicked. The RID of the person killed
  90. will be attached. Simple. It can to be used as a floating npc or as a npc placed on a map.
  91. Notice that this event is server-wide if used as a floating npc, so if you try running it for
  92. more than one map, and want to make a single npc, you'll have to use some sort of filter, which
  93. can be getmapxy, something like this:
  94. - script PCDieEvent -1,{
  95. if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
  96. if (@mapname$ == "valkyrie.gat") || (@mapname$ == "amatsu.gat") {
  97. killmonster "valkyrie.gat","All";
  98. announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
  99. if (killtest != 0) enablenpc "Outern Voices";
  100. if (killedonce == 1) end;
  101. set killedonce,1;
  102. } else
  103. end;
  104. L_Finish:
  105. end;
  106. }
  107. ----or---->
  108. OnPCDieEvent:
  109. if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
  110. if (@mapname$ == "valkyrie.gat") || (@mapname$ == "amatsu.gat") {
  111. killmonster "valkyrie.gat","All";
  112. announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
  113. if (killtest != 0) enablenpc "Outern Voices";
  114. if (killedonce == 1) end;
  115. set killedonce,1;
  116. } else
  117. end;
  118. L_Finish:
  119. end;
  120. We're using getmapxy to obtain the mapname, then adjust our commands and actions depending on the
  121. map. We could also use the command to find if the player died inside a wished area.
  122. -----------------------------------------------------------------------------