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