· 7 years ago · Oct 09, 2018, 02:30 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]
48607,3 // Yggdrasil Berry
49608,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 ================== //
78prontera,142,168,5 script Arena Master 808,{
79set .@n$,"["+strnpcinfo(1)+"]";
80function getPartyMapUsers;
81
82mes .@n$;
83mes "How can I help you?";
84mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
85if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
86next;
87switch(select("- Go to Arenas:- See Rankings:- Need Information:- Nevermind")) {
88
89// Arenas
90 case 1:
91 set @sphr,0;
92 set @bty,0;
93 set @killct,0;
94 set @first,1; // First Blood
95 mes .@n$;
96 mes "In which arena do you want to fight?";
97 next;
98 switch(select("- PvP:- GvG:- MvP:- Nevermind")) {
99// PvP
100 case 1:
101 mes .@n$;
102 mes "Now select the room you want to fight in.";
103 mes "This arena can hold up to "+$@muser[@map]+" player(s).";
104 next;
105 switch(select("- Normal Pvp 1 [" +getmapusers("guild_vs5")+"]:- Normal PvP 2 [" +getmapusers("guild_vs3")+"]:- No Party PVP [" +getmapusers("pvp_y_4-1")+"]:- No MVP [" +getmapusers("guild_vs4")+"]:- Baby PVP [" +getmapusers("pvp_y_5-1") + "]")){
106 // PvP Normal 1
107 case 1:
108 mes .@n$;
109 if(getmapusers("guild_vs5") >= 70) {
110 mes "I'm sorry, but this room is already full.";
111 close;
112 }
113 mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room.";
114 close2;
115 warp "guild_vs5",0,0;
116 end;
117
118 //PvP Normal 2
119 case 2:
120 mes .@n$;
121 if(getmapusers("guild_vs3") >= 70) {
122 mes "I'm sorry, but this room is already full.";
123 close;
124 }
125 mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room.";
126 close2;
127 warp "guild_vs3",0,0;
128 end;
129
130 // PvP NoParty
131 case 3:
132 mes .@n$;
133 if(getcharid(1)) {
134 mes "This is a noparty PVP";
135 close;
136 }
137 if(getmapusers("pvp_y_4-1") >= 70) {
138 mes "I'm sorry, but this room is already full.";
139 close;
140 }
141 mes "I'll warp you now to the "+ $@room$[@map]+" PvP Deathmatch Room.";
142 close2;
143 warp "pvp_y_4-1",0,0;
144 end;
145
146 //No MVP
147 case 4:
148 if(getmapusers("guild_vs4") >= 70) {
149 mes "I'm sorry, but this room is already full.";
150 close;
151 }
152 ///////////==================================Put here the restriction of the NO MVP
153 mes "I'll warp you now.";
154 mes "Good luck.";
155 close2;
156 warp "guild_vs4",0,0;
157 end;
158 //Baby PVP
159 case 5:
160 if(getmapusers("pvp_y_5-1") >= $@muser[@map]) {
161 mes "I'm sorry, but this room is already full.";
162 close;
163 }
164 ///////////==================================Put here the restriction of the Baby
165 mes "I'll warp you now.";
166 mes "Good luck.";
167 close2;
168 warp "pvp_y_5-1",0,0;
169 end;
170 }
171 break;
172
173function getPartyMapUsers {
174 // getarg(0) == Party PvP Type (2vs2,3vs3, etc...) > 2,3, etc...
175 // if it's a 6 = Total Map Users of the Party PvP Maps
176 // getarg(1) == Room
177 if(getarg(0) == 6) {
178 set @pt2play,getmapusers($@pt2pvp$[1]) + getmapusers($@pt2pvp$[2]) + getmapusers($@pt2pvp$[3]) + getmapusers($@pt2pvp$[4]) + getmapusers($@pt2pvp$[5]);
179 set @pt3play,getmapusers($@pt3pvp$[1]) + getmapusers($@pt3pvp$[2]) + getmapusers($@pt3pvp$[3]) + getmapusers($@pt3pvp$[4]) + getmapusers($@pt3pvp$[5]);
180 set @pt4play,getmapusers($@pt4pvp$[1]) + getmapusers($@pt4pvp$[2]) + getmapusers($@pt4pvp$[3]) + getmapusers($@pt4pvp$[4]) + getmapusers($@pt4pvp$[5]);
181 set @pt5play,getmapusers($@pt5pvp$[1]) + getmapusers($@pt5pvp$[2]) + getmapusers($@pt5pvp$[3]) + getmapusers($@pt5pvp$[4]) + getmapusers($@pt5pvp$[5]);
182 return @pt2play + @pt3play + @pt4play + @pt5play;
183
184 } else return getmapusers(getd("$@pt"+getarg(0)+"pvp$["+getarg(1)+"]"));
185}
186
187 // GvG
188 case 2:
189 mes .@n$;
190 if(!getcharid(2)) {
191 mes "I'm sorry, but you are not in a guild.";
192 close;
193 }
194 mes "Please choose the room you want to join:";
195 mes "Each arena can hold up to "+$@mgvg+" player(s).";
196 if($@same_gld) mes "If guilds already are in this room, you have to be a member of it so that you can join.";
197 next;
198 set .@rchoi,select("- GvG 1 [" + getmapusers("guild_vs1")+"]:- GvG 2 [" + getmapusers("guild_vs2")+"]") - 1;
199 mes .@n$;
200 if($@same_gld) {
201 set @gvgc,@menu;
202 if(getd("$@gvg_"+@gvgc+"_gld_1") == 0) {
203 mes "I will warp you now.";
204 close2;
205 warp $@gvgr$[.@rchoi],$@gvg_gld1_x[.@rchoi],$@gvg_gld1_y[.@rchoi];
206 setd("$@gvg_"+@gvgc+"_gld_1"),getcharid(2);
207 setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
208 end;
209 } else if(getd("$@gvg_"+@gvgc+"_gld_2") == 0) {
210 mes "I will warp you now.";
211 close2;
212 warp $@gvgr$[.@rchoi],$@gvg_gld2_x[.@rchoi],$@gvg_gld2_x[.@rchoi];
213 setd("$@gvg_"+@gvgc+"_gld_2"),getcharid(2);
214 setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
215 end;
216 }
217 if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
218 if(getd("$@gvg_"+@gvgc+"_1_ppl") >= $@mpgld) {
219 mes "I'm sorry, but your guild's side is already full.";
220 close;
221 }
222 mes "I will warp you now.";
223 close2;
224 set @rand,rand(1,2);
225 warp $@gvgr$[.@rchoi],getd("$@gvg_gld1_x"+@rand+"["+.@rchoi+"]"),getd("$@gvg_gld1_y"+@rand+"["+.@rchoi+"]");
226 setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
227 end;
228 } else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
229 if(getd("$@gvg_"+@gvgc+"_2_ppl") >= $@mpgld) {
230 mes "I'm sorry, but your guild's side is already full.";
231 close;
232 }
233 mes "I will warp you now.";
234 close2;
235 set @rand,rand(1,2);
236 warp $@gvgr$[.@rchoi],getd("$@gvg_gld2_x"+@rand+"["+.@rchoi+"]"),getd("$@gvg_gld2_y"+@rand+"["+.@rchoi+"]");
237 setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
238 end;
239 }
240 } else {
241 if(getmapusers($@gvgr$[.@rchoi]) >= $@mgvg) {
242 mes "I'm sorry, but this Arena is already full.";
243 close;
244 }
245 mes "I will warp you now.";
246 close2;
247 warp $@gvgr$[.@rchoi],0,0;
248 end;
249 }
250 break;
251
252 // MvP
253 case 3:
254 mes .@n$;
255 mes "I will now warp you to the MvP Master.";
256 mes "There you can choose 4 Arena Types with each 8 seperate rooms.";
257 close2;
258 warp "quiz_00",50,24;
259 end;
260
261 // Nevermind
262 case 4:
263 goto R_Bye;
264 break;
265 }
266
267// Ranking
268 case 2:
269 mes .@n$;
270 if(!$@pvptable) {
271 mes "I'm sorry, the ranking system is offline and thus I can't show you any ranking.";
272 close;
273 }
274 mes "Which ranking do you wanna see?";
275 next;
276 switch(select("- Kills:- Deaths:- High Scores:- Killing Sphree:- Dominating:- Mega Kill:- Unstoppable:- Wicked Sick:- Monster Kill:- GodLike:- Holy Sh1t:- MvP")) {
277 case 1: set .@listr$,"kills"; break;
278 case 2: set .@listr$,"death"; break;
279 case 3: set .@listr$,"hscore"; break;
280 case 4: set .@listr$,"killer"; break;
281 case 5: set .@listr$,"domi"; break;
282 case 6: set .@listr$,"mega"; break;
283 case 7: set .@listr$,"unstopp"; break;
284 case 8: set .@listr$,"wicked"; break;
285 case 9: set .@listr$,"monster"; break;
286 case 10: set .@listr$,"godlike"; break;
287 case 11: set .@listr$,"holys"; break;
288 case 12: set .@listr$,"mvp"; break;
289 }
290 set @rank,@menu;
291 mes .@n$;
292 mes "Which list do you want to see?";
293 next;
294 switch(select("- Top 5:- Top 10:- Top 15:- Top 20:- Top 25:- Top 30:- Nevermind")) {
295
296 default:
297 set .@limit,5*@menu;
298 break;
299
300 case 7:
301 goto R_Bye;
302 break;
303 }
304 mes .@n$;
305 mes "Ranking:";
306 switch(@rank) {
307
308 case 1: mes set(.@rankn$,"Top "+.@limit+" Killers"); set .@rankt$,"Kills"; break;
309 case 2: mes set(.@rankn$,"Top "+.@limit+" Victims"); set .@rankt$,"Deaths"; break;
310 case 3: mes set(.@rankn$,"Top "+.@limit+" High Scores"); set .@rankt$,"High Score"; break;
311 case 12: mes set(.@rank$,"Top "+.@limit+" MvP Hunters"); set .@rankt$,"MvP Kills"; break;
312 default: mes set(.@rankn$,"Top "+.@limit+" \""+$@sphreen$[@rank-3]+"\" Rankers"); set .@rankt$,$@sphreen$[@rank-3]+"s"; break;
313 }
314 mes "Correct?";
315 next;
316 if(select("- Yes:- No") == 2) goto R_Bye;
317 mes .@n$;
318 mes "I will now list the ranking in your Chat Box.";
319 close2;
320 dispbottom "======= "+.@rankn$+" ===========";
321 dispbottom "Player Name: "+.@rankt$;
322 query_sql "SELECT `char_id` , `"+.@listr$+"` FROM `arena_master` WHERE `"+.@listr$+"` > 0 ORDER BY `"+.@listr$+"` DESC LIMIT "+.@limit,.@ch_id,.@sh_r;
323 if(!.@sh_r[0]) {
324 dispbottom "No Player found.";
325 end;
326 }
327 for( set .@r,0; .@r < getarraysize(.@sh_r); set .@r,.@r + 1) {
328 query_sql "SELECT `name` FROM `char` WHERE `char_id` = '"+.@ch_id[.@r]+"'",.@ch_na$;
329 dispbottom .@ch_na$+": "+.@sh_r[.@r];
330 }
331 deletearray .@ch_id[0],128;
332 deletearray .@sh_r[0],128;
333 end;
334
335
336// Information
337 case 3:
338 mes .@n$;
339 mes "What do you want to know about?";
340 next;
341 switch(select("- PvP:- GvG:- Sphree:- Ranking:- Bounty Feature:- Nevermind")) {
342
343 case 1:
344 mes "[=== PvP ===]";
345 mes "Each PvP Type has five rooms, displayed as";
346 mes "2 Normal PVPs, 1 No Party PVP, 1 Baby PVP, and 1 NO MVP pvp";
347 next;
348 mes "[=== PvP ===]";
349 mes "Basically Normal PVP is just the typical pvp";
350 mes "No Party PVP is where party is not allowed";
351 mes "Baby PVP is for babies";
352 mes "And No MVP PVP is where MVP Cards are not allowed";
353 close;
354
355 case 2:
356 mes "[=== GvG ===]";
357 if($@same_gld) {
358 mes "There can be two guilds in one room at the same time with maximum "+$@mpgld+" members per guild.";
359 mes "Each guild has two spawn postions, Guild 1 has North and West and Guild 2 has East and South,";
360 mes "which will be chosen randomly on room entry, also only members";
361 mes "of 'em can enter the same room until no one is left of the respective guild.";
362 } else mes "Only members of a guild can enter a room and the maximum players, which can enter are "+$@mgvg+".";
363 close;
364
365 case 3:
366 mes "[=== Sphree ===]";
367 mes "Sphree - Required Kills.";
368 mes "First Blood - 1";
369 for ( set .@s,1; .@s < getarraysize($@sphreen$); set .@s,.@s + 1)
370 mes $@sphreen$[.@s] +" - "+$@sphr_kills[.@s];
371
372 next;
373 mes "[=== Sphree ===]";
374 mes "For each sphree you accomplish, except First Blood, you gain an point for the bounty feature, if it has been activated.";
375 mes "For more ask me about the Bounty Feature.";
376 next;
377 mes "[=== Sphree ===]";
378 mes "Also there is the Multi Kill Sphrees, but you won't recieve points for them.";
379 mes "The time span you can achieve them is "+ $@multi+" seconds.";
380 next;
381 mes "[=== Sphree ===]";
382 mes "In this time you, if you kill";
383 mes " - one more player = Double Kill";
384 mes " - two more players = Triple Kill";
385 mes " - three or more players = Ultra Kill";
386 close;
387
388 case 4:
389 mes "[=== Ranking ===]";
390 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.";
391 next;
392 mes "[=== Ranking ===]";
393 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.";
394 mes "But the save of them will only apply when you logout.";
395 close;
396
397 case 5:
398 mes .@n$;
399 if(!$@bty_type) {
400 mes "This feature isn't activate.";
401 close;
402 }
403 mes "The reward is counted as an eventpoint reward";
404 next;
405 mes .@n$;
406 mes "The Event Point depends on your victims sphree.";
407 mes "Here is a list of them:";
408 mes "And while I'm on it I will list the required kills for them too.";
409 mes " ";
410 mes "Sphree - Requ. Kills - Points";
411 for ( set .@s,1; .@s < getarraysize($@sphreen$); set .@s,.@s + 1)
412 mes $@sphreen$[.@s] +" - "+$@sphr_kills[.@s] + " - "+.@s;
413
414 next;
415
416 case 6:
417 goto R_Bye;
418 close;
419 }
420
421// Nevermind
422 case 4:
423 goto R_Bye;
424 break;
425}
426
427R_Bye:
428mes .@n$;
429mes "Okay, see ya.";
430close;
431}
432
433// =============== Main Settings ===============//
434- script PvPGvGMain -1,{
435end;
436
437OnInit:
438pvpon "guild_vs5";
439pvpon "guild_vs3";
440pvpon "pvp_y_4-1";
441pvpon "guild_vs4";
442pvpon "pvp_y_5-1";
443// =============== Ranking Check & Debug Messages ================//
444if($@debug) announce "====== Arena Master - Debug initiate... ========",bc_self;
445if(query_sql("SHOW TABLES LIKE 'arena_master'",.@pvptab[0]) == 0) set $@pvptable,0; else set $@pvptable,1;
446announce "Arena Master Ranking System - Status: "+ ( ($@pvptable)?"Online":"Offline"),bc_all;
447// ============== Sphree Settings ============//
448setarray $@sphreen$[1],"Killing Sphree","Dominating","Mega Kill","Unstoppable","Wicked Sick","Monster Kill","GodLike","Holy Sh1t";
449setarray $@msphree$[1],"Double Kill","Triple Kill","Ultra Kill";
450setarray $@sphr_kills[1],3,5,7,9,11,13,15,17; // Kills required for each sphree.
451set $@multi,15000; // Time Span for chance to gain Multi-Kill in milliseconds.
452set $@promo,5; // Kills required till points will be promoted to the current sphree.
453if($@debug) announce "PvP Sphree Settings loaded: "+$@sphreen$[0],bc_self;
454// ============== Bounty Settings =========//
455// Bounty Type: 0 = Off, 1 = Zeny, 2 = Cash Points, 3 = Bounty Points
456set $@bty_type,1;
457if($@bty_type) {
458 set $@bty_bonus,5; // Bonus, if you kill an player
459 set $@bty_bon_start,4; //which has achieved an spree of "$@bty_bon_start"
460// Clearing Array on Whisper to prevent double entries
461 if(.@re_in) {
462 // Items
463 for (set .@s,0; .@s < getarraysize($@arena_sh); set .@s,.@s + 1)
464 npcshopdelitem "Arena_Shop",$@arena_sh[.@s];
465 // Prices
466 deletearray $@arena_ar[0],128;
467 }
468
469 // Shop Items: PvP useful stuff D:, like Elements, Boxes and Food
470 // These will be used for all shops, but the prices depends on the Bounty Type you have set.
471 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;
472 npcshopdelitem "Arena_Shop",512;
473 // Prices:
474 // Two ways of doing so:
475 // - By formula
476 // - Array
477 // You can determine for each currency the way of calculation and prices.
478 if($@bty_type == 1) {
479// =============== Zeny ========== //
480 set $@bty_price,5000; // Zeny per Sphree
481
482 // If you want to use the formula, set ".arena_pay" to 1.
483 // If you wanna use the array, set ".arena_pay" to 2.
484 set $@arena_pay,1; // 1 = Formula, 2 = Per Array
485
486 // But remember to put the prices for all items.
487 setarray $@arena_ar[0],100; // Etc
488
489 } else if($@bty_type == 2) {
490// =============== Cash Points ========== //
491 set $@bty_price,2; // Cash Points per Sphree
492
493 // If you want to use the formula, set ".arena_pay" to 1.
494 // If you wanna use the array, set ".arena_pay" to 2.
495 set $@arena_pay,1; // 1 = Formula, 2 = Per Array
496
497 // But remember to put the prices for all items.
498 setarray $@arena_ar[0],100; // Etc
499
500 } else if($@bty_type == 3) {
501// =============== Bounty Points ========== //
502 set $@bty_price,5; // Bounty Points per Sphree
503
504 // If you want to use the formula, set ".arena_pay" to 1.
505 // If you wanna use the array, set ".arena_pay" to 2.
506 set $@arena_pay,1; // 1 = Formula, 2 = Per Array
507
508 // But remember to put the prices for all items.
509 setarray $@arena_ar[0],100; // Etc
510 }
511 for ( set .@s,0; .@s < getarraysize($@arena_sh); set .@s,.@s + 1) {
512 if($@arena_pay == 1) { // By Formula
513
514 // =============== Zeny Formula ========== //
515 // Default: ($@bty_price+(.@s*($@bty_price/10)))/2
516 // Base Price = $@bty_price, "Multiplier" = + (Index ID* ($@bty_price/10))/2
517 // Example: 5000 + (4(=Index of 12031)*(5000/10=500) > 7000/2 = 3500 Zeny for 12031
518 // Note: If the formula results in a decimal number it will be degraded.
519 if($@bty_type == 1) set .@arena_fo,($@bty_price+(.@s*($@bty_price/10)))/2;
520
521 // =============== Cash Points Formula ========== //
522 // Default: ($@bty_price+.@s)/2
523 // Base Price = $@bty_price, "Multiplier" = + Index ID/2
524 // Example: 2 + 4(=Index of 12031) > 6/2 = 3 Cash Points for 12031
525 // Note: If the formula results in a decimal number it will be degraded.
526 else if($@bty_type == 2) set .@arena_fo,($@bty_price+.@s)/2;
527
528 // =============== Bounty Points Formula ========== //
529 // Default: ($@bty_price+(.@s*10))/2
530 // Base Price = $@bty_price, "Multiplier" = + (Index ID* 10)/2
531 // Example: 5 + (4(=Index of 12031)*10) > 45/2 = 22 Bounty Points for 12031
532 // Note: If the formula results in a decimal number it will be degraded.
533 else if($@bty_type == 3) set .@arena_fo,($@bty_price+(.@s*10))/2;
534
535 // =============== Adding the price (calculated by the formula) to the array ========== //
536 setarray $@arena_ar[.@s],.@arena_fo;
537
538 }
539 npcshopadditem "Arena_Shop",$@arena_sh[.@s],$@arena_ar[.@s];
540 }
541}
542if($@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;
543// Bounty Calculation:
544// Scroll down till the line with "function getBounty {", should be near Line 813
545if($@debug) announce "Bounty Settings loaded: "+$@bty_type,bc_self;
546// ============ GvG Settings ============//
547set $@mpgld,20; //Max Guild Members per Guild
548if($@debug) announce "Max Members per Guild loaded: "+$@mpgld,bc_self;
549set $@mgvg,$@mpgld*2; // Total Members per Arena.
550if($@debug) announce "Max Members per Arena loaded: "+$@mgvg,bc_self;
551set $@same_gld,1; // Same Guild requirement: 1 = On / 0 = Off
552if($@debug) announce "Same Guild Requirement loaded: "+$@same_gld,bc_self;
553setarray $@gvgr$[0],"guild_vs1","guild_vs2","guild_vs3","guild_vs4","guild_vs5";
554if($@debug) announce "Guild Maps loaded: "+$@gvgr$[0],bc_self;
555// If you want to add more mapflags, add them before the "10" > mf_gvg_noparty
556setarray $@gvg_mf[0],0,1,2,3,4,5,9,11,13,15,22,33,34,35,38,41,44,10;
557if($@debug) announce "Guild Mapflags loaded: "+getarraysize($@gvg_mf),bc_self;
558if($@same_gld) {
559// Guild Map Coordinates - used if $@same_gld is enabled
560// Every Guild has two coordinates to spawn from:
561// Guild 1: gld1_ > x1+y1 = North, x2+y2 = East
562 setarray $@gvg_gld1_x1[0],9,9,12,8,18;
563 setarray $@gvg_gld1_y1[0],50,50,51,49,50;
564 setarray $@gvg_gld1_x2[0],50,50,50,50,49;
565 setarray $@gvg_gld1_y2[0],7,7,13,8,23;
566// Guild 2: gld2_ > x1+y1 = West, x2+y2 = South
567 setarray $@gvg_gld2_x1[0],50,50,49,50,49;
568 setarray $@gvg_gld2_y1[0],91,91,86,91,76;
569 setarray $@gvg_gld2_x2[0],92,92,86,91,79;
570 setarray $@gvg_gld2_y2[0],50,50,51,49,49;
571 if($@debug) announce "Guild 1 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld1_x1) +" & Y - "+getarraysize($@gvg_gld1_y1),bc_self;
572 if($@debug) announce "Guild 1 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld1_x2) +" & Y - "+getarraysize($@gvg_gld1_y2),bc_self;
573 if($@debug) announce "Guild 2 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld2_x1) +" & Y - "+getarraysize($@gvg_gld2_y1),bc_self;
574 if($@debug) announce "Guild 2 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld2_x2) +" & Y - "+getarraysize($@gvg_gld2_y2),bc_self;
575}
576// ======= Auto Mapflag Adding ===============//
577for ( set .@m,0; .@m < getarraysize($@gvgr$); set .@m,.@m + 1 ) {
578if($@debug) announce "Array Reading of GvG Maps complete",bc_self;
579if($@debug) announce "Mapflag set at "+$@gvgr$[.@m] + " initiate...",bc_self;
580
581// Use this if you disallows parties
582// for ( set .@mf,0; .@mf < getarraysize($@gvg_mf); set .@mf,.@mf + 1 ) {
583
584// Use this if you allow parties
585 for ( set .@mf,0; .@mf < (getarraysize($@gvg_mf) - 1); set .@mf,.@mf + 1 ) {
586 setmapflag $@gvgr$[.@m],$@gvg_mf[.@mf];
587 if($@debug) announce "Mapflag "+ $@gvg_mf[.@mf] +" set at "+$@gvgr$[.@m] + " complete",bc_self;
588 }
589}
590if($@debug) announce "Guild Mapflag loading completed",bc_self;
591// ============ PvP Settings ============//
592// If you want to add more mapflags, add them before the "7" > mf_pvp_noparty
593setarray $@pvp_mf[0],0,1,2,3,4,5,7,11,13,22,33,34,35,38,41,44,7;
594if($@debug) announce "PvP Mapflags loaded: "+getarraysize($@pvp_mf),bc_self;
595// ============= PvP Room Settings =======//
596setarray $@room$[1],"Prontera","Alberta","Izlude","Payon","Morroc";
597setarray $@muser[1],70,45,30,55,60;
598if($@debug) announce "PvP Town Maps loaded: "+$@room$[1],bc_self;
599// Dispell PvP
600setarray $@disppvp$[1],"guild_vs5","guild_vs3","pvp_y_4-1","guild_vs4","pvp_y_5-1";
601if($@debug) announce "PvP Dispell Maps loaded: "+$@disppvp$[1],bc_self;
602// ======= Auto Mapflag Adding - Dispell PvP ===============//
603for ( set .@m,1; .@m < getarraysize($@disppvp$); set .@m,.@m + 1 ) {
604if($@debug) announce "Array Reading of Dispell PvP Maps complete",bc_self;
605if($@debug) announce "Mapflag set at "+$@disppvp$[.@m] + " initiate...",bc_self;
606// Use this if you disallows parties
607// for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
608
609// Use this if you allow parties
610 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
611 setmapflag $@disppvp$[.@m],$@pvp_mf[.@mf];
612 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@disppvp$[.@m] + " complete",bc_self;
613 }
614}
615if($@debug) announce "PvP Dispell Mapflags loaded.",bc_self;
616// Normal PvP
617setarray $@npvp$[1],"pvp_y_2-1","pvp_y_2-4","pvp_y_2-2","pvp_y_2-3","pvp_y_2-5";
618if($@debug) announce "PvP Normal Maps loaded: "+$@npvp$[0],bc_self;
619// ======= Auto Mapflag Adding - Normal PvP ===============//
620for ( set .@m,1; .@m < getarraysize($@npvp$); set .@m,.@m + 1 ) {
621if($@debug) announce "Array Reading of Normal PvP Maps complete",bc_self;
622if($@debug) announce "Mapflag set at "+$@npvp$[.@m] + " initiate...",bc_self;
623// Use this if you disallows parties
624// for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
625
626// Use this if you allow parties
627 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
628 setmapflag $@npvp$[.@m],$@pvp_mf[.@mf];
629 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@npvp$[.@m] + " complete",bc_self;
630 }
631}
632if($@debug) announce "PvP Normal Mapflags loaded.",bc_self;
633// ================== Deathmatch Settings + Maps ================
634setarray $@dmpvp$[1],"pvp_y_3-1","pvp_y_3-4","pvp_y_3-2","pvp_y_3-3","pvp_y_3-5";
635if($@debug) announce "PvP DM Maps loaded: "+$@dmpvp$[0],bc_self;
636// ======= Auto Mapflag Adding - DM PvP ===============//
637for ( set .@m,1; .@m < getarraysize($@dmpvp$); set .@m,.@m + 1 ) {
638if($@debug) announce "Array Reading of DM PvP Maps complete",bc_self;
639if($@debug) announce "Mapflag set at "+$@dmpvp$[.@m] + " initiate...",bc_self;
640// Use this if you disallows parties
641// for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
642
643// Use this if you allow parties
644 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
645 setmapflag $@dmpvp$[.@m],$@pvp_mf[.@mf];
646 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@dmpvp$[.@m] + " complete",bc_self;
647 }
648}
649if($@debug) announce "PvP DM Mapflags loaded.",bc_self;
650// ================= Party PvP Settings =================
651// ========= 2vs2 Party PvP ==========//
652setarray $@pt2pvp$[1],"pvp_y_4-1","pvp_y_4-4","pvp_y_4-2","pvp_y_4-3","pvp_y_4-5";
653if($@debug) announce "Party PvP 2vs2 Maps loaded: "+$@pt2pvp$[0],bc_self;
654// 3vs3 Party PvP
655setarray $@pt3pvp$[1],"pvp_y_5-1","pvp_y_5-4","pvp_y_5-2","pvp_y_5-3","pvp_y_5-5";
656if($@debug) announce "Party PvP 3vs3 Maps loaded: "+$@pt3pvp$[0],bc_self;
657// 4vs4 Party PvP
658setarray $@pt4pvp$[1],"pvp_y_6-1","pvp_y_6-4","pvp_y_6-2","pvp_y_6-3","pvp_y_6-5";
659if($@debug) announce "Party PvP 4vs4 Maps loaded: "+$@pt4pvp$[0],bc_self;
660// 5vs5 Party PvP
661setarray $@pt5pvp$[1],"pvp_y_7-1","pvp_y_7-4","pvp_y_7-2","pvp_y_7-3","pvp_y_7-5";
662if($@debug) announce "Party PvP 5vs5 Maps loaded: "+$@pt5pvp$[0],bc_self;
663// ======= Auto Mapflag Adding ===============//
664// ============== Party 2vs2 =================//
665if($@debug) announce "Array Reading of Party 2vs2 PvP Maps - configuring",bc_self;
666for ( set .@m,1; .@m < getarraysize($@pt2pvp$); set .@m,.@m + 1 ) {
667 if($@debug) announce "Mapflag set at "+$@pt2pvp$[.@m] + " initiate...",bc_self;
668 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
669 setmapflag $@pt2pvp$[.@m],$@pvp_mf[.@mf];
670 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt2pvp$[.@m] + " complete",bc_self;
671 }
672}
673if($@debug) announce "Party 2v2 PvP Mapflags loaded.",bc_self;
674sleep2 100;
675// ============== Party 3vs3 =================//
676if($@debug) announce "Array Reading of Party 3vs3 PvP Maps - configuring",bc_self;
677for ( set .@m,1; .@m < getarraysize($@pt3pvp$); set .@m,.@m + 1 ) {
678 if($@debug) announce "Mapflag set at "+$@pt3pvp$[.@m] + " initiate...",bc_self;
679 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
680 setmapflag $@pt3pvp$[.@m],$@pvp_mf[.@mf];
681 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt3pvp$[.@m] + " complete",bc_self;
682 }
683}
684if($@debug) announce "Party 3v3 PvP Mapflags loaded.",bc_self;
685sleep2 100;
686// ============== Party 4vs4 =================//
687 if($@debug) announce "Array Reading of Party 4vs4 PvP Maps - configuring",bc_self;
688for ( set .@m,1; .@m < getarraysize($@pt4pvp$); set .@m,.@m + 1 ) {
689 if($@debug) announce "Mapflag set at "+$@pt4pvp$[.@m] + " initiate...",bc_self;
690 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
691 setmapflag $@pt4pvp$[.@m],$@pvp_mf[.@mf];
692 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt4pvp$[.@m] + " complete",bc_self;
693 }
694}
695if($@debug) announce "Party 4v4 PvP Mapflags loaded.",bc_self;
696sleep2 100;
697// ============== Party 5vs5 =================//
698 if($@debug) announce "Array Reading of Party 5vs5 PvP Maps - configuring",bc_self;
699for ( set .@m,1; .@m < getarraysize($@pt5pvp$); set .@m,.@m + 1 ) {
700 if($@debug) announce "Mapflag set at "+$@pt5pvp$[.@m] + " initiate...",bc_self;
701 for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
702 setmapflag $@pt5pvp$[.@m],$@pvp_mf[.@mf];
703 if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt5pvp$[.@m] + " complete",bc_self;
704 }
705}
706if($@debug) announce "Party 5v5 PvP Mapflags loaded.",bc_self;
707sleep2 100;
708if($@debug) announce "Party PvP Mapflags loaded.",bc_self;
709function writeStats;
710if($@debug) announce "Write Stats Function loaded.",bc_self;
711function getBounty;
712function writeBounty;
713if($@debug) announce "Bounty Function loaded.",bc_self;
714function doPromote;
715if($@debug) announce "Promote Function loaded.",bc_self;
716if(.@re_in) goto OnWhisperGlobal;
717end;
718
719OnPCKillEvent:
720set #EVENTPOINTS,#EVENTPOINTS + 1;
721if(compare(strcharinfo(3),"pvp_y_") == 0 && compare(strcharinfo(3),"guild_vs") == 0) end;
722if(getmapflag(strcharinfo(3),mf_pvp) == 0 && getmapflag(strcharinfo(3),mf_gvg) == 0) end;
723set .@v,killedrid;
724mapannounce strcharinfo(3),strcharinfo(0) + " has killed "+rid2name(.@v)+"!!!!!",0;
725set @killct,@killct + 1;
726switch(@killct) {
727 case 1:
728 if(@first) {
729 mapannounce strcharinfo(3),strcharinfo(0) + " has achieved First Blood!!!!",0;
730 soundeffectall "firstblood.wav",0,strcharinfo(3);
731 set @first,0;
732 }
733 break;
734
735 case 3:
736 set #EVENTPOINTS,#EVENTPOINTS + 5;
737 dispbottom "Gained 5 Event Points Total: " + #EVENTPOINTS;
738 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Killing Spree!!!!",0;
739 soundeffectall "killingspree.wav",0,strcharinfo(3);
740 set @sphr,1;
741 break;
742
743 case 5:
744 set #EVENTPOINTS,#EVENTPOINTS + 7;
745 dispbottom "Gained 7 Event Points Total: " + #EVENTPOINTS;
746 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Dominating!!!!",0;
747 soundeffectall "dominating.wav",0,strcharinfo(3);
748 set @sphr,2;
749 break;
750
751 case 7:
752 set #EVENTPOINTS,#EVENTPOINTS + 10;
753 dispbottom "Gained 10 Event Points Total: " + #EVENTPOINTS;
754 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Mega Kill!!!!",0;
755 soundeffectall "megakill.wav",0,strcharinfo(3);
756 set @sphr,3;
757 break;
758
759 case 9:
760 set #EVENTPOINTS,#EVENTPOINTS + 12;
761 dispbottom "Gained 12 Event Points Total: " + #EVENTPOINTS;
762 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Unstoppable!!!!",0;
763 soundeffectall "unstoppable.wav",0,strcharinfo(3);
764 set @sphr,4;
765 break;
766
767 case 11:
768 set #EVENTPOINTS,#EVENTPOINTS + 15;
769 dispbottom "Gained 15 Event Points Total: " + #EVENTPOINTS;
770 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Wicked Sick!!!!",0;
771 soundeffectall "wickedsick.wav",0,strcharinfo(3);
772 set @sphr,5;
773 break;
774
775 case 13:
776 set #EVENTPOINTS,#EVENTPOINTS + 17;
777 dispbottom "Gained 17 Event Points Total: " + #EVENTPOINTS;
778 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Monster Kill!!!!",0;
779 soundeffectall "monsterkill.wav",0,strcharinfo(3);
780 set @sphr,6;
781 break;
782
783 case 15:
784 set #EVENTPOINTS,#EVENTPOINTS + 20;
785 dispbottom "Gained 20 Event Points Total: " + #EVENTPOINTS;
786 mapannounce strcharinfo(3),strcharinfo(0) + " is now on GodLike!!!!",0;
787 soundeffectall "godlike.wav",0,strcharinfo(3);
788 set @sphr,7;
789 break;
790
791 case 20:
792 set #EVENTPOINTS,#EVENTPOINTS + 30;
793 dispbottom "Gained 30 Event Points Total: " + #EVENTPOINTS;
794 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Holy Sh1t!!!!",0;
795 soundeffectall "holyshit.wav",0,strcharinfo(3);
796 set @sphr,8;
797 break;
798
799 case 100:
800 set Zeny,Zeny+10000;
801 dispbottom "Gained 10,000 zeny";
802 mapannounce strcharinfo(3),strcharinfo(0) + " Has attained a 100 kill streak!!!!!",0;
803 soundeffectall "holyshit.wav",0,strcharinfo(3);
804 set @sphr,8;
805 break;
806
807 default:
808 if(@killct > 17) {
809 mapannounce strcharinfo(3),strcharinfo(0) + " is now on Holy Sh1t!!!!",0;
810 soundeffectall "holyshit.wav",0,strcharinfo(3);
811 }
812 break;
813}
814set @prokill,@prokill + 1;
815doPromote;
816
817
818set @mkillct,@mkillct + 1;
819deltimer strnpcinfo(0)+"::OnMultiSpan";
820addtimer $@multi,strnpcinfo(0)+"::OnMultiSpan";
821if(@mkillct >= 2) sleep2 500; // Slowing down multi-kill sound effects
822if(@mkillct == 2) {
823 mapannounce strcharinfo(3),strcharinfo(0) + " has made an Double Kill!!!!",0;
824 soundeffectall "doublekill.wav",0,strcharinfo(3);
825} else if(@mkillct == 3) {
826 mapannounce strcharinfo(3),strcharinfo(0) + " has made an Triple Kill!!!!",0;
827 soundeffectall "triplekill.wav",0,strcharinfo(3);
828} else if(@mkillct >= 4) {
829 mapannounce strcharinfo(3),strcharinfo(0) + " has made an Ultra Kill!!!!",0;
830 soundeffectall "ultrakill.wav",0,strcharinfo(3);
831}
832if($@bty_type && $@pvptable) {
833 if(@sphr >= $@bty_bon_start) {
834 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;
835 set @sphr,@sphr + $@bty_bonus;
836 }
837 query_sql("SELECT `bounty` FROM `arena_master` WHERE `char_id` = '"+getcharid(0,rid2name(.@v))+"'",@bty);
838 getBounty(@bty,.@v);
839 writeBounty(@sphr);
840}
841if(@killct%5==0) message strcharinfo(0),"Defeated Players: "+@killct;
842end;
843
844OnPCDieEvent:
845// ===== Should affects you only, if you warped to an player via @warpto/@goto or were @recall-ed
846// ==== so you won't recieve a value for @map, which is required for the respawn in DM Maps
847if(!@map) {
848 for( set @m,1; @m < getarraysize($@dmpvp$); set @m,@m + 1)
849 if(strcharinfo(3) == $@dmpvp$[@m]) {
850 set @map,@m;
851 break;
852 }
853}
854if($@pvptable) {
855 writeStats(getcharid(0),@killct,1);
856 if($@bty_type) writeBounty(@sphr);
857
858}
859set @sphr,0;
860set @killct,0;
861
862if($@same_gld && @gvgc > 0) {
863 if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
864 setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
865 if(getd("$@gvg_"+@gvgc+"_1_ppl") < 1) setd("$@gvg_"+@gvgc+"_gld_1"),0;
866 } else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
867 setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
868 if(getd("$@gvg_"+@gvgc+"_2_ppl") < 1) setd("$@gvg_"+@gvgc+"_gld_2"),0;
869 }
870 set @gvg_c,0;
871}
872if(strcharinfo(3) == $@dmpvp$[@map]) {
873 sleep2 1500;
874 if(killerrid != getcharid(3)) {
875 warp strcharinfo(3),0,0;
876 if(HP == 0) atcommand "@alive";
877 percentheal 100,100;
878 } else warp "SavePoint",0,0;
879}
880end;
881
882OnMultiSpan:
883set @mkillct,0;
884end;
885
886OnPCLogOutEvent:
887if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end;
888if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end;
889if($@pvptable) {
890 writeStats(getcharid(0),@killct,0);
891 if(@prodo)
892 if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@charid) != 0) // Should never happen, but to prevent bugs :I
893 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)+"'";
894}
895if($@same_gld && @gvgc > 0) {
896 if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
897 else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
898}
899end;
900
901OnNPCKillEvent:
902if(!$@pvptable) end;
903if(compare(strcharinfo(3),"pvp_n_") == 0) end; // Only working in the MvP Arena
904if(getmonsterinfo(killedrid,MOB_MODE) & 32) { // 32 = Mini-Boss & MvP Flag (There is no solo-flag for MvP q.q)
905 if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@charid) != 0)
906 query_sql "UPDATE `arena_master` SET `mvp` = `mvp` + 1 WHERE `char_id` = '"+getcharid(0)+"'";
907 else query_sql "INSERT INTO `arena_master` ( `char_id` , `mvp`) VALUES ( '"+getcharid(0)+"' , '1' )";
908}
909end;
910
911 function writeStats {
912 if(!$@pvptable) return; // To be save :O
913 set @c,getarg(0); // Char ID
914 set @k,getarg(1); // Kills
915 set @d,getarg(2); // Deaths
916 if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@charid) != 0) {
917 if(@k > query_sql("SELECT `hscore` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@hscore)) set @hscore,@k;
918 query_sql "UPDATE `arena_master` SET `kills` = `kills` + "+@k+", `death` = `death` + "+@d+" , `hscore` = '"+@hscore+"' WHERE `char_id` = '"+@c+"'";
919 } else query_sql "INSERT INTO `arena_master` ( `char_id` , `kills` , `death` , `hscore` ) VALUES ( '"+@c+"' , '"+@k+"' , '"+@d+"' , '"+@hscore+"' )";
920 return;
921 }
922
923 function doPromote {
924 set @prodo,1; // Check for OnPCLogOutEvent
925 switch(@sphr) { // Sphree Index
926 case 1:
927 if(@prokill/$@promo == 1) set @killer,@killer + 1;
928 break;
929
930 case 2:
931 if(@prokill/$@promo == 1) set @domi,@domi + 1;
932 break;
933
934 case 3:
935 if(@prokill/$@promo == 1) set @mega,@mega + 1;
936 break;
937
938 case 4:
939 if(@prokill/$@promo == 1) set @unstopp,@unstopp + 1;
940 break;
941
942 case 5:
943 if(@prokill/$@promo == 1) set @wicked,@wicked + 1;
944 break;
945
946 case 6:
947 if(@prokill/$@promo == 1) set @monster,@monster + 1;
948 break;
949
950 case 7:
951 if(@prokill/$@promo == 1) set @godlike,@godlike + 1;
952 break;
953
954 case 8:
955 if(@prokill/$@promo == 1) set @holys,@holys+ 1;
956 break;
957 }
958 set @prokill,0;
959 return;
960 }
961
962 function getBounty {
963 // getarg(0) == Last Sphree of Victim
964 // getarg(1) == RID of Victim
965 if(!getarg(0)) return; // No Sphree = No Bounty ;I
966 // Calculation:
967 // Exchange the */+ with the symbol you want,
968 // but note that it can be exploited if you change it too much,
969 // like 8 (Sphree Index)*$@bty_price (Cash Points,5) = 40 CASHPOINTS
970 switch($@bty_type) { // Bounty Reward Type
971 case 1: // Zeny
972 set Zeny,Zeny + ($@bty_price*getarg(0));
973 dispbottom "Bounty Hunter: You have recieved "+($@bty_price*getarg(0))+" Zeny for killing "+rid2name(getarg(1))+".";
974 break;
975
976 case 2: // Cash Points
977 set #CASHPOINTS,#CASHPOINTS + ($@bty_price+getarg(0));
978 dispbottom "Bounty Hunter: You have recieved "+($@bty_price+getarg(0))+" Cash Points for killing "+rid2name(getarg(1))+".";
979 dispbottom "You have now "+#CASHPOINTS+" Cash Points.";
980 break;
981
982 case 3: // Bounty Points
983 query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` + "+($@bty_price+getarg(0))+" WHERE `char_id` = '"+getcharid(0)+"'";
984 dispbottom "Bounty Hunter: You have recieved "+($@bty_price+getarg(0))+" Bounty Points for killing "+rid2name(getarg(1))+".";
985 break;
986 }
987 if(getarg(0) >= $@bty_bon_start)
988 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;
989 return;
990 }
991
992 function writeBounty {
993 query_sql "UPDATE `arena_master` SET `bounty` = '"+getarg(0)+"' WHERE `char_id` = '"+getcharid(0)+"'";
994 return;
995 }
996
997OnWhisperGlobal:
998if(!getgmlevel()) end;
999set .@re_in,0;
1000set $@debug,0;
1001if(select("- ReLoad:- Nevermind") == 2) close;
1002if(select("- Debug:- Without Debug") == 1) set $@debug,1;
1003set .@re_in,1;
1004goto OnInit;
1005end;
1006}
1007
1008pvp_y_4-1 mapflag pvp_noparty
1009pvp_y_4-1 mapflag partylock
1010pvp_y_4-1 mapflag pvp_noguild