root/doc/pccommand_list.txt @ 15

Revision 1, 5.7 kB (checked in by jinshiro, 17 years ago)
Line 
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:
13When a player logs in, the NPC will run as if he just clicked it. Which means
14if the script is like this:
15
16+ Sample:
17prontera,0,0,0  script  OnPCLoginEvent  -1,{
18        mes "lmao";
19        close;
20 }
21
22+ Explaination:
23every player who logs in will receive a message 'lmao' in their face as soon
24as 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:
44When a player Base level increases, the NPC will run as if he just clicked it. Which means
45if the script is like this:
46
47+ Sample:
48-       Script  OnPCBaseLvUpEvent       -1,{
49        mes "zomfg....";
50        close;
51}
52
53+ Explanation:
54whenever a player level ups his/her base level, the words zomfg will pop up
55in 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:
68It'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:
75When a player kills a monster, the NPC will run as if he just clicked it. Which means
76if the script is like this:
77
78+ Sample:
79-       script  OnNPCKillEvent  -1,{
80   mes "Holy shit";
81   close;
82}
83
84+ Explaination:
85whenever a player kills a monster on the map, the words "Holy Shit" will appear
86on 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:
98It 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:
105When a player logs in on the map, the NPC will run as if he just clicked it. Which means
106if the script is like this:
107
108+ Sample:
109prontera,159,192,2 script OnPCLoadMapEvent 101,{
110   mes "Holy shit";
111   close;
112}
113
114----or--->
115
116OnPCLoadMapEvent:
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:
129When a player dies, the event will be run as if a npc were clicked. The RID of the person killed
130will be attached. Simple. It can to be used as a floating npc or as a npc placed on a map.
131Notice that this event is server-wide if used as a floating npc, so if you try running it for
132more than one map, and want to make a single npc, you'll have to use some sort of filter, which
133can be getmapxy, something like this:
134
135-       script  PCDieEvent      -1,{
136if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
137if (@mapname$ == "valkyrie") || (@mapname$ == "amatsu") {
138killmonster "valkyrie","All";   
139announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
140if (killtest != 0) enablenpc "Outern Voices";
141if (killedonce == 1) end;
142set killedonce,1;
143} else
144end;
145
146L_Finish:
147        end;
148}
149
150----or---->
151
152OnPCDieEvent:
153if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
154if (@mapname$ == "valkyrie") || (@mapname$ == "amatsu") {
155killmonster "valkyrie","All";   
156announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
157if (killtest != 0) enablenpc "Outern Voices";
158if (killedonce == 1) end;
159set killedonce,1;
160} else
161end;
162
163L_Finish:
164        end;
165
166We're using getmapxy to obtain the mapname, then adjust our commands and actions depending on the
167map. We could also use the command to find if the player died inside a wished area.
168
169-----------------------------------------------------------------------------
Note: See TracBrowser for help on using the browser.