Jump to content

joey93

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

joey93's Achievements

Poring

Poring (1/15)

0

Reputation

  1. Someone have a battleground script with no bugs for running in Rathena 2020+ Emulators? tks PS: I try the Chris Script, but have so much bugs..
  2. Hello ! I`m trying add the Chris' Dynamic BG in my server, but when the match start, and the char teleport, my server crash (i use the last version of Rathena): this is my code : //===== rAthena Script ======================================= //= Dynamic Battleground Arena //===== By =================================================== //= llchrisll //===== Version ============================================== //= 1.0 - Initial Version //===== Tested With ========================================== //= rAthena 04/29/2020 Revision //= GIT Hash: 4829f3775d5371e65d6648cf05b6f0c2810bb664 //===== 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],1,1,1,1,1; // 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,1; // 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 Anyone can help me with this? Tks a lot.
  3. Hello guys.. I need to add information from the database in the basic info window (see photo), but I don't even know where to start. Can someone give me a light ?? more or less in this position in red .. Thank you very much in advance !!
  4. I am using this AnnieRuru function attached above to consider PvP between factions. But I can't attack other players without holding SHIFT. / noshift does not work for this case. Does anyone have any light?
  5. @AnnieRuru, hello !! how i use this?? prontera,155,185,5 script ksjfdhsk 1_F_MARIA,{ input faction; }
  6. //===== Alayne Scripts ======================================= //= Sky Fortress Instance //===== By: ================================================== //= Alayne //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena SVN //= hercules SVN //===== Description: ========================================= //= The official instance Sky Fortress transcription //===== Todo Remaining: ====================================== // //===== Additional Comments: ================================= // // //============================================================ prontera,152,176,3 script Scientist Doyeon::alasfscd 4_M_MAYOR,{ OnStart: set .@party_id, getcharid(1); set .@sf_leader, ( getcharid(0) == getpartyleader(.@party_id,2) ); //RATHENA set .@has_instance, SF_INSTANCE_ID > 0; //HERCULES //set .@has_instance, has_instance(.map$[0], instance_id()); set .@instance_delay, ( instance_delay_skyf - gettimetick(2) ); set .@npcname$, "[Scientist Doyeon]"; mes .@npcname$; mes "Did you ever heard about the Sky Fortress"; mes "That's known to be the craddle of all plagues that spread around the world..."; next; switch( select( (( .@party_id && .@sf_leader && !.@has_instance )?"Create " + .instance_name$:""), (( .@party_id && .@sf_leader && .@has_instance )?"Destroy " + .instance_name$:""), "Nevermind." )){ case 1: if( .@instance_delay > 0 ) { mes "You have to wait : ^FF0000"+.@instance_delay+" Seconds.^000000"; close; } getpartymember .@party_id,2; if( .min_party_member >= 1 ){ set .@origin, getcharid(3); set .@gettimetick, gettimetick(2); for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) ){ set .@member_count, .@member_count + 1; if( BaseLevel < .base_level[0] || BaseLevel > .base_level[1] ) set .@fail, .@fail|1; if( Zeny < .instance_zeny ) set .@fail, .@fail|2; if( instance_delay_skyf > .@gettimetick ) set .@fail, .@fail|4; if( .@fail ){ set .@name$, strcharinfo(0); break; } } attachrid( .@origin ); } //check that nobody else is inside for(set .@i,0; .@i<getarraysize(.map$); set .@i,.@i+1) { if (.map$[.@i] != "" && getmapusers(instance_mapname(.map$[.@i], -1)) > 0) { mes "Another team is already in the " + .instance_name$ + ". I can't send you there, sorry."; //close; } } //clean any previously remaining instance if(SF_INSTANCE_ID != -1) { getpartymember getcharid(1),2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) && SF_INSTANCE_ID > 0){ set SF_INSTANCE_ID, -1; } instance_destroy instance_id(); } if( .@name$ != "" && .@fail ){ mes "^FF0000[ Failed ]^000000"; mes "^0055FF"+.@name$+"^000000, You cannot join right now."; mes " "; mes "^FF0000[ Reason: ]^000000"; if( .@fail & 1 ) mes "^777777You must be Level: "+.base_level[0]+" - "+.base_level[1]+"^000000"; if( .@fail & 2 ) mes "^777777You need "+ .instance_zeny +" Zeny^000000"; if( .@fail & 4 ) mes "^777777You still have cooldown.^000000"; //break; } getpartymember getcharid(1),0; if (instance_check_party(.@party_id, .min_party_member, .base_level[0], .base_level[1]) == 0) { mes "^0055FF[ "+.instance_name$+" ]^000000"; mes "Make or join a party with at least "+.min_party_member+" member and try again, with level between " +.base_level[0] + " and " + .base_level[1] + "."; } else{ //RATHENA set .@instance, instance_create( .instance_name$ ); //HERCULES //set .@instance, instance_create( .instance_name$, .@party_id, IOT_PARTY ); if( .@instance < 0 ) { npctalk .instance_name$ + " reservation failed."; mes "^0000FF"+ .instance_name$ +" ^000000 - Reservation Failed!"; close; } mes "^0055FF[ "+.instance_name$+" ]^000000"; mes "^0000FF"+.instance_name$+" ^000000 - Reserved"; set .@gettimetick, gettimetick(2); getpartymember .@party_id,2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) ){ set instance_delay_skyf, ( .@gettimetick + ( .instance_delay )); set Zeny, Zeny - .instance_zeny; set SF_INSTANCE_ID, .@instance; dispbottom "["+.instance_name$+"] -"+ .instance_zeny +" Zeny and Instance Cooldown Applied."; } attachrid( .@origin ); npctalk .instance_name$ + " has been generated for Party - " + getpartyname( .@party_id ); set $instance_sf_id, getcharid(1); //HERCULES //for( set .@i, 0; .@i < getarraysize(.map$); set .@i,.@i+1 ) //{ // if( instance_attachmap( .map$[.@i],.@instance ) == "" ){ // setmapflag .map$[.@i],mf_zone,"Memorial Dungeon"; // npctalk .instance_name$ + " reservation failed due to map attach failure."; // mes "- ^FF0000Reservation Failed!^000000"; // instance_destroy( instance_id() ); // close; // } //} //instance_set_timeout .instance_delay,300,.@instance; //instance_init(.@instance); next; mes "^0055FF[ "+.instance_name$+" ]^000000"; mes "Go to the Portal, to enter inside the " + .instance_name$; } break; case 2: next; mes .instance_name$ + " Destroyed."; getpartymember getcharid(1),2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) && SF_INSTANCE_ID > 0){ set SF_INSTANCE_ID, -1; } instance_destroy instance_id(); break; default: break; } close; OnPCLoginEvent: OnPCLogoutEvent: set SF_INSTANCE_ID, -1; end; OnInit: setarray .base_level[0],145,175; setarray .map$[0],"1@sthb", "1@sthd", "1@sthc"; set .map_size, getarraysize( .map$ ); set .min_party_member, 1; set .instance_zeny, 0; set .instance_delay, 7200; set $sf_timer_delay, 3600; //1 hour to clean the instance set .instance_name$, "Sky Fortress"; end; } prontera,155,174,3 script Dimensional Device::alasfdd PORTAL,{ if( SF_INSTANCE_ID <= 0 ){ mes "The device doesn't seems to work. You can't seem to enter."; close; } else{ //RATHENA getmapxy(.@map$, .@x, .@y, UNITTYPE_PC); save .@map$, .@x, .@y; switch(instance_enter(.instance_name$)) { default: mes "An unknown error has occurred."; close; case 2: mes "The memorial dungeon " + .instance_name$ + " does not exist."; mes "The party leader did not generate the dungeon yet."; close; case 1: mes "You can enter the dungeon after making the party."; close; case 0: instance_announce 0, strcharinfo(0)+" from party, " +getpartyname( .@party_id )+", is entering the dungeon, "+.instance_name$+".",bc_map,"0x00ff99",FW_NORMAL,12; end; } //HERCULES //if( has_instance( .map$[0] ) == "" ){ // mes .instance_name$ + " doesnt exist for Party - "+getpartyname( .@party_id ); //} //else{ // warp .map$[0],56,68; // instance_announce 1, getpartyname(getcharid(1))+" entered in the "+.instance_name$+"!",bc_map,"0x00ff99"; //} } end; OnInit: set .instance_name$, "Sky Fortress"; setarray .map$[0],"1@sthb", "1@sthd", "1@sthc"; end; } 1@sthd,101,107,4 script sky_fortress HIDDEN_WARP_NPC,2,2,{ function summon_normal; function summon_doormob; function summon_guardian; end; OnInstanceInit: set .@map$, strnpcinfo(4); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //apply mapflags //setmapflag .@map$,mf_nomobloot; //setmapflag .@map$,mf_nomvploot; //disable unused npcs for now disablenpc instance_npcname( "sfwarp#1", instance_id() ); disablenpc instance_npcname( "sfwarp#2", instance_id() ); set 'instance_sf_level, 0; set 'randomPop, 0; set .max_sf_level, 4; set 'doorOpened, -1; set 'warpPoint, -1; set 'ldEntryX, -1; set 'ldEntryY, -1; set 'stephanId, -1; deletearray .stephanData[0], getarraysize(.@stephanData); deletearray 'stephanFollower[0], getarraysize('stephanFollower); set 'eQCount, -1; set .maxStephanServant, 10; set 'sfKeyId, 6960; set 'timerCount, 0; initnpctimer; end; function summon_normal { set .@map$, getarg(0); set .@npcname$, getarg(1); set .@increaseFloor, getarg(2); if(.@increaseFloor == 1) { 'instance_sf_level++; } setarray .@coordinate,77,158,122,47; switch( 'instance_sf_level ){ case 1: //Immortal Zombie Soldiers setarray .@monster,3476; setarray .@amount,6; setarray .@coordinate,45,77,67,58; set .@clabel$, .@npcname$ + "::OnNormalDied"; areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[0],.@amount[0],.@clabel$; break; case 2: set .@clabel$, .@npcname$ + "::OnNormalDied"; setarray .@monster,3477; setarray .@amount,3; setarray .@coordinate,43,89,69,83; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477, 3479; setarray .@amount,3, 1; setarray .@coordinate,41,55,34,81; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3480; setarray .@amount,1; setarray .@coordinate,34,54,41,46; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3478; setarray .@amount,2,1; setarray .@coordinate,87,54,81,99; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3478,3480,3477; setarray .@amount,1,2,1; setarray .@coordinate,79,99,24,92; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3478,3480; setarray .@amount,3,1,2; setarray .@coordinate,24,91,31,36; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3478,3480; setarray .@amount,3,1,2; setarray .@coordinate,97,43,32,36; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3480; setarray .@amount,2,1; setarray .@coordinate,90,44,97,69; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } break; case 3: set .@clabel$, .@npcname$ + "::OnNormalDied"; setarray .@monster,3477; setarray .@amount,2,1; setarray .@coordinate,217,77,206,34; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3478,3479,3480; setarray .@amount,2,1,1,2; setarray .@coordinate,205,34,140,41; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3478,3480; setarray .@amount,3,1,2; setarray .@coordinate,140,43,147,97; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3479,3478; setarray .@amount,3,2,1; setarray .@coordinate,148,97,203,90; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3479,3478; setarray .@amount,3,2,1; setarray .@coordinate,148,97,203,90; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3479,3478,3480; setarray .@amount,2,2,1,2; setarray .@coordinate,203,88,196,44; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3479,3478; setarray .@amount,2,2,1; setarray .@coordinate,195,44,150,51; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3479,3480; setarray .@amount,3,1,2; setarray .@coordinate,150,53,157,87; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3478,3480; setarray .@amount,2,1,2; setarray .@coordinate,158,87,193,79; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } setarray .@monster,3477,3480; setarray .@amount,2,3; setarray .@coordinate,193,78,186,58; set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } break; case 4: //Immortal Zombie Soldiers setarray .@monster,3480; setarray .@amount,5; setarray .@coordinate,93,110,117,82; set .@clabel$, .@npcname$ + "::OnNormalDied"; //RATHENA areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[0],.@amount[0],.@clabel$; copyarray 'stephanFollower, $@mobId[0], .@amount; //HERCULES //set 'stephanFollower, areamonster(.@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[0],.@amount[0],.@clabel$); break; } return; } function summon_doormob { set .@map$, getarg(0); set .@npcname$, getarg(1); set .@map$, instance_mapname( "1@sthc" ); killmonster .@map$, "All"; switch('warpPoint) { case 0: setarray .@coordinate,106,88,125,137; setarray .@monster,3481,3482; setarray .@amount,5,3; setarray .@label$[0], "OnDoorMobDied", "OnDoorMobDied"; areamonster .@map$,115,130,116,129,"--ja--",2288,1,.@npcname$ + "::OnDoorMobDied"; break; case 1: setarray .@coordinate,75,55,56,6; setarray .@monster,3482,3483; setarray .@amount,3,4; setarray .@label$[0], "OnDoorMobDied", "OnDoorMobDied"; areamonster .@map$,65,48,66,47,"--ja--",2288,1,.@npcname$ + "::OnDoorMobDied"; break; case 2: setarray .@coordinate,56,88,75,137; setarray .@monster,3481,3483; setarray .@amount,5,2; setarray .@label$[0], "OnDoorMobDied", "OnDoorMobDied"; areamonster .@map$,65,130,66,129,"--ja--",2288,1,.@npcname$ + "::OnDoorMobDied"; break; case 3: setarray .@coordinate,6,6,25,55; setarray .@monster,3481,3482,3483; setarray .@amount,3,3,3; setarray .@label$[0], "OnDoorMobDied", "OnDoorMobDied", "OnDoorMobDied"; break; case 4: setarray .@coordinate,6,88,24,135; setarray .@monster,3481,3483; setarray .@amount,6,5; setarray .@label$[0], "OnDoorMobDied", "OnDoorMobDied"; break; } set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ set .@clabel$, .@npcname$ + "::" + .@label$[.@i]; areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],.@amount[.@i],.@clabel$; } return; } function summon_guardian { set .@map$, getarg(0); set .@npcname$, getarg(1); set .@label$, .@npcname$ + "::OnGuardianDied"; if('instance_sf_level == 2) { //mvp or treasure chest switch('warpPoint) { case 3: setarray .@coordinate,14,51,17,48; setarray .@monster,rand(3474,3475); setarray .@amount,1; setarray .@label$, .@npcname$ + "::OnDoorGuardianDied"; break; case 4: setarray .@coordinate,13,134,18,129; setarray .@monster,rand(3474,3475); setarray .@amount,1; setarray .@label$, .@npcname$ + "::OnDoorGuardianDied"; break; } } else { switch( 'instance_sf_level ){ case 1: //weakened mvp setarray .@monster,3473; setarray .@coordinate,61,69,61,69; break; case 4: //stephan setarray .@monster,3484; setarray .@coordinate,103,114,103,114; break; default: instance_announce 0, "[ Sky Fortress ] : Cleared!! Congratulation!!",bc_map,0x00FF99; return; } } set .@monster_size, getarraysize( .@monster ); for( set .@i, 0; .@i < .@monster_size; set .@i,.@i+1 ){ if('instance_sf_level == .max_sf_level) { //RATHENA areamonster(.@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],1,.@label$); set 'stefanId, $@mobId[0]; //HERCULES //set 'stefanId, monster(.@map$,.@coordinate[0],.@coordinate[1],"--ja--",.@monster[.@i],1,.@label$); } else { areamonster .@map$,.@coordinate[0],.@coordinate[1],.@coordinate[2],.@coordinate[3],"--ja--",.@monster[.@i],1,.@label$; } } return; } OnDoorMobDied: //nothing, used to clean end; OnDoorGuardianDied: //nothing, used to clean end; OnNormalDied: if('instance_sf_level == .max_sf_level) { set .@map$, instance_mapname( "1@sthd" ); } else { set .@map$, instance_mapname( "1@sthb" ); } set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ) ; set .@mob_dead_num, mobcount(.@map$,.@npc_name$+"::OnNormalDied" ); set .@mvp_dead_num, mobcount(.@map$,.@npc_name$+"::OnGuardianDied" ); if( .@mob_dead_num == 0 ){ if('instance_sf_level == 1) { if(.@mvp_dead_num == 0) { enablenpc instance_npcname( "alasfshew", instance_id() ); donpcevent instance_npcname( "alasfshew", instance_id() ) + "::OnTalkEnabled"; } else { summon_normal( .@map$, .@npc_name$, 0 ); } } } end; OnGuardianDied: if('instance_sf_level == .max_sf_level) { set .@map$, instance_mapname( "1@sthd" ); } else { set .@map$, instance_mapname( "1@sthb" ); } set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); set .@mob_dead_num, mobcount(.@map$,.@npc_name$+"::OnNormalDied" ); set .@mvp_dead_num, mobcount(.@map$,.@npc_name$+"::OnGuardianDied" ); set .@party_id, getcharid(1); if( .@mvp_dead_num == 0 ){ if('instance_sf_level == 1) { if(.@mob_dead_num == 0) { enablenpc instance_npcname( "alasfshew", instance_id() ); donpcevent instance_npcname( "alasfshew", instance_id() ) + "::OnTalkEnabled"; } } else if ('instance_sf_level == .max_sf_level) { instance_announce 0, "[ Stefan J.E Wolf ] : Dead...I was...I won't be dead...", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "[ Stefan J.E Wolf ] : Come back...the power of Bijou...Eternal body...again!", bc_map, 0x0000FF; sleep2 1500; set 'randomPop, 0; killmonster instance_mapname( "1@sthd" ), "All"; //enable portal enablenpc instance_npcname( "alasfdeo", instance_id() ); sleep2 15000; getpartymember getcharid(1),2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) && SF_INSTANCE_ID > 0){ set SF_INSTANCE_ID, -1; } instance_destroy instance_id(); end; } } end; OnTimer10000: stopnpctimer; //each 10s, increase timer set 'timerCount, 'timerCount + 10; if('timerCount == $sf_timer_delay) { instance_announce 0, "[ Sky Fortress ] The Dimension collapse! I have to get you out of there!", bc_map, 0xFF0000; sleep 5000; getpartymember getcharid(1),2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) && SF_INSTANCE_ID > 0){ set SF_INSTANCE_ID, -1; } instance_destroy instance_id(); stopnpctimer; } if('randomPop == 1) { if('eQCount >= 0) { set 'eQCount, 'eQCount + 1; } set .@map$, instance_mapname( "1@sthd" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); set .@mob_dead_num, mobcount(.@map$,.@npc_name$+"::OnNormalDied" ); if(.@mob_dead_num == 0 || .@mob_dead_num < .maxStephanServant) { summon_normal( .@map$,.@npc_name$, 0 ); } getpartymember $instance_sf_id,2; set .@continue, 1; for( set .@i, 0; .@i < $@partymembercount && .@continue == 1; set .@i, .@i+1 ) { if( attachrid( $@partymemberaid[.@i] ) ){ if(strcharinfo(3) == instance_mapname( "1@sthd" )) { //RATHENA if(unitexists('stefanId)) { getunitdata('stefanId, .@stephanData); } set .@mvpHp, .@stephanData[2] <= .@stephanData[3] / 3; //HERCULES //set .@hp, getunitdata('stefanId, UDT_HP); //set .@mhp, getunitdata('stefanId, UDT_MAXHP); //set .@mvpHp, .@hp <= .@mhp / 3; //if mob hp is inferior to 1/3, that an earthquake didn't pop in the last minute, and that rand is okay if(.@mvpHp == 1 && 'eQCount >= 6 && rand(0,1) == 1) { set 'eQCount, 0; addtimer 3000, strnpcinfo(3) + "::OnEarthquakePop"; set .@continue, 0; } } } } } initnpctimer; end; OnEarthquakePop: set .@map$, strnpcinfo(4); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); for(set .@i, 0; .@i<getarraysize('stephanFollower); set .@i,.@i+1) { //earthquake on all mobs if(unitexists('stephanFollower[.@i])) { unitskilluseid 'stephanFollower[.@i], 653, 10; } else { deletearray 'stephanFollower[.@i], 1; } } end; OnFirstFloorOn: set .@map$, instance_mapname( "1@sthb" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //pop mvp + wave mobs summon_normal( .@map$, .@npc_name$, 1 ); summon_guardian( .@map$, .@npc_name$ ); end; OnSecondFloorOn: set .@map$, instance_mapname( "1@sthb" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //wave mobs summon_normal( .@map$, .@npc_name$, 1 ); end; OnDoorOpen: set .@map$, instance_mapname( "1@sthc" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //wave mobs summon_doormob( .@map$, .@npc_name$, 0 ); end; OnDevicePoped: set .@map$, instance_mapname( "1@sthc" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //pop mvp summon_guardian( .@map$, .@npc_name$ ); end; OnThirdFloorOn: set .@map$, instance_mapname( "1@sthb" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //wave mobs summon_normal( .@map$, .@npc_name$, 1 ); end; OnLastFloorOn: set .@map$, instance_mapname( "1@sthd" ); set .@npc_name$, instance_npcname( strnpcinfo(0), instance_id() ); //pop mvp set 'randomPop, 1; set 'eQCount, 0; summon_normal( .@map$, .@npc_name$, 1 ); summon_guardian( .@map$, .@npc_name$ ); end; } 1@sthb,61,69,3 script Stefan J.E. Wolf::alasfshew 3484,2,2,{ end; OnTouch: if('talking == 0) { set 'talking, 1; if('instance_sf_level == 0) { charcommand "#me " + strcharinfo(0) + " Is this what caused the invasion into Prontera? Inside the Sky Fortress?"; cutin "stephan_j_e_w", 2; sleep2 1500; instance_announce 0, "Intruders...Inside the Sky Fortress", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "Bijou...Told me to destroy the intruders!", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "Little...human...Greenhorn...Away!", bc_map, 0x0000FF; cutin "", 255; disablenpc strnpcinfo(3); donpcevent instance_npcname( "sky_fortress", instance_id() ) + "::OnFirstFloorOn"; } else if('instance_sf_level == 1) { cutin "stephan_j_e_w", 2; instance_announce 0, "Grunts", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "What a bunch of...Annoying worms!", bc_map, 0x0000FF; sleep2 1500; charcommand "#me " + strcharinfo(0) + " I believe that huge golem play an important role here..."; instance_announce 0, "Subordinates of the Sky Fortress...Stop them...Bijou's order!", bc_map, 0x0000FF; sleep2 1500; cutin "", 255; specialeffect 96; disablenpc strnpcinfo(3); enablenpc instance_npcname( "sfwarp#1", instance_id() ); enablenpc instance_npcname( "sfwarp#2", instance_id() ); enablenpc instance_npcname( "alasfshew2", instance_id() ); donpcevent instance_npcname( "sky_fortress", instance_id() ) + "::OnSecondFloorOn"; } } end; OnTalkEnabled: set 'talking, 0; end; OnInstanceInit: set 'talking, 0; OnInit: enablenpc strnpcinfo(3); end; } 1@sthb,208,93,3 script Stefan J.E. Wolf::alasfshew2 3484,5,5,{ end; OnTouch: if('talking == 0) { set 'talking, 1; instance_announce 0, "Grunts", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "Filthy humans! Stop them! Guard...The Holy Fortress!", bc_map, 0x0000FF; sleep2 1500; charcommand "#me " + strcharinfo(0) + " It's extremly vigilante..."; sleep2 1500; charcommand "#me " + strcharinfo(0) + " I thinks there must be something"; sleep2 1500; charcommand "#me " + strcharinfo(0) + " if we follow those Golem's traces."; sleep2 1500; disablenpc strnpcinfo(3); donpcevent instance_npcname( "sky_fortress", instance_id() ) + "::OnThirdFloorOn"; } end; OnTalkEnabled: set 'talking, 0; end; OnInstanceInit: set 'talking, 0; OnInit: disablenpc strnpcinfo(3); end; } 1@sthb,34,85,3 script Locked Door#7::alasfld 4_ENERGY_RED,{ getmapxy(.@map$, .@x, .@y, UNITTYPE_NPC); //debugmes "entry: [" + .@x + "," + .@y + "] / [" + 'ldEntryX + "," + 'ldEntryY + "]"; sleep2 200; if(countitem('sfKeyId) > 0 && .@x != 'ldEntryX && .@y != 'ldEntryY) { mes "[Locked Door]"; mes "Do you want to open the door?"; if(select("Yes","No") == 1) { delitem 'sfKeyId, 1; set 'ldEntryX, .@x; set 'ldEntryY, .@y; set 'warpPoint, rand(0,4); switch('warpPoint) { case 0: setarray 'entry[0], 115, 92; break; case 1: setarray 'entry[0], 66, 10; break; case 2: setarray 'entry[0], 66, 92; break; case 3: setarray 'entry[0], 16, 9; break; case 4: setarray 'entry[0], 15, 93; break; } getpartymember getcharid(1),2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) ){ if(strcharinfo(3) == instance_mapname( "1@sthb" )) { warp instance_mapname( "1@sthc" ), 'entry[0], 'entry[1]; } } donpcevent instance_npcname( "sky_fortress", instance_id() ) + "::OnDoorOpen"; } } else if('ldEntryX != 0 && 'ldEntryY != 0) { if(.@x == 'ldEntryX && .@y == 'ldEntryY) { switch('warpPoint) { case 0: setarray 'entry[0], 115, 92; break; case 1: setarray 'entry[0], 66, 10; break; case 2: setarray 'entry[0], 66, 92; break; case 3: setarray 'entry[0], 16, 9; break; case 4: setarray 'entry[0], 15, 93; break; } getpartymember getcharid(1),2; for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 ) if( attachrid( $@partymemberaid[.@i] ) ){ if(strcharinfo(3) == instance_mapname( "1@sthb" )) { warp instance_mapname( "1@sthc" ), 'entry[0], 'entry[1]; } } } } end; } 1@sthc,16,6,3 script warp::alasfow WARPNPC,2,2,{ end; OnTouch: warp instance_mapname( "1@sthb" ), 'ldEntryX, 'ldEntryY; end; } 1@sthb,189,55,3 script warp::alasfli WARPNPC,2,2,{ end; OnTouch: warp instance_mapname( "1@sthd" ), 105, 72; enablenpc instance_npcname( "alasfshew3" ); end; } 1@sthd,103,114,3 script Stefan J.E. Wolf::alasfshew3 3484,5,5,{ end; OnTouch: if('talking == 0) { set 'talking, 1; charcommand "#me " + strcharinfo(0) + " So this is finally the last...I suppose he must be the cause of Prontera invasion isn't he?"; sleep2 1500; cutin "stephan_j_e_w", 2; instance_announce 0, "[Wolf] Adventurers...A bunch of foolish greenhorns!", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "[Jack] I must follow orders...From Bijou!", bc_map, 0x0000FF; sleep2 1500; charcommand "#me " + strcharinfo(0) + " Bijou? So was the golem the mere guardian around here? Is that it?"; sleep2 1500; instance_announce 0, "[Stefan] Growl!", bc_map, 0x0000FF; sleep2 1500; instance_announce 0, "[Earnest] Filthy worms...Can't lead life as intended. Immortal power...My body...", bc_map, 0x0000FF; sleep2 1500; charcommand "#me " + strcharinfo(0) + " I'd better defeat it first."; sleep2 1500; instance_announce 0, "[Stefan J.E Wolf] Soldiers...Bijou's Fortress...Cut them all...I'll step up...I'll kill them...All", bc_map, 0x0000FF; sleep2 1500; disablenpc strnpcinfo(3); cutin "", 255; donpcevent instance_npcname( "sky_fortress" ) + "::OnLastFloorOn"; } end; OnInstanceInit: set 'talking, 0; OnInit: disablenpc strnpcinfo(3); end; } 1@sthc,66,6,3 duplicate(alasfow) warp::alasfow2 WARPNPC,2,2 1@sthc,15,88,3 duplicate(alasfow) warp::alasfow3 WARPNPC,2,2 1@sthc,66,88,3 duplicate(alasfow) warp::alasfow4 WARPNPC,2,2 1@sthc,115,88,3 duplicate(alasfow) warp::alasfow5 WARPNPC,2,2 1@sthc,15,51,3 script Strange Device#0::alasfsd HIDDEN_NPC,{ mes "[Strange Device]"; mes "Do you want to activate the device?"; if(select("Yes","No") == 1) { if(getd("'used" + strnpcinfo(2)) == 0) { donpcevent instance_npcname( "sky_fortress", instance_id() ) + "::OnDevicePoped"; setd("'used" + strnpcinfo(2), 1); } else { next; mes "[Strange Device]"; mes "Nothing happens."; } } close; OnInstanceInit: setd("'used" + strnpcinfo(2), 0); end; } 1@sthd,103,95,3 script Dimensional Device::alasfdeo PORTAL,{ mes "[Dimensional Device]"; mes "Do you want to leave?"; if(select("Yes","No") == 1) { warp "SavePoint", 0, 0; } close; OnInstanceInit: OnInit: disablenpc strnpcinfo(3); end; } 1@sthc,15,133,3 duplicate(alasfsd) Strange Device#2::alasfsd3 HIDDEN_NPC 1@sthb,83,99,3 duplicate(alasfld) Locked Door#1::alasfld2 4_ENERGY_BLUE 1@sthb,24,40,3 duplicate(alasfld) Locked Door#2::alasfld3 4_ENERGY_YELLOW 1@sthb,206,79,3 duplicate(alasfld) Locked Door#3::alasfld4 4_ENERGY_BLACK 1@sthb,147,86,3 duplicate(alasfld) Locked Door#4::alasfld5 4_ENERGY_WHITE 1@sthb,179,51,3 duplicate(alasfld) Locked Door#5::alasfld6 4_ENERGY_RED 1@sthb,73,70 warp sfwarp#1 2,2,1@sthb,73,75 1@sthb,93,74 warp sfwarp#2 2,2,1@sthb,210,98 This is my Script. att @superpatskie Worked perfectly. You are an angel !! att
  7. hello, i have a problem with the command instance annouce. I already tried to use ID = 0, instance_id(), but the error continue. anyone can help me plz????? thx
  8. joey93

    INSTANCES

    Hello ! Someone have functionals Custom instances to run in RATHENA 2019+ , plz. if possible with the maps.. ex: Skyfortress and etc.. Att.
  9. Hi guys.. I am building a Faction system on my server, and I would like to know if it is possible to use PK mode for only one faction to attack the other on maps. The identification is set in the database by a new field. 1 = Faction1 and 2 = Faction2. Could you help me please?
×
×
  • Create New...