· 7 years ago · Dec 04, 2018, 02:00 AM
1//|==================================================================================|
2//| ___ ___ ___ ___ ___ |
3//| /\ \ /\ \ /\ \ /| | /\ \ |
4//| |::\ \ /::\ \ /::\ \ |:| | /::\ \ |
5//| |:|:\ \ /:/\:\ \ /:/\:\ \ |:| | /:/\:\ \ |
6//| __|:|\:\ \ /:/ \:\ \ /:/ \:\ \ __|:| | /:/ /::\ \ |
7//| /::::|_\:\__\ /:/__/ \:\__\ /:/__/ \:\__\ /\ |:|__|____ /:/_/:/\:\__\ |
8//| \:\--\ \/__/ \:\ \ /:/ / \:\ \ /:/ / \:\/:::::/__/ \:\/:/ \/__/ |
9//| \:\ \ \:\ /:/ / \:\ /:/ / \::/__/ \::/__/ |
10//| \:\ \ \:\/:/ / \:\/:/ / \:\ \ \:\ \ |
11//| \:\__\ \::/ / \::/ / \:\__\ \:\__\ |
12//| \/__/ \/__/ \/__/ \/__/ \/__/ |
13//| ================================================================================ |
14//| Script Desenvolvido Por Mooka | eAthena | Por Favor, Nгo Retire Os Crйditos. |
15//| ================================================================================ |
16//| Observaзгo! O MapFlag Estб No Final Do Script ! |
17//| ================================================================================ |
18//|[v1.3.0]: Nova Funзгo de Mъltiplas linguagens. (Mooka) |
19//| ------ |
20//| v1.2.9 : Nova Tabela! (PM_Lang) (Mooka) |
21//| v1.2.8 : Alteraзгo na funзгo !exit. (Mooka) |
22//| v1.2.7 : Adicionado balгo de Chat no npc. (Mooka) |
23//| v1.2.6 : Nova opзгo! Ganhando experiкncia no PvP! (Mooka) |
24//| v1.2.5 : Adicionado !map#list. (Mooka) |
25//| v1.2.4 : Mapflags sгo definidos automaticamente. (Mooka) |
26//| v1.2.3 : Novo campo na tabela 'pvpm_map'. (noguild) (Mooka) |
27//| v1.2.2 : Alteraзгo na funзгo "Changeleader". (Mooka) |
28//| v1.2.1 : Implementada opзгo para WoE. (Contagem de pontos na WoE) (Mooka) |
29//| v1.2.0 : Novo comando remoto. (!map) (Mooka) |
30//| ------ |
31//| v1.1.9 : Comandos !pvp\!gvg\!baby mergidos no novo comando !warp. (Mooka) |
32//| v1.1.8 : Reformulado Sistema das Arenas. (Mooka) |
33//| v1.1.7 : Nova tabela no PvP Master. (pvpm_map) (Mooka) |
34//| v1.1.6 : Ranking nгo mostra mais valores com 0. (Mooka) |
35//| v1.1.5 : Novos comandos remotos. (!ban;!truncate) (Mooka) |
36//| v1.1.4 : Adicionado opзгo de Ranking Ratio aos Menus e CMD Remotos. (Mooka) |
37//| v1.1.3 : Otimizado IF's dos comandos remotos. (Mooka) |
38//| v1.1.2 : Desenvolvida nova opзгo de Ranking. (Ratio) (Mooka) |
39//| v1.1.1 : Alteraзгo na tabela pvpm_data. (Adicionado campo 'ratio') (Mooka) |
40//| v1.1.0 : Novo comando remoto. (!help) (Mooka) |
41//| ------ |
42//| v1.0.9 : Adicionado duplicaзхes do npc em todas as cidades. (Mooka) |
43//| v1.0.8 : Adicionada opзгo para retirar buffs. (Mooka) |
44//| v1.0.7 : Correзгo na funзгo Ranking2. (Mooka) |
45//| v1.0.6 : Correзгo no comando !exit. (Mooka) |
46//| v1.0.5 : Correзгo no bug de enviar o som "end" causando erro. (Mooka) |
47//| v1.0.4 : Implementado Sons do Unreal Tournament. (Mooka) |
48//| v1.0.3 : Adicionado novo tipo de contagem de Pontos com Announce. (Mooka) |
49//| v1.0.2 : Adicionada opзгo para servidores PK. (Mooka) |
50//| v1.0.1 : Adicionado PvP Baby. (Mooka) |
51//| v1.0.0 : Desenvolvida Versгo. (Mooka) |
52//| ================================================================================ |
53//| Table update (v1.3.0+): |
54//| DROP TABLE IF EXISTS `pvpm_lang`; |
55//| CREATE TABLE `pvpm_lang` ( |
56//| `id` int(11) unsigned NOT NULL default '0', |
57//| `lang` int(11) unsigned NOT NULL default '0', |
58//| `str` varchar(255) NOT NULL default '', |
59//| KEY `id` (`id`) |
60//| ) TYPE=MyISAM; |
61//| -------------------------------------------------------------------------------- |
62//| Table update (v1.2.3+): |
63//| alter table pvpm_map add noguild int(11) not null default '0'; |
64//| update pvpm_map set noguild=1 where map='guild_vs1'; |
65//| -------------------------------------------------------------------------------- |
66//| Table update (v1.1.7+): |
67//| DROP TABLE IF EXISTS `pvpm_map`; |
68//| CREATE TABLE `pvpm_map` ( |
69//| `id` int(11) unsigned NOT NULL default '0', |
70//| `map` varchar(255) NOT NULL default 'NULL', |
71//| `type` int(11) unsigned NOT NULL default '0', |
72//| KEY `id` (`id`) |
73//| ) TYPE=MyISAM; |
74//| insert into pvpm_map (id,map,type) values (0,'guild_vs3',0); |
75//| insert into pvpm_map (id,map,type) values (1,'pvp_n_1-5',0); |
76//| insert into pvpm_map (id,map,type) values (2,'guild_vs1',2); |
77//| insert into pvpm_map (id,map,type) values (3,'prt_are01',2); |
78//| insert into pvpm_map (id,map,type) values (4,'guild_vs2',1); |
79//| -------------------------------------------------------------------------------- |
80//| Table update (v1.1.1+): |
81//| alter table pvpm_data add ratio int(11) not null default '0' after dies |
82//| -------------------------------------------------------------------------------- |
83//| Table update (v1.0.0+): |
84//| DROP TABLE IF EXISTS `pvpm_data`; |
85//| CREATE TABLE `pvpm_data` ( |
86//| `id` int(11) unsigned NOT NULL default '0', |
87//| `name` varchar(255) NOT NULL default '', |
88//| `kills` int(11) unsigned NOT NULL default '0', |
89//| `dies` int(11) unsigned NOT NULL default '0', |
90//| `leader` int(11) unsigned NOT NULL default '0', |
91//| `annc` int(11) unsigned NOT NULL default '0', |
92//| `ban` int(11) unsigned NOT NULL default '0', |
93//| `type` int(11) unsigned NOT NULL default '0', |
94//| KEY `id` (`id`), |
95//| KEY `kills` (`kills`), |
96//| KEY `dies` (`dies`) |
97//| ) TYPE=MyISAM; |
98//| |
99//| ================================================================================ |
100- script init_PM -1,{ // |
101//| |
102//| -------------------------------------------------------------------------------- |
103//| |!Aviso importante sobre as configuraзхes! | |
104//| |O Sistema de Arena terб problemas caso passe de 10 mapas na lista. | |
105//| |Й possнvel alterar este limite editando o script, caso queira fale comigo. | |
106//| -------------------------------------------------------------------------------- |
107//| |
108OnInit: // |
109//| Configuraзхes: |
110//| |
111//|=> Nome do npc na janela. |
112set $@pvpm_name$,"[ ^FF0000 Arena ^000000 ]"; // |
113//| |
114//|=> Deseja usar o Ranking Ratio como principal? [ 1 = Sim ] |
115//|---> Nota: Ranking Ratio: Pontuaзгo = Kills - Mortes |
116set $@mainRanking,1; // |
117//| |
118//|=> Atй onde o Ranking irб mostrar. [ Mбximo 127 ] |
119set $@showsRankUntil,25; // |
120//| |
121//|=> Modo PK. Estб configurado para alterar automaticamente, mude se necessбrio. |
122set $@PK_Mode,getbattleflag("pk_mode"); // |
123//| |
124//|=> Deseja que ao player entrar no pvp perca os buff? [ 1 = Sim] |
125set $@breakBuffs,0; // |
126//| |
127//|=> Quando o player matar o outro, deve ganhar experiкncia? |
128//|---> Nota 1: Servidores de rates alta, configure o "quest_exp_rate". (exp.conf) |
129//|---> Nota 2: $@lostEXP: Quantidade de EXP perdida ao morrer. ( 0 = Desativado ) |
130//|---> Nota 3: Configuraзгo do comando: |
131//|--> 0 : Desativado. |
132//|--> 1 : Ativado usando fуrmula de EXP. ($@getEXP*KilledLVL/KillerLVL) |
133//|--> 2 : Ativado, o player sempre irб ganhar a quantia definida no $@getEXP. |
134set $@getEXPoption,1; // |
135set $@getEXP,115; // 0,1% no level 50. |
136set $@lostEXP,0; // |
137//| |
138//|=> Deseja ativar a contagem de pontos nos mapas da WoE? |
139//|---> Nota 1: Nгo sгo enviandos sons/broadcast nos mapas da WoE. |
140//|---> Nota 2: Opзхes de contagem. |
141//|--> 0: Desativado. |
142//|--> 1: Ativar contagem somente do PvP. |
143//|--> 2: Ativar contagem somente do GvG. |
144//|--> 3: Ativar ambos. |
145set $@CountPointsInWoE,3; // |
146//| |
147//|=> Configuraзгo do Som e Announce! |
148//|---> Nota 1: Os sons devem ser colocados na pasta data/wav em formato .wav |
149//|---> Nota 2: Se desativar o som do UT, desativarб o broadcast dele tambйm.(2) |
150//|--> 0 : Desativar Todas Opзхes. |
151//|--> 1 : Ativar somente broadcast Global. |
152//|--> 2 : Ativar somente sons/broadcast do Unreal Tournament. |
153//|--> 3 : Ativar Ambos. |
154set $@sound,3; // |
155//| |
156//|=> Lista com o nomes dos Sons Unreal Tournament. |
157//|---> Nota 1: $@SoundList$[Pontos em que irб tocar o som(Max. 127)],"Nome do Som"; |
158//|---> Nota 2: A partir do ultimo, serб somado 10 e repetirб o som, o set |
159//|---> com "end" indica que o ultimo som serб repetido dali em diante. |
160//|---> Nota 3: O nome do arquivo й o mesmo que serб exibido no announce. |
161set $@SoundList$[1],"First Blood"; // |
162set $@SoundList$[2],"Double Kill"; // |
163set $@SoundList$[3],"Triple Kill"; // |
164set $@SoundList$[5],"Mega Kill"; // |
165set $@SoundList$[10],"Ultra Kill"; // |
166set $@SoundList$[15],"Killing Spree"; // |
167set $@SoundList$[20],"Ownage"; // |
168set $@SoundList$[25],"Holy Shit"; // |
169set $@SoundList$[30],"God Like"; // |
170set $@SoundList$[35],"Dominating"; // |
171set $@SoundList$[40],"Unstoppable"; // |
172set $@SoundList$[50],"Monster Kill"; // |
173set $@SoundList$[51],"end"; // |
174//|==================================================================================|
175
176query_sql("select name from pvpm_data where leader=1 and type=0 limit 1",$@Player_Lider$);
177query_sql("select name from pvpm_data where leader=1 and type=2 limit 1",$@Guild_Lider$);
178
179 query_sql("select lang from pvpm_lang where lang=0 and lang=1",.@checkDefaultLang);
180 if(!.@checkDefaultLang && .@checkDefaultLang[1])
181 {
182 debugmes "[PvP Master Ultimate] NO DEFAULT LANGUAGE(LANG0)! LANG1 WAS SET AS DEFAULT!";
183 query_sql("update pvpm_lang set lang=lang-1");
184 }
185
186 query_sql("select count(lang) from pvpm_lang where id=0",.@c);
187 if(!.@c) debugmes "[PvP Master Ultimate] NO LANGUAGE DATA!";
188 for(set .@i,0;.@i<.@c;set .@i,.@i+1)
189 {
190 deletearray .@str$,82;
191 query_sql("select str from pvpm_lang where lang="+.@i,.@str$);
192 for(set .@y,0;.@y<82;set .@y,.@y+1) setd "$@PM_Lang"+.@i+"$["+.@y+"]",.@str$[.@y];
193 }
194
195OnReloadListMap:
196 deletearray $@IDPM,10;
197 deletearray $@mapPM$,10;
198 deletearray $@MapTypePM,10;
199 deletearray $@menu$,10;
200 query_sql("select * from pvpm_map order by id asc limit 10",$@IDPM,$@mapPM$,$@MapTypePM,$@mfPM);
201 setarray $@TypeArena$[0],"^CD5C5C<PvP>","^FF4500<PvP Baby>","^8B5742<GvG>","^0047AB<Evento>";
202 for(set .@j,0;.@j<=(getarraysize($@mapPM$)-1);set .@j,.@j+1)
203 {
204 set $@menu$[.@j],"^000000- Arena "+(.@j+1)+" "+$@TypeArena$[$@MapTypePM[.@j]];
205 setmapflag $@mapPM$[.@j],mf_noreturn;
206 setmapflag $@mapPM$[.@j],mf_nosave;
207 setmapflag $@mapPM$[.@j],mf_noteleport;
208 setmapflag $@mapPM$[.@j],mf_nowarpto;
209 setmapflag $@mapPM$[.@j],mf_nowarp;
210 setmapflag $@mapPM$[.@j],mf_nomemo;
211 setmapflag $@mapPM$[.@j],mf_nopenalty;
212 setmapflag $@mapPM$[.@j],mf_nobranch;
213 if(!$@MapTypePM[.@j] && !$@mfPM[.@j]) setmapflag $@mapPM$[.@j],mf_pvp; else
214 if(!$@MapTypePM[.@j]) setmapflag $@mapPM$[.@j],mf_pvp_noguild;
215 if($@MapTypePM[.@j]==2) setmapflag $@mapPM$[.@j],mf_gvg;
216 }
217}
218
219- script PM_source -1,{
220
221 while(1)
222 {
223 mes $@pvpm_name$;
224 mes callfunc("getMesPM",1);
225 mes callfunc("getMesPM",2);
226 mes callfunc("getMesPM",3);
227 mes "^008B8B< PvP "+callfunc("getMesPM",4)+" - ^FFA500"+$@Player_Lider$+"^008B8B >";
228 mes "^008B8B< GvG "+callfunc("getMesPM",4)+" - ^FFA500"+$@Guild_Lider$+"^008B8B >";
229 switch(select("^FFA500- "+callfunc("getMesPM",5)+"^000000:- Ranking:- "+callfunc("getMesPM",6)+":- "+callfunc("getMesPM",7)+":- "+callfunc("getMesPM",79)))
230 {
231 case 1:
232 for(set @i,0;@i<=(getarraysize($@IDPM)-1);set @i,@i+1) set @m$[@i]," ^0000FF["+getmapusers($@mapPM$[@i])+"]";
233 switch(getarraysize($@IDPM))
234 {
235 case 1: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0]));
236 case 2: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1]));
237 case 3: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2]));
238 case 4: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3]));
239 case 5: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4]));
240 case 6: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5]));
241 case 7: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6]));
242 case 8: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6],$@menu$[7]+@m$[7]));
243 case 9: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6],$@menu$[7]+@m$[7],$@menu$[8]+@m$[8]));
244 case 10: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6],$@menu$[7]+@m$[7],$@menu$[8]+@m$[8],$@menu$[9]+@m$[9]));
245 } mes "** ERROR ** CHECK THE pm_map TABLE"; close;
246
247 case 2:
248 switch(select("- PvP:- PvP "+callfunc("getMesPM",8)+":- PvP (Ratio):- GvG:- GvG "+callfunc("getMesPM",8)+":- GvG (Ratio):- "+callfunc("getMesPM",9)))
249 {
250 case 1: callfunc "pvpm_func","Ranking1","kills",0,"PvP"; next; continue;
251 case 2: callfunc "pvpm_func","Ranking1","dies",0,"PvP (Mortes)"; next; continue;
252 case 3: callfunc "pvpm_func","Ranking1","ratio",0,"PvP (Ratio)"; next; continue;
253 case 4: callfunc "pvpm_func","Ranking1","kills",2,"GvG"; next; continue;
254 case 5: callfunc "pvpm_func","Ranking1","dies",2,"GvG (Mortes)"; next; continue;
255 case 6: callfunc "pvpm_func","Ranking1","ratio",2,"GvG (Ratio)"; next; continue;
256 case 7:
257 switch(select("- "+callfunc("getMesPM",9)+" PvP:- "+callfunc("getMesPM",9)+" PvP "+callfunc("getMesPM",8)+":- "+callfunc("getMesPM",9)+" PvP (Ratio):- "+callfunc("getMesPM",9)+" GvG:- "+callfunc("getMesPM",9)+" GvG "+callfunc("getMesPM",8)+":- "+callfunc("getMesPM",9)+" GvG (Ratio)"))
258 {
259 case 1: callfunc "pvpm_func","Ranking2","kills",0; next; continue;
260 case 2: callfunc "pvpm_func","Ranking2","dies",0; next; continue;
261 case 3: callfunc "pvpm_func","Ranking2","ratio",0; next; continue;
262 case 4: callfunc "pvpm_func","Ranking2","kills",2; next; continue;
263 case 5: callfunc "pvpm_func","Ranking2","dies",2; next; continue;
264 case 6: callfunc "pvpm_func","Ranking2","ratio",2; next; continue;
265 }
266 }
267 case 3:
268 next;
269 mes $@pvpm_name$;
270 mes callfunc("getMesPM",10);
271 mes callfunc("getMesPM",11);
272 mes callfunc("getMesPM",12);
273 next; continue;
274 case 4:
275 close;
276
277 case 5:
278 next;
279 mes $@pvpm_name$;
280 mes callfunc("getMesPM",80);
281 query_sql("select str from pvpm_lang where id=0",@lang$);
282 for(set @a,0;@a<getarraysize(@lang$);set @a,@a+1) mes @a+" = "+@lang$[@a];
283 input @inp;
284 if(@inp < 0 || @inp > (getarraysize(@lang$)-1))
285 {
286 mes callfunc("getMesPM",81);
287 next; continue;
288 } set PM_Lang,@inp;
289 next; continue;
290 }
291 }
292
293OnInit:
294 waitingroom "",0;
295OnTimer5000:
296 setarray .@RoomDisplay$,"[PvP] Arena","PvP "+$@PM_Lang0$[4]+" ["+$@Player_Lider$+"]","GvG "+$@PM_Lang0$[4]+" ["+$@Guild_Lider$+"]";
297 delwaitingroom;
298 waitingroom .@RoomDisplay$[rand(0,2)],0;
299 initnpctimer;
300}
301
302- script cmd -1,{
303
304OnWhisperGlobal:
305
306 if(compare(@whispervar0$,"!warp"))
307 {
308 set @ArenaID,@whispervar1$;
309 if(!@ArenaID)
310 {
311 dispbottom callfunc("getMesPM",13);
312 end;
313 } callfunc("pvpm_func","Warp",0,@ArenaID);
314 }
315
316 if(compare(@whispervar0$,"!ranking"))
317 { if(compare(@whispervar0$,"2"))
318 {
319 if(compare(@whispervar1$,"pvp"))
320 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking2","ratio",0,"Ratio"; end; }
321 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking2","kills",0; else
322 callfunc "pvpm_func","Ranking2","dies",0;
323 end;
324 }
325
326 if(compare(@whispervar1$,"gvg"))
327 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking2","ratio",2,"Ratio"; end; }
328 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking2","kills",2; else
329 callfunc "pvpm_func","Ranking2","dies",2;
330 end;
331 }
332 }
333
334 if(compare(@whispervar1$,"pvp"))
335 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking1","ratio",0,"Ratio"; end; }
336 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking1","kills",0,"PvP"; else
337 callfunc "pvpm_func","Ranking1","dies",0,"PvP ( Mortes )";
338 end;
339 }
340
341 if(compare(@whispervar1$,"gvg"))
342 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking1","ratio",2,"Ratio"; end; }
343 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking1","kills",2,"GvG"; else
344 callfunc "pvpm_func","Ranking1","dies",2,"GvG";
345 end;
346 }
347 }
348
349 if ( compare(@whispervar0$,"!exit") )
350 {
351 getmapxy(@map$,@x,@y,0);
352 for(set @i,0;@i!=getarraysize($@mapPM$);set @i,@i+1)
353 {
354 if (@map$ != $@mapPM$[@i]) continue;
355 dispbottom callfunc("getMesPM",14);
356 sleep2 5000;
357 warp getsavepoint(0),getsavepoint(1),getsavepoint(2);
358 end;
359 }
360 dispbottom callfunc("getMesPM",15);
361 end;
362 }
363
364 if (compare(@whispervar0$,"lider"))
365 {
366 if(compare(@whispervar0$,"pvp")) dispbottom "PvP "+callfunc("getMesPM",4)+": "+$@Player_Lider$; else
367 dispbottom "GvG "+callfunc("getMesPM",4)+": "+$@Guild_Lider$;
368 end;
369 }
370
371 if(compare(@whispervar0$,"!truncate") && getgmlevel()>=70)
372 {
373 if(compare(@whispervar1$,"pvp"))
374 {
375 query_sql("delete from pvpm_data where type=0");
376 dispbottom callfunc("getMesPM",16);
377 end;
378 }
379 if(compare(@whispervar1$,"gvg"))
380 {
381 query_sql("delete from pvpm_data where type=2");
382 dispbottom callfunc("getMesPM",16);
383 end;
384 } dispbottom callfunc("getMesPM",17);
385 }
386
387 if (compare(@whispervar0$,"!ban"))
388 {
389 if(@whispervar1$=="") { dispbottom callfunc("getMesPM",18); end; }
390 if(@whispervar2$=="") { dispbottom callfunc("getMesPM",19); end; }
391 if(@whispervar3$=="") { dispbottom callfunc("getMesPM",20); end; }
392 if(@whispervar2$=="showtime")
393 { query_sql("select ban from pvpm_data where name='"+@whispervar1$+"' limit 1",@showtime);
394 dispbottom callfunc("getMesPM",21)+" ["+@whispervar1$+"] ["+@showtime+" "+callfunc("getMesPM",27)+"]";
395 end;
396 } if(@whispervar2$=="unban")
397 { query_sql("update pvpm_data set ban=0 where name='"+@whispervar1$+"' limit 1");
398 dispbottom callfunc("getMesPM",22)+@whispervar1$;
399 message @whispervar1$,callfunc("getMesPM",23);
400 end;
401 } set @time,@whispervar2$;
402 if(@time==0 && @whispervar2$!="unban" || @time==0 && @whispervar2$!="showtime") { dispbottom callfunc("getMesPM",24); end; }
403 set @id,0;
404 query_sql("select id from pvpm_data where name='"+@whispervar1$+"' and type="+@whispervar3$,@id);
405 if(!@id && @whispervar3$=="0" || !@id && @whispervar3$=="2") { dispbottom callfunc("getMesPM",25); end; }
406 set @bantime,0;
407 if(compare(@whispervar2$,"-")) query_sql("update pvpm_data set ban=ban"+@time+" where id="+@id+" limit 1"); else
408 query_sql("update pvpm_data set ban=ban+"+@time+" where id="+@id+" limit 1");
409 query_sql("select ban from pvpm_data where id="+@id+" limit 1",@bantime);
410 dispbottom callfunc("getMesPM",26)+" ("+@bantime+" "+callfunc("getMesPM",27)+")";
411 message @whispervar1$,callfunc("getMesPM",28)+" "+@bantime+" "+callfunc("getMesPM",27)+".";
412 warpchar "prontera",150,150,getcharid(0,@whispervar1$);
413 end;
414 }
415
416 if (compare(@whispervar0$,"!map") && getgmlevel()>=70)
417 {
418 if (compare(@whispervar1$,"add"))
419 {
420 if(getarraysize($@IDPM)>=10)
421 {
422 dispbottom callfunc("getMesPM",29);
423 dispbottom callfunc("getMesPM",30);
424 end;
425 } set @type,@whispervar3$;
426 if(!@type && @whispervar3$==""||@type>2)
427 {
428 dispbottom callfunc("getMesPM",31);
429 dispbottom callfunc("getMesPM",32);
430 dispbottom callfunc("getMesPM",33);
431 end;
432 } set @mapcheck$,"";
433 query_sql("select map from pvpm_map where map='"+@whispervar2$+"' limit 1",@mapcheck$);
434 if(@mapcheck$!="")
435 {
436 dispbottom callfunc("getMesPM",34);
437 end;
438 } query_sql("insert into `pvpm_map` (id,map,type) values ("+(getarraysize($@IDPM)-1)+",'"+@whispervar2$+"',"+@type+")");
439 dispbottom callfunc("getMesPM",35)+" ("+@whispervar2$+")";
440 doevent "init_PM::OnReloadListMap";
441 }
442
443 if (compare(@whispervar1$,"del"))
444 {
445 if(getarraysize($@IDPM)<=1)
446 {
447 dispbottom callfunc("getMesPM",36);
448 end;
449 } query_sql("select map from pvpm_map where map='"+@whispervar2$+"'",@mapcheck$);
450 if(@mapcheck$=="")
451 {
452 dispbottom callfunc("getMesPM",37);
453 end;
454 } query_sql("delete from pvpm_map where map='"+@whispervar2$+"'");
455 dispbottom callfunc("getMesPM",38)+" ("+@whispervar2$+")";
456 doevent "init_PM::OnReloadListMap";
457 }
458
459 if (compare(@whispervar1$,"list"))
460 {
461 for(set @i,0;@i<=(getarraysize($@IDPM)-1);set @i,@i+1) dispbottom "["+(@i+1)+"] "+$@mapPM$[@i];
462 end;
463 }
464 end;
465 }
466
467 if (compare(@whispervar0$,"!help"))
468 {
469 if(compare(@whispervar1$,"!warp")) {
470 dispbottom callfunc("getMesPM",39);
471 dispbottom callfunc("getMesPM",40);
472 dispbottom "- !warp#1;!warp#2;...!warp#5 ..";
473 dispbottom callfunc("getMesPM",41);
474 end;
475 }
476
477 if(compare(@whispervar1$,"!ranking")) {
478 dispbottom callfunc("getMesPM",39);
479 dispbottom callfunc("getMesPM",42);
480 dispbottom "- !ranking#pvp;!ranking#pvp#die;!ranking#gvg;!ranking#gvg#die;!ranking#ratio";
481 dispbottom "- !ranking2#pvp;!ranking2#pvp#die;!ranking2#gvg;!ranking2#gvg#die;!ranking2#ratio; (Mostra somente sua posiзгo)";
482 dispbottom callfunc("getMesPM",43);;
483 end;
484 }
485
486 if(compare(@whispervar1$,"!pvplider") || compare(@whispervar1$,"!gvglider")) {
487 dispbottom callfunc("getMesPM",39);
488 dispbottom callfunc("getMesPM",44);;
489 end;
490 }
491
492 if(compare(@whispervar1$,"!exit")) {
493 dispbottom callfunc("getMesPM",39);
494 dispbottom callfunc("getMesPM",45);
495 end;
496 }
497
498 if(compare(@whispervar1$,"!ban") && getgmlevel()>=70) {
499 dispbottom callfunc("getMesPM",39);
500 dispbottom callfunc("getMesPM",46);
501 dispbottom callfunc("getMesPM",47);
502 dispbottom callfunc("getMesPM",48);
503 dispbottom callfunc("getMesPM",49);
504 dispbottom callfunc("getMesPM",50);
505 end;
506 }
507
508 if(compare(@whispervar1$,"!map") && getgmlevel()>=70) {
509 dispbottom callfunc("getMesPM",39);
510 dispbottom callfunc("getMesPM",51);
511 dispbottom callfunc("getMesPM",52);
512 dispbottom "- Type: 0 = Arena PvP; 1 = Arena PvP Baby; 2 Arena GvG;";
513 dispbottom callfunc("getMesPM",53);
514 end;
515 }
516
517 if(compare(@whispervar1$,"!truncate") && getgmlevel()>=70) {
518 dispbottom callfunc("getMesPM",39);
519 dispbottom callfunc("getMesPM",54);
520 dispbottom callfunc("getMesPM",55);
521 dispbottom callfunc("getMesPM",56);
522 end;
523 } dispbottom callfunc("getMesPM",57);
524 end;
525 }
526
527 dispbottom callfunc("getMesPM",58);
528 dispbottom callfunc("getMesPM",59);
529 dispbottom callfunc("getMesPM",60);
530 dispbottom callfunc("getMesPM",61);
531 dispbottom callfunc("getMesPM",62);
532 dispbottom callfunc("getMesPM",63);
533 dispbottom callfunc("getMesPM",64);
534 dispbottom callfunc("getMesPM",65);
535 if(getgmlevel()>=70)
536 {
537 dispbottom callfunc("getMesPM",66);
538 dispbottom callfunc("getMesPM",67);
539 dispbottom callfunc("getMesPM",68);
540 dispbottom callfunc("getMesPM",69);
541 }
542
543}
544
545- script event#pvpm -1,{
546OnInit:
547OnTimer60000:
548 query_sql("update pvpm_data set ban=ban-1 where ban>0");
549 initnpctimer;
550 end;
551
552OnPCKillEvent:
553 callfunc("pvpm_func","PCKillEvent");
554
555OnPCDieEvent:
556 callfunc("pvpm_func","PCDieEvent");
557
558OnPCLoadMapEvent:
559 callfunc("pvpm_func","PCLoadEvent");
560}
561
562function script pvpm_func {
563
564 if (getarg(0) == "Ranking1")
565 {
566 deletearray @name$[0],getarraysize(@name$);
567 deletearray @points[0],getarraysize(@points);
568 query_sql "select name,"+getarg(1)+" from pvpm_data where type="+getarg(2)+" and "+getarg(1)+"!=0 order by "+getarg(1)+" desc limit 125",@name$,@points;
569 dispbottom "======= Ranking - "+getarg(3)+" =======";
570 for(set @i,0;@i != $@showsRankUntil;set @i,@i+1)
571 {
572 if(@name$[@i]=="") return;
573 dispbottom (@i+1)+"Ñ” | "+@name$[@i]+" | "+@points[@i];
574 } return;
575 }
576
577 if (getarg(0) == "Ranking2")
578 {
579 deletearray @name$[0],getarraysize(@name$);
580 deletearray @points[0],getarraysize(@points);
581 query_sql "select id,"+getarg(1)+" from pvpm_data where type="+getarg(2)+" order by "+getarg(1)+" desc limit 125",@id,@points;
582 for(set @i,0;@i <= 125;set @i,@i+1)
583 {
584 if (@id[@i] == getcharid(getarg(2)))
585 {
586 dispbottom "- "+strcharinfo(getarg(2))+" | "+(@i+1)+"Ñ” | "+@points[@i];
587 return;
588 }
589 }
590 dispbottom callfunc("getMesPM",70);
591 return;
592 }
593
594 if(getarg(0)=="Warp")
595 {
596 if(getarg(1))
597 {
598 if($@MapTypePM[(getarg(2)-1)]==2 && !getcharid(2))
599 {
600 mes $@pvpm_name$;
601 mes callfunc("getMesPM",71);
602 close;
603 } if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
604 {
605 mes $@pvpm_name$;
606 mes callfunc("getMesPM",72);
607 close;
608 } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0,1); else callfunc("pvpm_func","ban",2,1);
609 } else {
610 getmapxy(@map$,@x,@y,0);
611 if($@mapPM$[(getarg(2)-1)]==@map$)
612 {
613 dispbottom "<!!!> "+callfunc("getMesPM",73);
614 end;
615 } if($@MapTypePM[(getarg(2)-1)]==2)
616 {
617 dispbottom "<!!!> "+callfunc("getMesPM",71);
618 end;
619 } if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
620 {
621 dispbottom "<!!!> "+callfunc("getMesPM",72);
622 end;
623 } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0); else callfunc("pvpm_func","ban",2);
624 } set @MapIDx,(getarg(2)-1);
625 if($@breakBuffs) sc_end -1;
626 warp $@mapPM$[(getarg(2)-1)],0,0;
627 end;
628 }
629
630 if (getarg(0) == "ban")
631 {
632 set @bantime,0;
633 query_sql("select ban from pvpm_data where id="+getcharid(getarg(1))+" limit 1",@bantime);
634 if(!@bantime) return;
635 if(!getarg(2,0)) { dispbottom "<!!!> "+callfunc("getMesPM",74)+" "+@bantime+" "+callfunc("getMesPM",27)+"!"; end; } else
636 { mes "^FF7F50<!!!> ^FFA500"+callfunc("getMesPM",74)+" ^FF7F50"+@bantime+"^FFA500 "+callfunc("getMesPM",27)+"!"; close; }
637 }
638
639 if (getarg(0) == "Up")
640 {
641 if($@getEXPoption) callfunc("pvpm_func","getexp");
642 set @name$,"";
643 set @points,0;
644 query_sql("select name,"+getarg(1)+" from pvpm_data where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1",@name$,@points);
645 if (@name$=="")
646 {
647 query_sql("INSERT INTO pvpm_data (id,"+getarg(1)+",name,annc,type) values ("+getcharid(getarg(2))+",1,'"+strcharinfo(getarg(2))+"',"+getarg(3)+","+getarg(2)+")");
648 dispbottom "Score: 1";
649 end;
650 } query_sql("update pvpm_data set "+getarg(1)+"="+getarg(1)+"+1 where id="+getcharid(getarg(2)));
651 set @points,@points+1;
652 if($@mainRanking)
653 {
654 set @kills,0;
655 set @dies,0;
656 query_sql("select kills,dies from pvpm_data where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1",@kills,@dies);
657 query_sql("update pvpm_data set ratio="+(@kills-@dies)+" where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1");
658 set @points,@kills-@dies;
659 return;
660 } return;
661 }
662
663 if (getarg(0) == "ChangeLeader")
664 {
665 set @L_name$,"";
666 set @L_points,0;
667 if(!$@mainRanking) query_sql("select name,kills from pvpm_data where leader=1 and type="+getarg(1)+" limit 1",@L_name$,@L_points); else
668 query_sql("select name,ratio from pvpm_data where leader=1 and type="+getarg(1)+" limit 1",@L_name$,@L_points);
669 if (@points > @L_points && @L_name$ != strcharinfo(getarg(1)))
670 {
671 query_sql("update pvpm_data set leader=0 where type="+getarg(1));
672 query_sql("update pvpm_data set leader=1 where id="+getcharid(getarg(1))+" and type="+getarg(1));
673 mapannounce @map$,strcharinfo(getarg(1))+" | "+callfunc("getMesPM",75)+" !",bc_map,0xFF7F50;
674 set $@Player_Lider$,"";
675 set $@Guild_Lider$,"";
676 query_sql("select name from pvpm_data where leader=1 and type=0 limit 1",$@Player_Lider$);
677 query_sql("select name from pvpm_data where leader=1 and type=2 limit 1",$@Guild_Lider$);
678 } return;
679 }
680
681 if (getarg(0) == "Annc")
682 {
683 set @points,0;
684 set @annc,0;
685 query_sql "select kills,annc from pvpm_data where id="+getcharid(getarg(1))+" and type="+getarg(1),@points,@annc;
686 if(!@annc) query_sql "update pvpm_data set annc=annc+"+getarg(2)+" where id="+getcharid(getarg(1))+" and type="+getarg(1);
687 if (@points >= @annc)
688 {
689 Announce strcharinfo(getarg(1))+" | "+@points+" "+callfunc("getMesPM",76)+"! ["+getarg(3)+"]",bc_all,0xFF7F50;
690 query_sql "update pvpm_data set annc=annc+"+getarg(2)+" where id="+getcharid(getarg(1))+" and type="+getarg(1);
691 if($@sound==1||$@sound==3) soundeffectall "Monster Kill.wav",0;
692 } if(!$@sound||$@sound==1) return;
693 if(getarg(3)=="PvP")
694 {
695 if(@noMoreSounds&&@withoutDying==@withoutDyingAnnc)
696 {
697 mapannounce @map$,strcharinfo(0)+" | "+$@SoundList$[@noMoreSounds]+"! [ "+@withoutDying+" "+callfunc("getMesPM",76)+" ]",bc_map,0xFF7F50;
698 soundeffectall $@SoundList$[@noMoreSounds]+".wav",0,@map$;
699 set @withoutDyingAnnc,@withoutDyingAnnc+5;
700 return;
701 }
702 if($@SoundList$[@withoutDying]=="end")
703 {
704 set @withoutDyingAnnc,@withoutDyingAnnc+5;
705 set @noMoreSounds,@withoutDying-1;
706 }
707 if($@SoundList$[@withoutDying]!=""&&!@noMoreSounds)
708 {
709 mapannounce @map$,strcharinfo(0)+" | "+$@SoundList$[@withoutDying]+" ! [ "+@withoutDying+" "+callfunc("getMesPM",76)+" ]",bc_map,0xFF7F50;
710 soundeffectall $@SoundList$[@withoutDying]+".wav",0,@map$;
711 }
712 } return;
713 }
714
715 if(getarg(0) == "PCKillEvent")
716 {
717 set @Live,1;
718 if(@RightWoEMap)
719 {
720 if($@CountPointsInWoE==1 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","kills",0,100;
721 dispbottom "Player Score: "+@points;
722 if($@CountPointsInWoE==2 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","kills",2,1000;
723 dispbottom "Guild Score: "+@points;
724 end;
725 } getmapxy(@map$,@x,@y,0);
726 if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]>=0 && $@MapTypePM[@MapIDx]<=1 || $@PK_Mode)
727 {
728 set @withoutDying,@withoutDying+1;
729 callfunc("pvpm_func","Up","kills",0,100);
730 dispbottom "Player Score: "+@points;
731 callfunc("pvpm_func","ChangeLeader",0);
732 callfunc("pvpm_func","Annc",0,100,"PvP");
733 }
734 if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]==2 && getcharid(2) || $@PK_Mode && getcharid(2))
735 {
736 callfunc("pvpm_func","Up","kills",2,1000);
737 dispbottom "Guild Score: "+@points;
738 callfunc("pvpm_func","ChangeLeader",2);
739 callfunc("pvpm_func","Annc",2,1000,"GvG");
740 } end;
741 }
742
743 if(getarg(0) == "PCDieEvent")
744 {
745 set @Live,0;
746 if(@RightWoEMap)
747 {
748 if($@CountPointsInWoE==1 || $@CountPointsInWoE==3) { callfunc "pvpm_func","Up","dies",0,100; if($@mainRanking) dispbottom "Player Score: "+@points; }
749 if($@CountPointsInWoE==2 || $@CountPointsInWoE==3) { callfunc "pvpm_func","Up","dies",2,1000; if($@mainRanking) dispbottom "Guild Score: "+@points; }
750 }
751 set @withoutDying,0;
752 set @noMoreSounds,0;
753 set @withoutDyingAnnc,0;
754 set @MapIDx,0;
755 set @RightWoEMap,0;
756 getmapxy(@map$,@x,@y,0);
757 if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]>=0 && $@MapTypePM[@MapIDx]<=1 || $@PK_Mode) { callfunc "pvpm_func","Up","dies",0,100; if($@mainRanking) dispbottom "Player Score: "+@points; }
758 if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]==2 && getcharid(2) || $@PK_Mode && getcharid(2)) { callfunc "pvpm_func","Up","dies",2,1000; if($@mainRanking) dispbottom "Guild Score: "+@points; }
759 end;
760 }
761
762 if(getarg(0) == "PCLoadEvent")
763 {
764 getmapxy(@map$,@x,@y,0);
765 if(getcastlename(@map$)=="") { set @RightWoEMap,0; end; }
766 if(agitcheck() || agitcheck2()) set @RightWoEMap,1;
767 end;
768 }
769
770 if(getarg(0) == "getexp")
771 {
772 if(@Live)
773 {
774 attachrid(killedrid);
775 set .@BaseLevel,BaseLevel;
776 attachrid(killerrid);
777 if($@getEXPoption==1) set @EXP,(($@getEXP*.@BaseLevel)/BaseLevel); else set @EXP,$@getEXP;
778 getexp @EXP,@EXP;
779 dispbottom callfunc("getMesPM",77)+" "+@EXP+" EXP.";
780 } else {
781 if(BaseExp) set BaseExp,BaseExp-$@lostEXP;
782 if(JobExp) set JobExp,JobExp-$@lostEXP;
783 dispbottom callfunc("getMesPM",78)+" "+$@lostEXP+" EXP.";;
784 } return;
785 }
786}
787
788function script getMesPM { return getd("$@PM_Lang"+PM_Lang+"$["+getarg(0)+"]"); }
789
790//================== DUPLICATE =====================
791prontera,151,193,4 duplicate(PM_source) [PvP] Arena#1 899
792morocc,152,97,4 duplicate(PM_source) [PvP] Arena#2 899
793geffen,127,65,4 duplicate(PM_source) [PvP] Arena#3 899
794alberta,26,240,4 duplicate(PM_source) [PvP] Arena#4 899
795izlude,122,119,4 duplicate(PM_source) [PvP] Arena#5 899
796aldebaran,147,119,4 duplicate(PM_source) [PvP] Arena#6 899
797xmas,145,136,4 duplicate(PM_source) [PvP] Arena#7 899
798comodo,184,158,4 duplicate(PM_source) [PvP] Arena#8 899
799gonryun,161,126,4 duplicate(PM_source) [PvP] Arena#9 899
800louyang,226,106,4 duplicate(PM_source) [PvP] Arena#10 899
801ayothaya,155,121,4 duplicate(PM_source) [PvP] Arena#11 899
802hugel,87,164,4 duplicate(PM_source) [PvP] Arena#12 899
803moscovia,209,190,5 duplicate(PM_source) [PvP] Arena#13 899
804//================== WOE =====================
805
806//Necessбrio para ativar o sistema de contagem dos pontos na woe.
807//caso queira desativar algum mapa, retire-o daqui.
808
809aldeg_cas01 mapflag loadevent
810aldeg_cas02 mapflag loadevent
811aldeg_cas03 mapflag loadevent
812aldeg_cas04 mapflag loadevent
813gefg_cas01 mapflag loadevent
814gefg_cas02 mapflag loadevent
815gefg_cas03 mapflag loadevent
816gefg_cas04 mapflag loadevent
817gefg_cas05 mapflag loadevent
818payg_cas01 mapflag loadevent
819payg_cas02 mapflag loadevent
820payg_cas03 mapflag loadevent
821payg_cas04 mapflag loadevent
822payg_cas05 mapflag loadevent
823prtg_cas01 mapflag loadevent
824prtg_cas02 mapflag loadevent
825prtg_cas03 mapflag loadevent
826prtg_cas04 mapflag loadevent
827prtg_cas05 mapflag loadevent
828schg_cas01 mapflag loadevent
829schg_cas02 mapflag loadevent
830schg_cas03 mapflag loadevent
831schg_cas04 mapflag loadevent
832schg_cas05 mapflag loadevent
833arug_cas01 mapflag loadevent
834arug_cas02 mapflag loadevent
835arug_cas03 mapflag loadevent
836arug_cas04 mapflag loadevent
837arug_cas05 mapflag loadevent
838
839//NГO APAGUE DAQUI PARA BAIXO!
840pay_gld mapflag loadevent
841prt_gld mapflag loadevent
842sch_gld mapflag loadevent
843aru_gld mapflag loadevent
844gef_fild13 mapflag loadevent
845alde_gld mapflag loadevent
846n_castle mapflag loadevent