summaryrefslogtreecommitdiff
path: root/doc/pccommand_list.txt
blob: 0fd00db720e0ae68e46452195a7046738c2c3358 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---> PC Command List
------> Here's a list of PC commands and what they do. 

+ PCCommand: PCLoginEvent
+ Code by: (davidsiaw)
+ How it works:
When a player logs in, the NPC will run as if he just clicked it. Which means
if the script is like this:

+ Sample:
prontera.gat,0,0,0	script	PCLoginEvent	-1,{
	mes "lmao";
	close;
 }

+ Explaination:
every player who logs in will recieve a message 'lmao' in their face as soon
as they can see the map.

+ Note:
 1) This NPC will only run if its name is 'PCLoginEvent'
 2) I made it invisible because you don't need to see it. Its an abstract NPC
 3) If you don't want it, simply delete it
 4) If you have more than one PCLoginEvent NPC, strange things will happen.
 5) You can put this script in ANY file.
 6) I put an end; there because that just makes it do nothing.
 7) Modify this script to your liking and give your players a surprise
 8) Remember: IT RUNS LIKE A NORMAL NPC. BUT THE ONLY WAY TO 'CLICK' IT IS BY
              LOGGING ON
 9) There are 2 ways to use this - check the examples below!

-----------------------------------------------------------------------------

+ PCCommand: PcBaseUpEvent
+ Code by: lordalfa
+ How it works:
When a player Base level increases, the NPC will run as if he just clicked it. Which means
if the script is like this:

+ Sample:
-	Script	PCBaseUpEvent	-1,{
	mes "zomfg....";
	close;
}

+ Explaination:
whenever a player level ups his/her base level, the words zomfg will pop up 
in his face.

+ Note:
 1) This script runs every moment the player gains a level. It is adviced if
    you want to repeatedly use this script, to use a sort of filter.

-----------------------------------------------------------------------------

+ PCCommand: NPCKillEvent
+ Code by: lordalfa
+ How it works:
When a player kills a monster, the NPC will run as if he just clicked it. Which means
if the script is like this:

+ Sample:
-	script	NPCKillEvent	-1,{
   mes "Holy shit";
   close;
}

+ Explaination:
whenever a player kills a monster on the map, the words "Holy Shit" will appear
on the guy's face.

+ Note:
 1) This script runs everytime a player kills a monster It is adviced if
    you want to repeatedly use this script, to use a sort of filter.
 2) The var "KilledRid" is set on the killer, this can be used in
    strmobinfo to find out info about the Monster that was killed
-----------------------------------------------------------------------------

+ PCCommand: PCLoadMapEvent
+ Code by: zbuffer aka Lance
+ How it works:
When a player logs in on the map, the NPC will run as if he just clicked it. Which means
if the script is like this:

+ Sample:
prontera.gat,159,192,2 script PCLoadMapEvent 101,{
   mes "Holy shit";
   close;
}

----or--->

OnPCLoadMapEvent:
 announce " " strcharinfo(0) + " has changed map!", 16;
 end;

 + Note:
  1) The first event command would make the npc trigger if the player goes on the map.
  2) The second one would make the trigger work on all maps reguardless of script definations.
  3) It is not recommended to use the second one as it is not optimised and will cause 
     unessecery lag.
  1) And as usual... This script runs everytime a player kills a monster It is adviced if
     you want to repeatedly use this script, to use a sort of filter.

-----------------------------------------------------------------------------

+ PCCommand: PCDieEvent
+ Code by: Unknown
+ How it works:
When a player dies, the event will be run as if a npc were clicked. The RID of the person killed
will be attached. Simple. It can to be used as a floating npc or as a npc placed on a map.
Notice that this event is server-wide if used as a floating npc, so if you try running it for
more than one map, and want to make a single npc, you'll have to use some sort of filter, which
can be getmapxy, something like this:

-	script	PCDieEvent	-1,{
if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "valkyrie.gat") || (@mapname$ == "amatsu.gat") {
killmonster "valkyrie.gat","All";	
announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
if (killtest != 0) enablenpc "Outern Voices";
if (killedonce == 1) end;
set killedonce,1;
} else
end;

L_Finish:
	end;
}

----or---->

OnPCDieEvent: 
if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "valkyrie.gat") || (@mapname$ == "amatsu.gat") {
killmonster "valkyrie.gat","All";	
announce "Deep Voice: You have failed.... you have another opportunity though...",bc_self,0x660033;
if (killtest != 0) enablenpc "Outern Voices";
if (killedonce == 1) end;
set killedonce,1;
} else
end;

L_Finish:
	end;

We're using getmapxy to obtain the mapname, then adjust our commands and actions depending on the
map. We could also use the command to find if the player died inside a wished area.

-----------------------------------------------------------------------------