· 6 years ago · Jan 08, 2020, 12:26 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,10; // |
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,0; // |
135set $@getEXP,0; // 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,0; // |
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 end;
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$,"Arena [PvP]",""+$@PM_Lang0$[4]+" PvP ["+$@Player_Lider$+"]",""+$@PM_Lang0$[4]+" GvG ["+$@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;
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 next;
601 mes $@pvpm_name$;
602 mes callfunc("getMesPM",71);
603 end;
604 } if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
605 {
606 next;
607 mes $@pvpm_name$;
608 mes callfunc("getMesPM",72);
609 end;
610 } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0,1); else callfunc("pvpm_func","ban",2,1);
611 } else {
612 getmapxy(@map$,@x,@y,0);
613 if($@mapPM$[(getarg(2)-1)]==@map$)
614 {
615 dispbottom "<!!!> "+callfunc("getMesPM",73);
616 end;
617 } if($@MapTypePM[(getarg(2)-1)]==2)
618 {
619 dispbottom "<!!!> "+callfunc("getMesPM",71);
620 end;
621 } if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
622 {
623 dispbottom "<!!!> "+callfunc("getMesPM",72);
624 end;
625 } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0); else callfunc("pvpm_func","ban",2);
626 } set @MapIDx,(getarg(2)-1);
627 if($@breakBuffs) sc_end -1;
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 set BaseExp,BaseExp-$@lostEXP;
784 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,149,190,3 duplicate(PM_source) Arena [PvP]#1 801
794morocc,162,97,4 duplicate(PM_source) Arena [PvP]#2 801
795geffen,127,65,4 duplicate(PM_source) Arena [PvP]#3 801
796alberta,33,240,4 duplicate(PM_source) Arena [PvP]#4 801
797izlude,122,119,4 duplicate(PM_source) Arena [PvP]#5 801
798aldebaran,147,114,4 duplicate(PM_source) Arena [PvP]#6 801
799xmas,140,136,4 duplicate(PM_source) Arena [PvP]#7 801
800comodo,190,162,4 duplicate(PM_source) Arena [PvP]#8 801
801gonryun,161,126,4 duplicate(PM_source) Arena [PvP]#9 801
802louyang,226,106,4 duplicate(PM_source) Arena [PvP]#10 801
803ayothaya,155,121,4 duplicate(PM_source) Arena [PvP]#11 801
804hugel,94,157,4 duplicate(PM_source) Arena [PvP]#12 801
805moscovia,209,190,5 duplicate(PM_source) Arena [PvP]#13 801
806//================== WOE =====================
807
808//Necessário para ativar o sistema de contagem dos pontos na woe.
809//caso queira desativar algum mapa, retire-o daqui.
810
811aldeg_cas01 mapflag loadevent
812aldeg_cas02 mapflag loadevent
813aldeg_cas03 mapflag loadevent
814aldeg_cas04 mapflag loadevent
815gefg_cas01 mapflag loadevent
816gefg_cas02 mapflag loadevent
817gefg_cas03 mapflag loadevent
818gefg_cas04 mapflag loadevent
819gefg_cas05 mapflag loadevent
820payg_cas01 mapflag loadevent
821payg_cas02 mapflag loadevent
822payg_cas03 mapflag loadevent
823payg_cas04 mapflag loadevent
824payg_cas05 mapflag loadevent
825prtg_cas01 mapflag loadevent
826prtg_cas02 mapflag loadevent
827prtg_cas03 mapflag loadevent
828prtg_cas04 mapflag loadevent
829prtg_cas05 mapflag loadevent
830schg_cas01 mapflag loadevent
831schg_cas02 mapflag loadevent
832schg_cas03 mapflag loadevent
833schg_cas04 mapflag loadevent
834schg_cas05 mapflag loadevent
835arug_cas01 mapflag loadevent
836arug_cas02 mapflag loadevent
837arug_cas03 mapflag loadevent
838arug_cas04 mapflag loadevent
839arug_cas05 mapflag loadevent
840
841//NÃO APAGUE DAQUI PARA BAIXO!
842pay_gld mapflag loadevent
843prt_gld mapflag loadevent
844sch_gld mapflag loadevent
845aru_gld mapflag loadevent
846gef_fild13 mapflag loadevent
847alde_gld mapflag loadevent
848n_castle mapflag loadevent