) ARENA MASTER ... but it's not counting the kill ranking, only death, and it's giving an error in the map-server.1.6 but it's not counting the kill ranking, only death, and it's giving an error in the map-server.. print, please help!
//===== rAthena Script =======================================
//= Arena Master
//===== By ===================================================
//= llchrisll
//===== Version ==============================================
//= 1.0 - Initial Version
// Added Multi Kill & SoundEffects
// Added Bounty & Promotion Feature
// Fully tested & Rewritten most of the code
// - Since it didn't wanted to work like I wanted
// - Couldn't test the Party PvP option though.
// Added a bonus at the bounty feature
// - If an player gains a "[email protected]_bon_start" spree, "[email protected]_bonus"
// will be given to the player, who kill him/her.
//= 1.1 - Fixed an Bounty bug - Thanks to raijin91
// = Also the bounty bonus wasn't added, kinda forgot that it seems
// - Changed the First Blood part
// - Changed the Chat blocking part
// - Shorted the sphree part a bit, still testing it.
// - Added an Cost Multiplier for the shop to adjust the prices for Mid Rate and higher Servers.
// - Added another function to get the map users in each room and each pvp.
//= 1.2 - Compatible with rAthena
// - Fixed some bugs
//= 1.3 - Made the Sphree Announcer dynamically
// - Made modification regarding the sphree ranking, removed doPromote; function
// - Shorted the ranking display choices
//= 1.4 - Moved writeStats; into the kill part, bug with Logout prevented from saving in ranking
// - Fixed an bug with "First Blood" announcer
// - Updated the MvP Ranker to rAthena, @getmonsterinfo has an check for MvP EXP now
// - Removed limitation to MvP Arena, against every MvP useable now
// - Fixed Ranking bug, didn't save Kills and stuff correctly.
// - Added an addtional Player Counter for each PvP Room
// - Added Class Limitation regarding 3rd Jobs
// - Fixed an bug with Auto-Resurrect on Deathmatch Maps
// - Fixed another Ranking bug, didn't display correctly
//= 1.5 - Added Custom Bounty Map Feature, see line around '861'
// - Added to the Bounty Hunter an Locater, which locates the player...
// - Fixed an bug about the Bounty Hunter, forgot to reset the @hunt variable
// - Removed First Blood completely
// - Removed Chat Block part completely + OnPCMapLoadEvent
// - Fixed an Arena Shop bug by using [email protected]_pay = 2 (Permanent Price Array) - Thanks to Lelantos for the bug report
// - Rewrote the whole check at the Party PvP, also fixxed the check for
// online party member counting > misplaced the variables for "isloggedin" ... - Thanks to Lelantos for the bug report
//= 1.6 - Reduced PvP Rooms by adding Map Rotation Settings; Fixed Maps + Random Map each Day + Specific Map on an specific Day
// - Removed the Player Limitation except Party PvP
// - Reduced GvG Maps to 3
// - Removed the functions getPvPMapUsers and getPartyMapUsers
// - Added an announcer on Room Entry
// - Added in Party PvP an display how many parties are in which room before joining
// - Fixed minor bugs
// - Exchanged #CASHPOINTS Reward with Custom Variable Support, you can decide now
// - Modified the Arena Shop Multiplier by using an array to decide it for each Item seperatly
// - Moved the Arena Shop Config to the Arena Master NPC and made [email protected]_ to .arena_ or [email protected]_ variables
//= 1.7 - Fixed PvP KIll Announcer and Kill display message
// - Changed `hscore` to `hstreak` (confused people)
// - Fixed typo at PvP Deathmatch warp "$dmpvp$" > "[email protected]$"
// - Added some lines for the dynamic Map setting
// - Fixed a typo in mapannounce (Thanks to Questune09 for the bug report)
//= 1.8 - Moved the writeStats use on killing to when the player dies or logs out (lessens SQL usage)
// - Added OnPCLogoutEvent seperately
// - Removed some left over messages I missed to delete with last update
// - Removed MvP Ranker
// - Fixed an issue the Shop, which made it possible buy items without cost
//===== Tested With ==========================================
//= rAthena 03/29/2021 Revision
//= GIT Hash: 47c471e3d0e7997ae605ebf45760349f3b25d365
//===== Description ==========================================
//= PvP / GvG Arenas with ranking ladder
//= PvP Types:
// - Normal
// - Dispell: You'll be dispelled on Room entry.
// - Deathmatch: You'll be auto resurrect when you die.
// If you type @die, get comaed and similar, you'll be warped to your save point.
// - Party PvP: 2vs2, 3vs3, 4vs4, 5vs5
// -----------------------------------------------
//= GvG: 3 Arenas, the default guild_vs1 - guild_vs3.
//===== Comments & Credits =============================================
// = Thanks to Lelantos for the idea of the Custom Bounty Map Feature
// = Thanks to Vayrus for the bug reports.
//===== MySQL Entries ========================================
/*
// v1.0
DROP TABLE IF EXISTS `arena_master`;
CREATE TABLE `arena_master` (
`char_id` int(10) unsigned NOT NULL,
`kills` smallint(5) unsigned DEFAULT '0',
`death` smallint(5) unsigned DEFAULT '0',
`hstreak` smallint(5) unsigned DEFAULT '0',
`bounty` smallint(5) unsigned DEFAULT '0',
`bounty_pts` smallint(5) unsigned DEFAULT '0',
`killer` smallint(5) unsigned DEFAULT '0',
`domi` smallint(5) unsigned DEFAULT '0',
`mega` smallint(5) unsigned DEFAULT '0',
`unstopp` smallint(5) unsigned DEFAULT '0',
`wicked` smallint(5) unsigned DEFAULT '0',
`monster` smallint(5) unsigned DEFAULT '0',
`godlike` smallint(5) unsigned DEFAULT '0',
`holys` smallint(5) unsigned DEFAULT '0',
PRIMARY KEY (`char_id`)
) ENGINE=MyISAM;
*/
//============================================================
// ================= Arena Master ================== //
prontera,164,163,5 script Arena Master 808,{
mes .n$;
mes "Hello, "+strcharinfo(0)+"!";
if(getgmlevel() > 79)
if(select("- GM Menu:- Player Menu") == 1)
goto GM_Menu;
if([email protected]_load == 1) {
mes "I'm sorry, but the Arena and it's features are not available yet. Try again in a few minutes please.";
close;
}
mes "How can I help you?";
mes "Ranking Status: "+ ( ([email protected])?"Enabled":"Disabled");
next;
switch(select("- Arenas:- Rankings:- Arena Shop:- Information:- Nevermind")) {
// Arenas
case 1:
set @sphr,0;
set @bty,0;
set @killct,0;
mes .n$;
mes "In which arena do you want to fight?";
next;
switch(select("- PvP:- GvG:- Nevermind")) {
// PvP
case 1:
mes .n$;
mes "Please choose the PvP Type:";
mes "In the \"()\" stands, if 3rd Jobs, only 3rd Jobs or All Jobs are allowed to enter.";
next;
switch([email protected]_disp[$disppvp_map]) {
case 0: set [email protected]_pvpdisp$,"No 3rd Jobs"; break;
case 1: set [email protected]_pvpdisp$,"Only 3rd Jobs"; break;
case 2: set [email protected]_pvpdisp$,"All Jobs"; break;
}
switch([email protected]_n[$npvp_map]) {
case 0: set [email protected]_pvpn$,"No 3rd Jobs"; break;
case 1: set [email protected]_pvpn$,"Only 3rd Jobs"; break;
case 2: set [email protected]_pvpn$,"All Jobs"; break;
}
switch([email protected]_dm[$dmpvp_map]) {
case 0: set [email protected]_pvpdm$,"No 3rd Jobs"; break;
case 1: set [email protected]_pvpdm$,"Only 3rd Jobs"; break;
case 2: set [email protected]_pvpdm$,"All Jobs"; break;
}
switch(select("- PvP Dispell ["+getmapusers([email protected]$[$disppvp_map])+"] ("[email protected]_pvpdisp$+"):- Normal PvP ["+getmapusers([email protected]$[$npvp_map])+"] ("[email protected]_pvpn$+"):- PvP Deathmatch["+getmapusers([email protected]$[$dmpvp_map])+"] ("[email protected]_pvpdm$+"):- Party PvP")) {
// PvP Dispell
case 1:
mes .n$;
if([email protected]_disp[$disppvp_map] == 0 && eaclass()&EAJL_THIRD) {
mes "I'm sorry, but 3rd Classes are not allowed in this PvP Room.";
close;
} else if([email protected]_disp[$disppvp_map] == 1 && !(eaclass()&EAJL_THIRD)) {
mes "I'm sorry, but only 3rd Classes are allowed in this PvP Room.";
close;
}
mes "I'll warp you now to the PvP Room, also remove all your buffs.";
close2;
sc_end SC_ALL; // Remove every kind of buff
warp [email protected]$[$disppvp_map],0,0;
announce "["+strcharinfo(0)+"] has entered the PvP Dispell Arena!",0;
end;
//PvP Normal
case 2:
mes .n$;
if([email protected]_n[$npvp_map] == 0 && eaclass()&EAJL_THIRD) {
mes "I'm sorry, but 3rd Classes are not allowed in this PvP Room.";
close;
} else if([email protected]_n[$npvp_map] == 1 && !(eaclass()&EAJL_THIRD)) {
mes "I'm sorry, but only 3rd Classes are allowed in this PvP Room.";
close;
}
mes "I'll warp you now to the Normal PvP Room.";
close2;
warp [email protected]$[$npvp_map],0,0;
announce "["+strcharinfo(0)+"] has entered the Normal PvP Arena",0;
end;
// PvP DM
case 3:
mes .n$;
if([email protected]_dm[$dmpvp_map] == 0 && eaclass()&EAJL_THIRD) {
mes "I'm sorry, but 3rd Classes are not allowed in this PvP Room.";
close;
} else if([email protected]_dm[$dmpvp_map] == 1 && !(eaclass()&EAJL_THIRD)) {
mes "I'm sorry, but only 3rd Classes are allowed in this PvP Room.";
close;
}
mes "I'll warp you now to the PvP Deathmatch Room.";
close2;
set @dm,1;
warp [email protected]$[$dmpvp_map],0,0;
announce "["+strcharinfo(0)+"] has entered the PvP Deathmatch Arena!",0;
end;
// Party PvP
case 4:
mes .n$;
if(!getcharid(1)) {
mes "I'm sorry, but you are not in a party.";
mes "Please come back as soon you have found one.";
close;
}
if(getpartyleader(getcharid(1)) != strcharinfo(0)) {
mes "I'm sorry, but only your leader can register your party.";
close;
}
mes "Parties in Rooms:";
mes "2vs2: "+getmapusers([email protected]$[$pt2pvp_map])/2;
mes "3vs3: "+getmapusers([email protected]$[$pt3pvp_map])/3;
mes "4vs4: "+getmapusers([email protected]$[$pt4pvp_map])/4;
mes "5vs5: "+getmapusers([email protected]$[$pt5pvp_map])/5;
next;
mes .n$;
set @pty_id,getcharid(1);
getpartymember(@pty_id,1);
getpartymember(@pty_id,2);
set @ptymem,[email protected];
copyarray @ptymemid[0],[email protected],@ptymem; // Char ID
copyarray @ptymemaid[0],[email protected],@ptymem; // Account ID
set [email protected]_ct,0;
for ( set [email protected],0; [email protected] < @ptymem; set [email protected],[email protected] + 1)
if( isloggedin(@ptymemaid[[email protected]],@ptymemid[[email protected]]) == 1)
set [email protected]_ct,[email protected]_ct + 1;
if([email protected]_ct < 2) {
mes "It seems like you don't the required members for the Party vs Party Mode.";
mes "You need at least two players, which have to be online, to be able to participate.";
close;
}
set [email protected],[email protected]_ct;
mes "Chosen Party vs Party Mode:";
mes [email protected]+"vs"[email protected]+" Party PvP";
mes "Class Restriction:";
switch( getd("[email protected]_p"[email protected]+"["+getd("$pt"[email protected]+"pvp_map")+"]") ) {
case 0: mes "No 3rd Jobs allowed"; break;
case 1: mes "Only 3rd Jobs allowed"; break;
case 2: mes "All Jobs allowed"; break;
}
next;
mes .n$;
if(getmapusers(getd("[email protected]"[email protected]+"pvp$["+getd("$pt"[email protected]+"pvp_map")+"]")) >= ([email protected][email protected])) {
mes "I'm sorry, but the "[email protected]+"vs"[email protected]+" Arena is already full.";
mes "Please come back later.";
close;
}
getpartymember(@pty_id,1);
getpartymember(@pty_id,2);
set @ptymem,[email protected];
copyarray @ptymemid[0],[email protected],@ptymem; // Char ID
copyarray @ptymemaid[0],[email protected],@ptymem; // Account ID
for ( set [email protected],0; [email protected] < @ptymem; set [email protected],[email protected] + 1)
if(isloggedin(@ptymemaid[[email protected]],@ptymemid[[email protected]]) == 1)
if(getd("[email protected]_p"[email protected]+"["+getd("$pt"[email protected]+"pvp_map")+"]") == 0 && eaclass()&EAJL_THIRD) {
mes "I'm sorry, but 3rd Classes are not allowed in this PvP Room.";
close;
} else if(getd("[email protected]_p"[email protected]+"["+getd("$pt"[email protected]+"pvp_map")+"]") == 1 && !(eaclass()&EAJL_THIRD)) {
mes "I'm sorry, but only 3rd Classes are allowed in this PvP Room.";
close;
}
mes "I'll warp your party now.";
mes "Good luck.";
close2;
warpparty getd("[email protected]"[email protected]+"pvp$["+getd("$pt"[email protected]+"pvp_map")+"]"),0,0,@pty_id;
announce "The Party ["+getpartyname(getcharid(1))+"] has entered the "[email protected]+"vs"[email protected]+" Party PvP Arena!",0;
end;
}
break;
// GvG
case 2:
mes .n$;
if(!getcharid(2)) {
mes "I'm sorry, but you are not in a guild.";
close;
}
mes "Please choose the room you want to join:";
next;
set [email protected],select("- GvG 1 ["+getmapusers([email protected]$[0])+"]:- GvG 2 ["+getmapusers([email protected]$[1])+"]:- GvG 3 ["+getmapusers([email protected]$[2])+"]") - 1;
mes .n$;
mes "I will warp you now.";
close2;
warp [email protected]$[[email protected]],0,0;
end;
// Nevermind
case 3: break;
}
close;
// Ranking
case 2:
mes .n$;
if([email protected]) {
mes "I'm sorry, the ranking system is offline and thus I can't show you any ranking.";
close;
}
mes "Which ranking do you wanna see?";
next;
set [email protected],select("- Kills:- Deaths:- Highest Streak:- Killing Sphree:- Dominating:- Mega Kill:- Unstoppable:- Wicked Sick:- Monster Kill:- GodLike:- Holy Sh1t");
if([email protected] > 3 && [email protected] < 12) // PvP Sphree Ranker
set [email protected]$,[email protected]_rank$[[email protected]];
else { // PvP General K/D/Highest Streak Rankers
setarray [email protected]_rank$[0],"kills","death","hstreak";
set [email protected]$,[email protected]_rank$[[email protected]];
}
mes .n$;
mes "Which list do you want to see?";
next;
set [email protected],select("- Top 5:- Top 10:- Top 15:- Top 20:- Top 25:- Top 30:- Nevermind") * 5;
if([email protected] == 35)
goto R_Bye;
mes .n$;
mes "Ranking:";
switch([email protected]) {
case 1: mes set([email protected]$,"Top "[email protected]+" Killers"); set [email protected]$,"Kills"; break;
case 2: mes set([email protected]$,"Top "[email protected]+" Victims"); set [email protected]$,"Deaths"; break;
case 3: mes set([email protected]$,"Top "[email protected]+" Highest Streak"); set [email protected]$,"Highest Streak"; break;
default: mes set([email protected]$,"Top "[email protected]+" "[email protected]_names$[@rank-4]+" Rankers"); set [email protected]$,[email protected]_names$[[email protected]]+"s"; break;
}
mes "Correct?";
next;
if(select("- Yes:- No") == 2) goto R_Bye;
mes .n$;
mes "I will now list the ranking in your Chat Box.";
close2;
dispbottom "======= "[email protected]$+" ===========";
dispbottom "Player Name: "[email protected]$;
if(query_sql("SELECT `char_id` , `"[email protected]$+"` FROM `arena_master` WHERE `"[email protected]$+"` > 0 ORDER BY `"[email protected]$+"` DESC LIMIT "[email protected],[email protected]_id,[email protected]_r) == 0) {
dispbottom "No Player found.";
end;
}
for( set [email protected],0; [email protected] < getarraysize([email protected]_r); set [email protected],[email protected] + 1) {
query_sql "SELECT `name` FROM `char` WHERE `char_id` = '"[email protected]_id[[email protected]]+"'",[email protected]_na$;
dispbottom [email protected]_na$+": "[email protected]_r[[email protected]];
}
end;
// Arena Shop
case 3:
mes .n$;
mes "Hello, I can sell your useful items for the daily PvP need and more.";
mes "Depending on the bounty, I will open the respective shop.";
switch([email protected]_type) {
case 0:
next;
mes .n$;
mes "I'm sorry, but the bounty feature is not enabled.";
close;
case 1:
dispbottom "[Arena Shop]: I will now open the Bounty Shop, which uses \"Zeny\" as payment.";
break;
case 2:
dispbottom "[Arena Shop]: I will now open the Bounty Shop, which uses \""[email protected]_cvard$+"\" as payment.";
dispbottom "[Arena Shop]: You have "+getd(""[email protected]_cvarn$)+" "[email protected]_cvard$+".";
break;
case 3:
set @pts,0;
dispbottom "[Arena Shop]: I will now open the Bounty Shop, which uses \"Bounty Points\" as payment.";
query_sql "SELECT `bounty_pts` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@pts;
dispbottom "[Arena Shop]: You have "[email protected]+" Bounty Points.";
break;
}
close2;
callshop "Arena_Shop",1;
npcshopattach "Arena_Shop";
end;
OnBuyItem:
for( set [email protected],0; [email protected] < getarraysize(@bought_nameid); set [email protected],[email protected] + 1)
for( set [email protected],0; [email protected] < getarraysize(.arena_sh); set [email protected],[email protected] + 1)
if(@bought_nameid[[email protected]] == .arena_sh[[email protected]])
if(checkweight(@bought_nameid[[email protected]],@bought_quantity[[email protected]]) == 1) {
set [email protected]_item,(@bought_quantity[[email protected]]*.arena_ar[[email protected]]);
set [email protected],([email protected] + [email protected]_item);
break;
} else {
dispbottom "[Arena Shop]: You have reached your weight limit, lose some weight and come back please.";
end;
}
switch([email protected]_type) {
case 1:
if(Zeny >= [email protected]) set Zeny,Zeny - [email protected];
else {
dispbottom "[Arena Shop]: You don't have enough Zeny.";
end;
}
break;
case 2:
if(getd(""[email protected]_cvarn$) >= [email protected]) setd(""[email protected]_cvarn$),getd(""[email protected]_cvarn$) - [email protected];
else {
dispbottom "[Arena Shop]: You don't have enough "[email protected]_cvard$+", currently "+getd(""[email protected]_cvarn$)+".";
end;
}
break;
case 3:
if(@pts >= [email protected]) query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` - "[email protected]+" WHERE `char_id` = '"+getcharid(0)+"'";
else {
dispbottom "[Arena Shop]: You don't have enough Bounty Points, currently "[email protected];
end;
}
break;
}
for ( set [email protected],0; [email protected] < getarraysize(@bought_nameid); set [email protected],[email protected] + 1)
getitem @bought_nameid[[email protected]],@bought_quantity[[email protected]];
deletearray @bought_nameid[0],getarraysize(@bought_nameid);
deletearray @bought_quantity[0],getarraysize(@bought_quantity);
end;
// Information
case 4:
mes .n$;
mes "What do you want to know about?";
next;
switch(select("- PvP:- GvG:- Sphree:- Ranking:- Bounty Feature:- Nevermind")) {
case 1:
mes "[=== PvP ===]";
mes "PvP Types:";
mes " - Normal";
mes " - Dispell";
mes " - Deathmatch";
mes " - Party PvP:";
mes " - 2vs2";
mes " - 3vs3";
mes " - 4vs4";
mes " - 5vs5";
next;
mes "[=== PvP ===]";
mes "Dispell PvP:";
mes " - You'll be dispelled, when you enter the room.";
mes " ";
mes "Deathmatch PvP:";
mes " - You'll be auto-resurrect on death, except you type @die, get comaed or similar, then you'll be warped to your savepoint.";
close;
case 2:
mes "[=== GvG ===]";
mes "In these rooms, you can see what WoE would look like.";
close;
case 3:
mes "[=== Sphree ===]";
mes "Sphree - Required Kills.";
for ( set [email protected],0; [email protected] < getarraysize([email protected]_names$); set [email protected],[email protected] + 1)
mes [email protected]_names$[[email protected]] +" - "[email protected]_kills[[email protected]];
next;
mes "[=== Sphree ===]";
mes "For each sphree you accomplish, except First Blood, you gain an point for the bounty feature, if it has been activated.";
mes "For more ask me about the Bounty Feature.";
next;
mes "[=== Sphree ===]";
mes "Also there is the Multi Kill Sphrees, but you won't recieve points for them.";
mes "The time span you can achieve them is "+ [email protected]/1000+" seconds.";
next;
mes "[=== Sphree ===]";
mes "In this time you, if you kill";
mes " - one more player = Double Kill";
mes " - two more players = Triple Kill";
mes " - three or more players = Ultra Kill";
close;
case 4:
mes "[=== Ranking ===]";
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.";
close;
case 5:
mes .n$;
if([email protected]_type) {
mes "This feature isn't activate.";
close;
}
mes "Current Bounty Reward: "+ [email protected]_price + " " + ( ([email protected]_type == 1)?"Zeny": ( ([email protected]_type == 2)[email protected]_cvard$:"Bounty Points") );
mes "Also an Shop exists so you can prepare you for battle easier.";
mes "Next is an Bounty Bonus, which automatically activates when someone reaches "[email protected]_bon_start+" kills.";
mes "An announce will be displayed, to stop him and that you get an bonus to the bounty price, which depends on the bounty type.";
mes "Current Bonus is: "[email protected]_bonus+" " + ( ([email protected]_type == 1)?"Zeny": ( ([email protected]_type == 2)[email protected]_cvard$:"Bounty Points") );
mes "Also there is an Bounty Bonus Multiplier, but the value of that will stay an secret.";
next;
mes .n$;
mes "The bounty depends on your victims sphree.";
mes "Here is a list of them:";
mes " ";
mes "Sphree - Points";
for ( set [email protected],0; [email protected] < getarraysize([email protected]_names$); set [email protected],[email protected] + 1)
mes [email protected]_names$[[email protected]] +" - "[email protected];
next;
case 6:
break;
}
// Nevermind
case 5:
break;
}
R_Bye:
mes .n$;
mes "Okay, see ya.";
close;
// GM Menu
GM_Menu:
mes "How can I help you?";
next;
switch(select("- Table Settings:- Debug State:- Nevermind")) {
case 1:
mes .n$;
mes "Table Status: "+( ([email protected] == 1)?"":"Not ")+"Installed";
mes "What do you want to do?";
next;
if([email protected] == 1) {
switch(select("- Erase Content from Table:- Delete Table completely:- Nevermind")) {
case 1:
mes .n$;
mes "Are you sure, that you want to delete the rankings from the tables?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
mes "Here we go!";
query_sql "TRUNCATE TABLE `arena_master`";
break;
case 2:
mes .n$;
mes "Are you sure, that you want to delete the whole table from the database?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
mes "Here we go!!!";
query_sql "DROP TABLE IF EXISTS `arena_master`";
set [email protected]_table,0;
break;
case 3:
break;
}
} else if([email protected] == 0) {
if(select("- Create Tables:- Nevermind") - 1) close;
mes .n$;
mes "Are you sure, that you want to create the tables for the rankings?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
mes "Here we go!";
query_sql "CREATE TABLE `arena_master` ( `char_id` int(10) unsigned NOT NULL, `kills` smallint(5) unsigned DEFAULT '0', `death` smallint(5) unsigned DEFAULT '0', `hstreak` smallint(5) unsigned DEFAULT '0', `bounty` smallint(5) unsigned DEFAULT '0', `bounty_pts` smallint(5) unsigned DEFAULT '0', `killer` smallint(5) unsigned DEFAULT '0', `domi` smallint(5) unsigned DEFAULT '0', `mega` smallint(5) unsigned DEFAULT '0', `unstopp` smallint(5) unsigned DEFAULT '0', `wicked` smallint(5) unsigned DEFAULT '0', `monster` smallint(5) unsigned DEFAULT '0', `godlike` smallint(5) unsigned DEFAULT '0', `holys` smallint(5) unsigned DEFAULT '0')";
set [email protected]_table,1;
break;
}
close;
case 2:
mes .n$;
mes "Debug State: "+( ($arena_debug == 1)?"Online":"Offline");
mes "Do you want to change it?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
mes "Debug State has been turned "+ ( (!$arena_debug)?"on":"off")+".";
set $arena_debug,!$arena_debug;
break;
case 3:
break;
}
close;
OnLoading:
set .n$,"["+strnpcinfo(1)+"]";
while([email protected]_load) {
delwaitingroom;
waitingroom "Arena: Closed",0;
sleep 2000;
}
delwaitingroom;
announce "PvP/GvG Arena is now opened.",0;
waitingroom "PvP/GvG Arena: Open",0;
if($arena_debug) debugmes "Main OnInit Loaded, continuing with Arena Shop";
if([email protected]_type) { // If Bounty is enabled
// Shop Items: PvP useful stuff, like Elements, Boxes and Food
// These will be used for all shops, but the prices depends on the Bounty Type you have set.
setarray .arena_sh[0],12020, // [0] == Cursed Water
12028, // [1] == Box of Thunder
12029, // [2] == Box of Gloom
12030, // [3] == Box of Resentment
12031, // [4] == Box of Drowsiness
12032, // [5] == Box of Stroms
12033, // [6] == Box of Sunlight
12034, // [7] == Box of Panting
12108, // [8] == Scroll Package
12215, // [9] == LV 10 Blessing Scroll
12216, // [10] == LV 10 Agi Scroll
12217, // [11] == LV 5 Aspersio Scroll
12218, // [12] == LV 5 Assumptio Scroll
12219, // [13] == LV 10 Wind Walker Scroll
12075, // [14] == Steamed Tongue
12080, // [15] == Dragon Breath Cocktail
12085, // [16] == Immortal Stew
12090, // [17] == Steamed Desert Scorpions
12095, // [18] == Hwergelmir's Tonic
12100, // [19] == Cooked Nice Tail's Tails
12114, // [20] == Elemental Converter[Fire]
12115, // [21] == Elemental Converter[Water]
12116, // [22] == Elemental Converter[Earth]
12117, // [23] == Elemental Converter[Wind]
12118, // [24] == Fireproof Potion
12119, // [25] == Coldproof Potion
12120, // [26] == Earthproof Potion
12121, // [27] == Thunderproof Potion
13543, // [28] == Chemical Protection Helm Scroll Box
13544, // [29] == Chemical Protection Shield Scroll Box
13545, // [30] == Chemical Protection Armor Scroll Box
13546, // [31] == Chemical Protection Weapon Scroll Box
13547, // [32] == Repair Weapon Scroll Box
14593; // [33] == Mystical Amplification Scroll
// Prices:
// Two ways of doing so:
// - Per formula
// - Per Array
// You can determine for each currency the way of calculation and prices.
// If you want to use the formula, set "[email protected]_pay" to 1.
// If you wanna use the array, set "[email protected]_pay" to 2,
// but remember to put the prices for all items, also there is no multiplier added for this.
set [email protected]_pay,1;
// Cost Multiplier:
// The value here will multiply the costs in the shop.
// Fill in the index of the item array for which Item you want to use the multiplier.
// * Suggested Values:
// - Minimum: 1
// - Maximum: 10
// Note: On Mid Rate and High Rate Servers, it's easy to gain money very fast.
// So I added this to only increase the costs in the shop, but not the gain per kill.
// Note2: NEVER PUT '0' ALSO I DIDN'T ADD AN PREVENTION IF YOU GO HIGHER THAN '10'!!!
setarray [email protected]_multi[0],1, // [0]
2, // [1]
2, // [2]
2, // [3]
2, // [4]
2, // [5]
2, // [6]
2, // [7]
4, // [8]
4, // [9]
4, // [10]
4, // [11]
4, // [12]
4, // [13]
5, // [14]
5, // [15]
5, // [16]
5, // [17]
5, // [18]
5, // [19]
3, // [20]
3, // [21]
3, // [22]
3, // [23]
1, // [24]
1, // [25]
1, // [26]
1, // [27]
4, // [28]
4, // [29]
4, // [30]
4, // [31]
3, // [32]
2; // [33]
if([email protected]_pay == 1) {
// ============== * By Formula * ================
// Note: If the formula results in a decimal number it will be degraded.
for ( set [email protected],0; [email protected] < getarraysize(.arena_sh); set [email protected],[email protected] + 1) {
// =============== Zeny Formula ========== //
// Default: (([email protected]_price+([email protected]*([email protected]_price/10)))/2)*[email protected]_multi
// Base Price = [email protected]_price, "Bonus" = + (Index ID* ([email protected]_price/10))/2
// Example: 5000 + (4(=Index of 12031)*(5000/10=500) > 7000/2 = 3500 Zeny for 12031
// With Multiplier: "[email protected]_multi[4] = 5": 3500 * 5 = 17500
if([email protected]_type == 1) set [email protected]_fo,(([email protected]_price+([email protected]*([email protected]_price/10)))/2)*[email protected]_multi[[email protected]];
// =============== Custom Points Formula ========== //
// Default: (([email protected][email protected])/2)*[email protected]_multi
// Base Price = [email protected]_price, "Bonus" = + Index ID/2
// Example: 2 + 4(=Index of 12031) > 6/2 = 3 Custom Points for 12031
// With Multiplier: "[email protected]_multi[4] = 5": 3 * 5 = 15
else if([email protected]_type == 2) set [email protected]_fo,(([email protected][email protected])/2)*[email protected]_multi[[email protected]];
// =============== Bounty Points Formula ========== //
// Default: (([email protected]_price+([email protected]*10))/2)*[email protected]_multi
// Base Price = [email protected]_price, "Bonus" = + (Index ID* 10)/2
// Example: 5 + (4(=Index of 12031)*10) > 45/2 = 22 Bounty Points for 12031
// With Multiplier: "[email protected]_multi[4] = 5": 22 * 5 = 110
else if([email protected]_type == 3) set [email protected]_fo,(([email protected]_price+([email protected]*10))/2)*[email protected]_multi[[email protected]];
// =============== Adding the price (calculated by the formula) to the array ========== //
setarray .arena_ar[[email protected]],[email protected]_fo;
}
// Price Array
} else
setarray .arena_ar[0],100, // [0]
100, // [1]
100, // [2]
100, // [3]
100, // [4]
100, // [5]
100, // [6]
100, // [7]
100, // [8]
100, // [9]
100, // [10]
100, // [11]
100, // [12]
100, // [13]
100, // [14]
100, // [15]
100, // [16]
100, // [17]
100, // [18]
100, // [19]
100, // [20]
100, // [21]
100, // [22]
100, // [23]
100, // [24]
100, // [25]
100, // [26]
100, // [27]
100, // [28]
100, // [29]
100, // [30]
100, // [31]
100, // [32]
100; // [33]
npcshopdelitem "Arena_Shop",512;
// Adding Items and Prices to the Shop
for ( set [email protected],0; [email protected] < getarraysize(.arena_sh); set [email protected],[email protected] + 1)
npcshopadditem "Arena_Shop",.arena_sh[[email protected]],.arena_ar[[email protected]];
if($arena_debug) debugmes "Arena Shop loaded - Items: "+getarraysize(.arena_sh)+", Prices: "+getarraysize(.arena_ar);
}
end;
}
// =============== Bounty Shop =========== //
- shop Arena_Shop -1,512:-1
// =============== Main Settings ===============//
- script PvPGvGMain -1,{
end;
OnInit:
freeloop(1);
// =============== Ranking Check & Debug Messages ================//
set [email protected]_load,1;
//set $arena_debug,1;
initnpctimer;
if($arena_debug) debugmes "====== Arena Master - Debug initiate... ========";
if(query_sql("SHOW TABLES LIKE 'arena_master'",[email protected]) == 0) set [email protected],0; else set [email protected],1;
donpcevent "Arena Master::OnLoading";
// ============== Sphree Settings ============//
setarray [email protected]_names$[0],"Killing Sphree","Dominating","Mega Kill","Unstoppable","Wicked Sick","Monster Kill","GodLike","Holy Sh1t";
setarray [email protected]_kills[0],3,5,7,9,11,13,15,17; // Kills required for each sphree.
setarray [email protected]_wav$[0],"killingspree","dominating","megakill","unstoppable","wickedsick","monsterkill","godlike","holyshit"; // WAV file names
setarray [email protected]_rank$[0],"killer","domi","mega","unstopp","wicked","monster","godlike","holys"; // Variable Names for the ranking of each sphree
set [email protected],5000; // Time Span for chance to gain Multi-Kill in milliseconds.
if($arena_debug) debugmes "PvP Sphree Names loaded: "+getarraysize([email protected]_names$);
if($arena_debug) debugmes "PvP Sphree Kills loaded: "+getarraysize([email protected]_kills);
if($arena_debug) debugmes "PvP Sphree WAV Names loaded: "+getarraysize([email protected]_wav$);
if($arena_debug) debugmes "PvP Sphree Ranking Names loaded: "+getarraysize([email protected]_rank$);
// ============== Bounty Settings =========//
// Bounty Type:
// * 0 = Off
// * 1 = Zeny
// * 2 = Custom Points
// * 3 = Bounty Points
set [email protected]_type,2;
if([email protected]_type) {
set [email protected]_bonus,5; // Bonus, if you kill an player
set [email protected]_bon_start,4; //which has achieved an spree of "[email protected]_bon_start"
set [email protected]_bonus_multi,1; // Use Bonus Multiplier depending on the Bounty Type? See seperate sections below
set [email protected]_bonus_m,1000; // Multiplier for Bounty Bonus
// Custom Points Settings
set [email protected]_cvard$,"Cash Points"; // What to display for players
set [email protected]_cvarn$,"#CASHPOINTS"; // Actual Variable Name
// =============== Zeny ========== //
if([email protected]_type == 1)
set [email protected]_price,5000; // Zeny per Sphree
// =============== Custom Points ========== //
else if([email protected]_type == 2)
set [email protected]_price,2; // Custom Points per Sphree
// =============== Bounty Points ========== //
else if([email protected]_type == 3)
set [email protected]_price,5; // Bounty Points per Sphree
// Custom Bounty Maps
// = Maps on which you also can gain the reward
// 1 = On
// 0 = Off, ordinary ones
set [email protected]_cmap,1;
if([email protected]_cmap == 1) {
// Map Type:
// 1 = Every Map with PvP/GvG Mapflags
// 2 = Specific (Array below)
set [email protected]_cmap_type,2;
if([email protected]_cmap_type == 2) {
// Map Array
// Put the either the whole map name
// or a part of it to add more maps with the part containing
setarray [email protected]_cmaps$[0],"prt_fild08","prt_gld";
// Which map is a PvP/GvG Map?
// 6 = PvP
// 9 = GvG
// Note: In the same order as above
setarray [email protected]_cmap_pg[0],6,9;
}
// Party Usage
// 1 = No parties Allowed
// 2 = Parties allowed
setarray [email protected]_cmap_pty,2,1;
// Mapflags
setarray [email protected]_cmapfl[0],0, //mf_nomemo
// 1, //mf_noteleport
2, //mf_nosave
3, //mf_nobranch
4, //mf_nopenalty
5, //mf_nozenypenalty
11, //mf_notrade
// 13, //mf_nowarp
// 22, //mf_nogo
33, //mf_noreturn
// 34, //mf_nowarpto
// 35, //mf_nightmaredrop
38, //mf_nodrop
41, //mf_novending
44, //mf_noexppenalty
14, //mf_partylock
7; //mf_pvp_noparty
// ======= Auto Mapflag Adding ===============//
for ( set [email protected],0; [email protected] < getarraysize([email protected]_cmaps$); set [email protected],[email protected] + 1 ) {
if($arena_debug) debugmes "Mapflag set at "[email protected]_cmaps$[[email protected]] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize([email protected]_cmapfl); set [email protected],[email protected] + 1 ) {
if(([email protected]_cmapfl[[email protected]] == 14 || [email protected]_cmapfl[[email protected]] == 7) && [email protected]_cmap_pty[[email protected]] == 1) continue;
setmapflag [email protected]_cmaps$[[email protected]],[email protected]_cmapfl[[email protected]];
if($arena_debug) debugmes "Mapflag "+ [email protected]_cmapfl[[email protected]] +" set at "[email protected]_cmaps$[[email protected]] + " complete";
}
// PvP or GvG Mapflag
setmapflag [email protected]_cmaps$[[email protected]],[email protected]_cmap_pg[[email protected]];
if($arena_debug) debugmes "Mapflag "+ [email protected]_cmap_pg[[email protected]] +" set at "[email protected]_cmaps$[[email protected]] + " complete";
}
}
}
if($arena_debug) debugmes "Bounty Shop - Currency: " + ( ([email protected]_type == 1)?"Zeny": ( ([email protected]_type == 2)[email protected]_cvard$:"Bounty Points") ) + ", Basic Price: "+ [email protected]_price;
// Bounty Calculation:
// Scroll down till the line with "function getBounty {"
if($arena_debug) debugmes "Bounty Type loaded: "[email protected]_type;
// ============ GvG Settings ============//
setarray [email protected]$[0],"guild_vs1","guild_vs2","guild_vs3";
if($arena_debug) debugmes "Guild Maps loaded: "+getarraysize([email protected]$);
// Party Usage
// 1 = No parties Allowed
// 2 = Parties allowed
setarray [email protected]_pty[0],2,2,2;
// ======== Mapflags ======== //
// If you want you can add more mapflags
setarray .gvg_mf[0],0, //mf_nomemo
1, //mf_noteleport
2, //mf_nosave
3, //mf_nobranch
4, //mf_nopenalty
5, //mf_nozenypenalty
9, //mf_gvg
11, //mf_notrade
13, //mf_nowarp
15, //mf_noicewall
22, //mf_nogo
33, //mf_noreturn
34, //mf_nowarpto
35, //mf_nightmaredrop
38, //mf_nodrop
41, //mf_novending
44, //mf_noexppenalty
14, //mf_partylock
10; //mf_gvg_noparty
if($arena_debug) debugmes "Guild Mapflags loaded: "+getarraysize(.gvg_mf);
if($arena_debug) debugmes "Array Reading of GvG Maps complete";
for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1 ) {
if($arena_debug) debugmes "Mapflag set at "[email protected]$[[email protected]] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.gvg_mf); set [email protected],[email protected] + 1 ) {
if((.gvg_mf[[email protected]] == 14 || .gvg_mf[[email protected]] == 10) && .gvg_pty[[email protected]] == 2) continue;
setmapflag [email protected]$[[email protected]],.gvg_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .gvg_mf[[email protected]] +" set at "[email protected]$[[email protected]] + " complete";
}
}
if($arena_debug) debugmes "Guild Mapflag loading completed";
// ============ PvP Settings ============//
// = You can use your own Maps as you like, even reduce or put more
// = These below are the default PvP Maps
// ====== Dispell PvP ==========//
setarray [email protected]$[1],"pvp_y_1-1","pvp_y_1-4","pvp_y_1-2","pvp_y_1-3","pvp_y_1-5";
if($arena_debug) debugmes "PvP Dispell Maps loaded: "+(getarraysize([email protected]$)-1);
// ================== Normal Maps ================//
setarray [email protected]$[1],"pvp_y_2-1","pvp_y_2-4","pvp_y_2-2","pvp_y_2-3","pvp_y_2-5";
if($arena_debug) debugmes "PvP Normal Maps loaded: "+(getarraysize([email protected]$)-1);
// ================== Deathmatch Maps ================//
setarray [email protected]$[1],"pvp_y_3-1","pvp_y_3-4","pvp_y_3-2","pvp_y_3-3","pvp_y_3-5";
if($arena_debug) debugmes "PvP DM Maps loaded: "+(getarraysize([email protected]$)-1);
// ========= 2vs2 Party PvP ==========//
setarray [email protected]$[1],"pvp_y_4-1","pvp_y_4-4","pvp_y_4-2","pvp_y_4-3","pvp_y_4-5";
if($arena_debug) debugmes "Party PvP 2vs2 Maps loaded: "+(getarraysize([email protected]$)-1);
// ========= 3vs3 Party PvP ==========//
setarray [email protected]$[1],"pvp_y_5-1","pvp_y_5-4","pvp_y_5-2","pvp_y_5-3","pvp_y_5-5";
if($arena_debug) debugmes "Party PvP 3vs3 Maps loaded: "+(getarraysize([email protected]$)-1);
// ========= 4vs4 Party PvP ==========//
setarray [email protected]$[1],"pvp_y_6-1","pvp_y_6-4","pvp_y_6-2","pvp_y_6-3","pvp_y_6-5";
if($arena_debug) debugmes "Party PvP 4vs4 Maps loaded: "+(getarraysize([email protected]$)-1);
// ========= 5vs5 Party PvP ==========//
setarray [email protected]$[1],"pvp_y_7-1","pvp_y_7-4","pvp_y_7-2","pvp_y_7-3","pvp_y_7-5";
if($arena_debug) debugmes "Party PvP 5vs5 Maps loaded: "+(getarraysize([email protected]$)-1);
// ======= Party Usage ==========
// 1 = No parties Allowed
// 2 = Parties allowed
setarray .disp_pty[1],2,2,2,2,2;
setarray .n_pty[1],2,2,2,2,2;
setarray .dm_pty[1],2,2,2,2,2;
// ============= Class Limitation ========//
// * Values:
// 0 = No 3rd Job Allowed
// 1 = Only 3rd Job Allowed
// 2 = All
// --------------------------------------
// * Dispell PvP Rooms
setarray [email protected]_disp[1],2,2,2,2,2;
// * Normal PvP Rooms
setarray [email protected]_n[1],2,2,2,2,2;
// * Deathmatch PvP Rooms
setarray [email protected]_dm[1],2,2,2,2,2;
// * Party PvP 2vs2 Rooms
setarray [email protected]_p2[1],2,2,2,2,2;
// * Party PvP 3vs3 Rooms
setarray [email protected]_p3[1],2,2,2,2,2;
// * Party PvP 4vs4 Rooms
setarray [email protected]_p4[1],2,2,2,2,2;
// * Party PvP 5vs5 Rooms
setarray [email protected]_p5[1],2,2,2,2,2;
//==============================
// ===== Map Rotation ====== //
// 1 = Fixed Map (Always Default)
// 2 = Random each Day
// 3 = Each specific Day an specific Map
set .pvp_map,3;
// ===== 1: Fixed Map (Always Default) ======== //
// Type the Index of [email protected]<Type>pvp$ for the Map to be used
set $disppvp_map,2;
set $npvp_map,3;
set $dmpvp_map,1;
set $pt2pvp_map,4;
set $pt3pvp_map,4;
set $pt4pvp_map,4;
set $pt5pvp_map,4;
// ===== 3: Specific Day ======== //
if(.pvp_map == 3) {
// > Chose your time in the same row as the [email protected]_maps$ order
// > Values for the Array:
// MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
// ============================== //
setarray [email protected]_day[1],MONDAY,MONDAY,WEDNESDAY,SATURDAY,TUESDAY;
setarray [email protected]_day[1],TUESDAY,SATURDAY,WEDNESDAY,THURSDAY,MONDAY;
setarray [email protected]_day[1],WEDNESDAY,MONDAY,SUNDAY,TUESDAY,FRIDAY;
setarray [email protected]_day[1],FRIDAY,TUESDAY,SATURDAY,MONDAY,TUESDAY;
setarray [email protected]_day[1],FRIDAY,TUESDAY,SATURDAY,MONDAY,TUESDAY;
setarray [email protected]_day[1],FRIDAY,TUESDAY,SATURDAY,MONDAY,TUESDAY;
setarray [email protected]_day[1],FRIDAY,TUESDAY,SATURDAY,MONDAY,TUESDAY;
}
// ======== Mapflags ======== //
// If you want to add more mapflags,
// add them before the last two, which are for allowing party or not
setarray .pvp_mf[0],0, //mf_nomemo
1, //mf_noteleport
2, //mf_nosave
3, //mf_nobranch
4, //mf_nopenalty
5, //mf_nozenypenalty
11, //mf_notrade
13, //mf_nowarp
22, //mf_nogo
33, //mf_noreturn
34, //mf_nowarpto
35, //mf_nightmaredrop
38, //mf_nodrop
41, //mf_novending
44, //mf_noexppenalty
14, //mf_partylock
7; //mf_pvp_noparty
if($arena_debug) debugmes "PvP Mapflags loaded: "+(getarraysize(.pvp_mf)-1);
function writeStats;
if($arena_debug) debugmes "Write Stats Function loaded.";
function getBounty;
function writeBounty;
if($arena_debug) debugmes "Bounty Function loaded.";
function PVP_BTY_CMAP;
if($arena_debug) debugmes "Custom Bounty Map Function loaded.";
stopnpctimer;
set .time,getnpctimer(0);
if($arena_debug) debugmes "Loading Time: "+.time+" seconds.";
freeloop(0);
set [email protected]_load,0;
OnClock0001:
freeloop(1);
setarray [email protected]$[0],"disp","n","dm","pt2","pt3","pt4","pt5";
if(.pvp_map == 2) {
if($arena_debug) debugmes "Random Map Rotation:";
announce "[Arena Master]: New Day, new Battlefield!!! Random Map rotation has been loaded!",bc_all;
for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1) {
if($arena_debug) debugmes "[email protected]$ = "[email protected]$[[email protected]];
if($arena_debug) debugmes "Array Size: [email protected]"[email protected]$[[email protected]]+"pvp$ = "+getarraysize(getd("[email protected]"[email protected]$[[email protected]]+"pvp$"));
setd("$"[email protected]$[[email protected]]+"pvp_map"),rand(1,getarraysize(getd("[email protected]"[email protected]$[[email protected]]+"pvp$"))-1);
if($arena_debug) debugmes "$"[email protected]$[[email protected]]+"pvp_map = "+getd("$"[email protected]$[[email protected]]+"pvp_map");
if($arena_debug) debugmes "[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_map")+"] == "+getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_map")+"]");
if(!getd("$"[email protected]$[[email protected]]+"pvp_last") || getd("$"[email protected]$[[email protected]]+"pvp_last") != getd("$"[email protected]$[[email protected]]+"pvp_map")) {
setd("$"[email protected]$[[email protected]]+"pvp_last"),getd("$"[email protected]$[[email protected]]+"pvp_map");
mapannounce getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_last")+"]"),"[Arena Master]: Duo the map change I will move every player from the current map to the new map in 3 seconds!",bc_all,0xFF0000;
sleep 3000;
mapwarp getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_last")+"]"),getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_map")+"]"),0,0;
}
}
} else if(.pvp_map == 3) {
if($arena_debug) debugmes "Specific Day an Specific Map:";
announce "[Arena Master]: New Day, new Battlefield!!! Map selection depending on the day has been loaded!",bc_all;
for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1) {
if($arena_debug) debugmes "[email protected]$ = "[email protected]$[[email protected]];
if($arena_debug) debugmes "Previous Map: "+getd("$"[email protected]$[[email protected]]+"pvp_map");
// Saving the previous Map
if($arena_debug) debugmes "Saving Previous Map: "+getd("[email protected]"[email protected]$[[email protected]]+"pvp_last");
setd("$"[email protected]$[[email protected]]+"pvp_last"),getd("$"[email protected]$[[email protected]]+"pvp_map");
for ( set [email protected],1; [email protected] < getarraysize(getd("[email protected]"[email protected]$[[email protected]]+"pvp$")); set [email protected],[email protected] + 1) {
if($arena_debug) debugmes "Checking Day of ["[email protected]+"]: "+getd("[email protected]"[email protected]$[[email protected]]+"pvp_day["[email protected]+"]")+" == "+gettime(DT_DAYOFWEEK);
if(getd("[email protected]"[email protected]$[[email protected]]+"pvp_day["[email protected]+"]") == gettime(DT_DAYOFWEEK)) {
setd("$"[email protected]$[[email protected]]+"pvp_map"),[email protected];
if($arena_debug) debugmes "Day Check passed: "+getd("$"[email protected]$[[email protected]]+"pvp_map")+" == "[email protected];
mapannounce getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_last")+"]"),"[Arena Master]: Duo the map change I will move every player from the current map to the new map in 3 seconds!",bc_all,0xFF0000;
sleep 3000;
mapwarp getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_last")+"]"),getd("[email protected]"[email protected]$[[email protected]]+"pvp$["+getd("$"[email protected]$[[email protected]]+"pvp_map")+"]"),0,0;
}
}
}
}
if($arena_debug) debugmes "OnClock0001 and/or OnInit loaded, Auto Mapflag adding now....";
// ======= Auto Mapflag Adding ===============//
// ======= Dispell PvP ===============//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$disppvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if((.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) && .disp_pty[[email protected]] == 2) continue;
setmapflag [email protected]$[$disppvp_map],.pvp_mf[[email protected]];
if($disppvp_map != $disppvp_last)
removemapflag [email protected]$[$disppvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$disppvp_map] + " complete";
}
if($arena_debug) debugmes "PvP Dispell Mapflags loaded.";
// ======= Normal PvP ===============//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$npvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if((.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) && .n_pty[[email protected]] == 2) continue;
setmapflag [email protected]$[$npvp_map],.pvp_mf[[email protected]];
if($npvp_map != $npvp_last)
removemapflag [email protected]$[$npvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$npvp_map] + " complete";
}
if($arena_debug) debugmes "PvP Normal Mapflags loaded.";
// ======= Deathmatch PvP ===============//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$dmpvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if((.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) && .dm_pty[[email protected]] == 2) continue;
setmapflag [email protected]$[$dmpvp_map],.pvp_mf[[email protected]];
if($dmpvp_map != $dmpvp_last)
removemapflag [email protected]$[$dmpvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$dmpvp_map] + " complete";
}
if($arena_debug) debugmes "PvP DM Mapflags loaded.";
// ============== Party 2vs2 =================//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$pt2pvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if(.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) continue;
setmapflag [email protected]$[$pt2pvp_map],.pvp_mf[[email protected]];
if($pt2pvp_map != $pt2pvp_last)
removemapflag [email protected]$[$pt2pvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$pt2pvp_map] + " complete";
}
if($arena_debug) debugmes "Party 2v2 PvP Mapflags loaded.";
// ============== Party 3vs3 =================//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$pt3pvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if(.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) continue;
setmapflag [email protected]$[$pt3pvp_map],.pvp_mf[[email protected]];
if($pt3pvp_map != $pt3pvp_last)
removemapflag [email protected]$[$pt3pvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$pt3pvp_map] + " complete";
}
if($arena_debug) debugmes "Party 3v3 PvP Mapflags loaded.";
// ============== Party 4vs4 =================//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$pt4pvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if(.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) continue;
setmapflag [email protected]$[$pt4pvp_map],.pvp_mf[[email protected]];
if($pt4pvp_map != $pt4pvp_last)
removemapflag [email protected]$[$pt4pvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$pt4pvp_map] + " complete";
}
if($arena_debug) debugmes "Party 4v4 PvP Mapflags loaded.";
// ============== Party 5vs5 =================//
if($arena_debug) debugmes "Mapflag set at "[email protected]$[$pt5pvp_map] + " initiate...";
for ( set [email protected],0; [email protected] < getarraysize(.pvp_mf); set [email protected],[email protected] + 1 ) {
if(.pvp_mf[[email protected]] == 14 || .pvp_mf[[email protected]] == 7) continue;
setmapflag [email protected]$[$pt5pvp_map],.pvp_mf[[email protected]];
if($pt5pvp_map != $pt5pvp_last)
removemapflag [email protected]$[$pt5pvp_last],.pvp_mf[[email protected]];
if($arena_debug) debugmes "Mapflag "+ .pvp_mf[[email protected]] +" set at "[email protected]$[$pt5pvp_map] + " complete";
}
freeloop(0);
if($arena_debug) debugmes "Party 5v5 PvP Mapflags loaded.";
if($arena_debug) debugmes "PvP Mapflags loaded.";
end;
OnPCLogoutEvent:
if([email protected]) {
if(@killct) writeStats(@killct,1);
if([email protected]_type) writeBounty(@sphr,getcharid(0));
}
end;
OnPCKillEvent:
if(PVP_BTY_CMAP() == 0) end;
set [email protected],killedrid;
mapannounce strcharinfo(3),strcharinfo(0) + " has killed "+rid2name([email protected])+"!!!!!",0;
set @killct,@killct + 1;
if($arena_debug) {
debugmes "[Arena]: Showing debug messages";
for ( set [email protected],0; [email protected] < getarraysize([email protected]_kills); set [email protected],[email protected] + 1)
debugmes "[Arena]: Sphree Kills Array - Index #"[email protected]+": "[email protected]_kills[[email protected]];
for ( set [email protected],0; [email protected] < getarraysize([email protected]_names$); set [email protected],[email protected] + 1)
debugmes "[Arena]: Sphree Names Array - Index #"[email protected]+": "[email protected]_names$[[email protected]];
for ( set [email protected],0; [email protected] < getarraysize([email protected]_wav$); set [email protected],[email protected] + 1)
debugmes "[Arena]: Sphree WAV Names Array - Index #"[email protected]+": "[email protected]_wav$[[email protected]];
debugmes "[Arena]: Kill Counter Check and announces...";
debugmes "[Arena]: Kills: "[email protected]+", Arraysize [email protected]_kills: "+getarraysize([email protected]_kills)+", last sphree kills: "[email protected]_kills[getarraysize([email protected]_kills)-1];
}
// Checking if the kill counter is below the last sphree number
if(@killct <= [email protected]_kills[getarraysize([email protected]_kills)-1]) {
if($arena_debug) debugmes "[Arena]: Kills is less than last sphree kill.";
// Looping through the array to check for the sphree kill
for ( set [email protected],0; [email protected] < getarraysize([email protected]_kills); set [email protected],[email protected] + 1) {
if($arena_debug) debugmes "[Arena]: Array Index:"[email protected]+", Array Content: "[email protected]_kills[[email protected]];
if(@killct == [email protected]_kills[[email protected]]) {
if($arena_debug) debugmes "[Arena]: "[email protected]+", "[email protected]_kills[[email protected]];
mapannounce strcharinfo(3),strcharinfo(0) + " is now on "[email protected]_names$[[email protected]]+"!!!!",0;
soundeffectall [email protected]_wav$[[email protected]]+".wav",0,strcharinfo(3);
setd("@"[email protected]_rank$[[email protected]]),getd("@"[email protected]_rank$[[email protected]]) + 1; // Ranking Variable
break;
}
}
// Checking if the kill counter is above the last sphree number
} else if(@killct >= [email protected]_kills[getarraysize([email protected]_kills)-1]) {
mapannounce strcharinfo(3),strcharinfo(0) + " is now on "[email protected]_names$[getarraysize([email protected]_names$)-1]+"!!!!",0;
soundeffectall [email protected]_wav$[getarraysize([email protected]_wav$)-1]+".wav",0,strcharinfo(3);
}
if($arena_debug) debugmes "[Arena]: Check Done";
set @prokill,@prokill + 1;
set @mkillct,@mkillct + 1;
deltimer strnpcinfo(0)+"::OnMultiSpan";
addtimer [email protected],strnpcinfo(0)+"::OnMultiSpan";
if(@mkillct >= 4) sleep2 500; // Slowing down multi-kill sound effects
if(@mkillct == 2) {
mapannounce strcharinfo(3),strcharinfo(0) + " has made an Double Kill!!!!",0;
soundeffectall "doublekill.wav",0,strcharinfo(3);
} else if(@mkillct == 3) {
mapannounce strcharinfo(3),strcharinfo(0) + " has made an Triple Kill!!!!",0;
soundeffectall "triplekill.wav",0,strcharinfo(3);
} else if(@mkillct >= 4) {
mapannounce strcharinfo(3),strcharinfo(0) + " has made an Ultra Kill!!!!",0;
soundeffectall "ultrakill.wav",0,strcharinfo(3);
}
if([email protected] && [email protected]_type) {
if(@killct >= [email protected]_bon_start) {
if([email protected]) {
announce "Bounty Hunter: Oh My God!!! Someone stop "+strcharinfo(0)+" please!!! I'll give you a bonus of "+([email protected]_bonus*[email protected]_bonus_m)+" " + ( ([email protected]_type == 1)?"Zeny": ( ([email protected]_type == 2)[email protected]_cvard$:"Bounty Points") ) + " on "+ ( (Sex)?"his":"her") +" head!!",0;
sleep2 2500;
setarray [email protected]_pre$[0],"disp","n","dm","pt2","pt3","pt4","pt5";
setarray [email protected]_n$[0],"Dispell","Normal","Deathmatch","Party 2vs2","Party 3vs3","Party 4vs4","Party 5vs5";
for ( set [email protected],0; [email protected] < getarraysize([email protected]_pre$); set [email protected],[email protected] + 1)
for ( set [email protected],1; [email protected] < getarraysize(getd("[email protected]"[email protected]_pre$[[email protected]]+"pvp$")); set [email protected],[email protected] + 1)
if(strcharinfo(3) == getd("[email protected]"[email protected]_pre$[[email protected]]+"pvp$["[email protected]+"]")) {
announce "Bounty Hunter: "+( (Sex)?"He":"She")+" is in the ["[email protected]_n$[[email protected]]+" Arena]!!!",0;
break;
}
for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1)
if(strcharinfo(3) == [email protected]$[[email protected]]) {
announce "Bounty Hunter: "+( (Sex)?"He":"She")+" is in the [Guild Room "+([email protected]+1)+"]!!!",0;
break;
}
if([email protected]_cmap)
for ( set [email protected],0; [email protected] < getarraysize([email protected]_cmaps$); set [email protected],[email protected] + 1)
if(compare(strcharinfo(3),[email protected]_cmaps$[[email protected]]) == 1) {
announce "Bounty Hunter: "+( (Sex)?"He":"She")+" is on the map ["[email protected]_cmaps$[[email protected]]+"]!!!",0;
break;
}
set @hunt,1;
}
set @sphr,@killct + [email protected]_bonus;
}
if(query_sql("SELECT `bounty` FROM `arena_master` WHERE `char_id` = '"+getcharid(0,rid2name([email protected]))+"'",[email protected]) != 0)
getBounty([email protected],[email protected]);
writeBounty(@sphr,getcharid(0));
}
if(@killct%5==0) message strcharinfo(0),"Defeated Players: "[email protected];
end;
OnPCDieEvent:
if(PVP_BTY_CMAP() == 0) end;
// ===== Should affects you only, if you warped to an player via @warpto/@goto or were @recall-ed
// ==== so you won't recieve a value for @map, which is required for the respawn in DM Maps
if([email protected])
if(strcharinfo(3) == [email protected]$[$dmpvp_map])
set @dm,1;
if([email protected]) {
writeStats(@killct,1);
if([email protected]_type) writeBounty(@sphr,getcharid(0));
}
set @sphr,0;
set @killct,0;
if(@dm) {
if($arena_debug) debugmes "KillerRid: "+killerrid+", KilledRid: "+killedrid;
sleep2 1300;
if(killerrid != 0 && killerrid != getcharid(3)) {
warp strcharinfo(3),0,0;
if(HP == 0) atcommand "@alive";
percentheal 100,100;
} else warp "SavePoint",0,0;
}
set @hunt,0;
end;
OnMultiSpan:
set @mkillct,0;
end;
function writeStats {
if([email protected]) return; // To be save :O
set [email protected],getarg(0); // Kills
set [email protected],getarg(1); // Deaths
if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",[email protected]_id) != 0) {
if([email protected] > query_sql("SELECT `hstreak` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",[email protected])) set [email protected],[email protected];
// Adding General Kill/Death/Highstreak Values
query_sql "UPDATE `arena_master` SET `kills` = `kills` + "[email protected]+" , `death` = `death` + "[email protected]+" , `hstreak` = '"[email protected]+"' , `killer` = `killer` + "[email protected]+" , `domi` = `domi` + "[email protected]+" , `mega` = `mega` + "[email protected]+" , `unstopp` = `unstopp` + "[email protected]+" , `wicked` = `wicked` + "[email protected]+" , `monster` = `monster` + "[email protected]+" , `godlike` = `godlike` + "[email protected]+" , `holys` = `holys` + "[email protected]+" WHERE `char_id` = '"+getcharid(0)+"'";
// Reseting Ranking Variables
for ( set [email protected],0; [email protected] < getarraysize([email protected]_rank$); set [email protected],[email protected] + 1)
setd("@"[email protected]_rank$[[email protected]]),0;
} else
query_sql "INSERT INTO `arena_master` ( `char_id` , `kills` , `death` , `hstreak` , `killer` , `domi` , `mega` , `unstopp` , `wicked` , `monster` , `godlike` , `holys` ) VALUES ( '"+getcharid(0)+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' )";
return;
}
function getBounty {
// getarg(0) == Last Sphree of Victim
// getarg(1) == RID of Victim
if(!getarg(0)) return; // No Sphree = No Bounty ;I
// Calculation:
// Exchange the */+ with the symbol you want,
// but note that it can be exploited if you change it too much,
// like 8 (Sphree Index)*[email protected]_price (Custom Points,5) = 40 Custom Points
// If Bounty Bonus Multiplier is active
if([email protected]_bonus_multi == 1)
set [email protected]_b_gain,[email protected]_bonus*[email protected]_bonus_m;
else
set [email protected]_b_gain,[email protected]_bonus;
if(getarg(0) >= [email protected]_bon_start)
mapannounce strcharinfo(3),"Bounty Hunter: "+strcharinfo(0)+" has ended "+rid2name(getarg(1))+"'s Spree and was rewarded with additional "[email protected]_b_gain+" " + ( ([email protected]_type == 1)?"Zeny": ( ([email protected]_type == 2)[email protected]_cvard$:"Bounty Points") ),0;
switch([email protected]_type) { // Bounty Reward Type
case 1: // Zeny
set Zeny,Zeny + ([email protected]_price*getarg(0)) + [email protected]_b_gain;
dispbottom "Bounty Hunter: You have recieved "+([email protected]_price*getarg(0)[email protected]_b_gain)+" Zeny for killing "+rid2name(getarg(1))+".";
break;
case 2: // Custom Points
setd(""[email protected]_cvarn$),getd(""[email protected]_cvarn$) + ([email protected]_price+getarg(0)) + [email protected]_b_gain;
dispbottom "Bounty Hunter: You have recieved "+([email protected]_price+getarg(0)[email protected]_b_gain)+" "[email protected]_cvard$+" for killing "+rid2name(getarg(1))+".";
dispbottom "You have now "+getd(""[email protected]_cvarn$)+" "[email protected]_cvard$+".";
break;
case 3: // Bounty Points
query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` + "+([email protected]_price+getarg(0)[email protected]_b_gain)+" WHERE `char_id` = '"+getcharid(0)+"'";
dispbottom "Bounty Hunter: You have recieved "+([email protected]_price+getarg(0)[email protected]_b_gain)+" Bounty Points for killing "+rid2name(getarg(1))+".";
break;
}
writeBounty(0,getcharid(0,rid2name(getarg(1))));
return;
}
function writeBounty {
// getarg(0) == Kills
// getarg(1) == Character ID
query_sql "UPDATE `arena_master` SET `bounty` = '"+getarg(0)+"' WHERE `char_id` = '"+getarg(1)+"'";
return;
}
function PVP_BTY_CMAP {
// Regular Maps in [email protected]<.>pvp$ & [email protected]$ array
setarray [email protected]_pre$[0],"disp","dm","n","pt2","pt3","pt4","pt5";
for ( set [email protected],0; [email protected] < getarraysize([email protected]_pre$); set [email protected],[email protected] + 1)
for ( set [email protected],1; [email protected] < getarraysize(getd("[email protected]"[email protected]_pre$[[email protected]]+"pvp$")); set [email protected],[email protected] + 1)
if(strcharinfo(3) == getd("[email protected]"[email protected]_pre$[[email protected]]+"pvp$["[email protected]+"]"))
return 1;
for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1)
if(strcharinfo(3) == [email protected]$[[email protected]])
return 1;
// Mapflag
if([email protected]_cmap_type == 1)
if(getmapflag(strcharinfo(3),mf_pvp) == 1 && getmapflag(strcharinfo(3),mf_gvg) == 1)
return 1;
// Custom Maps
else if([email protected]_cmap_type == 2) {
// One Map
if(getarraysize([email protected]_cmaps$) == 1)
if(compare(strcharinfo(3),[email protected]_cmaps$[0]) == 1)
return 1;
// Array
else if(getarraysize([email protected]_cmaps$) > 1)
for ( set [email protected],0; [email protected] < getarraysize([email protected]_cmaps$); set [email protected],[email protected] + 1)
if(compare(strcharinfo(3),[email protected]_cmaps$[[email protected]]) == 1)
return 1;
}
return 0;
}
// =========== End of Function ==========
}
Can you help me please?
I'm with the (
) ARENA MASTER ... but it's not counting the kill ranking, only death, and it's giving an error in the map-server.1.6 but it's not counting the kill ranking, only death, and it's giving an error in the map-server.. print, please help!
and
CREATE TABLE `arena_master` ( `char_id` int(10) unsigned NOT NULL, `kills` smallint(5) unsigned DEFAULT '0', `death` smallint(5) unsigned DEFAULT '0', `hstreak` smallint(5) unsigned DEFAULT '0', `bounty` smallint(5) unsigned DEFAULT '0', `bounty_pts` smallint(5) unsigned DEFAULT '0', `killer` smallint(5) unsigned DEFAULT '0', `domi` smallint(5) unsigned DEFAULT '0', `mega` smallint(5) unsigned DEFAULT '0', `unstopp` smallint(5) unsigned DEFAULT '0', `wicked` smallint(5) unsigned DEFAULT '0', `monster` smallint(5) unsigned DEFAULT '0', `godlike` smallint(5) unsigned DEFAULT '0', `holys` smallint(5) unsigned DEFAULT '0', PRIMARY KEY (`char_id`) ) ENGINE=MyISAM;Link to comment
Share on other sites