· 8 years ago · Dec 05, 2017, 04:30 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_nogo;
211 setmapflag $@mapPM$[.@j],mf_nomemo;
212 setmapflag $@mapPM$[.@j],mf_nopenalty;
213 setmapflag $@mapPM$[.@j],mf_nobranch;
214 if(!$@MapTypePM[.@j] && !$@mfPM[.@j]) setmapflag $@mapPM$[.@j],mf_pvp; else
215 if(!$@MapTypePM[.@j]) setmapflag $@mapPM$[.@j],mf_pvp_noguild;
216 if($@MapTypePM[.@j]==2) setmapflag $@mapPM$[.@j],mf_gvg;
217 }
218}
219
220- script PM_source -1,{
221
222 while(1)
223 {
224 mes $@pvpm_name$;
225 mes callfunc("getMesPM",1);
226 mes callfunc("getMesPM",2);
227 mes callfunc("getMesPM",3);
228 mes "^008B8B< PvP "+callfunc("getMesPM",4)+" - ^FFA500"+$@Player_Lider$+"^008B8B >";
229 mes "^008B8B< GvG "+callfunc("getMesPM",4)+" - ^FFA500"+$@Guild_Lider$+"^008B8B >";
230 switch(select("^FFA500- "+callfunc("getMesPM",5)+"^000000:- Ranking:- "+callfunc("getMesPM",6)+":- "+callfunc("getMesPM",7)+":- "+callfunc("getMesPM",79)))
231 {
232 case 1:
233 for(set @i,0;@i<=(getarraysize($@IDPM)-1);set @i,@i+1) set @m$[@i]," ^0000FF["+getmapusers($@mapPM$[@i])+"]";
234 switch(getarraysize($@IDPM))
235 {
236 case 1: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0]));
237 case 2: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1]));
238 case 3: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2]));
239 case 4: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3]));
240 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]));
241 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]));
242 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]));
243 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]));
244 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]));
245 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]));
246 } mes "** ERROR ** CHECK THE pm_map TABLE"; close;
247
248 case 2:
249 switch(select("- PvP:- PvP "+callfunc("getMesPM",8)+":- PvP (Ratio):- GvG:- GvG "+callfunc("getMesPM",8)+":- GvG (Ratio):- "+callfunc("getMesPM",9)))
250 {
251 case 1: callfunc "pvpm_func","Ranking1","kills",0,"PvP"; next; continue;
252 case 2: callfunc "pvpm_func","Ranking1","dies",0,"PvP (Mortes)"; next; continue;
253 case 3: callfunc "pvpm_func","Ranking1","ratio",0,"PvP (Ratio)"; next; continue;
254 case 4: callfunc "pvpm_func","Ranking1","kills",2,"GvG"; next; continue;
255 case 5: callfunc "pvpm_func","Ranking1","dies",2,"GvG (Mortes)"; next; continue;
256 case 6: callfunc "pvpm_func","Ranking1","ratio",2,"GvG (Ratio)"; next; continue;
257 case 7:
258 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)"))
259 {
260 case 1: callfunc "pvpm_func","Ranking2","kills",0; next; continue;
261 case 2: callfunc "pvpm_func","Ranking2","dies",0; next; continue;
262 case 3: callfunc "pvpm_func","Ranking2","ratio",0; next; continue;
263 case 4: callfunc "pvpm_func","Ranking2","kills",2; next; continue;
264 case 5: callfunc "pvpm_func","Ranking2","dies",2; next; continue;
265 case 6: callfunc "pvpm_func","Ranking2","ratio",2; next; continue;
266 }
267 }
268 case 3:
269 next;
270 mes $@pvpm_name$;
271 mes callfunc("getMesPM",10);
272 mes callfunc("getMesPM",11);
273 mes callfunc("getMesPM",12);
274 next; continue;
275 case 4:
276 close;
277
278 case 5:
279 next;
280 mes $@pvpm_name$;
281 mes callfunc("getMesPM",80);
282 query_sql("select str from pvpm_lang where id=0",@lang$);
283 for(set @a,0;@a<getarraysize(@lang$);set @a,@a+1) mes @a+" = "+@lang$[@a];
284 input @inp;
285 if(@inp < 0 || @inp > (getarraysize(@lang$)-1))
286 {
287 mes callfunc("getMesPM",81);
288 next; continue;
289 } set PM_Lang,@inp;
290 next; continue;
291 }
292 }
293
294OnInit:
295 waitingroom "",0;
296OnTimer5000:
297 setarray .@RoomDisplay$,"[PvP] Arena","PvP "+$@PM_Lang0$[4]+" ["+$@Player_Lider$+"]","GvG "+$@PM_Lang0$[4]+" ["+$@Guild_Lider$+"]";
298 delwaitingroom;
299 waitingroom .@RoomDisplay$[rand(0,2)],0;
300 initnpctimer;
301}
302
303- script cmd -1,{
304
305OnWhisperGlobal:
306
307 if(compare(@whispervar0$,"!warp"))
308 {
309 set @ArenaID,@whispervar1$;
310 if(!@ArenaID)
311 {
312 dispbottom callfunc("getMesPM",13);
313 end;
314 } callfunc("pvpm_func","Warp",0,@ArenaID);
315 }
316
317 if(compare(@whispervar0$,"!ranking"))
318 { if(compare(@whispervar0$,"2"))
319 {
320 if(compare(@whispervar1$,"pvp"))
321 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking2","ratio",0,"Ratio"; end; }
322 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking2","kills",0; else
323 callfunc "pvpm_func","Ranking2","dies",0;
324 end;
325 }
326
327 if(compare(@whispervar1$,"gvg"))
328 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking2","ratio",2,"Ratio"; end; }
329 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking2","kills",2; else
330 callfunc "pvpm_func","Ranking2","dies",2;
331 end;
332 }
333 }
334
335 if(compare(@whispervar1$,"pvp"))
336 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking1","ratio",0,"Ratio"; end; }
337 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking1","kills",0,"PvP"; else
338 callfunc "pvpm_func","Ranking1","dies",0,"PvP ( Mortes )";
339 end;
340 }
341
342 if(compare(@whispervar1$,"gvg"))
343 { if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking1","ratio",2,"Ratio"; end; }
344 if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking1","kills",2,"GvG"; else
345 callfunc "pvpm_func","Ranking1","dies",2,"GvG";
346 end;
347 }
348 }
349
350 if ( compare(@whispervar0$,"!exit") )
351 {
352 getmapxy(@map$,@x,@y,0);
353 for(set @i,0;@i!=getarraysize($@mapPM$);set @i,@i+1)
354 {
355 if (@map$ != $@mapPM$[@i]) continue;
356 dispbottom callfunc("getMesPM",14);
357 sleep2 5000;
358 warp getsavepoint(0),getsavepoint(1),getsavepoint(2);
359 end;
360 }
361 dispbottom callfunc("getMesPM",15);
362 end;
363 }
364
365 if (compare(@whispervar0$,"lider"))
366 {
367 if(compare(@whispervar0$,"pvp")) dispbottom "PvP "+callfunc("getMesPM",4)+": "+$@Player_Lider$; else
368 dispbottom "GvG "+callfunc("getMesPM",4)+": "+$@Guild_Lider$;
369 end;
370 }
371
372 if(compare(@whispervar0$,"!truncate") && getgmlevel()>=70)
373 {
374 if(compare(@whispervar1$,"pvp"))
375 {
376 query_sql("delete from pvpm_data where type=0");
377 dispbottom callfunc("getMesPM",16);
378 end;
379 }
380 if(compare(@whispervar1$,"gvg"))
381 {
382 query_sql("delete from pvpm_data where type=2");
383 dispbottom callfunc("getMesPM",16);
384 end;
385 } dispbottom callfunc("getMesPM",17);
386 }
387
388 if (compare(@whispervar0$,"!ban"))
389 {
390 if(@whispervar1$=="") { dispbottom callfunc("getMesPM",18); end; }
391 if(@whispervar2$=="") { dispbottom callfunc("getMesPM",19); end; }
392 if(@whispervar3$=="") { dispbottom callfunc("getMesPM",20); end; }
393 if(@whispervar2$=="showtime")
394 { query_sql("select ban from pvpm_data where name='"+@whispervar1$+"' limit 1",@showtime);
395 dispbottom callfunc("getMesPM",21)+" ["+@whispervar1$+"] ["+@showtime+" "+callfunc("getMesPM",27)+"]";
396 end;
397 } if(@whispervar2$=="unban")
398 { query_sql("update pvpm_data set ban=0 where name='"+@whispervar1$+"' limit 1");
399 dispbottom callfunc("getMesPM",22)+@whispervar1$;
400 message @whispervar1$,callfunc("getMesPM",23);
401 end;
402 } set @time,@whispervar2$;
403 if(@time==0 && @whispervar2$!="unban" || @time==0 && @whispervar2$!="showtime") { dispbottom callfunc("getMesPM",24); end; }
404 set @id,0;
405 query_sql("select id from pvpm_data where name='"+@whispervar1$+"' and type="+@whispervar3$,@id);
406 if(!@id && @whispervar3$=="0" || !@id && @whispervar3$=="2") { dispbottom callfunc("getMesPM",25); end; }
407 set @bantime,0;
408 if(compare(@whispervar2$,"-")) query_sql("update pvpm_data set ban=ban"+@time+" where id="+@id+" limit 1"); else
409 query_sql("update pvpm_data set ban=ban+"+@time+" where id="+@id+" limit 1");
410 query_sql("select ban from pvpm_data where id="+@id+" limit 1",@bantime);
411 dispbottom callfunc("getMesPM",26)+" ("+@bantime+" "+callfunc("getMesPM",27)+")";
412 message @whispervar1$,callfunc("getMesPM",28)+" "+@bantime+" "+callfunc("getMesPM",27)+".";
413 warpchar "prontera",150,150,getcharid(0,@whispervar1$);
414 end;
415 }
416
417 if (compare(@whispervar0$,"!map") && getgmlevel()>=70)
418 {
419 if (compare(@whispervar1$,"add"))
420 {
421 if(getarraysize($@IDPM)>=10)
422 {
423 dispbottom callfunc("getMesPM",29);
424 dispbottom callfunc("getMesPM",30);
425 end;
426 } set @type,@whispervar3$;
427 if(!@type && @whispervar3$==""||@type>2)
428 {
429 dispbottom callfunc("getMesPM",31);
430 dispbottom callfunc("getMesPM",32);
431 dispbottom callfunc("getMesPM",33);
432 end;
433 } set @mapcheck$,"";
434 query_sql("select map from pvpm_map where map='"+@whispervar2$+"' limit 1",@mapcheck$);
435 if(@mapcheck$!="")
436 {
437 dispbottom callfunc("getMesPM",34);
438 end;
439 } query_sql("insert into `pvpm_map` (id,map,type) values ("+(getarraysize($@IDPM)-1)+",'"+@whispervar2$+"',"+@type+")");
440 dispbottom callfunc("getMesPM",35)+" ("+@whispervar2$+")";
441 doevent "init_PM::OnReloadListMap";
442 }
443
444 if (compare(@whispervar1$,"del"))
445 {
446 if(getarraysize($@IDPM)<=1)
447 {
448 dispbottom callfunc("getMesPM",36);
449 end;
450 } query_sql("select map from pvpm_map where map='"+@whispervar2$+"'",@mapcheck$);
451 if(@mapcheck$=="")
452 {
453 dispbottom callfunc("getMesPM",37);
454 end;
455 } query_sql("delete from pvpm_map where map='"+@whispervar2$+"'");
456 dispbottom callfunc("getMesPM",38)+" ("+@whispervar2$+")";
457 doevent "init_PM::OnReloadListMap";
458 }
459
460 if (compare(@whispervar1$,"list"))
461 {
462 for(set @i,0;@i<=(getarraysize($@IDPM)-1);set @i,@i+1) dispbottom "["+(@i+1)+"] "+$@mapPM$[@i];
463 end;
464 }
465 end;
466 }
467
468 if (compare(@whispervar0$,"!help"))
469 {
470 if(compare(@whispervar1$,"!warp")) {
471 dispbottom callfunc("getMesPM",39);
472 dispbottom callfunc("getMesPM",40);
473 dispbottom "- !warp#1;!warp#2;...!warp#5 ..";
474 dispbottom callfunc("getMesPM",41);
475 end;
476 }
477
478 if(compare(@whispervar1$,"!ranking")) {
479 dispbottom callfunc("getMesPM",39);
480 dispbottom callfunc("getMesPM",42);
481 dispbottom "- !ranking#pvp;!ranking#pvp#die;!ranking#gvg;!ranking#gvg#die;!ranking#ratio";
482 dispbottom "- !ranking2#pvp;!ranking2#pvp#die;!ranking2#gvg;!ranking2#gvg#die;!ranking2#ratio; (Mostra somente sua posição)";
483 dispbottom callfunc("getMesPM",43);;
484 end;
485 }
486
487 if(compare(@whispervar1$,"!pvplider") || compare(@whispervar1$,"!gvglider")) {
488 dispbottom callfunc("getMesPM",39);
489 dispbottom callfunc("getMesPM",44);;
490 end;
491 }
492
493 if(compare(@whispervar1$,"!exit")) {
494 dispbottom callfunc("getMesPM",39);
495 dispbottom callfunc("getMesPM",45);
496 end;
497 }
498
499 if(compare(@whispervar1$,"!ban") && getgmlevel()>=70) {
500 dispbottom callfunc("getMesPM",39);
501 dispbottom callfunc("getMesPM",46);
502 dispbottom callfunc("getMesPM",47);
503 dispbottom callfunc("getMesPM",48);
504 dispbottom callfunc("getMesPM",49);
505 dispbottom callfunc("getMesPM",50);
506 end;
507 }
508
509 if(compare(@whispervar1$,"!map") && getgmlevel()>=70) {
510 dispbottom callfunc("getMesPM",39);
511 dispbottom callfunc("getMesPM",51);
512 dispbottom callfunc("getMesPM",52);
513 dispbottom "- Type: 0 = Arena PvP; 1 = Arena PvP Baby; 2 Arena GvG;";
514 dispbottom callfunc("getMesPM",53);
515 end;
516 }
517
518 if(compare(@whispervar1$,"!truncate") && getgmlevel()>=70) {
519 dispbottom callfunc("getMesPM",39);
520 dispbottom callfunc("getMesPM",54);
521 dispbottom callfunc("getMesPM",55);
522 dispbottom callfunc("getMesPM",56);
523 end;
524 } dispbottom callfunc("getMesPM",57);
525 end;
526 }
527
528 dispbottom callfunc("getMesPM",58);
529 dispbottom callfunc("getMesPM",59);
530 dispbottom callfunc("getMesPM",60);
531 dispbottom callfunc("getMesPM",61);
532 dispbottom callfunc("getMesPM",62);
533 dispbottom callfunc("getMesPM",63);
534 dispbottom callfunc("getMesPM",64);
535 dispbottom callfunc("getMesPM",65);
536 if(getgmlevel()>=70)
537 {
538 dispbottom callfunc("getMesPM",66);
539 dispbottom callfunc("getMesPM",67);
540 dispbottom callfunc("getMesPM",68);
541 dispbottom callfunc("getMesPM",69);
542 }
543
544}
545
546- script event#pvpm -1,{
547OnInit:
548OnTimer60000:
549 query_sql("update pvpm_data set ban=ban-1 where ban>0");
550 initnpctimer;
551 end;
552
553OnPCKillEvent:
554 callfunc("pvpm_func","PCKillEvent");
555
556OnPCDieEvent:
557 callfunc("pvpm_func","PCDieEvent");
558
559OnPCLoadMapEvent:
560 callfunc("pvpm_func","PCLoadEvent");
561}
562
563function script pvpm_func {
564
565 if (getarg(0) == "Ranking1")
566 {
567 deletearray @name$[0],getarraysize(@name$);
568 deletearray @points[0],getarraysize(@points);
569 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;
570 dispbottom "======= Ranking - "+getarg(3)+" =======";
571 for(set @i,0;@i != $@showsRankUntil;set @i,@i+1)
572 {
573 if(@name$[@i]=="") return;
574 dispbottom (@i+1)+"º | "+@name$[@i]+" | "+@points[@i];
575 } return;
576 }
577
578 if (getarg(0) == "Ranking2")
579 {
580 deletearray @name$[0],getarraysize(@name$);
581 deletearray @points[0],getarraysize(@points);
582 query_sql "select id,"+getarg(1)+" from pvpm_data where type="+getarg(2)+" order by "+getarg(1)+" desc limit 125",@id,@points;
583 for(set @i,0;@i <= 125;set @i,@i+1)
584 {
585 if (@id[@i] == getcharid(getarg(2)))
586 {
587 dispbottom "- "+strcharinfo(getarg(2))+" | "+(@i+1)+"º | "+@points[@i];
588 return;
589 }
590 }
591 dispbottom callfunc("getMesPM",70);
592 return;
593 }
594
595 if(getarg(0)=="Warp")
596 {
597 if(getarg(1))
598 {
599 if($@MapTypePM[(getarg(2)-1)]==2 && !getcharid(2))
600 {
601 mes $@pvpm_name$;
602 mes callfunc("getMesPM",71);
603 close;
604 } if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
605 {
606 mes $@pvpm_name$;
607 mes callfunc("getMesPM",72);
608 close;
609 } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0,1); else callfunc("pvpm_func","ban",2,1);
610 } else {
611 getmapxy(@map$,@x,@y,0);
612 if($@mapPM$[(getarg(2)-1)]==@map$)
613 {
614 dispbottom "<!!!> "+callfunc("getMesPM",73);
615 end;
616 } if($@MapTypePM[(getarg(2)-1)]==2)
617 {
618 dispbottom "<!!!> "+callfunc("getMesPM",71);
619 end;
620 } if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
621 {
622 dispbottom "<!!!> "+callfunc("getMesPM",72);
623 end;
624 } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0); else callfunc("pvpm_func","ban",2);
625 } set @MapIDx,(getarg(2)-1);
626 if($@breakBuffs) sc_end -1;
627 announce "O Player "+strcharinfo(0)+" entrou na arena !", 6;
628 warp $@mapPM$[(getarg(2)-1)],0,0;
629 end;
630 }
631
632 if (getarg(0) == "ban")
633 {
634 set @bantime,0;
635 query_sql("select ban from pvpm_data where id="+getcharid(getarg(1))+" limit 1",@bantime);
636 if(!@bantime) return;
637 if(!getarg(2,0)) { dispbottom "<!!!> "+callfunc("getMesPM",74)+" "+@bantime+" "+callfunc("getMesPM",27)+"!"; end; } else
638 { mes "^FF7F50<!!!> ^FFA500"+callfunc("getMesPM",74)+" ^FF7F50"+@bantime+"^FFA500 "+callfunc("getMesPM",27)+"!"; close; }
639 }
640
641 if (getarg(0) == "Up")
642 {
643 if($@getEXPoption) callfunc("pvpm_func","getexp");
644 set @name$,"";
645 set @points,0;
646 query_sql("select name,"+getarg(1)+" from pvpm_data where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1",@name$,@points);
647 if (@name$=="")
648 {
649 query_sql("INSERT INTO pvpm_data (id,"+getarg(1)+",name,annc,type) values ("+getcharid(getarg(2))+",1,'"+strcharinfo(getarg(2))+"',"+getarg(3)+","+getarg(2)+")");
650 dispbottom "Score: 1";
651 end;
652 } query_sql("update pvpm_data set "+getarg(1)+"="+getarg(1)+"+1 where id="+getcharid(getarg(2)));
653 set @points,@points+1;
654 if($@mainRanking)
655 {
656 set @kills,0;
657 set @dies,0;
658 query_sql("select kills,dies from pvpm_data where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1",@kills,@dies);
659 query_sql("update pvpm_data set ratio="+(@kills-@dies)+" where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1");
660 set @points,@kills-@dies;
661 return;
662 } return;
663 }
664
665 if (getarg(0) == "ChangeLeader")
666 {
667 set @L_name$,"";
668 set @L_points,0;
669 if(!$@mainRanking) query_sql("select name,kills from pvpm_data where leader=1 and type="+getarg(1)+" limit 1",@L_name$,@L_points); else
670 query_sql("select name,ratio from pvpm_data where leader=1 and type="+getarg(1)+" limit 1",@L_name$,@L_points);
671 if (@points > @L_points && @L_name$ != strcharinfo(getarg(1)))
672 {
673 query_sql("update pvpm_data set leader=0 where type="+getarg(1));
674 query_sql("update pvpm_data set leader=1 where id="+getcharid(getarg(1))+" and type="+getarg(1));
675 mapannounce @map$,strcharinfo(getarg(1))+" | "+callfunc("getMesPM",75)+" !",bc_map,0xFF7F50;
676 set $@Player_Lider$,"";
677 set $@Guild_Lider$,"";
678 query_sql("select name from pvpm_data where leader=1 and type=0 limit 1",$@Player_Lider$);
679 query_sql("select name from pvpm_data where leader=1 and type=2 limit 1",$@Guild_Lider$);
680 } return;
681 }
682
683 if (getarg(0) == "Annc")
684 {
685 set @points,0;
686 set @annc,0;
687 query_sql "select kills,annc from pvpm_data where id="+getcharid(getarg(1))+" and type="+getarg(1),@points,@annc;
688 if(!@annc) query_sql "update pvpm_data set annc=annc+"+getarg(2)+" where id="+getcharid(getarg(1))+" and type="+getarg(1);
689 if (@points >= @annc)
690 {
691 Announce strcharinfo(getarg(1))+" | "+@points+" "+callfunc("getMesPM",76)+"! ["+getarg(3)+"]",bc_all,0xFF7F50;
692 query_sql "update pvpm_data set annc=annc+"+getarg(2)+" where id="+getcharid(getarg(1))+" and type="+getarg(1);
693 if($@sound==1||$@sound==3) soundeffectall "Monster Kill.wav",0;
694 } if(!$@sound||$@sound==1) return;
695 if(getarg(3)=="PvP")
696 {
697 if(@noMoreSounds&&@withoutDying==@withoutDyingAnnc)
698 {
699 mapannounce @map$,strcharinfo(0)+" | "+$@SoundList$[@noMoreSounds]+"! [ "+@withoutDying+" "+callfunc("getMesPM",76)+" ]",bc_map,0xFF7F50;
700 soundeffectall $@SoundList$[@noMoreSounds]+".wav",0,@map$;
701 set @withoutDyingAnnc,@withoutDyingAnnc+5;
702 return;
703 }
704 if($@SoundList$[@withoutDying]=="end")
705 {
706 set @withoutDyingAnnc,@withoutDyingAnnc+5;
707 set @noMoreSounds,@withoutDying-1;
708 }
709 if($@SoundList$[@withoutDying]!=""&&!@noMoreSounds)
710 {
711 mapannounce @map$,strcharinfo(0)+" | "+$@SoundList$[@withoutDying]+" ! [ "+@withoutDying+" "+callfunc("getMesPM",76)+" ]",bc_map,0xFF7F50;
712 soundeffectall $@SoundList$[@withoutDying]+".wav",0,@map$;
713 }
714 } return;
715 }
716
717 if(getarg(0) == "PCKillEvent")
718 {
719 set @Live,1;
720 if(@RightWoEMap)
721 {
722 if($@CountPointsInWoE==1 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","kills",0,100;
723 dispbottom "Player Score: "+@points;
724 if($@CountPointsInWoE==2 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","kills",2,1000;
725 dispbottom "Guild Score: "+@points;
726 end;
727 } getmapxy(@map$,@x,@y,0);
728 if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]>=0 && $@MapTypePM[@MapIDx]<=1 || $@PK_Mode)
729 {
730 set @withoutDying,@withoutDying+1;
731 callfunc("pvpm_func","Up","kills",0,100);
732 dispbottom "Player Score: "+@points;
733 callfunc("pvpm_func","ChangeLeader",0);
734 callfunc("pvpm_func","Annc",0,100,"PvP");
735 }
736 if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]==2 && getcharid(2) || $@PK_Mode && getcharid(2))
737 {
738 callfunc("pvpm_func","Up","kills",2,1000);
739 dispbottom "Guild Score: "+@points;
740 callfunc("pvpm_func","ChangeLeader",2);
741 callfunc("pvpm_func","Annc",2,1000,"GvG");
742 } end;
743 }
744
745 if(getarg(0) == "PCDieEvent")
746 {
747 set @Live,0;
748 if(@RightWoEMap)
749 {
750 if($@CountPointsInWoE==1 || $@CountPointsInWoE==3) { callfunc "pvpm_func","Up","dies",0,100; if($@mainRanking) dispbottom "Player Score: "+@points; }
751 if($@CountPointsInWoE==2 || $@CountPointsInWoE==3) { callfunc "pvpm_func","Up","dies",2,1000; if($@mainRanking) dispbottom "Guild Score: "+@points; }
752 }
753 set @withoutDying,0;
754 set @noMoreSounds,0;
755 set @withoutDyingAnnc,0;
756 set @MapIDx,0;
757 set @RightWoEMap,0;
758 getmapxy(@map$,@x,@y,0);
759 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; }
760 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; }
761 end;
762 }
763
764 if(getarg(0) == "PCLoadEvent")
765 {
766 getmapxy(@map$,@x,@y,0);
767 if(getcastlename(@map$)=="") { set @RightWoEMap,0; end; }
768 if(agitcheck() || agitcheck2()) set @RightWoEMap,1;
769 end;
770 }
771
772 if(getarg(0) == "getexp")
773 {
774 if(@Live)
775 {
776 attachrid(killedrid);
777 set .@BaseLevel,BaseLevel;
778 attachrid(killerrid);
779 if($@getEXPoption==1) set @EXP,(($@getEXP*.@BaseLevel)/BaseLevel); else set @EXP,$@getEXP;
780 getexp @EXP,@EXP;
781 dispbottom callfunc("getMesPM",77)+" "+@EXP+" EXP.";
782 } else {
783 if(BaseExp) set BaseExp,BaseExp-$@lostEXP;
784 if(JobExp) set JobExp,JobExp-$@lostEXP;
785 dispbottom callfunc("getMesPM",78)+" "+$@lostEXP+" EXP.";;
786 } return;
787 }
788}
789
790function script getMesPM { return getd("$@PM_Lang"+PM_Lang+"$["+getarg(0)+"]"); }
791
792//================== DUPLICATE =====================
793prontera,161,173,4 duplicate(PM_source) [PvP] Arena#1 734
794geffen,130,66,3 duplicate(PM_source) [PvP] Arena#3 734
795payon,164,101,6 duplicate(PM_source) [PvP] Arena#4 734
796aldebaran,146,115,4 duplicate(PM_source) [PvP] Arena#5 734
797yuno,169,173,4 duplicate(PM_source) [PvP] Arena#6 734
798amatsu,123,145,3 duplicate(PM_source) [PvP] Arena#7 734
799gonryun,166,110,3 duplicate(PM_source) [PvP] Arena#8 734
800louyang,231,104,3 duplicate(PM_source) [PvP] Arena#9 734
801lighthalzen,163,105,3 duplicate(PM_source) [PvP] Arena#10 734
802comodo,199,157,4 duplicate(PM_source) [PvP] Arena#11 734
803ayothaya,221,183,4 duplicate(PM_source) [PvP] Arena#12 734
804hugel,109,152,2 duplicate(PM_source) [PvP] Arena#13 734
805rachel,107,120,0 duplicate(PM_source) [PvP] Arena#14 734
806veins,222,137,4 duplicate(PM_source) [PvP] Arena#15 734
807// novas cidades
808brasilis,199,206,2 duplicate(PM_source) [PvP] Arena#16 734
809manuk,287,181,0 duplicate(PM_source) [PvP] Arena#17 734
810splendide,184,143,0 duplicate(PM_source) [PvP] Arena#18 447
811dicastes01,190,178,0 duplicate(PM_source) [PvP] Arena#19 449
812mora,142,99,4 duplicate(PM_source) [PvP] Arena#20 734
813dewata,194,201,6 duplicate(PM_source) [PvP] Arena#21 734
814malangdo,194,123,0 duplicate(PM_source) [PvP] Arena#22 545
815
816//================== WOE =====================
817
818//Necessário para ativar o sistema de contagem dos pontos na woe.
819//caso queira desativar algum mapa, retire-o daqui.
820
821aldeg_cas01 mapflag loadevent
822aldeg_cas02 mapflag loadevent
823aldeg_cas03 mapflag loadevent
824aldeg_cas04 mapflag loadevent
825gefg_cas01 mapflag loadevent
826gefg_cas02 mapflag loadevent
827gefg_cas03 mapflag loadevent
828gefg_cas04 mapflag loadevent
829gefg_cas05 mapflag loadevent
830payg_cas01 mapflag loadevent
831payg_cas02 mapflag loadevent
832payg_cas03 mapflag loadevent
833payg_cas04 mapflag loadevent
834payg_cas05 mapflag loadevent
835prtg_cas01 mapflag loadevent
836prtg_cas02 mapflag loadevent
837prtg_cas03 mapflag loadevent
838prtg_cas04 mapflag loadevent
839prtg_cas05 mapflag loadevent
840schg_cas01 mapflag loadevent
841schg_cas02 mapflag loadevent
842schg_cas03 mapflag loadevent
843schg_cas04 mapflag loadevent
844schg_cas05 mapflag loadevent
845arug_cas01 mapflag loadevent
846arug_cas02 mapflag loadevent
847arug_cas03 mapflag loadevent
848arug_cas04 mapflag loadevent
849arug_cas05 mapflag loadevent
850
851//NÃO APAGUE DAQUI PARA BAIXO!
852pay_gld mapflag loadevent
853prt_gld mapflag loadevent
854sch_gld mapflag loadevent
855aru_gld mapflag loadevent
856gef_fild13 mapflag loadevent
857alde_gld mapflag loadevent
858n_castle mapflag loadevent