// ....... if your server has { Overwriting user function [int__] } don't blame me ..........function script int__ {set .@num, atoi(getarg(0));if( .@num ==0 || .@num >=2147483647)returngetarg(0);set .@l, getstrlen(.@num);for(set .@i,0; .@i < .@l; set .@i, .@i +1){set .@num$, .@num %pow(10,.@i+1)/pow(10,.@i)+ .@num$;if((.@i+1)%3==0&& .@i+1!= .@l )set .@num$, ","+ .@num$;}return .@num$;}//===== eAthena Script ======================================//= MvP Ladder Game Script//===== By: ===============================================//= by aftermath (1.0)//= by ~AnnieRuru~ (2.0)//===== Current Version: ======================================//= 2.5//===== Compatible With: ===================================== //= eAthena 13405 Trunk//===== Description: ========================================= //= This script warps you to an arena where you have to kill all MvP bosses in//= accending or more like from weakest to strongest. //===== Topic =================================================//= http://www.eathena.ws/board/index.php?showtopic=178049//===== Additional Comments: ================================== //= 1.0 & 1.1 by aftermath//= 2.0 ~by AnnieRuru~ rewrite everything with new MVPs//= 2.1//= ---- now announce rounds//= ---- fix the misleading .totalround variable//= ---- just noticed the original script enabled noteleport mapflag, so I uncommented it//= ---- optimize the script a bit//= ---- the map name is store in a variable now, easier to change the map location//= ---- fix a bug if 2nd player manage to come in the map to ks the 1st player, (eg : guild recall skill for example ) the game will still continue on and zeny still reward to the mvp killer//= ---- fix a bug if the player manage to kill all mvps and didn't turn on @autoloot, he will not collect the loot from final mvp//= ---- eliminate the error show on map-server if the player disconnect while loading the mvp ladder map//= 2.2//= ---- add item reward on complete each round and final round ( idea thx to Qasther )//= ---- added noloot mapflag, commented because some of you like it//= ---- added config delay time//= ---- added config on displaying announcements//= 2.2a//= ---- TODO is done. now whoever wants to change npc location just have to change the npc header. script handle the rest//= 2.3//= ---- move the config to the top of the file, easier to config I think//= ---- zeny reward no longer use for-loop, because I noticed nobody know how to configure zeny reward properly//= ---- eliminate all global variables ... into npc variables. I prefer npc variables//= ---- added entrance fee configuration, can choose between item cost or zeny cost//= ---- added waiting room feature to show the count down timer since the player went in//= ---- added time attack feature to prevent player @at'ing inside the map because 1st round is a passive monster//= ---- added best record to encourage your players beat the best score//= ---- added 2 more checks to prevent 2 players inside the map, except GMs - loadevent with 20 seconds delay//= ---- oh and, move the map from guild_vs2 to guild_vs2-1//= 2.3a//= ---- added GM level configuration to reset the best record//= ---- change the misleading "time left" announcement//= ---- added prize reward if beaten the best record//= ---- fix a typo that nobody can beat the best record ...//= 2.4//= ---- added deny usage ( suggested by llama123 )//= ---- added GM can reset other players deny usage//= ---- change a bit the way it announce minutes and seconds//= ---- FIX a CRITICAL TYPO the script doesn't deduct zeny after register ( wah nobody report this )//= 2.4a//= ---- added an announcement when the player failed to finish the ladder//= ---- gm menu don't have a reset deny option if in the config doesn't has a value set//= 2.5//= ---- int__ function into main script//= ---- GM not suppose to beat player's best record ...//= ---- rewrite waitingroom system//= ---- fix a minor bug if the player already warp out within 10 seconds, now no longer warp again//= ---- added a feature if the player completed within a set amount of time, a bonus item is given//= ---- player will receive a message if the deny usage is reset by a GM//= ---- if account deny usage is equal or more than player's deny usage, player deny usage is deleted to save space//========================================================// Configure Mapflags ------------------------//guild_vs2-1 mapflag nobranchguild_vs2-1 mapflag nomemo//guild_vs2-1 mapflag nopenalty // disable exp loss//guild_vs2-1 mapflag noreturnguild_vs2-1 mapflag nosave SavePointguild_vs2-1 mapflag noteleportguild_vs2-1 mapflag nowarpguild_vs2-1 mapflag nowarpto//guild_vs2-1 mapflag nomobloot // disable monster drop loots,//guild_vs2-1 mapflag nomvploot // 2 of theseguild_vs2-1 mapflag loadeventguild_vs2-1,0,0,0 script ev_Mvp -1,{OnInit:// Configurations -----------------------------------------------------// set entrance fee. Note: Only choose zeny OR item. If item amount if specify, the script will use itemset .entryitemid, 674; // 674 - mithril coinset .entryitemamount, 0; // by default is using zenyset .entryzeny, 100000;// id of each mvp. you can add moresetarray .mvpid[1],1086,// Golden Thief Bug 641115,// Eddga 651150,// Moonlight Flower 671159,// Phreeoni 691112,// Drake 701583,// Tao Gunka 701492,// Incantation Samurai 711046,// Doppelgangger 721252,// Garm 731418,// Evil Snake Lord 731059,// Mistress 741190,// Orc Lord 741087,// Orc Hero 771251,// Knight of Windstorm 771038,// Osiris 781658,// Ygnizem 791272,// Dark Lord 801871,// Fallen Bishop 801039,// Baphomet 811147,// Maya 811785,// Atroce 821389,// Dracula 851630,// Bacsojin 851885,// Gorynych 851623,// RSX 0806 861511,// Amon Ra 881688,// Lady Tanee 891768,// Gloom Under Night 891719,// Datale 901734,// Kiel D-01 901157,// Pharaoh 931373,// Lord of Death 941312,// Turtle General 971779,// Ktullanux 981874,// Beelzebub 98rand(1646,1651),// Lord Knight Seyren 99 || Assassin Cross Eremes 99 || Whitesmith Harword 99 || High Priest Magaleta 99 || Sniper Shecil 99 || High Wizard Katrinn 991708,// Thanatos 991751,// Valkyrie Randgris 991832;// Ifrit 99// total rounds - Default has 39 roundsset .totalround, getarraysize(.mvpid)-1;// set the zeny rewardset .reward[1], 10000;set .reward[2], 20000;set .reward[3], 30000;set .reward[4], 40000;set .reward[5], 50000;set .reward[6], 60000;set .reward[7], 70000;set .reward[8], 80000;set .reward[9], 90000;set .reward[10], 100000;set .reward[11], 110000;set .reward[12], 120000;set .reward[13], 130000;set .reward[14], 140000;set .reward[15], 150000;set .reward[16], 160000;set .reward[17], 170000;set .reward[18], 180000;set .reward[19], 190000;set .reward[20], 200000;set .reward[21], 210000;set .reward[22], 220000;set .reward[23], 230000;set .reward[24], 240000;set .reward[25], 250000;set .reward[26], 260000;set .reward[27], 270000;set .reward[28], 280000;set .reward[29], 290000;set .reward[30], 300000;set .reward[31], 310000;set .reward[32], 320000;set .reward[33], 330000;set .reward[34], 340000;set .reward[35], 350000;set .reward[36], 360000;set .reward[37], 370000;set .reward[38], 380000;set .reward[39], 390000;// Time attack. The player has to beat all MVPs within # minutes. When the time is up, will warp to respawn point. Do Not set this as 0set .timeout, 60;// set item reward on completing each round. STACK with zeny rewardset .itemid, 608; // 608 - Yggdrasil Seedset .itemamount, 0;// item reward on completion whole ladderset .lastitemid, 607; // 607 - Yggdrasil Berryset .lastitemamount, 10;// item reward when beaten the best recordset .topitemid, 607;set .topitemamount, 10;set .gmnotop, 20; // GM not suppose to beat player's record ...// If the player completed the ladder within this amount of time in minutes, they will get extra items for trying their bestset .hightime, 45; // if complete within 45 minutes, the reward is givenset .highitemid, 607;set .highitemamount, 10;// time delay for next round, in seconds. Default is 3set .delay, 5;// set respawn point after finished the mvp ladder gameset .respawnmap$, "SavePoint";set .respawnx, 0;set .respawny, 0;// set this to disallow player use the room for # MINUTES after registering, prevent same player go in again and againset .usagedeny_player, 3; // deny that character each time registerset .usagedeny_account, 5; // deny whole account each time register// make announcement when player join MVP ladderset .joinann, 2; // 0 - disable announcement, 1- announce to server, 2- announce to town where mvp ladder warper located// make announcement when player finished MVP ladderset .quitann, 2; // 0 - disable announcement, 1- announce to server, 2- announce to town where mvp ladder warper located// minimum GM level in your server consider as Support GM, to allow these GMs get into this map// in the case player complain this script bug again ...// please tell them to use @jumpto or @warpset .mingmlvl, 20;// minimum gm level can reset the deny usage, to allow that player can play this game for 1 more time without waiting// this setting also allow the GM himself can play this ladder without the deny usageset .gmcandeny, 70;// minimum gm level can reset the best record.set .gmlvlreset, 99;// Config Ends --------------------------------------------------------------getmapxy .eventmap$, .@x, .@y, 1;if( .joinann < 0 || .joinann > 2)set .joinann, 0;set .usagedeny_player, .usagedeny_player*60;set .usagedeny_account, .usagedeny_account*60;if( .usagedeny_account >= .usagedeny_player)set .usagedeny_player, 0;if( .gmnotop==0)set .gmnotop, 20;mapannounce .eventmap$, "Admin has refresh the server, please register again. Sorry for inconvenience.", 1;mapwarp .eventmap$, "prontera", 156, 191;end;OnEvent:set .round, 0;killmonsterall .eventmap$;announce"You have "+ .timeout+" minutes to complete total "+ .totalround+" Rounds.", 1;OnMvpDead:set .round, .round+1;if( .round >=2){if( .reward[.round-1]){messagestrcharinfo(0), "You have rewarded "+callfunc("int__", .reward[.round-1])+" zeny.";set zeny, zeny + .reward[.round-1];}if( .itemamount&& .round!= .totalround+1)getitem .itemid, .itemamount;}if( .round== .totalround+1){announce"Amazing ... You able to beat all the MVPs !", 1;getitem .lastitemid, .lastitemamount;set .@timeused, .timeout*60- .remaintime;if( .highitemamount&& .@timeused < .hightime*60){announce"A bonus item has rewarded for completion within "+ .hightime+" minutes.", 1;getitem .highitemid, .highitemamount;}if(( $mvplads_time ==0 || .@timeused < $mvplads_time )&&getgmlevel() < .gmnotop){announce"And you beat the RECORD !!! [ "+( .@timeused /60)+" min "+( .@timeused %60)+" sec ]", 1;getitem .topitemid, .topitemamount;set $mvplads_name$, strcharinfo(0);set $mvplads_time, .@timeused;}elseannounce"Time used [ "+( .@timeused /60)+" min "+( .@timeused %60)+" sec ]", 1;sleep210000;if(!playerattached())end;getmapxy .@map$, .@x, .@y, 0;if( .@map$ == .eventmap$ )warp .respawnmap$, .respawnx, .respawny;if( .quitann==1)announcestrcharinfo(0)+" has finished the MvP ladder !", 0;elseif( .quitann==2)mapannounce .npcmap$, strcharinfo(0)+" has finished the MvP ladder !", 0;end;}elseif( .round== .totalround)announce"Final Round will begin in "+ .delay+" sec.", 1;elseannounce"Round "+ .round+" will begin in "+ .delay+" sec.", 1;sleep .delay*1000;if( .mvpid[.round] >=1646&& .mvpid[.round] <=1651)monster .eventmap$,0,0,"--ja--",rand(1646,1651),1,"ev_Mvp::OnMvpDead";elsemonster .eventmap$,0,0,"--ja--",.mvpid[.round],1,"ev_Mvp::OnMvpDead";end;}prontera,164,171,3 script MvP Ladder Warper 56,{mes"[^FF0000MvP Ladder Warper^000000]";mes"Welcome to MvP ladder game.";mes"In this game, you have to kill every single MvP monster in accending order, starting from weakest to the strongest.";mes"Everytime you beaten a MVP, you will reward with zeny.";if(getvariableofnpc(.lastitemamount,"ev_Mvp"))mes"If you can finish the MVP ladder, you will earn "+getvariableofnpc(.lastitemamount,"ev_Mvp")+" "+getitemname(getvariableofnpc(.lastitemid,"ev_Mvp"))+".";if(getvariableofnpc(.entryitemamount,"ev_Mvp"))mes"But the entrance fee is "+getvariableofnpc(.entryitemamount,"ev_Mvp")+" "+getitemname(getvariableofnpc(.entryitemid,"ev_Mvp"))+".";elseif(getvariableofnpc(.entryzeny,"ev_Mvp"))mes"But the entrance fee is "+callfunc("int__", getvariableofnpc(.entryzeny,"ev_Mvp"))+" zeny";next;mes"[^FF0000MvP Ladder Warper^000000]";mes"So... do you want to play the game?";next;if(select("Yes, lets get it on.","Show me the best record.","No.",(getgmlevel() >=getvariableofnpc(.gmcandeny,"ev_Mvp")&&(getvariableofnpc(.usagedeny_player,"ev_Mvp") || getvariableofnpc(.usagedeny_account,"ev_Mvp")))?"Reset a player deny usage":"")==3){mes"[^FF0000MvP Ladder Warper^000000]";mes"When you are strong enough to complete the game, please come back.";close;}elseif( @menu==2){mes"[^FF0000MvP Ladder Warper^000000]";if( $mvplads_time ==0){mes"Nobody finish this game before.";close;}else{mes"The best record is";mes"[ "+( $mvplads_time /60)+" min "+( $mvplads_time %60)+" sec ]";mes"By the player ^0000FF"+ $mvplads_name$ +"^000000.";if(getgmlevel() < getvariableofnpc(.gmlvlreset,"ev_Mvp"))close;next;if(select("Close.", "Reset it.")==1)close;if(select("Nevermind.", "I really want to reset it.")==1)close;mes"[^FF0000MvP Ladder Warper^000000]";mes"Record reset successfully.";set $mvplads_name$, "";set $mvplads_time, 0;close;}}elseif( @menu==4){if(getgmlevel() < getvariableofnpc(.gmcandeny,"ev_Mvp"))end;mes"[^FF0000MvP Ladder Warper^000000]";mes"Enter the player name";next;input .@name$;set .@aid, getcharid(3, .@name$);mes"[^FF0000MvP Ladder Warper^000000]";if( .@aid ==0){mes"That player is not online or not exist.";close;}set .@origin, getcharid(3);attachrid .@aid;set mvplads_deny, 0;set #mvplads_deny, 0;messagestrcharinfo(0), "GM has allow you to play MVP Ladder right now.";attachrid .@origin;mesrid2name(.@aid)+" can play this game now.";close;}if(gettimetick(2) < mvplads_deny +getvariableofnpc(.usagedeny_player,"ev_Mvp")){mes"[^FF0000MvP Ladder Warper^000000]";mes"I'm sorry, please wait for another";set .@left, mvplads_deny +getvariableofnpc(.usagedeny_player,"ev_Mvp")-gettimetick(2);set .@day, .@left /(24*60*60);set .@hour, .@left %(24*60*60)/(60*60);set .@min, .@left %(24*60*60)%(60*60)/(60);set .@sec, .@left %(24*60*60)%(60*60)%(60);mes((.@day)?(.@day+" day "):"")+((.@hour||.@day)?(.@hour +" hour "):"")+((.@min||.@hour||.@day)?(.@min +" min "):"")+ .@sec +" sec";mes"for you to play again.";close;}elseif(gettimetick(2) < #mvplads_deny +getvariableofnpc(.usagedeny_account,"ev_Mvp")){mes"[^FF0000MvP Ladder Warper^000000]";mes"I'm sorry, please wait for another";set .@left, #mvplads_deny +getvariableofnpc(.usagedeny_account,"ev_Mvp")-gettimetick(2);set .@day, .@left /(24*60*60);set .@hour, .@left %(24*60*60)/(60*60);set .@min, .@left %(24*60*60)%(60*60)/(60);set .@sec, .@left %(24*60*60)%(60*60)%(60);mes((.@day)?(.@day+" day "):"")+((.@hour||.@day)?(.@hour +" hour "):"")+((.@min||.@hour||.@day)?(.@min +" min "):"")+ .@sec +" sec.";mes"for your account to play again.";close;}elseif(countitem(getvariableofnpc(.entryitemid,"ev_Mvp")) < getvariableofnpc(.entryitemamount,"ev_Mvp")){mes"[^FF0000MvP Ladder Warper^000000]";mes"You don't have enough "+getitemname(getvariableofnpc(.entryitemid,"ev_Mvp"))+", please come back when you do.";close;}elseif(getvariableofnpc(.entryitemamount,"ev_Mvp")==0&& zeny < getvariableofnpc(.entryzeny,"ev_Mvp")){mes"[^FF0000MvP Ladder Warper^000000]";mes"You don't have enough zeny, please come back when you do.";close;}elseif( .inuse || getmapusers(getvariableofnpc(.eventmap$,"ev_Mvp")) >=1){mes"[^FF0000MvP Ladder Warper^000000]";mes"I'm sorry but a player is currently playing the game. Please standby until the player finishes the game or gets killed.";mes"Thank You.";close;}if(getvariableofnpc(.joinann,"ev_Mvp"))announcestrcharinfo(0)+" has started the MvP ladder game.",(getvariableofnpc(.joinann,"ev_Mvp")-1);if(getgmlevel() < getvariableofnpc(.gmcandeny,"ev_Mvp")&&getvariableofnpc(.usagedeny_player,"ev_Mvp"))set mvplads_deny, gettimetick(2);if(getgmlevel() < getvariableofnpc(.gmcandeny,"ev_Mvp")&&getvariableofnpc(.usagedeny_account,"ev_Mvp"))set #mvplads_deny, gettimetick(2);percentheal100,100;warpgetvariableofnpc( .eventmap$, "ev_Mvp"), 0, 0;set .inuse, 1;set .inuseid, getcharid(3);set .inusename$, strcharinfo(0);if(getvariableofnpc(.entryitemamount,"ev_Mvp"))delitemgetvariableofnpc(.entryitemid,"ev_Mvp"), getvariableofnpc(.entryitemamount,"ev_Mvp");elseset zeny, zeny -getvariableofnpc(.entryzeny,"ev_Mvp");initnpctimer;doevent"ev_Mvp::OnEvent";end;OnTimer20:setgetvariableofnpc(.starttime,"ev_Mvp"), gettimetick(2);do{setgetvariableofnpc(.remaintime,"ev_Mvp"), getvariableofnpc(.timeout,"ev_Mvp")*60+getvariableofnpc(.starttime,"ev_Mvp")-gettimetick(2);set .@hour, getvariableofnpc(.remaintime,"ev_Mvp")/3600 ;set .@min, getvariableofnpc(.remaintime,"ev_Mvp")%3600/60 ;set .@sec, getvariableofnpc(.remaintime,"ev_Mvp")%3600%60 ;delwaitingroomstrnpcinfo(0);waitingroom"Time Left = "+(( .@hour )?( .@hour +":"):"")+(( .@min < 10)?"0"+ .@min: .@min )+":"+(( .@sec < 10)?"0"+ .@sec: .@sec ), 0;if(getmapusers(getvariableofnpc(.eventmap$,"ev_Mvp"))==0&& .inuse==0)break;elseif( .@sec ){switch( .@min ){case30:case20:case10:case5:case3:case2:case1:mapannouncegetvariableofnpc(.eventmap$,"ev_Mvp"), "You have "+ .@min +" min left to complete MVP ladder game.", 0;default:}}sleep995;}while(getvariableofnpc(.remaintime,"ev_Mvp") > 1);if(getvariableofnpc(.round,"ev_Mvp")!=getvariableofnpc(.totalround,"ev_Mvp")+1){killmonsterallgetvariableofnpc(.eventmap$,"ev_Mvp");mapannouncegetvariableofnpc(.eventmap$,"ev_Mvp"), "You failed to kill all MVPs in time.", 0;if(getvariableofnpc(.quitann,"ev_Mvp")==1)announce .inusename$ +" failed to finish the MvP ladder !", 0;elseif(getvariableofnpc(.quitann,"ev_Mvp")==2)mapannouncegetvariableofnpc(.npcmap$,"ev_Mvp"), .inusename$ +" failed to finish the MvP ladder !", 0;if(attachrid(.inuseid)){getmapxy .@map$, .@x, .@y, 0;if( .@map$ ==getvariableofnpc(.eventmap$,"ev_Mvp"))warpgetvariableofnpc(.respawnmap$,"ev_Mvp"), getvariableofnpc(.respawnx,"ev_Mvp"), getvariableofnpc(.respawny,"ev_Mvp");}}setgetvariableofnpc(.remaintime,"ev_Mvp"), 0;delwaitingroomstrnpcinfo(0);end;OnTimer20000:set .inuse, 0;end;OnInit:sleep1;getmapxy .@map$, .@x, .@y, 1;setgetvariableofnpc(.npcmap$,"ev_Mvp"), .@map$;end;OnPCLoadMapEvent:sleep21;getmapxy .@map$, .@x, .@y, 0;if( .@map$ !=getvariableofnpc(.eventmap$,"ev_Mvp"))end;if(getcharid(3)== .inuseid || getgmlevel() >=getvariableofnpc(.mingmlvl,"ev_Mvp"))end;warpgetvariableofnpc(.respawnmap$,"ev_Mvp"), getvariableofnpc(.respawnx,"ev_Mvp"), getvariableofnpc(.respawny,"ev_Mvp");announce"You are forbidden to enter MVP ladder game without registration.", 3, 0xFF0000;end;}