Jump to content

celeron0134

Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by celeron0134

  1. Thankyou so much for helping me .. thank you thankyou @Yumi Haruka [SOLVED] (i dont know if this is against the rules.. [sorry for not reading it all]) can i tag you on my other script request? which involves a NPC that will drop an item every X minutes if a player is nearby? ( For PVP purposes and Defending the spot) "with a waiting room countdown" -- if this is against the rules .. i am so sorry
  2. thankyou so much ill try this later .. it will be a huge help jawaii,204,287,3 script Yumi Test 94,{ for(.@i=0;.@i<getarraysize(.Require);.@i++) .@menu$ += (countitem(.Require[.@i]) ? "- Exchange ^0055FF"+.ReqAmount[.@i]+"^000000 "+getitemname(.Require[.@i])+" to "+getitemname(.Exchange[.@i])+":":":"); .@sel = select(.@menu$)-1; message strcharinfo(0),"Input amount 1-1000"; input .@in,1,1000; if(countitem(.Require[.@sel]) < .ReqAmount[.@sel]*.@in){ message strcharinfo(0),"Insufficient "+getitemname(.Require[.@sel])+""; end; } if(!checkweight(.Exchange[.@sel],.@in)){ message strcharinfo(0),"Insufficient inventory space"; end; } delitem .Require[.@sel],.ReqAmount[.@sel]*.@in; getitem .Exchange[.@sel],.@in; end; OnInit: setarray .Require[0],1232,1242,13001,1234,1236,13047 ,1238 ,1241,1233,13002 ,1235 ,1230; setarray .ReqAmount[0],1,1,1,1,1,1 ,5 ,10,10,10 ,30 ,50; setarray .Exchange[0],7929,7929,7929,7929,7929,7929,7929,7929,7929,7929,7929,7929; end; } @Haruka Mayumitried it.. however i am confused a little bit.. i was trying to exchange itemID 1230 for 50 pcs 7929 , it requires me 50 1230 for 1 7929 ( the concept is an NPC that buys items from players ) Worked !! .. there's just a bug .. when you're on the @input state.. when you typed 0 .. it still gets the item and exchange it.. normaly you should enter 1 ..
  3. thanks so much for the reply.. this is the script i've been working on prontera,155,185,4 script Weapon Exchanger 4_BOARD3,{ setarray .@item, 5125,2116,2521,1148,2250,2355,2324; setarray .@amount, 5,1,3; setarray .@exchange, 7915,675; setarray .@item1, 2244,2245,2248,2282,2254,2255,1559,2527,5045,5017,1162,5008,2317,1158,1466,2249,1124,1128,1477,2288,1236,1256,2507,2319,2274; .@menu = select( //bronze (countitem(.@item[0])?"- "+getitemname(.@item[0])+" = "+.@amount[0]+" "+getitemname(.@exchange[0])+" ":""), (countitem(.@item[1])?"- "+getitemname(.@item[1])+" = "+.@amount[0]+" "+getitemname(.@exchange[0])+" ":""), (countitem(.@item[2])?"- "+getitemname(.@item[2])+" = "+.@amount[0]+" "+getitemname(.@exchange[0])+" ":""), (countitem(.@item[3])?"- "+getitemname(.@item[3])+" = "+.@amount[0]+" "+getitemname(.@exchange[0])+" ":""), (countitem(.@item[4])?"- "+getitemname(.@item[4])+" = "+.@amount[0]+" "+getitemname(.@exchange[0])+" ":""), (countitem(.@item[5])?"- "+getitemname(.@item[5])+" = "+.@amount[0]+" "+getitemname(.@exchange[0])+" ":""), //Silver (countitem(.@item1[0])?"- "+getitemname(.@item1[0])+" = "+.@amount[1]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[1])?"- "+getitemname(.@item1[1])+" = "+.@amount[1]+" "+getitemname(.@exchange[1])+" ":""), //3 silver (countitem(.@item1[2])?"- "+getitemname(.@item1[2])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[3])?"- "+getitemname(.@item1[3])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[4])?"- "+getitemname(.@item1[4])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[5])?"- "+getitemname(.@item1[5])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[6])?"- "+getitemname(.@item1[6])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[7])?"- "+getitemname(.@item1[7])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[8])?"- "+getitemname(.@item1[8])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[9])?"- "+getitemname(.@item1[9])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[10])?"- "+getitemname(.@item1[10])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[11])?"- "+getitemname(.@item1[11])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[12])?"- "+getitemname(.@item1[12])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[13])?"- "+getitemname(.@item1[13])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[14])?"- "+getitemname(.@item1[14])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[15])?"- "+getitemname(.@item1[15])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[16])?"- "+getitemname(.@item1[16])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[17])?"- "+getitemname(.@item1[17])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[18])?"- "+getitemname(.@item1[18])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[19])?"- "+getitemname(.@item1[19])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[20])?"- "+getitemname(.@item1[20])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[21])?"- "+getitemname(.@item1[21])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[22])?"- "+getitemname(.@item1[22])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[23])?"- "+getitemname(.@item1[23])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[24])?"- "+getitemname(.@item1[24])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[25])?"- "+getitemname(.@item1[25])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[26])?"- "+getitemname(.@item1[26])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[27])?"- "+getitemname(.@item1[27])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), (countitem(.@item1[28])?"- "+getitemname(.@item1[28])+" = "+.@amount[2]+" "+getitemname(.@exchange[1])+" ":""), "- Nothing" ); switch(.@menu) { case 1: input @amount,0,1000; set .choice, 0; delitem .@item[0],@amount; getitem .@exchange[0],.@amount[.choice]*@amount; break; case 2: input @amount,0,1000; set .choice, 1; delitem .@item[1],@amount; getitem .@exchange[0],.@amount[.choice]*@amount; break; case 3: input @amount,0,1000; set .choice, 2; delitem .@item[2],@amount; getitem .@exchange[0],.@amount[.choice]*@amount; break; case 4: input @amount,0,1000; set .choice, 3; delitem .@item[3],@amount; getitem .@exchange[0],.@amount[.choice]*@amount; break; case 5: input @amount,0,1000; set .choice, 4; delitem .@item[4],@amount; getitem .@exchange[0],.@amount[.choice]*@amount; break; case 6: input @amount,0,1000; set .choice, 5; delitem .@item[5],@amount; getitem .@exchange[0],.@amount[.choice]*@amount; break; //Silver case 7: input @amount,0,1000; set .choice, 0; delitem .@item1[0],@amount; getitem .@exchange[1],.@amount[1]*@amount; break; case 8: input @amount,0,1000; set .choice, 1; delitem .@item1[1],@amount; getitem .@exchange[1],.@amount[1]*@amount; break; case 9: input @amount,0,1000; set .choice, 2; delitem .@item1[2],@amount; getitem .@exchange[1],.@amount[1]*@amount; break; case 10: input @amount,0,1000; set .choice, 3; delitem .@item1[3],@amount; getitem .@exchange[1],.@amount[1]*@amount; break; //3 silver case 11: input @amount,0,1000; set .choice, 4; delitem .@item1[4],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 12: input @amount,0,1000; set .choice, 5; delitem .@item1[5],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 13: input @amount,0,1000; set .choice, 6; delitem .@item1[6],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 14: input @amount,0,1000; set .choice, 7; delitem .@item1[7],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 15: input @amount,0,1000; set .choice, 8; delitem .@item1[8],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 16: input @amount,0,1000; set .choice, 9; delitem .@item1[9],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 17: input @amount,0,1000; set .choice, 10; delitem .@item1[10],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 18: input @amount,0,1000; set .choice, 11; delitem .@item1[11],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 19: input @amount,0,1000; set .choice, 12; delitem .@item1[12],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 20: input @amount,0,1000; set .choice, 13; delitem .@item1[13],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 21: input @amount,0,1000; set .choice, 14; delitem .@item1[14],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 22: input @amount,0,1000; set .choice, 15; delitem .@item1[15],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 23: input @amount,0,1000; set .choice, 16; delitem .@item1[16],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 24: input @amount,0,1000; set .choice, 17; delitem .@item1[17],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 25: input @amount,0,1000; set .choice, 18; delitem .@item1[18],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 26: input @amount,0,1000; set .choice, 19; delitem .@item1[19],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 27: input @amount,0,1000; set .choice, 20; delitem .@item1[20],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 28: input @amount,0,1000; set .choice, 21; delitem .@item1[21],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 29: input @amount,0,1000; set .choice, 22; delitem .@item1[22],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 30: input @amount,0,1000; set .choice, 23; delitem .@item1[23],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 31: input @amount,0,1000; set .choice, 24; delitem .@item1[24],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 32: input @amount,0,1000; set .choice, 25; delitem .@item1[25],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 33: input @amount,0,1000; set .choice, 26; delitem .@item1[26],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 34: input @amount,0,1000; set .choice, 27; delitem .@item1[27],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 35: input @amount,0,1000; set .choice, 28; delitem .@item1[28],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 36: input @amount,0,1000; set .choice, 29; delitem .@item1[29],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 37: input @amount,0,1000; set .choice, 30; delitem .@item1[30],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; case 38: input @amount,0,1000; set .choice, 31; delitem .@item1[31],@amount; getitem .@exchange[1],.@amount[2]*@amount; break; default: mes "[ Exchanger ]"; mes "There's nothing i can do for you."; mes " "; mes "Please come back to me later!"; break; } end; } id like to want it simpler .. so i wont get confused adding cases.. as you see im on only case 38; and it's too long already.. scrolling up and down to check if it works breaks my eyes like maybe setarray .@case, 1,2,3,4,5,6,7,8,9,10 each case will delete a specified item and get an specified item example.. 1 red potion = 1 flywing , but 1 orange potion will get 2 dead branches
  4. hii how can i shorten or make an array of cases so it example i have case 1: up to case 300: and so on thankyou in advance switch(.@menu) { case 1:
  5. got an error.. pasted your script on npc/custom/quests/Compendium.c am i doing it right? why does it says needs ';'?
  6. countdown from 5minutes - 0 - 5:00 ,4:59 - 0:00 tapos mag drodrop sya ng item sa floor , tapos disabled sya from 12midnight to 6am in the morning
  7. Also this will be disabled on midnight and will be resumed on 7am in the morning kindly help me pleaseeeee thanks bump please
  8. Hello good day .. i need an NPC that when your are near the NPC like 2 cells away from the NPC.. a timer (waiting room) will count down for 60 secs and if you run away from that NPC.. the timer will stop ( but it will not reset ).. so if you go again near the NPC the count down will resume after 60 secs.. an item will drop and repeats the 60 sec count down , while you are near the NPC you'll get a random buffs or Debuffs . every 5 secs example , gloria or reverse orchish,, blessing or curse, for the walk away and going back.. any player can resume the count down
  9. finally !!! one of the best scripters replied.. thankyou so much.. ill try this out
  10. sorry. i tried monster .maps$,0,0,"--ja--",.mobId,1,"ANY_MAP_SPAWNER::OnMyMobDead"; it still summons at random
  11. managed to work this by adding input @amount,0,100; the problem now is how will i make for example i input 101 or more.. how will i add a message saying that you can't exchange more than 100 at once
  12. kindly help me on adding amount i want to exchange.. example if i have 100 501.. and id like to exchange all 100 at once .. so i dont have to click the NPC 100times thanks
  13. How can i make this to summon .mobID on all maps in .maps$ , not randomly.. but it will summon on every map all at once
  14. Hello @Patskie thank you for your reply.. i will try it now @Patskie thankyou it worked.. so meaning # sign is for account okay thanks again
  15. new_1-3,85,167,4 script asdfg 1162,{ if (!isequipped(5009)) { mes "Please use Safety Helmet[0] Before Talk."; close; } if( gettimetick(2) < wait_time ) { mes "You can only receive rewards once every 4hours."; close; } progressbar "ffff00",10; getitem 7179, 1; set wait_time, gettimetick(2) + ( 3600 * 4 ); mes "Here are your Rewards"; mes "Come Back Again After 4 hours"; close; } } the problem is i can just character select and pick another character and get the rewards id like to have this once per account for every 4hours thankyou
  16. bump ~~ tried using @AnnieRuru bg_round.txt by setting the minplayerstart to 1( for 1v1) but id still love to have it as a queue where you'll just type @1v1 to join queue and youl randomly select a enemy to 1v1 with..
  17. bindatcmd - @watch = warp quiz_01 140 274 bindatcmd - @1v1 = you will be on a queue, it will do a 30sec waiting time for picking a random enemy that's on the queue Buffer = quiz_01 125 285 and quiz_01 155 285 ( Agi,Bless only) Walls @ quiz_01 138 287 - 138 286 - 138 285 - 138 284 - 138 283 142 287 - 142 286 - 142 285 - 142 284 - 142 283 when the script picked a player from a queue you two will be warped on quiz_01 149 285 or quiz_01 130 285 but never warp on the same coordinates as your enemy Announce: Player1 Vs Player2 will begin in 30secs use @watch to see them in action After 25 secs Announce: Player1 Vs Player2 will begin in 5 Announce: Player1 Vs Player2 will begin in 4 Announce: Player1 Vs Player2 will begin in 3 Announce: Player1 Vs Player2 will begin in 2 Announce: Player1 Vs Player2 will begin in 1 Announce: Player1 Vs Player2 FIGHT!! Disable Buffer, And wall killing a player will get 1v1Points + 1 when a player kills a player, warp the dead player on quiz_01 140 272 After 5 secs warp the winning player on quiz_01 140 272 then do a 30sec count for the next players on the queue to be warped and fight again and a 1v1 Shop for this using 1v1Points
  18. Good day rathena .. why is that some players are having FPS drops.. or they are lagging specially on WOE where there are atleast 3 guilds.. you can't even walk.. some says its the client.. i have a 2018 client .. should i downgrade to 2015 client for this issue?
  19. Hello some of my players are having errors on meteor storm,quagmire,storm gust LOV dispel effects homunculus errors But other players don't have this error.. they are using the same installers I don't have the ss of the errors.. can you still help me?
  20. is there a way to see characters on the same map with the same ip? use: for detecting bots on the map.. where i can see names lang farm1,farm2,farm3,farm4,farm5 all rogues with same ip.. so i could make fun on them and warp them on dif places or just ban them
  21. - script KoE -1,{ OnInit: disablenpc "The King#KoE"; disablenpc "Exit#KoE"; bindatcmd "koe", strnpcinfo(0)+"::Oncommand", 99,99; end; Oncommand: if ( compare( .@atcmd_parameters$, "on" ) ) goto L_start; else if ( compare( .@atcmd_parameters$, "off" ) ) goto L_end; else { dispbottom "type - '@koe on' to start the event"; dispbottom "type - '@koe off' to end the event"; } end; L_start: gvgon "guild_vs1"; announce "The King of Emperium Hill has begun!", bc_all; .start = 1; enablenpc "The King#KoE"; disablenpc "Exit#KoE"; $koegid = 0; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 7; monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead"; end; L_end: gvgoff "guild_vs1"; announce "The King of Emperium Hill is over!", bc_all; .start = 0; enablenpc "Exit#KoE"; disablenpc "The King#KoE"; killmonsterall "guild_vs1"; // maprespawnguildid "guild_vs1", $koegid, 6; end; OnEmpDead: $koegid = getcharid(2); announce "The current King of Emperium Hill is the ["+ strcharinfo(2) +"] guild.", bc_all; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 6; sleep 500; if ( .start ) monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead"; end; } // KoE Entrance prontera,155,191,4 script The King#KoE 58,{ mes "[The King]"; if ( !getcharid(2) ) { mes "You must have a guild to participate in the ^FF0000King of Emperium Hill Tournament^000000."; close; } mes "Hello."; mes "Would you like to participate in the ^FF0000King of Emperium Hill Tournament^000000?"; if ( select ( "Yes", "No" ) == 2 ) close; switch( rand(1,4) ){ case 1: warp "guild_vs1", 50, 88; end; case 2: warp "guild_vs1", 88, 50; end; case 3: warp "guild_vs1", 50, 11; end; case 4: warp "guild_vs1", 11, 50; end; } } // KoE Exit guild_vs1,49,56,5 script Exit#KoE 51,{ mes "[Exit]"; mes "See ya."; if ( getcharid(2) == $koegid ) getitem 501, 1; // configure prize here close2; warp "Save",0,0; end; } // Flags guild_vs1,49,38,4 script King of Emperium Hill#1::koe_flag 722,{ if ( !$koegid ) end; mes "[King of Emperium Hill]"; mes "The Current King of Emperium Hill is the ["+ getguildname($koegid) +"] guild."; close; OnRevKoE: flagemblem $koegid; end; } guild_vs1,61,49,6 duplicate(koe_flag) King of Emperium Hill#2 722 guild_vs1,38,49,2 duplicate(koe_flag) King of Emperium Hill#3 722 guild_vs1,49,61,0 duplicate(koe_flag) King of Emperium Hill#4 722 guild_vs1 mapflag nobranch guild_vs1 mapflag nomemo guild_vs1 mapflag nopenalty guild_vs1 mapflag noreturn guild_vs1 mapflag nosave SavePoint guild_vs1 mapflag noteleport guild_vs1 mapflag gvg_noparty guild_vs1 mapflag nowarp guild_vs1 mapflag nowarpto guild_vs1 mapflag guildlock guild_vs1 mapflag nogo Just want to add when a player breaks the emp he/she will be rewarded by TCG(7227) and - announce the name of the breaker.. ( King of Emperium Hill has Been conquered by ( the breaker ) of the (guild) [Solved] By UsingSearchEngine
  22. Woe points + 1 for every 5mins inside the active castle Woe points + 5 for the owner of the guild and all guild member that's inside the active castle every 5 mins Woe points + 10 for breaking emp of the active castle Woe shop - woe points
  23. @BeWan tried your free script.. but it does not create tables on the sql idk why.. i tried talking to the NPC.. and killing my dummy account.. but it doesnt show on the ranks
  24. @BeWan tried the reset menu.. it resets on the NPC.. but when you kill a player it will show the old ranks and on the ranking can you make it Kills[10] Deaths[9] something like that
  25. //===== rAthena Script ======================================= //= Dynamic Battleground Arena //===== By =================================================== //= llchrisll //===== Version ============================================== //= 1.0 - Initial Version //===== Tested With ========================================== //= rAthena 06/29/2019 Revision //= GIT Hash: c1975d7ea3729c1f5deec2e0dcf04841c4b96969 //===== Description ========================================== //= This battleground arena can be configured however you like. // You could compare it with an Call of Duty game. // Which consists of Domination, Capture the Flag and so on //= The config is per Game Mode dynamically changeable. //= Using extra Maps so it won't collide with other Battlegrounds // Copied the bat_a01 and bat_b01 map //===== Comments ============================================= //= You need the following file: Battleground_Arena.rar // Inside the GRF you find instructions how to install the maps: // dbg_readme.txt //===== ToDO ================================================= //= Capture the Flag: Change effect for Flag Holder to a better one! //============================================================ - script DBGArena_Core -1,{ OnInit: // BG Modes setarray $@DBG_Mode$[1],"Team Deathmatch","Search & Destroy","Domination","Rush","Capture the Flag"; // BG Maps for each Mode // Note: [0] = is to prevent errors when $@DBG_Status is reseted by Arena Ending mid-way like by a player leaving setarray $@DBG_Map$[0],"dbg_arena","dbg_arena","dbg_arena","dbg_dom","dbg_arena","dbg_arena"; // BG Announce Colors per Mode setarray $@DBG_Anno$[1],"0x8CFFFB","0xA4CC2D","0xEAC2EB","0xB97A56","0xEB1E33"; // BG Announce Type // How will the Announces be displayed to the players: // Recommended Values: // - bc_all: Global // - bc_woe: Displayed as WoE Information, which can be turned off set $@DBG_Anno_T,bc_woe; // BG Team Spawn Coordinates per Mode setarray .team1_x[1],87,87,349,87,87; setarray .team1_y[1],75,75,311,75,75; setarray .team2_x[1],312,312,350,312,312; setarray .team2_y[1],225,225,91,225,225; // Min Players to start an match per Mode setarray .DBG_PlayersMin[1],2,2,2,2,2; // Max Players per Team per Mode setarray .DBG_PlayersMax[1],10,10,20,10,10; // Time Limit until match ends per Mode in minutes setarray .DBG_TLimit[1],10,10,10,10,10; // Max Points to end the match per Mode // Note: Client can only display up to 100 points setarray .DBG_MPTS[1],75,2,100,2,3; // Battleground Join Timer in minutes set .BG_JoinTime,3; // WoE Restriction // 0 = Ignore WoE Status // 1 = When WoE is active, no BG set .DBG_WoE,1; // Battleground Happy Hour // For the actual Happy Hour time look for "OnClock" // 0 = Disable // 1 = Enable set .DBG_HH,1; // Don't touch this value below, to adjust the rate itself go to "OnClock2000:" set .DBG_HH_Rate,1; // Custom Commands bindatcmd "joinbgarena",strnpcinfo(0)+"::OnBGJoin"; bindatcmd "leavebgarena",strnpcinfo(0)+"::OnBGLeave"; bindatcmd "bgarenainfo",strnpcinfo(0)+"::OnBGInfo"; // Custom GM Commands to start or end the BG Arena manually bindatcmd "startbgarena",strnpcinfo(0)+"::OnBGArenaInit",99,99; bindatcmd "endbgarena",strnpcinfo(0)+"::OnBGArenaEnd",99,99; // Load Reward Function function DBG_Reward; end; // Happy Hour Starting Time OnClock2000: if(!.DBG_HH || .DBG_WoE && (agitcheck() || agitcheck2() || agitcheck3())) end; set .DBG_HH_Rate,2; // Happy Hour Rate announce "Battleground Arena: Battleground Happy Hour has started. Rewards will be x"+.DBG_HH_Rate+" for the next hour!",bc_all; end; // Happy Hour Ending Time OnClock2100: if(!.DBG_HH) end; announce "Battleground Arena: Battleground Happy Hour has ended!",bc_all; set .DBG_HH_Rate,1; // Reset to normal reward end; // Starting Battleground Arena OnBGArenaInit: // Check if players are still on the map if(getmapusers("dbg_arena") > 0) mapwarp "dbg_arena","prontera",156,191; if(getmapusers("dbg_dom") > 0) mapwarp "dbg_dom","prontera",156,191; OnBGArenaPrepare: if(.DBG_Match) { donpcevent "DBGArena_Vote::OnBGVoteInit"; set .DBG_Match,0; end; } set $@DBG_T1Score,0; set $@DBG_T2Score,0; donpcevent strnpcinfo(0)+"::OnBGArenaScore"; set .DBG_Prepare,1; set .t,0; // Checking for exisiting battle groups if($@DBG_T1) { set .@bg_t1,bg_get_data($@DBG_T1,1); // Saving Player Amount of Team 1 copyarray .Team1[0],$@arenamembers[0],.@bg_t1; // and copy the Game IDs into the "join" array .Team1 bg_destroy $@DBG_T1; set $@DBG_T1,0; for ( set .@t,0; .@t < getarraysize(.Team1); set .@t,.@t + 1) if(attachrid(.Team1[.@t]) == 1) // Attach the current Game ID for getcharid() setarray .Team1[.@t],getcharid(3); // Overwrite the Game ID with the Account ID } if($@DBG_T2) { set .@bg_t2,bg_get_data($@DBG_T2,1); // Saving Player Amount of Team 2 copyarray .Team2[0],$@arenamembers[0],.@bg_t2; // and copy the Game IDs into the "join" array .Team2 bg_destroy $@DBG_T2; set $@DBG_T2,0; for ( set .@t,0; .@t < getarraysize(.Team2); set .@t,.@t + 1) if(attachrid(.Team2[.@t]) == 1) // Attach the current Game ID for getcharid() setarray .Team2[.@t],getcharid(3); // Overwrite the Game ID with the Account ID } if(!$@DBG_Status) { donpcevent "DBGArena_Vote::OnBGVoteInit"; end; } // Creating BG Group ID's set $@DBG_T1,bg_create($@DBG_Map$[$@DBG_Status],.team1_x[$@DBG_Status],.team1_y[$@DBG_Status],strnpcinfo(0)+"::OnBGLeave",strnpcinfo(0)+"::OnBGArenaDeath"); set $@DBG_T2,bg_create($@DBG_Map$[$@DBG_Status],.team2_x[$@DBG_Status],.team2_y[$@DBG_Status],strnpcinfo(0)+"::OnBGLeave",strnpcinfo(0)+"::OnBGArenaDeath"); sleep 2000; announce "Battleground Arena: You have "+.BG_JoinTime+" Minute"+( (.BG_JoinTime > 1)?"s":"")+" to join by using \"@joinbgarena\" - Mode: "+$@DBG_Mode$[$@DBG_Status],$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; // Check if there are existing players in the queue if(getarraysize(.Team1) > 0 || getarraysize(.Team2) > 0) announce "Battleground Arena: "+$@DBG_Mode$[$@DBG_Status]+" - Team 1: "+getarraysize(.Team1)+"/"+.DBG_PlayersMax[$@DBG_Status]+" : Team 2: "+getarraysize(.Team2)+"/"+.DBG_PlayersMax[$@DBG_Status],$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set .BGJoin,1; sleep (.BG_JoinTime*60*1000); set .BGJoin,0; if( (getarraysize(.Team1) + getarraysize(.Team2) ) < .DBG_PlayersMin[$@DBG_Status]) { announce "Battleground Arena: Time is over! But there are not enough participants to start/continue the match!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; donpcevent strnpcinfo(0)+"::OnBGArenaEnd"; // End the whole Battleground end; } for ( set .@t,0; .@t < getarraysize(.Team1); set .@t,.@t + 1) if(isloggedin(.Team1[.@t])) { if(attachrid(.Team1[.@t]) == 0) continue; bg_join($@DBG_T1); detachrid; } for ( set .@t,0; .@t < getarraysize(.Team2); set .@t,.@t + 1) if(isloggedin(.Team2[.@t])) { if(attachrid(.Team2[.@t]) == 0) continue; bg_join($@DBG_T2); detachrid; } deletearray .Team1[0],getarraysize(.Team1); deletearray .Team2[0],getarraysize(.Team2); set .DBG_Prepare,0; OnBGArenaReset: // Next Round, mostly for S&D and CTF // Warp BG Groups on the field if(.DBG_Reset) { stopnpctimer; bg_warp $@DBG_T1,$@DBG_Map$[$@DBG_Status],.team1_x[$@DBG_Status],.team1_y[$@DBG_Status]; bg_warp $@DBG_T2,$@DBG_Map$[$@DBG_Status],.team2_x[$@DBG_Status],.team2_y[$@DBG_Status]; set .DBG_Reset,0; set .t,0; } set .@bg_pl,bg_get_data($@DBG_T1,1); for ( set .@p,0; .@p < .@bg_pl; set .@p,.@p + 1) { pcblockmove $@arenamembers[.@p],1; // Disable Movement pcblockskill $@arenamembers[.@p],1; // Disable Skills } set .@bg_pl,bg_get_data($@DBG_T2,1); for ( set .@p,0; .@p < .@bg_pl; set .@p,.@p + 1) { pcblockmove $@arenamembers[.@p],1; // Disable Movement pcblockskill $@arenamembers[.@p],1; // Disable Skills } donpcevent "DBG_Init::OnBGPrepare"; end; // Battleground Arena - Match Duration OnBGArenaTimer: set .DBG_Match,1; initnpctimer; end; OnTimer60000: // Every Minute stopnpctimer; set .t,.t + 1; // Increase Minute Counter if(.DBG_Match && .t < .DBG_TLimit[$@DBG_Status]) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+" - Time Limit: "+(.DBG_TLimit[$@DBG_Status] - .t)+" Minute"+ ( ((.DBG_TLimit[$@DBG_Status] - .t) > 1)?"s":"") +" left!",bc_all,$@DBG_Anno$[$@DBG_Status]; initnpctimer; // If an Match is active and timer has been reached } else if(.DBG_Match && .t == .DBG_TLimit[$@DBG_Status]) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The Match is over! Time Limit has been reached!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; if($@DBG_Status != 1 || $@DBG_Status != 3) { // S&D + Rush + CTF has round based matches if($@DBG_Status == 2) // S&D: Declare Team 2 as winner set getvariableofnpc(.SAD_Win,"DBG_Init"),2; else if($@DBG_Status == 4) // Rush: Declare Team 2 as winner set getvariableofnpc(.Rush_Win,"DBG_Init"),2; donpcevent "DBG_Init::OnRoundReset"; } else donpcevent strnpcinfo(0)+"::OnBGMatchEnd"; } else if($@DBG_Status && !.DBG_Prepare) if(getmapusers($@DBG_Map$[$@DBG_Status]) < .DBG_PlayersMin[$@DBG_Status]) donpcevent strnpcinfo(0)+"::OnBGArenaEnd"; end; // Battleground Arena - Death Event OnBGArenaDeath: mapannounce $@DBG_Map$[$@DBG_Status],"["+rid2name(killerrid)+"] has killed ["+strcharinfo(0)+"]!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; switch($@DBG_Status) { default: break; case 1: // TDM if(@DBG_Team == 1) // Killed player is in Team 1, increase Team 2's Score set $@DBG_T2Score,$@DBG_T2Score + 1; else if(@DBG_Team == 2) // Killed player is in Team 2, increase Team 1's Score set $@DBG_T1Score,$@DBG_T1Score + 1; break; case 2: // Search & Destroy if(!@Has_Bomb) end; getmapxy(.@map$,.@bomb_x,.@bomb_y,BL_NPC); movenpc "Bomb#SAD",.@bomb_x,.@bomb_y; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The bomb has been dropped!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set @Has_Bomb,0; enablenpc "Bomb#SAD"; set .@bg_pl,bg_get_data($@DBG_T1,1); copyarray .@bg_ids[getarraysize(.@bg_ids)],$@arenamembers[0],.@bg_pl; set .@bg_pl,bg_get_data($@DBG_T2,1); copyarray .@bg_ids[getarraysize(.@bg_ids)],$@arenamembers[0],.@bg_pl; for ( set .@p,0; .@p < getarraysize(.@bg_ids); set .@p,.@p + 1) if(attachrid(.@bg_ids[.@p])) viewpoint 0,.@bomb_x,.@bomb_y,3,0xFF0000; end; case 4: // Rush if(@DBG_Team == 1) // Player of Team 1 has been killed, decrease Team 1's Life Pool set .Rush_Life,.Rush_Life - 1; else if(@DBG_Team == 2) end; if(!.Rush_Life) { // Team 1's Lifes are 0, Team 2 wins the round mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Team 1 has lost all of their lifes! Team 2 wins this round!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set getvariableofnpc(.Rush_Win,"DBG_Init"),2; donpcevent "DBG_Init::OnRoundReset"; end; } mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Team 2 has "+.Rush_Life+" lifes left!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; break; case 5: // Capture the Flag if(!@Has_Flag) end; getmapxy(.@map$,.@flag_x,.@flag_y,BL_NPC); set .@npc$,"Team "+@Has_Flag+" Flag#"+@Has_Flag; movenpc .@npc$,.@flag_x,.@flag_y; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The Flag of Team "+@DBG_Team+" has been dropped!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set @Has_Flag,0; enablenpc .@npc$; set .@bg_pl,bg_get_data($@DBG_T1,1); copyarray .@bg_ids[getarraysize(.@bg_ids)],$@arenamembers[0],.@bg_pl; set .@bg_pl,bg_get_data($@DBG_T2,1); copyarray .@bg_ids[getarraysize(.@bg_ids)],$@arenamembers[0],.@bg_pl; for ( set .@p,0; .@p < getarraysize(.@bg_ids); set .@p,.@p + 1) if(attachrid(.@bg_ids[.@p])) viewpoint 0,.@flag_x,.@flag_y,3,0xFF0000; end; } donpcevent strnpcinfo(0)+"::OnBGArenaScore"; end; OnBGArenaScore: bg_updatescore $@DBG_Map$[$@DBG_Status],$@DBG_T1Score,$@DBG_T2Score; if($@DBG_T1Score >= .DBG_MPTS[$@DBG_Status] || $@DBG_T2Score >= .DBG_MPTS[$@DBG_Status] || .DBG_End) donpcevent strnpcinfo(0)+"::OnBGMatchEnd"; end; // Match ended = Give rewards OnBGMatchEnd: // .@rew_xxx[X]: Rewards of Winner/Loser // [0] = BGArenaPts // [1] = War Badges // [2] = Valor Badges // [3] = Bravery Badges // Note: If you add more rewards, you have to edit the DBG_Reward function too > .@rew_item[] stopnpctimer; set .t,0; switch($@DBG_Status) { case 0: debugmes "OnBGMatchEnd - $@DBG_Status = 0 > Error"; break; // Shouldn't happen case 1: // TDM setarray .@rew_win[0],10,5,5,5; setarray .@rew_lose[0],5,2,2,2; break; case 2: // Search & Destroy setarray .@rew_win[0],15,8,8,8; setarray .@rew_lose[0],7,4,4,4; break; case 3: // Domination setarray .@rew_win[0],20,10,10,10; setarray .@rew_lose[0],10,8,8,8; break; case 4: // Rush setarray .@rew_win[0],15,8,8,8; setarray .@rew_lose[0],7,4,4,4; break; case 5: // Capture the Flag setarray .@rew_win[0],15,8,8,8; setarray .@rew_lose[0],7,4,4,4; break; } donpcevent "DBG_Init::OnBGDisable"; // Disable NPC's // Decide Winners and reset score if($@DBG_T1Score < $@DBG_T2Score) { DBG_Reward($@DBG_T2,.DBG_HH_Rate,.@rew_win[0],.@rew_win[1],.@rew_win[2],.@rew_win[3]); DBG_Reward($@DBG_T1,.DBG_HH_Rate,.@rew_lose[0],.@rew_lose[1],.@rew_lose[2],.@rew_lose[3]); announce "Battleground Arena: Team 2 has won this match!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; } else if($@DBG_T2Score < $@DBG_T1Score) { DBG_Reward($@DBG_T1,.DBG_HH_Rate,.@rew_win[0],.@rew_win[1],.@rew_win[2],.@rew_win[3]); DBG_Reward($@DBG_T2,.DBG_HH_Rate,.@rew_lose[0],.@rew_lose[1],.@rew_lose[2],.@rew_lose[3]); announce "Battleground Arena: Team 1 has won this match!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; } else { DBG_Reward($@DBG_T1,.DBG_HH_Rate,.@rew_lose[0],.@rew_lose[1],.@rew_lose[2],.@rew_lose[3]); DBG_Reward($@DBG_T2,.DBG_HH_Rate,.@rew_lose[0],.@rew_lose[1],.@rew_lose[2],.@rew_lose[3]); announce "Battleground Arena: It's an draw ! Nobody has won this match!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; } mapwarp $@DBG_Map$[$@DBG_Status],"prontera",156,191; sleep 2500; // Let the players finish warping if(.DBG_End) donpcevent strnpcinfo(0)+"::OnBGArenaEnd"; else donpcevent strnpcinfo(0)+"::OnBGArenaPrepare"; end; // Battleground Arena - Arena ended OnBGArenaEnd: if(!$@DBG_Status || !.DBG_Match) end; donpcevent "DBG_Init::OnBGDisable"; mapwarp $@DBG_Map$[$@DBG_Status],"prontera",156,191; deletearray .Team1[0],getarraysize(.Team1); deletearray .Team2[0],getarraysize(.Team2); if($@DBG_T1) { set .@bg_t,bg_get_data($@DBG_T1,1); // Saving Player Amount of Team 1 bg_destroy $@DBG_T1; set $@DBG_T1,0; for ( set .@t,0; .@t < .@bg_t; set .@t,.@t + 1) if(isloggedin($@arenamembers[.@t]) == 1 && attachrid($@arenamembers[.@t]) == 1) { bg_leave; set @DBG_Team,0; pcblockmove getcharid(3),0; pcblockskill getcharid(3),0; detachrid; } } if($@DBG_T2) { set .@bg_t,bg_get_data($@DBG_T2,1); // Saving Player Amount of Team 2 bg_destroy $@DBG_T2; set $@DBG_T2,0; for ( set .@t,0; .@t < .@bg_t; set .@t,.@t + 1) if(isloggedin($@arenamembers[.@t]) == 1 && attachrid($@arenamembers[.@t]) == 1) { bg_leave; set @DBG_Team,0; pcblockmove getcharid(3),0; pcblockskill getcharid(3),0; detachrid; } } set $@DBG_Status,0; set .DBG_Match,0; set .DBG_Prepare,0; set .DBG_Reset,0; set .DBG_End,0; set .BGJoin,0; announce "[Server]: Battleground Arena has ended! Good luck next time!",$@DBG_Anno_T; end; // Battleground Arena - @joinbgarena command OnBGJoin: if(!.BGJoin) { message strcharinfo(0),"Battleground Arena: Joining the Arena is currently not possible."; end; } if(@DBG_Team) { message strcharinfo(0),"Battleground Arena: You are already registered for the Arena."; end; } if(getarraysize(.Team1) <= getarraysize(.Team2) && getarraysize(.Team1) < .DBG_PlayersMax[$@DBG_Status]) { setarray .Team1[getarraysize(.Team1)],getcharid(3); set @DBG_Team,1; } else if(getarraysize(.Team2) <= getarraysize(.Team1) && getarraysize(.Team2) < .DBG_PlayersMax[$@DBG_Status]) { setarray .Team2[getarraysize(.Team2)],getcharid(3); set @DBG_Team,2; } else { message strcharinfo(0),"Battleground Arena: I'm sorry, but every Team is full already. Please try again later."; end; } announce "Battleground Arena: "+$@DBG_Mode$[$@DBG_Status]+" - Team 1: "+getarraysize(.Team1)+"/"+.DBG_PlayersMax[$@DBG_Status]+" : Team 2: "+getarraysize(.Team2)+"/"+.DBG_PlayersMax[$@DBG_Status],$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; end; // Battleground Arena - @leavebgarena command & Quit Event OnBGLeave: if(!$@DBG_Status || !@DBG_Team) { message strcharinfo(0),"Battleground Arena: From what are you running away? You didn't register yet!"; end; } if(.BGJoin) { if(@DBG_Team == 1) for ( set .@c,0; .@c < getarraysize(.Team1); set .@c,.@c + 1) if(getcharid(3) == .Team1[.@c]) deletearray .Team1[.@c],1; else if(@DBG_Team == 2) for ( set .@c,0; .@c < getarraysize(.Team1); set .@c,.@c + 1) if(getcharid(3) == .Team1[.@c]) deletearray .Team1[.@c],1; } else if(.DBG_Match) { bg_leave; warp "prontera",156,191; pcblockmove getcharid(3),0; pcblockskill getcharid(3),0; if(getmapusers($@DBG_Map$[$@DBG_Status]) < .DBG_PlayersMin[$@DBG_Status]) { announce "Battleground Arena: There are not enough participants to continue the match.",$@DBG_Anno_T; set .DBG_End,1; donpcevent strnpcinfo(0)+"::OnBGArenaScore"; } } set @DBG_Team,0; announce "Battleground Arena: ["+strcharinfo(0)+"] has left the battlefield!",$@DBG_Anno_T; end; // Battleground Arena - @bgarenainfo command OnBGInfo: if(!$@DBG_Status) message strcharinfo(0),"Battleground Arena: Inactive"; else { message strcharinfo(0),"Battleground Arena: "+$@DBG_Mode$[$@DBG_Status]+" - "+$@DBG_T1Score+" : "+$@DBG_T2Score; if(.DBG_Match) message strcharinfo(0),"Battleground Arena: Time Limit - "+(.DBG_TLimit[$@DBG_Status] - .t)+" Minute"+ ( ((.DBG_TLimit[$@DBG_Status] - .t) > 1)?"s":"")+" until the Match ends."; else if(.BGJoin) message strcharinfo(0),"Battleground Arena: It's currently possible to join the battlefield!"; } end; // Battleground Arena - Unblock players and put markers on minimap OnBGPlayerBlock: set .@bg_pl,bg_get_data($@DBG_T1,1); copyarray .@bg_ids[getarraysize(.@bg_ids)],$@arenamembers[0],.@bg_pl; set .@bg_pl,bg_get_data($@DBG_T2,1); copyarray .@bg_ids[getarraysize(.@bg_ids)],$@arenamembers[0],.@bg_pl; for ( set .@p,0; .@p < getarraysize(.@bg_ids); set .@p,.@p + 1) if(attachrid(.@bg_ids[.@p])) { pcblockmove getcharid(3),0; // Enable Movement pcblockskill getcharid(3),0; // Enable Skills if($@DBG_Status == 2) { // S&D getmapxy(.@map_a$,.@targeta_x,.@targeta_y,BL_NPC,"Target A#1"); getmapxy(.@map_b$,.@targetb_x,.@targetb_y,BL_NPC,"Target B#2"); viewpoint 1,.@targeta_x,.@targeta_y,1,0xFF0000; viewpoint 1,.@targetb_x,.@targetb_y,2,0x00FF00; } else if($@DBG_Status == 3) { // Domination getmapxy(.@map_a$,.@flaga_x,.@flaga_y,BL_NPC,"Flag A#1"); getmapxy(.@map_b$,.@flagb_x,.@flagb_y,BL_NPC,"Flag B#2"); getmapxy(.@map_c$,.@flagc_x,.@flagc_y,BL_NPC,"Flag C#3"); viewpoint 1,.@flaga_x,.@flaga_y,1,0xFF0000; viewpoint 1,.@flagb_x,.@flagb_y,2,0x00FF00; viewpoint 1,.@flagc_x,.@flagc_y,3,0x0000FF; } else if($@DBG_Status == 4) { // Rush getmapxy(.@map$,.@def_x,.@def_y,BL_NPC,"Defend Crystal"); viewpoint 1,.@def_x,.@def_y,1,0xFF0000; } } end; // Battleground Arena - Reward Function function DBG_Reward { // getarg(0) = Group ID // getarg(1) = Happy Hour Rate // getarg(2) = BGArenaPts // getarg(3) = War Badges (7773) // getarg(4) = Valor Badges (7829) // getarg(5) = Bravery Badges (7828) // Item ID of Rewards: // Change this values to adjust the reward ids! setarray .@rew_item[0],7773,7829,7828; set .@grp_count,bg_get_data(getarg(0),1); // Loop through the players and give them the reward for ( set .@b,0; .@b < .@grp_count; set .@b,.@b + 1) { attachrid($@arenamembers[.@b]); set BGArenaPts,BGArenaPts + (getarg(2)*getarg(1)); dispbottom "Battleground Arena: You have recieved "+(getarg(2)*getarg(1))+"x Battleground Arena Points."; for ( set .@r,0; .@r < getarraysize(.@rew_item); set .@r,.@r + 1) getitem .@rew_item[.@r],getarg(.@r+3)*getarg(1); detachrid; } return; } } // Battleground Arena - Vote NPC - script DBGArena_Vote -1,{ OnInit: // Time to vote in minutes set .VoteTime,3; bindatcmd "@votebgarena",strnpcinfo(0)+"::OnBGVote"; end; // Battleground Arena - Starting Vote OnBGVoteInit: set .vt,0; set .bg_v1_ct,0; set .bg_v2_ct,0; set .bg_v3_ct,0; set .bg_v1,rand(1,(getarraysize($@DBG_Mode$) - 1)); if($@DBG_Status) // Save previous Game Mode as 2nd Vote Option set .bg_v2,$@DBG_Status; else set .bg_v2,rand(1,(getarraysize($@DBG_Mode$) - 1)); set .bg_v3,rand(1,(getarraysize($@DBG_Mode$) - 1)); // Checking of duplicate Vote Entries while(1) { set .@f1,0; set .@f3,0; if(.bg_v1 == .bg_v2 || .bg_v1 == .bg_v3) set .@f1,1; if(.bg_v3 == .bg_v2 || .bg_v3 == .bg_v1) set .@f3,1; if(.@f1) set .bg_v1,rand(1,(getarraysize($@DBG_Mode$) - 1)); if(.@f3) set .bg_v3,rand(1,(getarraysize($@DBG_Mode$) - 1)); if(!.@f1 && !.@f3) break; sleep 100; // Preventing infinite loop } announce "Battleground Arena: Game Mode Voting is now possible. Use \"@votebgarena\" to vote for an Game Mode.",$@DBG_Anno_T; sleep 2000; announce "Battleground Arena: You have "+.VoteTime+" Minute"+ ( (.VoteTime > 1)?"s":"")+" to vote, if there are no votes until then, the Arena will be stopped.",$@DBG_Anno_T; set .Vote,1; initnpctimer; end; // Battleground Arena - Vote Time Limit OnTimer60000: // Every Minute stopnpctimer; set .vt,.vt + 1; if(.vt == .VoteTime) { // Check if Time Limit has been reached set .Vote,0; set .vt,0; announce "Battleground Arena: Vote Result - "+$@DBG_Mode$[.bg_v1]+" = "+.bg_v1_ct+" | "+$@DBG_Mode$[.bg_v2]+" = "+.bg_v2_ct+" | "+$@DBG_Mode$[.bg_v3]+" = "+.bg_v3_ct,$@DBG_Anno_T; // End the Battleground if there are no votes placed if(!.bg_v1_ct && !.bg_v2_ct && !.bg_v3_ct) { donpcevent "DBGArena_Core::OnBGArenaEnd"; end; // Comparing if any vote is the same as one other but still higher than a different one } else if(.bg_v1_ct == .bg_v2_ct && .bg_v1_ct > .bg_v3_ct) set .@bg,1; else if(.bg_v2_ct == .bg_v3_ct && .bg_v2_ct > .bg_v1_ct) set .@bg,2; else if(.bg_v3_ct == .bg_v1_ct && .bg_v3_ct > .bg_v2_ct) set .@bg,3; // Compare if any vote is higher than the others else if(.bg_v1_ct > .bg_v2_ct && .bg_v1_ct > .bg_v3_ct) set .@bg,1; else if(.bg_v2_ct > .bg_v1_ct && .bg_v2_ct > .bg_v3_ct) set .@bg,2; else if(.bg_v3_ct > .bg_v1_ct && .bg_v3_ct > .bg_v2_ct) set .@bg,3; set $@DBG_Status,getd(".bg_v"+.@bg); donpcevent "DBGArena_Core::OnBGArenaPrepare"; end; } initnpctimer; end; OnBGVote: if(!.Vote) { message strcharinfo(0),"Battleground Arena: There is currently no voting running."; end; } if(.@atcmd_parameters$[0] == "") { message strcharinfo(0),"Battleground Arena: Current Votings: "+.bg_v1_ct+" : "+$@DBG_Mode$[.bg_v1]+" (1) | "+.bg_v2_ct+" : "+$@DBG_Mode$[.bg_v2]+" (2) | "+.bg_v3_ct+" : "+$@DBG_Mode$[.bg_v3]+" (3)"; sleep2 1000; message strcharinfo(0),"Battleground Arena: You can vote with \"@votebgarena 1|2|3\" for the prefered Game Mode."; } else { set .@v,atoi(.@atcmd_parameters$[0]); setd(".bg_v"+.@v+"_ct"),getd(".bg_v"+.@v+"_ct") + 1; message strcharinfo(0),"Battleground Arena: Vote has been confirmed. You have voted for \""+$@DBG_Mode$[getd(".bg_v"+.@v)]+"\"."; } end; } // Battleground Arena - Healer NPC's - script #DBG_Heal -1,{ if(@DBG_Team != atoi(charat(strnpcinfo(2),2)) ) { npctalk "You don't belong to Team "+charat(strnpcinfo(2),2)+"!",strnpcinfo(0),bc_self; } else { if(@Heal_Delay > gettimetick(2)) { npctalk "You can't be healed yet, please wait a few seconds.",strnpcinfo(0),bc_self; end; } npctalk "You have been fully healed! Good luck!",strnpcinfo(0),bc_self; specialeffect 911; percentheal 100,100; set @Heal_Delay,gettimetick(2) + .HDelay; } end; OnInit: // Delay until you can get healed again in seconds set .HDelay,10; disablenpc strnpcinfo(0); end; OnEnable: enablenpc strnpcinfo(0); if($@DBG_Map$[$@DBG_Status] == "dbg_arena") { enablenpc "Healer#1-1"; enablenpc "Healer#1-2"; } else if($@DBG_Map$[$@DBG_Status] == "dbg_dom") { enablenpc "Healer#2-1"; enablenpc "Healer#2-2"; } end; OnDisable: if($@DBG_Map$[$@DBG_Status] == "dbg_arena") { disablenpc "Healer#1-1"; disablenpc "Healer#1-2"; } else if($@DBG_Map$[$@DBG_Status] == "dbg_dom") { disablenpc "Healer#2-1"; disablenpc "Healer#2-2"; } disablenpc strnpcinfo(0); end; } dbg_arena,88,82,4 duplicate(#DBG_Heal) Healer#1-1 4_F_NURSE dbg_arena,311,232,4 duplicate(#DBG_Heal) Healer#1-2 4_F_NURSE dbg_dom,354,317,4 duplicate(#DBG_Heal) Healer#2-1 4_F_NURSE dbg_dom,349,100,4 duplicate(#DBG_Heal) Healer#2-2 4_F_NURSE // Battleground Arena - Player warped on the battlefield and prepare final stuff for the match - script DBG_Init -1,{ OnBGPrepare: sleep 2500; // Let the players be warped to the map before starting mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The Match will start shortly.",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Until 10 seconds before the start of the match, you won't be able to move or use skills.",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Think about a good strategy to win and play fair.",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; switch($@DBG_Status) { default: break; case 2: // Search & Destroy enablenpc "DBG_Target"; enablenpc "Target A#1"; enablenpc "Target B#2"; enablenpc "Bomb#SAD"; set .Planting_1,0; set .Planting_2,0; set .Bomb_Active_T1,0; set .Bomb_Active_T2,0; if(!.NoAnno) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Team 1 has to destroy one of the targets by using the bomb, which can be picked up!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Team 2 has to defend both targets and defuse the bomb, if it was planted.",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; } break; case 3: // Domination enablenpc "DBG_DOM_Flag"; enablenpc "Flag A#1"; enablenpc "Flag B#2"; enablenpc "Flag C#3"; // Reseting Display ID to Neutral Flag setnpcdisplay "Flag A#1",1911; setnpcdisplay "Flag B#2",1911; setnpcdisplay "Flag C#3",1911; // Create Chat Room (Display Box) donpcevent "Flag A#1::OnDisplayBox"; donpcevent "Flag B#2::OnDisplayBox"; donpcevent "Flag C#3::OnDisplayBox"; if(!.NoAnno) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": There are 3 Flags to take, if one team has more members at a flag than the other, then the first team will get the flag!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Holding Flags gives Points every 5 seconds. The more flags your team holds the more points you will get!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; } break; case 4: // Rush // How many Lifes does the Attacker Team has in Rush? set getvariableofnpc(.Rush_Life,"DBGArena_Core"),45; if(!.NoAnno) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Team 1 has to attack the other Team's Crystal to win, while they have to defend until the time limit has been reached!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Team 1 has "+getvariableofnpc(.Rush_Life,"DBGArena_Core")+" Lifes. If they hit \"0\" Team 2 wins!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; } break; case 5: // Capture the Flag enablenpc "DBG_CTF_Flag"; enablenpc "Team 1 Flag#1"; enablenpc "Team 2 Flag#2"; movenpc "Team 1 Flag#1",.CTF1_x,.CTF1_y; movenpc "Team 2 Flag#2",.CTF2_x,.CTF2_y; set getvariableofnpc(.Flag1_Base,"Team 1 Flag#1"),1; set getvariableofnpc(.Flag2_Base,"Team 2 Flag#2"),1; // Effect for Flag Holder set .f_effect,409; // Meteor Assault set .f_effect_t,1500; // Timer in milliseconds, when the effect will shown again if(!.NoAnno) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Each Team has a flag to protect while stealing the enemies flag!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The first team to bring the enemies flag to their own wins the round!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; } break; } set .NoAnno,0; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The Match will start in 1 Minute!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 50000; // 50 sec mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": 10 Seconds left, you can now move and buff your members!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; donpcevent "DBGArena_Core::OnBGPlayerBlock"; donpcevent "#DBG_Heal::OnEnable"; sleep 10000; // 10 sec mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": The Match starts now! Good luck to both Teams!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; donpcevent "DBGArena_Core::OnBGArenaTimer"; // Start the Timer in DBGArena_Core for Time Limit if($@DBG_Status == 3) // Start flag timer for Domination initnpctimer; else if($@DBG_Status == 4) // Spawn Crystal for Rush bg_monster $@DBG_T2,$@DBG_Map$[$@DBG_Status],.mob[0],.mob[1],"Defend Crystal",1914,strnpcinfo(0)+"::OnRushMobDeath"; end; // Round Reset - Basically only for S&D / Rush / CTF OnRoundReset: if($@DBG_Status == 2 && .SAD_Win > 0) { set .@RS$,"SAD"; setd(".T"+.SAD_Win+"_Score"),getd(".T"+.SAD_Win+"_Score") + 1; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": [Team "+.SAD_Win+"] has scored 1 Point!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set .SAD_Win,0; } else if($@DBG_Status == 4 && .Rush_Win > 0) { set .@RS$,"Rush"; setd(".T"+.Rush_Win+"_Score"),getd(".T"+.Rush_Win+"_Score") + 1; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": [Team "+.Rush_Win+"] has scored 1 Point!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set .Rush_Win,0; } else if($@DBG_Status == 5 && .CTF_Win > 0) { set .@RS$,"CTF"; setd(".T"+.CTF_Win+"_Score"),getd(".T"+.CTF_Win+"_Score") + 1; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": [Team "+.CTF_Win+"] has scored 1 Point!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set .CTF_Win,0; } sleep 2000; donpcevent strnpcinfo(0)+"::OnBGDisable"; donpcevent strnpcinfo(0)+"::OnBGRoundScore"; set .rounds,.rounds + 1; mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Round "+.rounds+" has finished!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 2000; if(.rounds < getd("."+.@RS$+"_RoundSwap")) { mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": Starting Round "+(.rounds+1)+" in a few seconds!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set getvariableofnpc(.DBG_Reset,"DBGArena_Core"),1; set .NoAnno,1; // To prevent repeating the Announcements in the next round donpcevent "DBGArena_Core::OnBGArenaReset"; } else { if(.T1_Score > .T2_Score) set $@DBG_T1Score,$@DBG_T1Score + 1; else if(.T2_Score > .T1_Score) set $@DBG_T2Score,$@DBG_T2Score + 1; set .T1_Score,0; set .T2_Score,0; if(.Team_Swapped) { donpcevent strnpcinfo(0)+"::OnBGRoundScore"; donpcevent "DBGArena_Core::OnBGArenaScore"; set .Team_Swapped,0; end; } mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": End of the match! Switching Teams....",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 2000; set .rounds,0; // Swapping Teams set .@T1,$@DBG_T2; set .@T2,$@DBG_T1; set $@DBG_T1,.@T1; set $@DBG_T2,.@T2; set .Team_Swapped,1; // Reseting Round set getvariableofnpc(.DBG_Reset,"DBGArena_Core"),1; donpcevent "DBGArena_Core::OnBGArenaReset"; } end; // Battleground Arena - Update Score OnBGRoundScore: bg_updatescore $@DBG_Map$[$@DBG_Status],.T1_Score,.T2_Score; end; // Domination - Flag Timer OnTimer5000: // Every 5th second stopnpctimer; if(($@DBG_T1Score + .flags_pts[$@DBG_Flag_CT1]) < 100) set $@DBG_T1Score,$@DBG_T1Score + .flags_pts[$@DBG_Flag_CT1]; else set $@DBG_T1Score,100; if(($@DBG_T2Score + .flags_pts[$@DBG_Flag_CT2]) < 100) set $@DBG_T2Score,$@DBG_T2Score + .flags_pts[$@DBG_Flag_CT2]; else set $@DBG_T2Score,100; donpcevent "DBGArena_Core::OnBGArenaScore"; initnpctimer; end; // Rush - Crystal Death Event OnRushMobDeath: mapannounce $@DBG_Map$[$@DBG_Status],$@DBG_Mode$[$@DBG_Status]+": [Team 1] has destroyed the Crystal!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set .Rush_Win,1; donpcevent strnpcinfo(0)+"::OnRoundReset"; end; OnFlagMark: deltimer strnpcinfo(0)+"::OnFlagMark"; if(!@Has_Flag) end; specialeffect2 .f_effect; addtimer .f_effect_t,strnpcinfo(0)+"::OnFlagMark"; end; OnBGDisable: switch($@DBG_Status) { default: break; case 2: // Search and Destroy stopnpctimer "DBG_Target"; stopnpctimer "Target A#1"; stopnpctimer "Target B#2"; movenpc "Bomb#SAD",.SAD_x,.SAD_y; disablenpc "DBG_Target"; disablenpc "Target A#1"; disablenpc "Target B#2"; disablenpc "Bomb#SAD"; break; case 3: // Domination stopnpctimer; disablenpc "DBG_DOM_Flag"; disablenpc "Flag A#1"; disablenpc "Flag B#2"; disablenpc "Flag C#3"; break; case 5: // Capture the Flag movenpc "Team 1 Flag#1",.CTF1_x,.CTF1_y; movenpc "Team 2 Flag#2",.CTF2_x,.CTF2_y; disablenpc "DBG_CTF_Flag"; disablenpc "Team 1 Flag#1"; disablenpc "Team 2 Flag#2"; break; } donpcevent "#DBG_Heal::OnDisable"; killmonsterall $@DBG_Map$[$@DBG_Status]; end; OnInit: // ======= Search and Destroy ===== // Saving original coordiantes of the bomb getmapxy(.@map$,.SAD_x,.SAD_y,BL_NPC,"Bomb#SAD"); // How many rounds until the teams are swapped? // Note: First round has the value 0 set .SAD_RoundSwap,2; // ======= Domination ===== // Flag Settings - Points // Default: [ ] = Flag Count // [0] = 0 Flags > 0 Pts (Obviously) // [1] = 1 Flag > 1 Pt // [2] = 2 Flags > 3 Pts // [3] = 3 Flags > 5 Pts setarray .flags_pts[0],0,1,3,5; // ======= Rush ===== // How many rounds until the teams are swapped? // Note: First round has the value 0 set .Rush_RoundSwap,2; // Mob Coordinates of Defender Team (Team 2) setarray .mob[0],328,150; // ======= Rush ===== // Saving original coordiantes of the flags getmapxy(.@map$,.CTF1_x,.CTF1_y,BL_NPC,"Team 1 Flag#1"); getmapxy(.@map$,.CTF2_x,.CTF2_y,BL_NPC,"Team 2 Flag#2"); // How many rounds until the teams are swapped? // Note: First round has the value 0 set .CTF_RoundSwap,2; end; } // Search and Destroy - Target NPC's - script DBG_Target -1,{ if(getd(".Bomb_Active_T"+strnpcinfo(2)) && @DBG_Team == 2) { progressbar "",.defuse; if(!playerattached()) end; // Check if the player is still attached, like got killed stopnpctimer strnpcinfo(0); mapannounce strnpcinfo(4),"Search & Destroy: Team 2 has succesfully defused the bomb at "+strnpcinfo(1)+".",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; setd(".Bomb_Active_T"+strnpcinfo(2)),0; setd(".b_T"+strnpcinfo(2)),0; set getvariableofnpc(.SAD_Win,"DBG_Init"),2; donpcevent "DBG_Init::OnRoundReset"; } else if(!getd(".Bomb_Active_T"+strnpcinfo(2)) && @DBG_Team == 1) { // Check if Attacker if(!@Has_Bomb) message strcharinfo(0),"You need to the bomb to destroy this target."; else if(getd(".Planting_"+strnpcinfo(2)) == 0) { addtimer 1000,strnpcinfo(0)+"::OnBombPlant"; getmapxy(.@map$,@x,@y,BL_PC); setd(".Planting_"+strnpcinfo(2)),1; } } end; OnBombPlant: deltimer strnpcinfo(0)+"::OnBombPlant"; getmapxy(.@map$,.@x,.@y,BL_PC); if(.@x != @x && .@y != @y) { message strcharinfo(0),"Search & Destroy: You are not allowed to move!"; set .plant_t,0; setd(".Planting_"+strnpcinfo(2)),0; set @x,0; set @y,0; end; } if(.plant_t < .plant) { addtimer 1000,strnpcinfo(0)+"::OnBombPlant"; npctalk "Planting complete in "+(.plant-.plant_t)+" seconds.",strnpcinfo(0); set .plant_t,.plant_t + 1; end; } set @x,0; set @y,0; mapannounce strnpcinfo(4),"Search & Destroy: Team 1 has planted the Bomb at "+strnpcinfo(1)+". "+.bomb+" seconds unil it explodes!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; setd(".Bomb_Active_T"+strnpcinfo(2)),1; set @Has_Bomb,0; set .plant_t,0; setd(".Planting_"+strnpcinfo(2)),0; initnpctimer strnpcinfo(0); end; OnTimer1000: stopnpctimer strnpcinfo(0); setd(".b_T"+strnpcinfo(2)),getd(".b_T"+strnpcinfo(2)) + 1; npctalk "Time left until explosion: "+(.bomb-getd(".b_T"+strnpcinfo(2)))+" seconds",strnpcinfo(0); misceffect 54; initnpctimer strnpcinfo(0); if(getd(".b_T"+strnpcinfo(2)) < .bomb || getd(".Bomb_Active_T"+strnpcinfo(2)) == 0) end; stopnpctimer strnpcinfo(0); setd(".Bomb_Active_T"+strnpcinfo(2)),0; specialeffect .explode; set getvariableofnpc(.SAD_Win,"DBG_Init"),1; donpcevent "DBG_Init::OnRoundReset"; end; OnInit: set .bomb,20; // Time until bomb explodes in seconds set .plant,5; // Required time to plant the bomb in seconds set .defuse,8; // Time to defuse the bomb set .explode,730; // Effect ID for explosion disablenpc strnpcinfo(0); end; } dbg_arena,199,191,4 duplicate(DBG_Target) Target A#1 1914 dbg_arena,199,106,4 duplicate(DBG_Target) Target B#2 1915 // Search & Destroy - Bomb dbg_arena,97,78,4 script Bomb#SAD 1904,{ if(@DBG_Team != 1) end; set @Has_Bomb,1; npctalk "["+strcharinfo(0)+"] has picked up the Bomb.",strnpcinfo(0),bc_area; sleep 500; disablenpc strnpcinfo(0); end; OnInit: set .npc$,strnpcinfo(0); disablenpc .npc$; end; } // Domination - Flag Template - script DBG_DOM_Flag -1,{ end; OnTouch: if(getd(".Flag"+strnpcinfo(2)+"_Group") == @DBG_Team) end; // Team x owns this Flag, end if(getd(".TakeOver_F"+strnpcinfo(2))) end; // TakeOver is in progress setd(".TakeOver_F"+strnpcinfo(2)),1; mapannounce strnpcinfo(4),"Domination: ["+strnpcinfo(1)+"] is being taken....",bc_area,$@DBG_Anno$[$@DBG_Status]; while( .@t < .flag_timer) { misceffect (766-.@t); set .@t,.@t + 1; sleep 1000; } setd(".TakeOver_F"+strnpcinfo(2)),0; getmapxy(.@map$,.@flag_x,.@flag_y,BL_NPC); set .@F_T1,bg_getareausers($@DBG_T1,strnpcinfo(4),(.@flag_x-3),(.@flag_y-3),(.@flag_x+3),(.@flag_y+3)); set .@F_T2,bg_getareausers($@DBG_T2,strnpcinfo(4),(.@flag_x-3),(.@flag_y-3),(.@flag_x+3),(.@flag_y+3)); if(!getd(".Flag"+strnpcinfo(2)+"_Group")) { // Neutral Flag if(.@F_T1 > .@F_T2) { set $@DBG_Flag_CT1,$@DBG_Flag_CT1 + 1; setd(".Flag"+strnpcinfo(2)+"_Group"),1; } else if(.@F_T2 > .@F_T1) { set $@DBG_Flag_CT2,$@DBG_Flag_CT2 + 1; setd(".Flag"+strnpcinfo(2)+"_Group"),2; } else { npctalk strnpcinfo(1)+": There are equal amount of players, therefore no one can take the flag!"; end; } } else if(getd(".Flag"+strnpcinfo(2)+"_Group") == 1) { // Team 1 has flag if(.@F_T1 < .@F_T2) { set $@DBG_Flag_CT1,$@DBG_Flag_CT1 - 1; set $@DBG_Flag_CT2,$@DBG_Flag_CT2 + 1; setd(".Flag"+strnpcinfo(2)+"_Group"),2; } else { npctalk strnpcinfo(1)+": There are equal amount or Team 1 has more players, therefore Team 1 keeps the flag!"; end; } } else if(getd(".Flag"+strnpcinfo(2)+"_Group") == 2) { // Team 2 has flag if(.@F_T2 < .@F_T1) { set $@DBG_Flag_CT1,$@DBG_Flag_CT1 + 1; set $@DBG_Flag_CT2,$@DBG_Flag_CT2 - 1; setd(".Flag"+strnpcinfo(2)+"_Group"),1; } else { npctalk strnpcinfo(1)+": There are equal amount or Team 2 has more players, therefore Team 2 keeps the flag!"; end; } } setnpcdisplay(strnpcinfo(0),strnpcinfo(0),getd(".T"+getd(".Flag"+strnpcinfo(2)+"_Group")+"_FlagID")); mapannounce strnpcinfo(4),"Domination: ["+strnpcinfo(1)+"] has been taken by Team "+getd(".Flag"+strnpcinfo(2)+"_Group")+"!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; delwaitingroom; OnDisplayBox: waitingroom strnpcinfo(1)+" - "+( (getd(".Flag"+strnpcinfo(2)+"_Group") == 0)?"[Neutral]":"[Team "+getd(".Flag"+strnpcinfo(2)+"_Group")+"]"),0; end; OnInit: set .T1_FlagID,1912; // ID to display when Team 1 has taken the Flag set .T2_FlagID,1913; // ID to display when Team 2 has taken the Flag set .flag_timer,10; // Timer to take an flag in seconds disablenpc strnpcinfo(0); end; } // Flags duplicates to be taken dbg_dom,209,291,4 duplicate(DBG_DOM_Flag) Flag A#1 1911,3,3 dbg_dom,274,204,4 duplicate(DBG_DOM_Flag) Flag B#2 1911,3,3 dbg_dom,267,131,4 duplicate(DBG_DOM_Flag) Flag C#3 1911,3,3 // Capture the Flag - Flag NPC's - script DBG_CTF_Flag -1,{ if(getd(".Flag"+strnpcinfo(2)+"_Base")) { // Is the flag at base? if(@DBG_Team == atoi(strnpcinfo(2)) && (@Has_Flag > 0 && @Has_Flag != @DBG_Team) ) { mapannounce strnpcinfo(4),"Capture the Flag: Team "+@DBG_Team+" has succesfully conquered the enemies Flag!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; set getvariableofnpc(.CTF_Win,"DBG_Init"),@DBG_Team; set @Has_Flag,0; donpcevent "DBG_Init::OnRoundReset"; } else if(@DBG_Team != atoi(strnpcinfo(2))) { disablenpc strnpcinfo(0); setd(".Flag"+strnpcinfo(2)+"_Base"),0; set @Has_Flag,atoi(strnpcinfo(2)); mapannounce strnpcinfo(4),"Capture the Flag: The Flag of Team "+strnpcinfo(2)+" has been taken by ["+strcharinfo(0)+"]!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; addtimer 5000,"DBG_Init::OnFlagMark"; } } else if(!getd(".Flag"+strnpcinfo(2)+"_Base")) { // Has the flag been dropped? if(@DBG_Team == atoi(strnpcinfo(2))) { // Is the player in the same team as the Flag belongs to? movenpc strnpcinfo(0),getd(".CTF"+strnpcinfo(2)+"_x"),getd(".CTF"+strnpcinfo(2)+"_y"); setd(".Flag"+strnpcinfo(2)+"_Base"),1; mapannounce strnpcinfo(4),"Capture the Flag: The Flag of Team "+@DBG_Team+" has been saved by ["+strcharinfo(0)+"]!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; } else { disablenpc strnpcinfo(0); set @Has_Flag,atoi(strnpcinfo(2)); specialeffect2 getvariableofnpc(.f_effect,"DBG_Init"); addtimer getvariableofnpc(.f_effect_t,"DBG_Init"),"DBG_Init::OnFlagMark"; mapannounce strnpcinfo(4),"Capture the Flag: The Flag of Team "+strnpcinfo(2)+" has been taken by ["+strcharinfo(0)+"]!",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; } } end; OnInit: // Saving original coordiantes and Names of the flags if(strnpcinfo(2) != "") { getmapxy(.@map$,getd(".CTF"+strnpcinfo(2)+"_x"),getd(".CTF"+strnpcinfo(2)+"_y"),BL_NPC); setd(".npc_F"+strnpcinfo(2)+"$"),strnpcinfo(0); } disablenpc strnpcinfo(0); end; } dbg_arena,62,150,4 duplicate(DBG_CTF_Flag) Team 1 Flag#1 1912 dbg_arena,328,150,4 duplicate(DBG_CTF_Flag) Team 2 Flag#2 1913 prontera,147,175,4 script Battleground Arena 100,{ mes .n$; mes "Welcome, "+strcharinfo(0)+"!"; mes "How can I help you?"; next; switch(select("- Start Arena:- Information:- Shop:- Leave")) { case 1: mes .n$; if($@DBG_Status) { mes "The Battleground Arena is currently active."; mes "Use \"@joinbgarena\" to join."; close; } if(.DBG_WoE && (agitcheck() || agitcheck2() || agitcheck3())) { mes "Currently the War of Emperium is active, therefore I can't start the Arena!"; close; } mes "Which Game Mode do you want to play?"; next; for ( set .@g,1; .@g < getarraysize($@DBG_Mode$); set .@g,.@g + 1) set .@gm_menu$,.@gm_menu$ + "- "+$@DBG_Mode$[.@g]+ ( ($@DBG_Mode$[.@g+1] != "")?":":""); set .@gm,select(.@gm_menu$); mes .n$; mes $@DBG_Mode$[.@gm]+", it is?"; if(select("- Yes:- No") - 1) close; next; mes .n$; mes "Okay, here we go."; set $@DBG_Status,.@gm; close2; announce "An warrior is calling out for others to participate in the Battleground Arena.",$@DBG_Anno_T,$@DBG_Anno$[$@DBG_Status]; sleep 3000; donpcevent "DBGArena_Core::OnBGArenaInit"; end; case 2: mes .n$; mes "About what do you want to learn more?"; next; switch(select("- Join Arena:- Game Modes:- Happy Hour:- Custom Commands:- Rewards:- Nevermind")) { case 1: // Join Arena mes .n$; mes "Every Warrior can start the Battleground Arena by selecting the Game Mode,"; mes (getvariableofnpc(.DBG_WoE,"DBGArena_Core") == 0?"even":"but not")+" when WoE is active."; mes "As soon it starts you will see the announcement."; break; // Games Modes case 2: mes .n$; mes "There are a total of "+(getarraysize($@DBG_Mode$) - 1)+" Game Modes."; mes "About which Game Mode do you want to know more?"; next; switch(select("- Team Deathmatch:- Search & Destroy:- Domination:- Rush:- Capture the Flag")) { case 1: // TDM mes .n$; mes "Team Deathmatch consists only of battling the other Team."; mes "The goal is to defeat more enemies than the other team until either the time limit or the required points have been reached."; break; case 2: // S&D mes .n$; mes "Search & Destroy consists of destroying 1 of 2 Targets."; mes "Team 1 has access to the bomb while Team 2 has to defend the targets."; break; case 3: // Domination mes .n$; mes "Domination consists of taking flags. There are a total of 3 flags to take."; mes "Each flag gives points every 5 seconds, the more flags are taken by an team the more points they will recieve."; break; case 4: // Rush mes .n$; mes "Rush consists of destroying an Crystal."; mes "Team 1 are the attackers and have limited lifes, while Team 2 has to defend the crystal until either the Time Limit or the attackers are out of lifes."; break; case 5: // CTF mes .n$; mes "Capture the Flag consists of taking the enemies flag and bring it to the own flag."; mes "If the own flag was taken, you have to take it back to score."; break; } next; mes .n$; switch(@menu) { default: mes "Time Limit per Match is: "+getvariableofnpc(.DBG_TLimit[@menu],"DBGArena_Core")+" "+ ( (getvariableofnpc(.DBG_TLimit[@menu],"DBGArena_Core") > 1)?"Minutes":"Minute"); mes "The required Points to win is: "+getvariableofnpc(.DBG_MPTS[@menu],"DBGArena_Core"); break; case 2: case 4: case 5: mes "There are multiply rounds per match and the Time Limit per round is:"; mes getvariableofnpc(.DBG_TLimit[@menu],"DBGArena_Core")+" "+ ( (getvariableofnpc(.DBG_TLimit[@menu],"DBGArena_Core") > 1)?"Minutes":"Minute"); mes "After each round, the match will restart until a certain amount of rounds have passed, then the teams will be swapped and the team which scores the most in these rounds, scores 1 total point."; mes "The required Points to win is: "+getvariableofnpc(.DBG_MPTS[@menu],"DBGArena_Core"); break; } break; // Happy Hour case 3: mes .n$; mes "During the day it can happen that \"Happy Hour\" will start."; mes "This means that the reward will be increased for this very hour."; break; // Custom Commands case 4: mes .n$; mes "There are following commands for the Battleground Arena:"; mes " > @bgarenainfo = Display the Score and Time left"; mes " > @joinbgarena = Joins the Battleground Arena"; mes " > @leavebgarena = Leaves the Battleground Arena"; if(getgroupid()) { mes " "; mes " For GM's exists:"; mes " > @startbgarena = Start the Battleground Arena"; mes " > @endbgarena = Ends the Battleground Arena"; } break; // Rewards case 5: mes .n$; mes "There are 4 different rewards awaiting you after each match."; mes "The reward amount itself depends on the Game Mode tho."; mes " "; mes " > Arena Points (for the Arena Shop)"; mes " > Valor Badges"; mes " > War Badges"; mes " > Bravery Badges"; break; // Nevermind case 6: break; } break; case 3: mes .n$; mes "I will now open the Battleground Arena Shop!"; mes "You have currently "+BGArenaPts+" Arena Points!"; mes "Note: The Discount Skill won't work on me!"; close2; callshop "DBG_Shop",1; npcshopattach "DBG_Shop"; end; case 4: break; } close; OnBuyItem: for ( set .@b,0; .@b < getarraysize(@bought_nameid); set .@b,.@b + 1) for ( set .@s,0; .@s < getarraysize(.bg_shop); set .@s,.@s + 2) if(@bought_nameid[.@b] == .bg_shop[.@s]) { if(checkweight(@bought_nameid[.@b],@bought_nameid[.@b]) == 0) { npctalk "Battleground Shop: You can't buy this many items, you would be overweight!!",strnpcinfo(0),bc_self; end; } set .@total,.@total + (.bg_shop[.@s+1]*@bought_quantity[.@b]); } if(.@total > BGArenaPts) { npctalk "Battleground Shop: I'm sorry, but you don't have the required Arena Points. You are missing "+(.@total-BGArenaPts)+" Points.",strnpcinfo(0),bc_self;; end; } for ( set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i + 1) getitem @bought_nameid[.@i],@bought_quantity[.@i]; set BGArenaPts,BGArenaPts - .@total; dispbottom "Battleground Shop: You have paied "+.@total+" Arena Points."; end; OnInit: set .n$,"["+strnpcinfo(0)+"]"; // Item ID,Price setarray .bg_shop[0],12020,2, // [0] == Cursed Water 12028,2, // [1] == Box of Thunder 12029,2, // [2] == Box of Gloom 12030,2, // [3] == Box of Resentment 12031,2, // [4] == Box of Drowsiness 12032,2, // [5] == Box of Stroms 12033,2, // [6] == Box of Sunlight 12034,2, // [7] == Box of Panting 12108,5, // [8] == Scroll Package 12215,5, // [9] == LV 10 Blessing Scroll 12216,5, // [10] == LV 10 Agi Scroll 12217,5, // [11] == LV 5 Aspersio Scroll 12218,5, // [12] == LV 5 Assumptio Scroll 12219,5, // [13] == LV 10 Wind Walker Scroll 12075,10, // [14] == Steamed Tongue 12080,10, // [15] == Dragon Breath Cocktail 12085,10, // [16] == Immortal Stew 12090,10, // [17] == Steamed Desert Scorpions 12095,10, // [18] == Hwergelmir's Tonic 12100,10, // [19] == Cooked Nice Tail's Tails 12114,4, // [20] == Elemental Converter[Fire] 12115,4, // [21] == Elemental Converter[Water] 12116,4, // [22] == Elemental Converter[Earth] 12117,4, // [23] == Elemental Converter[Wind] 12118,3, // [24] == Fireproof Potion 12119,3, // [25] == Coldproof Potion 12120,3, // [26] == Earthproof Potion 12121,3, // [27] == Thunderproof Potion 13543,10, // [28] == Chemical Protection Helm Scroll Box 13544,10, // [29] == Chemical Protection Shield Scroll Box 13545,10, // [30] == Chemical Protection Armor Scroll Box 13546,10, // [31] == Chemical Protection Weapon Scroll Box 7139,1, // [32] == Glistening Coat 13547,10, // [33] == Repair Weapon Scroll Box 14593,5; // [34] == Mystical Amplification Scroll npcshopdelitem "DBG_Shop",501; for ( set .@s,0; .@s < getarraysize(.bg_shop); set .@s,.@s + 2) npcshopadditem "DBG_Shop",.bg_shop[.@s],.bg_shop[.@s+1]; end; } - pointshop DBG_Shop -1,BGArenaPts,501:-1 // Base Flags - Only to display the Team's Flag // Template for saving lines only - script DBG_BaseFlag -1,{ end; } // Team 1 Base Flags on dbg_arena dbg_arena,80,81,4 duplicate(DBG_BaseFlag) Team 1 Base#arena1 1912 dbg_arena,95,81,4 duplicate(DBG_BaseFlag) Team 1 Base#arena2 1912 dbg_arena,95,68,4 duplicate(DBG_BaseFlag) Team 1 Base#arena3 1912 dbg_arena,80,68,4 duplicate(DBG_BaseFlag) Team 1 Base#arena4 1912 // Team 2 Base Flags on dbg_arena dbg_arena,304,230,4 duplicate(DBG_BaseFlag) Team 2 Base#arena1 1913 dbg_arena,318,230,4 duplicate(DBG_BaseFlag) Team 2 Base#arena2 1913 dbg_arena,318,218,4 duplicate(DBG_BaseFlag) Team 2 Base#arena3 1913 dbg_arena,304,218,4 duplicate(DBG_BaseFlag) Team 2 Base#arena4 1913 // Mapflags // Battleground Arena dbg_arena mapflag nosave dbg_arena mapflag noteleport dbg_arena mapflag nomemo dbg_arena mapflag nowarp dbg_arena mapflag nowarpto dbg_arena mapflag noreturn dbg_arena mapflag nogo dbg_arena mapflag nodrop dbg_arena mapflag nobranch dbg_arena mapflag nopenalty dbg_arena mapflag nozenypenalty dbg_arena mapflag novending dbg_arena mapflag nochat dbg_arena mapflag nightenabled dbg_arena mapflag battleground 2 // Battleground Arena - Domination dbg_dom mapflag nosave dbg_dom mapflag noteleport dbg_dom mapflag nomemo dbg_dom mapflag nowarp dbg_dom mapflag nowarpto dbg_dom mapflag noreturn dbg_dom mapflag nogo dbg_dom mapflag nodrop dbg_dom mapflag nobranch dbg_dom mapflag nopenalty dbg_dom mapflag nozenypenalty dbg_dom mapflag novending dbg_dom mapflag nochat dbg_dom mapflag nightenabled dbg_dom mapflag battleground 2 how to fix this error thanks
×
×
  • Create New...