· 7 years ago · Oct 21, 2018, 09:14 PM
1//===== eAthena Script =======================================
2//= Arena Master
3//===== By ===================================================
4//= lllchrislll
5//===== Version ==============================================
6//= 1.0 - Script Made
7// Added Multi Kill & SoundEffects
8// Added Bounty & Promotion Feature
9// Fully tested & Rewritten most of the code
10// - Since it didn't wanted to work like I wanted q-q
11// - Couldn't test the Party PvP option though.
12// Added a bonus at the bounty feature
13// - If an player gains a "$@bty_bon_start" spree, "$@bty_bonus"
14// will be given to the player, who kill him/her.
15//===== Compatible With ======================================
16//= Every eAthena Version [SQL]
17//===== Description ==========================================
18//= PvP / GvG & MvP Arena which also handles an ranking to it.
19//= PvP Types:
20// - Normal
21// - Dispell: You'll be dispelled on Room entry.
22// - Deathmatch: You'll be auto resurrect when you die.
23// If you type @die, get comaed and similar, you'll be warped to your save point.
24// - Party PvP: 2vs2, 3vs3, 4vs4, 5vs5
25//= PvP:
26// - There are 5 Rooms: Prontera, Alberta, Izlude, Morroc
27// PvP Types: Normal - Deathmatch has one of these.
28// That means 5*3.
29// - Party PvP: There are 4 types and those also has one of room each.
30// > So 5*4.
31// -----------------------------------------------
32// = Total 35 Rooms !!!!
33// -----------------------------------------------
34//= GvG: 5 Arenas, the default guild_vs1 - guild_vs5.
35//= MvP: For the MvP Part I'm using the scripts in npc/custom/MVP_arena/
36// Enable both in npc/scripts_custom.conf or uncomment the two "npc:" below this
37//npc: npc/custom/MVP_arena/arena_mvp.txt
38//npc: npc/custom/MVP_arena/amvp_func.txt
39//===== Comments & Credits =============================================
40//= Credits:
41// - MvP Arena: Darkchild, massdriller, Silent
42// Well, it's added to the SVN already, but just in case D:.
43//=========== Item Usage Restrictions =======================
44// Required File: db/item_noequip.txt
45// Entries, insert theres at the bottom of the file.
46/*
47// Disabled for PvP+GvG - PvP/GvG Arena [lllchrislll]
48//607,3 // Yggdrasil Berry
49//608,3 // Yggdrasil Seed
50*/
51//===== MySQL Entries ========================================
52/*
53// v1.0
54DROP TABLE IF EXISTS `arena_master`;
55CREATE TABLE `arena_master` (
56 `char_id` int(10) unsigned NOT NULL,
57 `kills` smallint(5) unsigned DEFAULT '0',
58 `death` smallint(5) unsigned DEFAULT '0',
59 `hscore` smallint(5) unsigned DEFAULT '0',
60 `bounty` smallint(5) unsigned DEFAULT '0',
61 `bounty_pts` smallint(5) unsigned DEFAULT '0',
62 `killer` smallint(5) unsigned DEFAULT '0',
63 `domi` smallint(5) unsigned DEFAULT '0',
64 `mega` smallint(5) unsigned DEFAULT '0',
65 `unstopp` smallint(5) unsigned DEFAULT '0',
66 `wicked` smallint(5) unsigned DEFAULT '0',
67 `monster` smallint(5) unsigned DEFAULT '0',
68 `godlike` smallint(5) unsigned DEFAULT '0',
69 `holys` smallint(5) unsigned DEFAULT '0',
70 `mvp` smallint(5) unsigned DEFAULT '0',
71PRIMARY KEY (`char_id`)
72) ENGINE=MyISAM;
73*/
74//=============== ToDo List ==========================
75// - Nothing yet
76//============================================================
77// ================= Arena Master ================== //
78
79//Arena Informationand Ranking EDITED ****
80
81dicastes01,250,214,4 script Arena Information 974,{
82set .@n$,"["+strnpcinfo(1)+"]";
83
84mes .@n$;
85mes "How can I help you?";
86mes "-------------------------";
87mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
88if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
89next;
90switch(select("- See Rankings:- Need Information:- Nevermind")) {
91
92// Ranking
93 case 1:
94 mes .@n$;
95 if(!$@pvptable) {
96 mes "I'm sorry, the ranking system is offline and thus I can't show you any ranking.";
97 close;
98 }
99 mes "Which ranking do you wanna see?";
100 next;
101 switch(select("- Kills:- Deaths:- High Scores:- Killing Sphree:- Dominating:- Mega Kill:- Unstoppable:- Wicked Sick:- Monster Kill:- GodLike:- Holy Sh1t:- MvP")) {
102 case 1: set .@listr$,"kills"; break;
103 case 2: set .@listr$,"death"; break;
104 case 3: set .@listr$,"hscore"; break;
105 case 4: set .@listr$,"killer"; break;
106 case 5: set .@listr$,"domi"; break;
107 case 6: set .@listr$,"mega"; break;
108 case 7: set .@listr$,"unstopp"; break;
109 case 8: set .@listr$,"wicked"; break;
110 case 9: set .@listr$,"monster"; break;
111 case 10: set .@listr$,"godlike"; break;
112 case 11: set .@listr$,"holys"; break;
113 case 12: set .@listr$,"mvp"; break;
114 }
115 set @rank,@menu;
116 mes .@n$;
117 mes "Which list do you want to see?";
118 next;
119 switch(select("- Top 5:- Top 10:- Top 15:- Top 20:- Top 25:- Top 30:- Nevermind")) {
120
121 default:
122 set .@limit,5*@menu;
123 break;
124
125 case 7:
126 goto R_Bye;
127 break;
128 }
129 mes .@n$;
130 mes "Ranking:";
131 switch(@rank) {
132
133 case 1: mes set(.@rankn$,"Top "+.@limit+" Killers"); set .@rankt$,"Kills"; break;
134 case 2: mes set(.@rankn$,"Top "+.@limit+" Victims"); set .@rankt$,"Deaths"; break;
135 case 3: mes set(.@rankn$,"Top "+.@limit+" High Scores"); set .@rankt$,"High Score"; break;
136 case 12: mes set(.@rank$,"Top "+.@limit+" MvP Hunters"); set .@rankt$,"MvP Kills"; break;
137 default: mes set(.@rankn$,"Top "+.@limit+" \""+$@sphreen$[@rank-3]+"\" Rankers"); set .@rankt$,$@sphreen$[@rank-3]+"s"; break;
138 }
139 mes "Correct?";
140 next;
141 if(select("- Yes:- No") == 2) goto R_Bye;
142 mes .@n$;
143 mes "I will now list the ranking in your Chat Box.";
144 close2;
145 dispbottom "======= "+.@rankn$+" ===========";
146 dispbottom "Player Name: "+.@rankt$;
147 query_sql "SELECT `char_id` , `"+.@listr$+"` FROM `arena_master` WHERE `"+.@listr$+"` > 0 ORDER BY `"+.@listr$+"` DESC LIMIT "+.@limit,.@ch_id,.@sh_r;
148 if(!.@sh_r[0]) {
149 dispbottom "No Player found.";
150 end;
151 }
152 for( set .@r,0; .@r < getarraysize(.@sh_r); set .@r,.@r + 1) {
153 query_sql "SELECT `name` FROM `char` WHERE `char_id` = '"+.@ch_id[.@r]+"'",.@ch_na$;
154 dispbottom .@ch_na$+": "+.@sh_r[.@r];
155 }
156 deletearray .@ch_id[0],128;
157 deletearray .@sh_r[0],128;
158 end;
159
160// Arena Shop
161 case 2:
162 mes .@n$;
163 mes "Hello, I can sell your useful items for the daily PvP need and more.";
164 mes "Depending on the bounty, I will open the respective shop.";
165 next;
166 mes .@n$;
167 switch($@bty_type) {
168
169 case 0:
170 mes "I'm sorry, but the bounty feature is not enabled.";
171 close;
172
173 case 1:
174 mes "I will now open the Bounty Shop, which uses \"Zeny\" as payment.";
175 break;
176
177 case 2:
178 mes "I will now open the Bounty Shop, which uses \"Cash Points\" as payment.";
179 break;
180
181 case 3:
182 mes "I will now open the Bounty Shop, which uses \"Bounty Points\" as payment.";
183 break;
184 }
185 close2;
186 callshop "Arena_Shop",1;
187 npcshopattach "Arena_Shop";
188 end;
189
190 OnBuyItem:
191 for( set @s,0; @s < getarraysize(@bought_nameid); set @s,@s + 1) {
192 for( set @i,0; @i < getarraysize($@arena_sh); set @i,@i + 1) {
193 if(@bought_nameid[@s] == $@arena_sh[@i]) {
194 if(checkweight(@bought_nameid[@s],@bought_quantity[@s]) == 1) {
195 set @c_item,(@bought_quantity[@s]*$@arena_ar[@i]);
196 set @total,(@total + @c_item);
197 break;
198 } else {
199 dispbottom "Arena Shop: You have reached your weight limit, lose some weight and come back please.";
200 end;
201 }
202 }
203 }
204 }
205 switch($@bty_type) {
206
207 case 1:
208 if(Zeny >= @total) {
209 for ( set @b,0; @b < getarraysize(@bought_nameid); set @b,@b + 1)
210 getitem @bought_nameid[@b],@bought_quantity[@b];
211
212 set Zeny,Zeny - @total;
213
214 } else dispbottom "You don't have enough Zeny.";
215 break;
216
217 case 2:
218 if(#CASHPOINTS >= @total) {
219 for ( set @b,0; @b < getarraysize(@bought_nameid); set @b,@b + 1)
220 getitem @bought_nameid[@b],@bought_quantity[@b];
221
222 set #CASHPOINTS,#CASHPOINTS - @total;
223
224 } else dispbottom "You don't have enough Cash Points, currently "+#CASHPOINTS;
225 break;
226
227 case 3:
228 if(query_sql("SELECT `bounty_pts` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@pts) >= @total)
229 for ( set @b,0; @b < getarraysize(@bought_nameid); set @b,@b + 1) {
230 getitem @bought_nameid[@b],@bought_quantity[@b];
231
232 query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` - "+@total+" WHERE `char_id` = '"+getcharid(0)+"'";
233
234 } else dispbottom "You don't have enough Bounty Points, currently "+@pts;
235 break;
236 }
237 set @total,0;
238 deletearray @bought_nameid[0],128;
239 deletearray @bought_quantity[0],128;
240 end;
241
242// Information
243 case 3:
244 mes .@n$;
245 mes "What do you want to know about?";
246 next;
247 switch(select("- PvP:- GvG:- Sphree:- Ranking:- Bounty Feature:- Nevermind")) {
248
249 case 1:
250 mes "[=== PvP ===]";
251 mes "Each PvP Type has five rooms, displayed as";
252 mes "Prontera, Alberta, Izlude, Payon and Morroc.";
253 mes "Party PvP has 4 types and each type has also five rooms.";
254 next;
255 mes "[=== PvP ===]";
256 mes "PvP Types:";
257 mes " - Normal";
258 mes " - Dispell";
259 mes " - Deathmatch";
260 mes " - Party PvP:";
261 mes " - 2vs2";
262 mes " - 3vs3";
263 mes " - 4vs4";
264 mes " - 5vs5";
265 next;
266 mes "[=== PvP ===]";
267 mes "Dispell PvP:";
268 mes " - You'll be dispelled, when";
269 mes " you entry an room.";
270 mes " ";
271 mes "Deathmatch PvP:";
272 mes " - You'll be auto-resurrect on";
273 mes " death, except you type @die,";
274 mes " get comaed or similar, then";
275 mes " you'll be warped to your savepoint.";
276 close;
277
278 case 2:
279 mes "[=== GvG ===]";
280 if($@same_gld) {
281 mes "There can be two guilds in one room at the same time with maximum "+$@mpgld+" members per guild.";
282 mes "Each guild has two spawn postions, Guild 1 has North and West and Guild 2 has East and South,";
283 mes "which will be chosen randomly on room entry, also only members";
284 mes "of 'em can enter the same room until no one is left of the respective guild.";
285 } else mes "Only members of a guild can enter a room and the maximum players, which can enter are "+$@mgvg+".";
286 close;
287
288 case 3:
289 mes "[=== Sphree ===]";
290 mes "Sphree - Required Kills.";
291 mes "First Blood - 1";
292 for ( set .@s,1; .@s < getarraysize($@sphreen$); set .@s,.@s + 1)
293 mes $@sphreen$[.@s] +" - "+$@sphr_kills[.@s];
294
295 next;
296 mes "[=== Sphree ===]";
297 mes "For each sphree you accomplish, except First Blood, you gain an point for the bounty feature, if it has been activated.";
298 mes "For more ask me about the Bounty Feature.";
299 next;
300 mes "[=== Sphree ===]";
301 mes "Also there is the Multi Kill Sphrees, but you won't recieve points for them.";
302 mes "The time span you can achieve them is "+ $@multi+" seconds.";
303 next;
304 mes "[=== Sphree ===]";
305 mes "In this time you, if you kill";
306 mes " - one more player = Double Kill";
307 mes " - two more players = Triple Kill";
308 mes " - three or more players = Ultra Kill";
309 close;
310
311 case 4:
312 mes "[=== Ranking ===]";
313 mes "Kills, Deaths, Sphree Counts (like Killing Sphree), the highest kill count till you died and lists it in either a Top 5, 10, 15, 20, 25 or a Top 30 List with the wanted information you have chosen, will be displayed.";
314 next;
315 mes "[=== Ranking ===]";
316 mes "Additionally there is an promote feature, which is part of the ranking to save your sphree counts which can be, like mentioned above, listed.";
317 mes "But the save of them will only apply when you logout.";
318 close;
319
320 case 5:
321 mes .@n$;
322 if(!$@bty_type) {
323 mes "This feature isn't activate.";
324 close;
325 }
326 mes "There are three different bounty rewards, which are the following:";
327 mes " - Zeny";
328 mes " - Cash Points";
329 mes " - Bounty Points";
330 next;
331 mes .@n$;
332 mes "But depending on the setting which has been made by the GM Team, only one will be used.";
333 mes "Also for each of these an Shop exists and only one shop can be accessed.";
334 mes "Current Bounty Reward: "+ $@bty_price + " " + ( ($@bty_type == 1)?"Zeny": ( ($@bty_type == 2)?"Cash Points":"Bounty Points") );
335 next;
336 mes .@n$;
337 mes "The bounty depends on your victims sphree.";
338 mes "Here is a list of them:";
339 mes "And while I'm on it I will list the required kills for them too.";
340 mes " ";
341 mes "Sphree - Requ. Kills - Points";
342 for ( set .@s,1; .@s < getarraysize($@sphreen$); set .@s,.@s + 1)
343 mes $@sphreen$[.@s] +" - "+$@sphr_kills[.@s] + " - "+.@s;
344
345 next;
346
347 case 6:
348 goto R_Bye;
349 close;
350 }
351
352// Nevermind
353 case 4:
354 goto R_Bye;
355 break;
356}
357
358R_Bye:
359mes .@n$;
360mes "Okay, see ya.";
361close;
362}
363
364// Arena GVG - EDITED ****
365dicastes01,254,211,4 script GVG Arena 651,{
366set .@n$,"["+strnpcinfo(1)+"]";
367
368mes .@n$;
369mes "Guild vs Guild arena";
370mes "-------------------------";
371mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
372if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
373next;
374switch(select("- Go to GVG arena:- Nevermind")) {
375
376 // GvG
377 case 1:
378 set @sphr,0;
379 set @bty,0;
380 set @killct,0;
381 set @first,1; // First Blood
382 mes .@n$;
383 mes "In which arena do you want to fight?";
384 next;
385 mes .@n$;
386 if(!getcharid(2)) {
387 mes "I'm sorry, but you are not in a guild.";
388 close;
389 }
390 mes "Please choose the room you want to join:";
391 mes "Each arena can hold up to "+$@mgvg+" player(s).";
392 if($@same_gld) mes "If guilds already are in this room, you have to be a member of it so that you can join.";
393 next;
394 set .@rchoi,select("- GvG 1 ["+getmapusers($@gvgr$[0])+"]:- GvG 2 ["+getmapusers($@gvgr$[1])+"]:- GvG 3 ["+getmapusers($@gvgr$[2])+"]:- GvG 4 ["+getmapusers($@gvgr$[3])+"]:- GvG 5 ["+getmapusers($@gvgr$[4])+"]") - 1;
395 mes .@n$;
396 if($@same_gld) {
397 set @gvgc,@menu;
398 if(getd("$@gvg_"+@gvgc+"_gld_1") == 0) {
399 mes "I will warp you now.";
400 close2;
401 warp $@gvgr$[.@rchoi],$@gvg_gld1_x[.@rchoi],$@gvg_gld1_y[.@rchoi];
402 setd("$@gvg_"+@gvgc+"_gld_1"),getcharid(2);
403 setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
404 end;
405 } else if(getd("$@gvg_"+@gvgc+"_gld_2") == 0) {
406 mes "I will warp you now.";
407 close2;
408 warp $@gvgr$[.@rchoi],$@gvg_gld2_x[.@rchoi],$@gvg_gld2_x[.@rchoi];
409 setd("$@gvg_"+@gvgc+"_gld_2"),getcharid(2);
410 setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
411 end;
412 }
413 if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
414 if(getd("$@gvg_"+@gvgc+"_1_ppl") >= $@mpgld) {
415 mes "I'm sorry, but your guild's side is already full.";
416 close;
417 }
418 mes "I will warp you now.";
419 close2;
420 set @rand,rand(1,2);
421 warp $@gvgr$[.@rchoi],getd("$@gvg_gld1_x"+@rand+"["+.@rchoi+"]"),getd("$@gvg_gld1_y"+@rand+"["+.@rchoi+"]");
422 setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
423 end;
424 } else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
425 if(getd("$@gvg_"+@gvgc+"_2_ppl") >= $@mpgld) {
426 mes "I'm sorry, but your guild's side is already full.";
427 close;
428 }
429 mes "I will warp you now.";
430 close2;
431 set @rand,rand(1,2);
432 warp $@gvgr$[.@rchoi],getd("$@gvg_gld2_x"+@rand+"["+.@rchoi+"]"),getd("$@gvg_gld2_y"+@rand+"["+.@rchoi+"]");
433 setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
434 end;
435 }
436 } else {
437 if(getmapusers($@gvgr$[.@rchoi]) >= $@mgvg) {
438 mes "I'm sorry, but this Arena is already full.";
439 close;
440 }
441 mes "I will warp you now.";
442 close2;
443 warp $@gvgr$[.@rchoi],0,0;
444 end;
445 }
446 break;
447
448// Nevermind
449 case 2:
450 goto R_Bye;
451 break;
452}
453
454R_Bye:
455mes .@n$;
456mes "Okay, see ya.";
457close;
458}
459
460// PVP Arena NPC Edited ****
461
462dicastes01,239,211,4 script PVP Arena 651,{
463set .@n$,"["+strnpcinfo(1)+"]";
464function getPartyMapUsers;
465
466mes .@n$;
467mes "Would you like to PvP now?";
468mes "-------------------------";
469mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
470if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
471next;
472switch(select("- Enter to PvP:- Cancel")) {
473
474// PvP
475 case 1:
476 set @sphr,0;
477 set @bty,0;
478 set @killct,0;
479 set @first,1; // First Blood
480 mes .@n$;
481 mes "In which arena do you want to fight?";
482 next;
483 mes .@n$;
484 mes "Now select the room you want to fight in.";
485 set @map,select("- Prontera:- Alberta:- Izlude:- Payon:- Morroc");
486 next;
487 mes .@n$;
488 mes "Please choose the PvP Type:";
489 mes "This arena can hold up to "+$@muser[@map]+" player(s).";
490 mes "Party PvP is different of course.";
491 next;
492 switch(select("- PvP (Dispell) ["+getmapusers($@disppvp$[@map])+"]:- Normal PvP ["+getmapusers($@npvp$[@map])+"]:- PvP Deathmatch["+getmapusers($@dmpvp$[@map])+"]:- Party PvP["+getPartyMapUsers(6)+"]")) {
493
494 // PvP Dispell
495 case 1:
496 mes .@n$;
497 if(getmapusers($@disppvp$[@map]) >= $@muser[@map]) {
498 mes "I'm sorry, but this room is already full.";
499 close;
500 }
501 mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room, also remove all your buffs.";
502 close2;
503 sc_end SC_ALL;
504 warp $@disppvp$[@map],0,0;
505 end;
506
507 //PvP Normal
508 case 2:
509 mes .@n$;
510 if(getmapusers($@npvp$[@map]) >= $@muser[@map]) {
511 mes "I'm sorry, but this room is already full.";
512 close;
513 }
514 mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room.";
515 close2;
516 warp $@npvp$[@map],0,0;
517 end;
518
519 // PvP DM
520 case 3:
521 mes .@n$;
522 if(getmapusers($@dmpvp$[@map]) >= $@muser[@map]) {
523 mes "I'm sorry, but this room is already full.";
524 close;
525 }
526 mes "I'll warp you now to the "+ $@room$[@map]+" PvP Deathmatch Room.";
527 close2;
528 warp $@dmpvp$[@map],0,0;
529 end;
530
531 // Party PvP
532 case 4:
533 mes .@n$;
534 if(!getcharid(1)) {
535 mes "I'm sorry, but you are not in a party.";
536 mes "Please come back as soon you have found one.";
537 close;
538 }
539 mes "Please choose the Party vs Party Mode:";
540 next;
541 set .@pt,select("- 2vs2 ["+getPartyMapUsers(2,@map)/2+"]:- 3vs3 ["+getPartyMapUsers(3,@map)/3+"]:- 4vs4 ["+getPartyMapUsers(4,@map)/4+"]:- 5vs5 ["+getPartyMapUsers(5,@map)/5+"]") + 1;
542 mes .@n$;
543 if(getPartyMapUsers(.@pt,@map) >= (.@pt*.@pt)) {
544 mes "I'm sorry, but this "+.@pt+"vs"+.@pt+" Arena is already full.";
545 mes "Please try another.";
546 close;
547 }
548 set @pty_id,getcharid(1);
549 if(getpartyleader(@pty_id) != strcharinfo(0)) {
550 mes "I'm sorry, but only your leader can register your party.";
551 close;
552 }
553
554 getpartymember(@pty_id,1);
555 set @ptymem,$@partymembercount;
556 if(@ptymem != .@pt) {
557 mes "I'm sorry, but you have not the required amount of members in your party.";
558 mes "Please make sure that you have exact "+.@pt+" members, not more not less.";
559 close;
560 }
561 getpartymember(@pty_id,2);
562 copyarray @ptymemid[0],$@partymembercid,@ptymem;
563 copyarray @ptymemaid[0],$@partymemberaid,@ptymem;
564 set .@pt_ct,0;
565 for ( set .@pm,0; .@pm < @ptymem; set .@pm,.@pm + 1)
566 if(isloggedin(@ptymemid[.@pm],@ptymemaid[.@pm]) == 0)
567 set .@pt_ct,.@pt_ct + 1;
568 if(.@pt_ct) {
569 mes "It seems like that members are offline.";
570 mes "Please kick them and gather new members.";
571 close;
572 }
573 mes "I'll warp your party now.";
574 mes "Good luck.";
575 close2;
576 warpparty getd("$@pt"+.@pt+"pvp$["+@map+"]"),0,0,@pty_id;
577 end;
578 }
579 break;
580
581function getPartyMapUsers {
582 // getarg(0) == Party PvP Type (2vs2,3vs3, etc...) > 2,3, etc...
583 // if it's a 6 = Total Map Users of the Party PvP Maps
584 // getarg(1) == Room
585 if(getarg(0) == 6) {
586 set @pt2play,getmapusers($@pt2pvp$[1]) + getmapusers($@pt2pvp$[2]) + getmapusers($@pt2pvp$[3]) + getmapusers($@pt2pvp$[4]) + getmapusers($@pt2pvp$[5]);
587 set @pt3play,getmapusers($@pt3pvp$[1]) + getmapusers($@pt3pvp$[2]) + getmapusers($@pt3pvp$[3]) + getmapusers($@pt3pvp$[4]) + getmapusers($@pt3pvp$[5]);
588 set @pt4play,getmapusers($@pt4pvp$[1]) + getmapusers($@pt4pvp$[2]) + getmapusers($@pt4pvp$[3]) + getmapusers($@pt4pvp$[4]) + getmapusers($@pt4pvp$[5]);
589 set @pt5play,getmapusers($@pt5pvp$[1]) + getmapusers($@pt5pvp$[2]) + getmapusers($@pt5pvp$[3]) + getmapusers($@pt5pvp$[4]) + getmapusers($@pt5pvp$[5]);
590 return @pt2play + @pt3play + @pt4play + @pt5play;
591
592 } else return getmapusers(getd("$@pt"+getarg(0)+"pvp$["+getarg(1)+"]"));
593}
594
595// Nevermind
596 case 5:
597 goto R_Bye;
598 break;
599}
600
601R_Bye:
602mes .@n$;
603mes "Okay, see ya.";
604close;
605}
606
607
608// =============== Bounty Feature Shop =========== //
609- shop Arena_Shop -1,512:-1
610// =============== Main Settings ===============//
611- script PvPGvGMain -1,{
612end;
613
614OnInit:
615// =============== Ranking Check & Debug Messages ================//
616if($@debug) announce "====== Arena Master - Debug initiate... ========",bc_self;
617if(query_sql("SHOW TABLES LIKE 'arena_master'",.@pvptab[0]) == 0) set $@pvptable,0; else set $@pvptable,1;
618announce "Arena Master Ranking System - Status: "+ ( ($@pvptable)?"Online":"Offline"),bc_all;
619// ============== Sphree Settings ============//
620setarray $@sphreen$[1],"Killing Sphree","Dominating","Mega Kill","Unstoppable","Wicked Sick","Monster Kill","GodLike","Holy Sh1t";
621setarray $@msphree$[1],"Double Kill","Triple Kill","Ultra Kill";
622setarray $@sphr_kills[1],3,5,7,9,11,13,15,17; // Kills required for each sphree.
623set $@multi,15000; // Time Span for chance to gain Multi-Kill in milliseconds.
624set $@promo,5; // Kills required till points will be promoted to the current sphree.
625if($@debug) announce "PvP Sphree Settings loaded: "+$@sphreen$[0],bc_self;
626// ============== Bounty Settings =========//
627// Bounty Type: 0 = Off, 1 = Zeny, 2 = Cash Points, 3 = Bounty Points
628set $@bty_type,1;
629if($@bty_type) {
630 set $@bty_bonus,5; // Bonus, if you kill an player
631 set $@bty_bon_start,4; //which has achieved an spree of "$@bty_bon_start"
632// Clearing Array on Whisper to prevent double entries
633 if(.@re_in) {
634 // Items
635 for (set .@s,0; .@s < getarraysize($@arena_sh); set .@s,.@s + 1)
636 npcshopdelitem "Arena_Shop",$@arena_sh[.@s];
637 // Prices
638 deletearray $@arena_ar[0],128;
639 }
640
641 // Shop Items: PvP useful stuff D:, like Elements, Boxes and Food
642 // These will be used for all shops, but the prices depends on the Bounty Type you have set.
643 setarray $@arena_sh[0],12020,12028,12029,12030,12031,12032,12033,12034,12108,12215,12216,12217,12218,12219,12075,12080,12085,12090,12095,12100,12114,12115,12116,12117,12118,12119,12120,12121,13543,13544,13545,13546,13547,14593;
644 npcshopdelitem "Arena_Shop",512;
645 // Prices:
646 // Two ways of doing so:
647 // - By formula
648 // - Array
649 // You can determine for each currency the way of calculation and prices.
650 if($@bty_type == 1) {
651// =============== Zeny ========== //
652 set $@bty_price,2000; // Zeny per Sphree
653
654 // If you want to use the formula, set ".arena_pay" to 1.
655 // If you wanna use the array, set ".arena_pay" to 2.
656 set $@arena_pay,1; // 1 = Formula, 2 = Per Array
657
658 // But remember to put the prices for all items.
659 setarray $@arena_ar[0],100; // Etc
660
661 } else if($@bty_type == 2) {
662// =============== Cash Points ========== //
663 set $@bty_price,2; // Cash Points per Sphree
664
665 // If you want to use the formula, set ".arena_pay" to 1.
666 // If you wanna use the array, set ".arena_pay" to 2.
667 set $@arena_pay,1; // 1 = Formula, 2 = Per Array
668
669 // But remember to put the prices for all items.
670 setarray $@arena_ar[0],100; // Etc
671
672 } else if($@bty_type == 3) {
673// =============== Bounty Points ========== //
674 set $@bty_price,5; // Bounty Points per Sphree
675
676 // If you want to use the formula, set ".arena_pay" to 1.
677 // If you wanna use the array, set ".arena_pay" to 2.
678 set $@arena_pay,1; // 1 = Formula, 2 = Per Array
679
680 // But remember to put the prices for all items.
681 setarray $@arena_ar[0],100; // Etc
682 }
683 for ( set .@s,0; .@s < getarraysize($@arena_sh); set .@s,.@s + 1) {
684 if($@arena_pay == 1) { // By Formula
685
686 // =============== Zeny Formula ========== //
687 // Default: ($@bty_price+(.@s*($@bty_price/10)))/2
688 // Base Price = $@bty_price, "Multiplier" = + (Index ID* ($@bty_price/10))/2
689 // Example: 5000 + (4(=Index of 12031)*(5000/10=500) > 7000/2 = 3500 Zeny for 12031
690 // Note: If the formula results in a decimal number it will be degraded.
691 if($@bty_type == 1) set .@arena_fo,($@bty_price+(.@s*($@bty_price/10)))/2;
692
693 // =============== Cash Points Formula ========== //
694 // Default: ($@bty_price+.@s)/2
695 // Base Price = $@bty_price, "Multiplier" = + Index ID/2
696 // Example: 2 + 4(=Index of 12031) > 6/2 = 3 Cash Points for 12031
697 // Note: If the formula results in a decimal number it will be degraded.
698 else if($@bty_type == 2) set .@arena_fo,($@bty_price+.@s)/2;
699
700 // =============== Bounty Points Formula ========== //
701 // Default: ($@bty_price+(.@s*10))/2
702 // Base Price = $@bty_price, "Multiplier" = + (Index ID* 10)/2
703 // Example: 5 + (4(=Index of 12031)*10) > 45/2 = 22 Bounty Points for 12031
704 // Note: If the formula results in a decimal number it will be degraded.
705 else if($@bty_type == 3) set .@arena_fo,($@bty_price+(.@s*10))/2;
706
707 // =============== Adding the price (calculated by the formula) to the array ========== //
708 setarray $@arena_ar[.@s],.@arena_fo;
709
710 }
711 npcshopadditem "Arena_Shop",$@arena_sh[.@s],$@arena_ar[.@s];
712 }
713}
714if($@debug) announce "Bounty Shop - Currency: " + ( ($@bty_type == 1)?"Zeny": ( ($@bty_type == 2)?"Cash Points":"Bounty Points") ) + ", Basic Price: "+ $@bty_price + ", Items: "+getarraysize($@arena_sh)+", Prices: "+getarraysize($@arena_ar),bc_self;
715// Bounty Calculation:
716// Scroll down till the line with "function getBounty {", should be near Line 813
717if($@debug) announce "Bounty Settings loaded: "+$@bty_type,bc_self;
718// ============ GvG Settings ============//
719set $@mpgld,20; //Max Guild Members per Guild
720if($@debug) announce "Max Members per Guild loaded: "+$@mpgld,bc_self;
721set $@mgvg,$@mpgld*2; // Total Members per Arena.
722if($@debug) announce "Max Members per Arena loaded: "+$@mgvg,bc_self;
723set $@same_gld,1; // Same Guild requirement: 1 = On / 0 = Off
724if($@debug) announce "Same Guild Requirement loaded: "+$@same_gld,bc_self;
725setarray $@gvgr$[0],"guild_vs1","guild_vs2","guild_vs3","guild_vs4","guild_vs5";
726if($@debug) announce "Guild Maps loaded: "+$@gvgr$[0],bc_self;
727// If you want to add more mapflags, add them before the "10" > mf_gvg_noparty
728setarray $@gvg_mf[0],0,1,2,3,4,5,9,11,13,15,22,33,34,35,38,41,44,10;
729if($@debug) announce "Guild Mapflags loaded: "+getarraysize($@gvg_mf),bc_self;
730if($@same_gld) {
731// Guild Map Coordinates - used if $@same_gld is enabled
732// Every Guild has two coordinates to spawn from:
733// Guild 1: gld1_ > x1+y1 = North, x2+y2 = East
734 setarray $@gvg_gld1_x1[0],9,9,12,8,18;
735 setarray $@gvg_gld1_y1[0],50,50,51,49,50;
736 setarray $@gvg_gld1_x2[0],50,50,50,50,49;
737 setarray $@gvg_gld1_y2[0],7,7,13,8,23;
738// Guild 2: gld2_ > x1+y1 = West, x2+y2 = South
739 setarray $@gvg_gld2_x1[0],50,50,49,50,49;
740 setarray $@gvg_gld2_y1[0],91,91,86,91,76;
741 setarray $@gvg_gld2_x2[0],92,92,86,91,79;
742 setarray $@gvg_gld2_y2[0],50,50,51,49,49;
743 if($@debug) announce "Guild 1 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld1_x1) +" & Y - "+getarraysize($@gvg_gld1_y1),bc_self;
744 if($@debug) announce "Guild 1 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld1_x2) +" & Y - "+getarraysize($@gvg_gld1_y2),bc_self;
745 if($@debug) announce "Guild 2 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld2_x1) +" & Y - "+getarraysize($@gvg_gld2_y1),bc_self;
746 if($@debug) announce "Guild 2 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld2_x2) +" & Y - "+getarraysize($@gvg_gld2_y2),bc_self;
747}
748// ======= Auto Mapflag Adding ===============//
749for ( set .@m,0; .@m < getarraysize($@gvgr$); set .@m,.@m + 1 ) {
750if($@debug) announce "Array Reading of GvG Maps complete",bc_self;
751if($@debug) announce "Mapflag set at "+$@gvgr$[.@m] + " initiate...",bc_self;
752
753// Use this if you disallows parties
754// for ( set .@mf,0; .@mf < getarraysize($@gvg_mf); set .@mf,.@mf + 1 ) {
755
756// Use this if you allow parties
757 for ( set .@mf,0; .@mf < (getarraysize($@gvg_mf) - 1); set .@mf,.@mf + 1 ) {
758 setmapflag $@gvgr$[.@m],$@gvg_mf[.@mf];
759 if($@debug) announce "Mapflag "+ $@gvg_mf[.@mf] +" set at "+$@gvgr$[.@m] + " complete",bc_self;
760 }
761}
762if($@debug) announce "Guild Mapflag loading completed",bc_self;
763// ============ PvP Settings ============//
764// If you want to add more mapflags, add them before the "7" > mf_pvp_noparty
765setarray $@pvp_mf[0],0,1,2,3,4,5,7,11,13,22,33,34,35,38,41,44,7;
766if($@debug) announce "PvP Mapflags loaded: "+getarraysize($@pvp_mf),bc_self;
767// ============= PvP Room Settings =======//
768setarray $@room$[1],"Prontera","Alberta","Izlude","Payon","Morroc";
769setarray $@muser[1],70,45,30,55,60;
770if($@debug) announce "PvP Town Maps loaded: "+$@room$[1],bc_self;
771// Dispell PvP
772setarray $@disppvp$[1],"pvp_y_1-1","pvp_y_1-4","pvp_y_1-2","pvp_y_1-3","pvp_y_1-5";
773if($@debug) announce "PvP Dispell Maps loaded: "+$@disppvp$[1],bc_self;
774// ======= Auto Mapflag Adding - Dispell PvP ===============//
775for ( set .@m,1; .@m < getarraysize($@disppvp$); set .@m,.@m + 1 ) {
776if($@debug) announce "Array Reading of Dispell PvP Maps complete",bc_self;
777if($@debug) announce "Mapflag set at "+$@disppvp$[.@m] + " initiate...",bc_self;
778// Use this if you disallows parties
779// for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
780
781// Use this if you allow parties
782 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
783 setmapflag $@disppvp$[.@m],$@pvp_mf[.@mf];
784 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@disppvp$[.@m] + " complete",bc_self;
785 }
786}
787if($@debug) announce "PvP Dispell Mapflags loaded.",bc_self;
788// Normal PvP
789setarray $@npvp$[1],"pvp_y_2-1","pvp_y_2-4","pvp_y_2-2","pvp_y_2-3","pvp_y_2-5";
790if($@debug) announce "PvP Normal Maps loaded: "+$@npvp$[0],bc_self;
791// ======= Auto Mapflag Adding - Normal PvP ===============//
792for ( set .@m,1; .@m < getarraysize($@npvp$); set .@m,.@m + 1 ) {
793if($@debug) announce "Array Reading of Normal PvP Maps complete",bc_self;
794if($@debug) announce "Mapflag set at "+$@npvp$[.@m] + " initiate...",bc_self;
795// Use this if you disallows parties
796// for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
797
798// Use this if you allow parties
799 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
800 setmapflag $@npvp$[.@m],$@pvp_mf[.@mf];
801 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@npvp$[.@m] + " complete",bc_self;
802 }
803}
804if($@debug) announce "PvP Normal Mapflags loaded.",bc_self;
805// ================== Deathmatch Settings + Maps ================
806setarray $@dmpvp$[1],"pvp_y_3-1","pvp_y_3-4","pvp_y_3-2","pvp_y_3-3","pvp_y_3-5";
807if($@debug) announce "PvP DM Maps loaded: "+$@dmpvp$[0],bc_self;
808// ======= Auto Mapflag Adding - DM PvP ===============//
809for ( set .@m,1; .@m < getarraysize($@dmpvp$); set .@m,.@m + 1 ) {
810if($@debug) announce "Array Reading of DM PvP Maps complete",bc_self;
811if($@debug) announce "Mapflag set at "+$@dmpvp$[.@m] + " initiate...",bc_self;
812// Use this if you disallows parties
813// for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
814
815// Use this if you allow parties
816 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
817 setmapflag $@dmpvp$[.@m],$@pvp_mf[.@mf];
818 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@dmpvp$[.@m] + " complete",bc_self;
819 }
820}
821if($@debug) announce "PvP DM Mapflags loaded.",bc_self;
822// ================= Party PvP Settings =================
823// ========= 2vs2 Party PvP ==========//
824setarray $@pt2pvp$[1],"pvp_y_4-1","pvp_y_4-4","pvp_y_4-2","pvp_y_4-3","pvp_y_4-5";
825if($@debug) announce "Party PvP 2vs2 Maps loaded: "+$@pt2pvp$[0],bc_self;
826// 3vs3 Party PvP
827setarray $@pt3pvp$[1],"pvp_y_5-1","pvp_y_5-4","pvp_y_5-2","pvp_y_5-3","pvp_y_5-5";
828if($@debug) announce "Party PvP 3vs3 Maps loaded: "+$@pt3pvp$[0],bc_self;
829// 4vs4 Party PvP
830setarray $@pt4pvp$[1],"pvp_y_6-1","pvp_y_6-4","pvp_y_6-2","pvp_y_6-3","pvp_y_6-5";
831if($@debug) announce "Party PvP 4vs4 Maps loaded: "+$@pt4pvp$[0],bc_self;
832// 5vs5 Party PvP
833setarray $@pt5pvp$[1],"pvp_y_7-1","pvp_y_7-4","pvp_y_7-2","pvp_y_7-3","pvp_y_7-5";
834if($@debug) announce "Party PvP 5vs5 Maps loaded: "+$@pt5pvp$[0],bc_self;
835// ======= Auto Mapflag Adding ===============//
836// ============== Party 2vs2 =================//
837if($@debug) announce "Array Reading of Party 2vs2 PvP Maps - configuring",bc_self;
838for ( set .@m,1; .@m < getarraysize($@pt2pvp$); set .@m,.@m + 1 ) {
839 if($@debug) announce "Mapflag set at "+$@pt2pvp$[.@m] + " initiate...",bc_self;
840 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
841 setmapflag $@pt2pvp$[.@m],$@pvp_mf[.@mf];
842 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt2pvp$[.@m] + " complete",bc_self;
843 }
844}
845if($@debug) announce "Party 2v2 PvP Mapflags loaded.",bc_self;
846sleep2 100;
847// ============== Party 3vs3 =================//
848if($@debug) announce "Array Reading of Party 3vs3 PvP Maps - configuring",bc_self;
849for ( set .@m,1; .@m < getarraysize($@pt3pvp$); set .@m,.@m + 1 ) {
850 if($@debug) announce "Mapflag set at "+$@pt3pvp$[.@m] + " initiate...",bc_self;
851 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
852 setmapflag $@pt3pvp$[.@m],$@pvp_mf[.@mf];
853 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt3pvp$[.@m] + " complete",bc_self;
854 }
855}
856if($@debug) announce "Party 3v3 PvP Mapflags loaded.",bc_self;
857sleep2 100;
858// ============== Party 4vs4 =================//
859 if($@debug) announce "Array Reading of Party 4vs4 PvP Maps - configuring",bc_self;
860for ( set .@m,1; .@m < getarraysize($@pt4pvp$); set .@m,.@m + 1 ) {
861 if($@debug) announce "Mapflag set at "+$@pt4pvp$[.@m] + " initiate...",bc_self;
862 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
863 setmapflag $@pt4pvp$[.@m],$@pvp_mf[.@mf];
864 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt4pvp$[.@m] + " complete",bc_self;
865 }
866}
867if($@debug) announce "Party 4v4 PvP Mapflags loaded.",bc_self;
868sleep2 100;
869// ============== Party 5vs5 =================//
870 if($@debug) announce "Array Reading of Party 5vs5 PvP Maps - configuring",bc_self;
871for ( set .@m,1; .@m < getarraysize($@pt5pvp$); set .@m,.@m + 1 ) {
872 if($@debug) announce "Mapflag set at "+$@pt5pvp$[.@m] + " initiate...",bc_self;
873 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
874 setmapflag $@pt5pvp$[.@m],$@pvp_mf[.@mf];
875 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt5pvp$[.@m] + " complete",bc_self;
876 }
877}
878if($@debug) announce "Party 5v5 PvP Mapflags loaded.",bc_self;
879sleep2 100;
880if($@debug) announce "Party PvP Mapflags loaded.",bc_self;
881function writeStats;
882if($@debug) announce "Write Stats Function loaded.",bc_self;
883function getBounty;
884function writeBounty;
885if($@debug) announce "Bounty Function loaded.",bc_self;
886function doPromote;
887if($@debug) announce "Promote Function loaded.",bc_self;
888if(.@re_in) goto OnWhisperGlobal;
889end;
890
891OnPCKillEvent:
892if(compare(strcharinfo(3),"pvp_y_") == 0 && compare(strcharinfo(3),"guild_vs") == 0) end;
893if(getmapflag(strcharinfo(3),mf_pvp) == 0 && getmapflag(strcharinfo(3),mf_gvg) == 0) end;
894set .@v,killedrid;
895mapannounce strcharinfo(3),strcharinfo(0) + " has killed "+rid2name(.@v)+"!!!!!",0;
896set @killct,@killct + 1;
897switch(@killct) {
898 case 1:
899 if(@first) {
900 mapannounce strcharinfo(3),strcharinfo(0) + " has achieved First Blood!!!!",0;
901 soundeffectall "firstblood.wav",0,strcharinfo(3);
902 set @first,0;
903 }
904 break;
905
906 case 3:
907 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Killing Spree!!!!",0;
908 soundeffectall "killingspree.wav",0,strcharinfo(3);
909 set @sphr,1;
910 break;
911
912 case 5:
913 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Dominating!!!!",0;
914 soundeffectall "dominating.wav",0,strcharinfo(3);
915 set @sphr,2;
916 break;
917
918 case 7:
919 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Mega Kill!!!!",0;
920 soundeffectall "megakill.wav",0,strcharinfo(3);
921 set @sphr,3;
922 break;
923
924 case 9:
925 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Unstoppable!!!!",0;
926 soundeffectall "unstoppable.wav",0,strcharinfo(3);
927 set @sphr,4;
928 break;
929
930 case 11:
931 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Wicked Sick!!!!",0;
932 soundeffectall "wickedsick.wav",0,strcharinfo(3);
933 set @sphr,5;
934 break;
935
936 case 13:
937 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Monster Kill!!!!",0;
938 soundeffectall "monsterkill.wav",0,strcharinfo(3);
939 set @sphr,6;
940 break;
941
942 case 15:
943 mapannounce strcharinfo(3),strcharinfo(0) + " is now on GodLike!!!!",0;
944 soundeffectall "godlike.wav",0,strcharinfo(3);
945 set @sphr,7;
946 break;
947
948 case 17:
949 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Holy Sh1t!!!!",0;
950 soundeffectall "holyshit.wav",0,strcharinfo(3);
951 set @sphr,8;
952 break;
953
954 default:
955 if(@killct > 17) {
956 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Holy Sh1t!!!!",0;
957 soundeffectall "holyshit.wav",0,strcharinfo(3);
958 }
959 break;
960}
961set @prokill,@prokill + 1;
962doPromote;
963
964
965set @mkillct,@mkillct + 1;
966deltimer strnpcinfo(0)+"::OnMultiSpan";
967addtimer $@multi,strnpcinfo(0)+"::OnMultiSpan";
968if(@mkillct >= 2) sleep2 500; // Slowing down multi-kill sound effects
969if(@mkillct == 2) {
970 mapannounce strcharinfo(3),strcharinfo(0) + " has made an Double Kill!!!!",0;
971 soundeffectall "doublekill.wav",0,strcharinfo(3);
972} else if(@mkillct == 3) {
973 mapannounce strcharinfo(3),strcharinfo(0) + " has made an Triple Kill!!!!",0;
974 soundeffectall "triplekill.wav",0,strcharinfo(3);
975} else if(@mkillct >= 4) {
976 mapannounce strcharinfo(3),strcharinfo(0) + " has made an Ultra Kill!!!!",0;
977 soundeffectall "ultrakill.wav",0,strcharinfo(3);
978}
979if($@bty_type && $@pvptable) {
980 if(@sphr >= $@bty_bon_start) {
981 mapannounce strcharinfo(3),"Bounty Hunter: Oh My God!!! Someone stop "+strcharinfo(0)+" please!!! I'll give you a bonus of "+$@bty_bonus+" on "+ ( (Sex)?"his":"her") +" head!!",0;
982 set @sphr,@sphr + $@bty_bonus;
983 }
984 query_sql("SELECT `bounty` FROM `arena_master` WHERE `char_id` = '"+getcharid(0,rid2name(.@v))+"'",@bty);
985 getBounty(@bty,.@v);
986 writeBounty(@sphr);
987}
988if(@killct%5==0) message strcharinfo(0),"Defeated Players: "+@killct;
989end;
990
991OnPCDieEvent:
992// ===== Should affects you only, if you warped to an player via @warpto/@goto or were @recall-ed
993// ==== so you won't recieve a value for @map, which is required for the respawn in DM Maps
994if(!@map) {
995 for( set @m,1; @m < getarraysize($@dmpvp$); set @m,@m + 1)
996 if(strcharinfo(3) == $@dmpvp$[@m]) {
997 set @map,@m;
998 break;
999 }
1000}
1001if($@pvptable) {
1002 writeStats(getcharid(0),@killct,1);
1003 if($@bty_type) writeBounty(@sphr);
1004
1005}
1006set @sphr,0;
1007set @killct,0;
1008
1009if($@same_gld && @gvgc > 0) {
1010 if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
1011 setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
1012 if(getd("$@gvg_"+@gvgc+"_1_ppl") < 1) setd("$@gvg_"+@gvgc+"_gld_1"),0;
1013 } else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
1014 setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
1015 if(getd("$@gvg_"+@gvgc+"_2_ppl") < 1) setd("$@gvg_"+@gvgc+"_gld_2"),0;
1016 }
1017 set @gvg_c,0;
1018}
1019if(strcharinfo(3) == $@dmpvp$[@map]) {
1020 sleep2 1500;
1021 if(killerrid != getcharid(3)) {
1022 warp strcharinfo(3),0,0;
1023 if(HP == 0) atcommand "@alive";
1024 percentheal 100,100;
1025 } else warp "SavePoint",0,0;
1026}
1027end;
1028
1029OnMultiSpan:
1030set @mkillct,0;
1031end;
1032
1033OnPCLogOutEvent:
1034if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end;
1035if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end;
1036if($@pvptable) {
1037 writeStats(getcharid(0),@killct,0);
1038 if(@prodo)
1039 if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@charid) != 0) // Should never happen, but to prevent bugs :I
1040 query_sql "UPDATE `arena_master` SET `killer` = `killer` + "+@killer+" , `domi` = `domi` + "+@domi+" , `mega` = `mega` + "+@mega+" , `unstopp` = `unstopp` + "+@unstopp+" , `wicked` = `wicked` + "+@wicked+" , `monster` = `monster` + "+@monster+" , `godlike` = `godlike` + "+@godlike+" , `holys` = `holys` + "+@holys+" WHERE `char_id` = '"+getcharid(0)+"'";
1041}
1042if($@same_gld && @gvgc > 0) {
1043 if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
1044 else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
1045}
1046end;
1047
1048OnNPCKillEvent:
1049if(!$@pvptable) end;
1050if(compare(strcharinfo(3),"pvp_n_") == 0) end; // Only working in the MvP Arena
1051if(getmonsterinfo(killedrid,MOB_MODE) & 32) { // 32 = Mini-Boss & MvP Flag (There is no solo-flag for MvP q.q)
1052 if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@charid) != 0)
1053 query_sql "UPDATE `arena_master` SET `mvp` = `mvp` + 1 WHERE `char_id` = '"+getcharid(0)+"'";
1054 else query_sql "INSERT INTO `arena_master` ( `char_id` , `mvp`) VALUES ( '"+getcharid(0)+"' , '1' )";
1055}
1056end;
1057
1058 function writeStats {
1059 if(!$@pvptable) return; // To be save :O
1060 set @c,getarg(0); // Char ID
1061 set @k,getarg(1); // Kills
1062 set @d,getarg(2); // Deaths
1063 if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@charid) != 0) {
1064 if(@k > query_sql("SELECT `hscore` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@hscore)) set @hscore,@k;
1065 query_sql "UPDATE `arena_master` SET `kills` = `kills` + "+@k+", `death` = `death` + "+@d+" , `hscore` = '"+@hscore+"' WHERE `char_id` = '"+@c+"'";
1066 } else query_sql "INSERT INTO `arena_master` ( `char_id` , `kills` , `death` , `hscore` ) VALUES ( '"+@c+"' , '"+@k+"' , '"+@d+"' , '"+@hscore+"' )";
1067 return;
1068 }
1069
1070 function doPromote {
1071 set @prodo,1; // Check for OnPCLogOutEvent
1072 switch(@sphr) { // Sphree Index
1073 case 1:
1074 if(@prokill/$@promo == 1) set @killer,@killer + 1;
1075 break;
1076
1077 case 2:
1078 if(@prokill/$@promo == 1) set @domi,@domi + 1;
1079 break;
1080
1081 case 3:
1082 if(@prokill/$@promo == 1) set @mega,@mega + 1;
1083 break;
1084
1085 case 4:
1086 if(@prokill/$@promo == 1) set @unstopp,@unstopp + 1;
1087 break;
1088
1089 case 5:
1090 if(@prokill/$@promo == 1) set @wicked,@wicked + 1;
1091 break;
1092
1093 case 6:
1094 if(@prokill/$@promo == 1) set @monster,@monster + 1;
1095 break;
1096
1097 case 7:
1098 if(@prokill/$@promo == 1) set @godlike,@godlike + 1;
1099 break;
1100
1101 case 8:
1102 if(@prokill/$@promo == 1) set @holys,@holys+ 1;
1103 break;
1104 }
1105 set @prokill,0;
1106 return;
1107 }
1108
1109 function getBounty {
1110 // getarg(0) == Last Sphree of Victim
1111 // getarg(1) == RID of Victim
1112 if(!getarg(0)) return; // No Sphree = No Bounty ;I
1113 // Calculation:
1114 // Exchange the */+ with the symbol you want,
1115 // but note that it can be exploited if you change it too much,
1116 // like 8 (Sphree Index)*$@bty_price (Cash Points,5) = 40 CASHPOINTS
1117 switch($@bty_type) { // Bounty Reward Type
1118 case 1: // Zeny
1119 set Zeny,Zeny + ($@bty_price*getarg(0));
1120 dispbottom "Bounty Hunter: You have recieved "+($@bty_price*getarg(0))+" Zeny for killing "+rid2name(getarg(1))+".";
1121 break;
1122
1123 case 2: // Cash Points
1124 set #CASHPOINTS,#CASHPOINTS + ($@bty_price+getarg(0));
1125 dispbottom "Bounty Hunter: You have recieved "+($@bty_price+getarg(0))+" Cash Points for killing "+rid2name(getarg(1))+".";
1126 dispbottom "You have now "+#CASHPOINTS+" Cash Points.";
1127 break;
1128
1129 case 3: // Bounty Points
1130 query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` + "+($@bty_price+getarg(0))+" WHERE `char_id` = '"+getcharid(0)+"'";
1131 dispbottom "Bounty Hunter: You have recieved "+($@bty_price+getarg(0))+" Bounty Points for killing "+rid2name(getarg(1))+".";
1132 break;
1133 }
1134 if(getarg(0) >= $@bty_bon_start)
1135 mapannounce strcharinfo(3),"Bounty Hunter: "+strcharinfo(0)+" has ended "+rid2name(getarg(1))+"'s Spree and was rewarded with "+($@bty_price*getarg(0))+" " + ( ($@bty_type == 1)?"Zeny": ( ($@bty_type == 2)?"Cash Points":"Bounty Points") ),0;
1136 return;
1137 }
1138
1139 function writeBounty {
1140 query_sql "UPDATE `arena_master` SET `bounty` = '"+getarg(0)+"' WHERE `char_id` = '"+getcharid(0)+"'";
1141 return;
1142 }
1143
1144OnWhisperGlobal:
1145if(!getgmlevel()) end;
1146set .@re_in,0;
1147set $@debug,0;
1148if(select("- ReLoad:- Nevermind") == 2) close;
1149if(select("- Debug:- Without Debug") == 1) set $@debug,1;
1150set .@re_in,1;
1151goto OnInit;
1152end;
1153}
1154
1155prontlegend,218,223,4 duplicate(PVP Arena) PVP Arena#01 415
1156prontlegend,243,223,4 duplicate(GVG Arena) GVG Arena#01 416
1157prontlegend,229,227,4 duplicate(Arena Information) Arena Information#01 974
1158
1159pvp_y_1-1 mapflag pvp_noguild
1160pvp_y_1-1 mapflag pvp_noparty
1161pvp_y_1-4 mapflag pvp_noparty
1162pvp_y_1-2 mapflag pvp_noparty
1163pvp_y_1-3 mapflag pvp_noparty
1164pvp_y_1-5 mapflag pvp_noparty
1165pvp_y_2-1 mapflag pvp_noparty
1166pvp_y_2-4 mapflag pvp_noparty
1167pvp_y_2-2 mapflag pvp_noparty
1168pvp_y_2-3 mapflag pvp_noparty
1169pvp_y_2-5 mapflag pvp_noparty
1170pvp_y_3-1 mapflag pvp_noparty
1171pvp_y_3-4 mapflag pvp_noparty
1172pvp_y_3-2 mapflag pvp_noparty
1173pvp_y_3-3 mapflag pvp_noparty
1174pvp_y_3-5 mapflag pvp_noparty
1175pvp_y_1-1 mapflag pvp_noguild
1176pvp_y_1-1 mapflag pvp_noguild
1177pvp_y_1-4 mapflag pvp_noguild
1178pvp_y_1-2 mapflag pvp_noguild
1179pvp_y_1-3 mapflag pvp_noguild
1180pvp_y_1-5 mapflag pvp_noguild
1181pvp_y_2-1 mapflag pvp_noguild
1182pvp_y_2-4 mapflag pvp_noguild
1183pvp_y_2-2 mapflag pvp_noguild
1184pvp_y_2-3 mapflag pvp_noguild
1185pvp_y_2-5 mapflag pvp_noguild
1186pvp_y_3-1 mapflag pvp_noguild
1187pvp_y_3-4 mapflag pvp_noguild
1188pvp_y_3-2 mapflag pvp_noguild
1189pvp_y_3-3 mapflag pvp_noguild
1190pvp_y_3-5 mapflag pvp_noguild