Jump to content

cumbe11

Members
  • Content Count

    42
  • Joined

  • Last visited

Posts posted by cumbe11


  1. Original English version without personal changes ..

     

     

    // (c) 2008 - 2012 eAmod Project; Andres Garbanzo / Zephyrus//// - [email protected]// - MSN [email protected]// - Skype: Zephyrus_cr// - Site: http://dev.terra-gaming.com//// This file is NOT public - you are not allowed to distribute it.// Authorized Server List : http://dev.terra-gaming.com/index.php?/topic/72-authorized-eamod-servers/// eAmod is a non Free, extended version of eAthena Ragnarok Private Server.// ==============================================================================// BattleGround System - Common NPCs// ==============================================================================// MapFlags// *********************************************************************bat_room	mapflag	nomemobat_room	mapflag	nowarptobat_room	mapflag	nobranchbat_room	mapflag	nopenaltybat_room	mapflag	noteleportbat_room	mapflag	nosave	SavePointbat_room	mapflag	allow_bg_items// Mapflag Town is required to Join BG Queuesbat_room	mapflag	town// Battleground Queue Admin// *********************************************************************-	script	BG_Queue_Join	-1,{	end;OnInit:	// Configuration	// *****************************************************	// Battleground Rotation - Main NPC name	setarray .BG_Arenas$[0],	 "Flavius_CTF", "Tierra_EOS", "Tierra_TI", "Flavius_TD","Tierra_Boss","Conquest", "Flavius_SC","Tierra_DOM", "Rush";	// Battleground Arena Name - for announcements	setarray .BG_Names$[0],		"Capture the Flag","Eye of Storm","Triple Inferno","Team DeathMatch", "Bossnia","Conquest","Stone Control","Domination", "Rush";	// Minimum Players to start the BG	setarray .BG_Min[0],	 5, 5, 5, 5, 5, 20, 5, 5, 15;	// Maximum Players per Team	setarray .BG_Max[0],	 35, 35, 35, 35, 35, 50, 35, 35, 30;	// BG Message Colors	setarray .BG_Color$[0],	 "0xA0522D", "0x4169E1", "0x696969", "0x808000", "0x483D8B","0xFFA500", "0x9ACD32", "0x4169E1","0xDDA0DD";	// Team Building Mode : 0 = Lineal | 1 = Random | 2 = Class Priority | 3 = Faction Mode | 4 = Team Color ( by script set Bat_Team,N; )	set .TeamMode, 0;	// Main Code	// *****************************************************	set .BG_Count, getarraysize(.BG_Arenas$);	set .BG_Queue, bg_queue_create("Battleground Arena","BG_Queue_Join::OnJoinEvent",80);	set .VS_Queue, bg_queue_create("Free For All Arena","BG_Queue_Join::OnVersusJoin",80);	// Move to Next Arena	if( $BG_Index >= .BG_Count ) set $BG_Index,0; // Restart Rotation	set .BG_Arena$,.BG_Arenas$[$BG_Index];	set .Ready, 1;	donpcevent "BG_Queue_Join::OnDoHappyHour";	initnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method	// Comment the next two lines if you don't want to allow @joinbg and @leavebg commands.	bindatcmd "joinbg","BG_Queue_Join::OnDoJoin",0,99;	bindatcmd "leavebg","BG_Queue_Join::OnDoLeave",0,99;	end;OnDoJoin: // @joinbg	if( checkquest(8506,PLAYTIME) == 2 )		erasequest 8506;	if( checkquest(8506,PLAYTIME) != -1 )	{		dispbottom "[You are a Deserter. You can't participate until the indicator goes off]";		end;	}	bg_queue_join .BG_Queue;	end;OnDoLeave: // @leavebg	bg_queue_leave .BG_Queue;	end;OnRotate:OnTimer120000: // Rotation if BG don't start... Comment if you don't want to use this method. 120 = 2 Minutes	set $@BG_Status, 0;	// Warps Teams	bg_warp $@BG_Team1,"bat_room",155,150;	bg_warp $@BG_Team2,"bat_room",155,150;	bg_warp $@BG_Team3,"bat_room",155,150;	// Destroy Teams	bg_destroy $@BG_Team1; set $@BG_Team1, 0;	bg_destroy $@BG_Team2; set $@BG_Team2, 0;	bg_destroy $@BG_Team3; set $@BG_Team3, 0;	// Move to Next Arena	if( set($BG_Index,$BG_Index + 1) >= .BG_Count )		set $BG_Index,0; // Restart Rotation	set .BG_Arena$,.BG_Arenas$[$BG_Index];	initnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method	// Trigger the Event - Maybe people is waiting...OnJoinEvent:	if( $@BG_Status == 2 )		end; // BG Ending... Must wait until OnRotate is called	set .@Queue_Count, bg_queue_data(.BG_Queue,0);	switch( $@BG_Status )	{	case 0: // Idle - Ready to Start		if( .BG_Arena$ == "Tierra_TI" )			set .@Req, .BG_Min[$BG_Index] * 3;		else			set .@Req, .BG_Min[$BG_Index] * 2;		if( bg_queue_checkstart(.BG_Queue,.TeamMode,( (.BG_Arena$ == "Tierra_TI") ? 3 : 2 ),.BG_Min[$BG_Index]) )		{			donpcevent .BG_Arena$ + "::OnBuildTeams";			// Fill Teams with Queue Members						if( .BG_Arenas$[$BG_Index] == "Tierra_TI" )				bg_queue2teams .BG_Queue,.BG_Min[$BG_Index],.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;			else				bg_queue2teams .BG_Queue,.BG_Min[$BG_Index],.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2;			stopnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method			set $@BG_Status,1;			set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- Begining";			bgannounce .@msg$,.BG_Color$[$BG_Index];			donpcevent .BG_Arena$ + "::OnReady";		}		else		{			set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- " + (.@Req - .@Queue_Count) + " more players to start.";			announce .@msg$,0,.BG_Color$[$BG_Index];		}		break;	case 1: // Running - Others can join		if( .@Queue_Count > 0 )		{			if( .BG_Arena$ == "Tierra_TI" )			{				bg_balance_teams .BG_Queue,.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;				set .@BG_Count1, bg_get_data($@BG_Team1,0);				set .@BG_Count2, bg_get_data($@BG_Team2,0);				set .@BG_Count3, bg_get_data($@BG_Team3,0);				set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- B: " + .@BG_Count1 + "/" + .BG_Max[$BG_Index] + ", R: " + .@BG_Count2 + "/" + .BG_Max[$BG_Index] + ", G: " + .@BG_Count3 + "/" + .BG_Max[$BG_Index] + " (Playing)";			}			else			{				bg_balance_teams .BG_Queue,.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2;				set .@BG_Count1, bg_get_data($@BG_Team1,0);				set .@BG_Count2, bg_get_data($@BG_Team2,0);				set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- B: " + .@BG_Count1 + "/" + .BG_Max[$BG_Index] + ", R: " + .@BG_Count2 + "/" + .BG_Max[$BG_Index] + " (Playing)";			}			bgannounce .@msg$,.BG_Color$[$BG_Index];		}		break;	}	end;OnVersusJoin:	if( $@VS_Status != 0 )		end;	set .@Queue_Count, bg_queue_data(.VS_Queue,0);	if( .@Queue_Count >= 10 )	{		donpcevent "FFA_Arena::OnBuildTeams";		bg_queue2teams .VS_Queue,1,1,0,$@VS_Team[0],$@VS_Team[1],$@VS_Team[2],$@VS_Team[3],$@VS_Team[4],$@VS_Team[5],$@VS_Team[6],$@VS_Team[7],$@VS_Team[8],$@VS_Team[9];		set $@VS_Status,1;		announce "Battleground -- Free For All -- Begining",0,0x483D8B;		donpcevent "FFA_Arena::OnReady";	}	else		announce "Battleground -- Free For All -- " + (10 - .@Queue_Count) + " more players to start",0,0x483D8B;	end;OnFri0600: // Friday, 6 a.m.	rankreset 1; // Ranking Reset	end;// BattleGround Happy HourOnDoHappyHour:OnClock1600:OnClock1800:OnClock2000:OnClock2200:	switch( gettime(4) )	{	case 1:	case 3:	case 5:		if( gettime(3) >= 20 && gettime(3) < 22 )		{			announce "-- Battleground Happy Hour has begun | Ranked Arena Mode --",0,0x00FF00;			setbattleflag "bg_reward_rates",120; // +20% Reward Rates			setbattleflag "bg_ranked_mode",1;			end;		}				if( gettime(3) == 22 )		{			announce "-- Battleground Happy Hour is over | Regular Arena Mode --",0,0x00BFFF;			setbattleflag "bg_reward_rates",100; // Normal Rates			setbattleflag "bg_ranked_mode",0;			end;		}		break;	case 2:	case 4:	case 6:		if( gettime(3) >= 16 && gettime(3) < 18 )		{			announce "-- Battleground Happy Hour has begun | Ranked Arena Mode --",0,0x00FF00;			setbattleflag "bg_reward_rates",120; // +20% Reward Rates			setbattleflag "bg_ranked_mode",1;			end;		}				if( gettime(3) == 18 )		{			announce "-- Battleground Happy Hour is over | Regular Arena Mode --",0,0x00BFFF;			setbattleflag "bg_reward_rates",100; // Normal Rates			setbattleflag "bg_ranked_mode",0;			end;		}		break;	}	end;}// Registration NPC// *********************************************************************-	script	BG_Register	-1,{	if( getvariableofnpc(.Ready,"BG_Queue_Join") == 0 )		donpcevent "BG_Queue_Join::OnInit";	mes "[^FFA500Battle Recruiter^000000]";	mes "This is the Battleground Information and Registration service.";	mes "What do you want to do?";	next;	switch( select("^FFA500Battleground Arenas^000000:^0000FFFree For All Arena^000000:Warp to Battle Room") )	{	case 1:		mes "[^FFA500Battle Recruiter^000000]";		mes "Battlegrounds Arena are different kinds of games where Teams fight for victory.";		mes "What do you want to do?";		next;		switch( select("Register:Party Register:Leave Queue:Battleground Help") )		{		case 1:			if( BaseLevel < 80 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Min required level to join a battleground is 80.";				close;			}			if( checkquest(8506,PLAYTIME) == 2 )				erasequest 8506;			if( checkquest(8506,PLAYTIME) != -1 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "You are a Deserter. You can't participate until the indicator goes off";				close;			}			mes "[^FFA500Battle Recruiter^000000]";			mes "Let's proceed with the registration...";			mes "You must wait on any City until BG starts.";			mes "Close this window to continue...";			close2;			bg_queue_join getvariableofnpc(.BG_Queue,"BG_Queue_Join");			end;		case 2:			if( getcharid(1) == 0 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "You are not on a Party.";				close;			}			mes "[^FFA500Battle Recruiter^000000]";			mes "Let's proceed with the registration...";			mes "You must wait on any City until BG starts.";			mes "Close this window to continue...";			close2;			bg_queue_partyjoin getcharid(1),getvariableofnpc(.BG_Queue,"BG_Queue_Join");			end;		case 3:			mes "[^FFA500Battle Recruiter^000000]";			mes "If you are registered, you will be removed.";			mes "Are you sure?";			next;			if( select("Yes, leave queue:No, I will stay") == 2 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Ok, nothing to change.";				close;			}			mes "[^FFA500Battle Recruiter^000000]";			mes "Close this window to continue...";			close2;			bg_queue_leave getvariableofnpc(.BG_Queue,"BG_Queue_Join");			end;		case 4:			mes "[^FFA500Battle Recruiter^000000]";			mes "Tell me... what battleground you don't understand?";			next;			switch( select("Capture the Flag:Team DeathMatch:Stone Control:Eye of Storm:Bossnia:Domination:Triple Inferno:Conquest:Rush") )			{			case 1:				mes "[^FFA500Battle Recruiter^000000]";				mes "The objective of the Flavius Battle CTF is to score 3 points before your enemy, by capture their Flag.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "To capture a Flag you need to take the enemy flag, and bring it to your base flag.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If your base flag is captured too, you need to kill the flag carrier and take the flag back to your base.";				break;			case 2:				mes "[^FFA500Battle Recruiter^000000]";				mes "Kill all the enemy players to let their Team without points.";				mes "Protect our army.";				break;			case 3:				mes "[^FFA500Battle Recruiter^000000]";				mes "Take the Stones in the middle of the battlefield and put in on your base, in the Stone Points.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each Stone will give points to your team. First team reach 99 points wins the game.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Protect your stones from to be captured by the enemy.";				break;			case 4:				mes "[^FFA500Battle Recruiter^000000]";				mes "There are two bases, North and South which teams can capture by holding position on the Base more than the other team.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each base will give you points each 5 seconds of Domination. If your Team control both bases the amount of points increases.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "To get aditional points, in the middle there is a Flag spawn, capture it and put it on any of your team Bases.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "The first Team reach 99 points wins the match.";				break;			case 5:				mes "[^FFA500Battle Recruiter^000000]";				mes "Attack the enemy base and destroy each MVP Guardian. To do damage to the guardian your team must capture the Balance Flag in the middle base.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each team have 5 guardian to be protected or killed.";				break;			case 6:				mes "[^FFA500Battle Recruiter^000000]";				mes "There are three bases, North, Center and South which teams can capture by holding position on the Base more than the other team.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each base will give you points each 5 seconds of Domination.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "The first Team reach 99 points wins the match.";				break;			case 7:				mes "[^FFA500Battle Recruiter^000000]";				mes "There are 3 teams in the battlefield, your team and other 2 enemies.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Kill the enemy players, collect the skulls and bring then to the Sacrifice Totem to win points.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "You can collect your own team skulls and bring then to your Sacrifice Totem to avoid other teams to score.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If you get killed all your skulls will be drop to the floor, including your own skull. First Team to get 80 points wins the battle.";				break;			case 8:				mes "[^FFA500Battle Recruiter^000000]";				mes "If you are Attacking, destroy the enemy defenses and it's Flag.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If you are Defending, protect your castle defenses and the Flag.";				break;			case 9:				mes "[^FFA500Battle Recruiter^000000]";				mes "Fight to capture the Castle and organize your team to defend it.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If you fail on the first capture, kill the defender and take it for your team.";				break;			}			break;		}		close;	case 2:		mes "[^FFA500Battle Recruiter^000000]";		mes "Free For All Arena is a Duel between 10 players with No Teams.";		mes "The target is to kill 25 players.";		mes "What do you want to do?";		next;		switch( select("Register:Leave Queue") )		{		case 1:			if( BaseLevel < 80 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Min required level to join a battleground is 80.";				close;			}			if( checkquest(8506,PLAYTIME) == 2 )				erasequest 8506;			if( checkquest(8506,PLAYTIME) != -1 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "You are a Deserter. You can't participate until the indicator goes off";				close;			}			mes "[^FFA500Battle Recruiter^000000]";			mes "Let's proceed with the registration...";			mes "You must wait on any City until BG starts.";			mes "Close this window to continue...";			close2;			bg_queue_join getvariableofnpc(.VS_Queue,"BG_Queue_Join");			end;		case 2:			mes "[^FFA500Battle Recruiter^000000]";			mes "If you are registered, you will be removed.";			mes "Are you sure?";			next;			if( select("Yes, leave queue:No, I will stay") == 2 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Ok, nothing to change.";				close;			}			mes "[^FFA500Battle Recruiter^000000]";			mes "Close this window to continue...";			close2;			bg_queue_leave getvariableofnpc(.VS_Queue,"BG_Queue_Join");			end;		}		break;	case 3:		mes "[^FFA500Battle Recruiter^000000]";		mes "May the War God bless you.";		close2;		warp "bat_room",155,150;		end;	}	end;}bat_room,160,150,3	duplicate(BG_Register)	Battle Recruiter#bat	728// prontera,155,180,4	duplicate(BG_Register)	Battle Recruiter#prt	728// General Guillaume// *********************************************************************bat_room,160,159,3	script	General Guillaume	420,{	cutin "bat_kiyom2",2;	mes "[General Guillaume]";	mes "Hot-blooded adventurer, we need your ability to win this battle.";	next;	cutin "bat_kiyom1",2;	mes "[General Guillaume]";	mes "Our great king, Marcel Marollo VII, is very sick lately. His Majesty has declared that he chosen either me or Prince Croix as the next king amongst his 9 sons.";	next;	mes "[General Guillaume]";	mes "Two kings can't share a nation!";	mes "Only the one victorious from His Majesty's appointed battle will be enthroned.";	next;	mes "[General Guillaume]";	mes "This is however, not just a battle between us. This battle will determine the future of this country. I pledge on my honor to prove that I'm the one who can protect this Maroll from outside threats.";	next;	switch( select("Join the Blue Team","Join the Green Team","End Conversation") )	{	case 1:		cutin "bat_kiyom2",2;		mes "[General Guillaume]";		mes "Welcome to my army, comrade.";		mes "Your eyes tell me that you're a soldier that I can trust.";		set Bat_Team,1;		next;		mes "[General Guillaume]";		mes "Now, go upstairs and apply for battle with your comrades. I'm sure they'll welcome you whole-heartedly!";		break;	case 2:		cutin "bat_kiyom2",2;		mes "[General Guillaume]";		mes "So you will take this fight as your own...";		mes "Then you are my enemy.";		set Bat_Team,0;		next;		mes "[General Guillaume]";		mes "Go now, We will meet again in the Battlefield.";		break;	case 3:		mes "[General Guillaume]";		mes "I'll be the one who will capture the flag!";		break;	}	close2;	cutin "",255;	end;}// General Croix// *********************************************************************bat_room,160,140,3	script	Prince Croix	416,{	cutin "bat_crua1",2;	mes "[Prince Croix]";	mes "Wise adventurer, why don't you lend us your power for victory?";	next;	cutin "bat_crua2",2;	mes "[Prince Croix]";	mes "I do not wish to shed blood, but I have no choice but to fight for the possibility of peace and for the sake of my people.";	next;	mes "[Prince Croix]";	mes "General Guillaume may have an advantage in this battle as he is the great general of Maroll, but that doesn't automatically mean he'll win. I want to win this battle so that I can grant a better future for my people.";	next;		switch( select("Join the Red Team","Join the Green Team","End Conversation") )	{	case 1:		mes "[Prince Croix]";		mes "Thank you so much. I feel like I can win with the help of adventurers like you. Now, please go downstairs and join your comrades in sharpening their skills to fight the enemy!";		set Bat_Team,2;		break;	case 2:		mes "[Prince Croix]";		mes "So you will take this fight as your own...";		mes "Then you are my enemy.";		set Bat_Team,0;		next;		mes "[Prince Croix]";		mes "Go now, We will meet again in the Battlefield.";		break;	case 3:		mes "[Prince Croix]";		mes "For Maroll!";		break;	}			close2;	cutin "",255;	end;}// Guard Dummy// *********************************************************************bat_room,161,141,3	script	Prince Croix's Aid::bat_aid	415,{ end; }bat_room,161,139,3	duplicate(bat_aid)	Prince Croix's Aid::bat_aid2	415bat_room,161,160,3	duplicate(bat_aid)	General Guillaume's Aid::bat_aid3	419bat_room,161,158,3	duplicate(bat_aid)	General Guillaume's Aid::bat_aid4	419// Flags// *********************************************************************-	script	Base Flag#bg	-1,{ end; }// BattleGround Warper - Exit// *********************************************************************bat_room,148,150,4	script	Teleporter#bat	124,{	mes "[Teleporter]";	mes "Do you wish to leave the battlefield? Use my service to return to town.";	next;	if( select("Leave:Don't Leave") == 2 )	{		mes "[Teleporter]";		mes "I'll be here whenever you're in need of my service.";		close;	}	switch( @ArenaPVP_out )	{		// Rune Midgard Republic		case 1: warp "prontera",149,92; break;		case 2: warp "payon",165,98; break;		case 3: warp "morocc",153,94; break;		case 4: warp "umbala",121,143; break;		case 5: warp "comodo",196,140; break;		case 6: warp "niflheim",214,193; break;		case 7: warp "aldebaran",143,111; break;		case 8: warp "geffen",107,53; break;		// Schwarzard Republic		case 9: warp "yuno",151,177; break;		case 10: warp "hugel",99,143; break;		case 11: warp "lighthalzen",167,93; break;		case 12: warp "einbroch",70,194; break;		case 13: warp "einbech",168,130; break;		// Arunafelz Republic		case 14: warp "rachel",118,114; break;		case 15: warp "veins",207,122; break;		// Islands		case 16: warp "nameless_n",161,179; break;		case 17: warp "louyang",213,106; break;		case 18: warp "gonryun",154,111; break;		case 19: warp "ayothaya",148,109; break;		case 20: warp "moscovia",229,195; break;		case 21: warp "xmas",151,127; break;		case 22: warp "amatsu",203,107; break;		case 23: warp "izlude",126,114; break;		case 24: warp "brasilis",195,211; break;		case 25: warp "manuk",279,214; break;		case 26: warp "splendide",200,174; break;		// Anyplace else		default:			set .@spoint$, getsavepoint(0);			set .@x, getsavepoint(1);			set .@y, getsavepoint(2);			mes "[Teleporter]";			mes "You will be sent back to " + .@spoint$ + ".";			close2;			warp .@spoint$, .@x, .@y;			break;	}		set @ArenaPVP_out, 0;	end;}// Kafra// *********************************************************************bat_room,148,147,4	script	Kafra Staff::kaf_bat	861,{	cutin "kafra_09",2;	callfunc "F_Kafra",0,2,1,150,0;}// Badges Exchange// *********************************************************************bat_room,163,146,2	script	Telma	701,{	mes "[Telma]";	mes "Welcome, mighty warrior.";	mes "Do you need supply for your battles?";	mes "I can exchange you a nice amount for your badges or open the normal Chronos Supply Store for you.";	next;	switch( select("^FF0000Terra Old Red Box^000000:^FFA500Chronos Supply Store^000000:^FF0000Battleground Exclusive^000000:^0000FFWar of Emperium Exclusive Boxs:War of Emperium Exclusive Items^000000:Other Items") )	{	case 1: // Terra Old Red Box		mes "[Telma]";		mes "You can exchange your BG partipation points, a full round of each won BG, for one ^FF0000Terra Old Red Box^000000.";		mes "Let me check your points...";		next;		mes "Tierra EoS : ^0000FF" + BG_EoE + "^000000";		mes "Tierra Boss : ^0000FF" + BG_Boss + "^000000";		mes "Tierra Dom : ^0000FF" + BG_DOM + "^000000";		mes "Flavius CTF : ^0000FF" + BG_CTF + "^000000";		mes "Flavius TDM : ^0000FF" + BG_TDM + "^000000";		mes "Flavius SC : ^0000FF" + BG_SC + "^000000";		mes "Conquest : ^0000FF" + BG_CON + "^000000";		mes "Rush : ^0000FF" + BG_RUSH + "^000000";		mes "Triple Inferno : ^0000FF" + BG_TI + "^000000";		next;		if( BG_EoE > 0 && BG_Boss > 0 && BG_CTF > 0 && BG_TDM > 0 && BG_SC > 0 && BG_TI > 0 && BG_CON > 0 && BG_RUSH > 0 && BG_DOM > 0 )		{			set BG_EoE, BG_EoE - 1;			set BG_Boss, BG_Boss - 1;			set BG_DOM, BG_DOM - 1;			set BG_CTF, BG_CTF - 1;			set BG_TDM, BG_TDM - 1;			set BG_SC, BG_SC - 1;			set BG_CON, BG_CON - 1;			set BG_RUSH, BG_RUSH - 1;			set BG_TI, BG_TI - 1;			getitem 5000,1;			mes "[Telma]";			mes "Here is one Box for you!!";			mes "I hope you can find inside it a big surprise.";			mes "Talk to me if you want to exchange more.";		}		else		{			mes "[Telma]";			mes "To exchange your points for a Box, you need at least 2 one of each Battleground.";			mes "Play all kinds of BG's!!.";		}		close;	case 2: // Supply Store		mes "[Telma]";		mes "Close this window to open the Chronos Supply Store.";		close2;		callshop "ChronosShop",1;		end;	case 3: // BG Supply		setarray .@Items[0], 547, 504, 505, 678, 7135, 7136, 7137, 7138, 7139, 715, 716, 717,12016, 1025, 7321, 662,12072,12077,12082,12087,12092,12097;		setarray .@Amount[0], 150, 100, 100, 10, 40, 40, 30, 30, 25, 50, 100, 200, 10, 40, 25, 10, 3, 3, 3, 3, 3, 3;		setarray .@Value[0], 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1;		set .@cID, getbattleflag("bg_reserved_char_id");		set .@Tarjet$, "Battleground";		break;	case 4: // WoE Supply Boxs		setarray .@Items[0], 8916, 8917, 8924, 8929, 8935, 8934, 8926, 8927, 8962, 8961, 8925, 8928, 8930;		setarray .@Amount[0], 3, 1, 2, 2, 1, 1, 2, 1, 1, 1, 4, 1, 1;		setarray .@Value[0], 8, 4, 4, 8, 10, 10, 8, 8, 4, 2, 8, 10, 8;		set .@cID, 0;		set .@Tarjet$, "War of Emperium or GvG";		break;	case 5: // WoE Supply Items		setarray .@Items[0], 7137, 7138, 662,12072,12077,12082,12087,12092,12097,14287,14288;		setarray .@Amount[0], 30, 30, 10, 6, 6, 6, 6, 6, 6, 5, 5;		setarray .@Value[0], 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8;		set .@cID, getbattleflag("woe_reserved_char_id");		set .@Tarjet$, "War of Emperium or GvG";		break;	case 6:		setarray .@Items[0], 8918, 8919, 8960;		setarray .@Amount[0], 1, 1, 1;		setarray .@Value[0], 15, 15, 15;		set .@cID, 0;		set .@Tarjet$, "Everywhere";		break;	}	set .@Menu$, "";	for( set .@i, 0; .@i < getarraysize(.@Items); set .@i, .@i + 1 )		set .@Menu$, .@Menu$ + .@Amount[.@i] + " " + getitemname(.@Items[.@i]) + " (" + .@Value[.@i] + " badges):";	set .@j, select(.@Menu$) - 1;	mes "[Telma]";	mes "^0000FF" + .@Amount[.@j] + " " + getitemname(.@Items[.@j]) + "^000000";	mes "It will cost you " + .@Value[.@j] + " badges per pack.";	mes "Remember this can only be used on " + .@Tarjet$ + ".";	next;		mes "[Telma]";	mes "But tell me first, where do you want to receive the items?";	next;	set .@Destiny, select("Here, in my Inventory:Direct to my Storage") - 1;	mes "[Telma]";	mes "How many packets do you want to buy? (1..50)";	next;	input .@total;	if( .@total < 1 || .@total > 50 )	{		mes "[Telma]";		mes "I am sorry, please input a value from 1 to 50.";		mes "Talk to me again when you do your selections.";		close;	}		set .@vtotal, .@total * .@Value[.@j]; // Value of all Packages	set .@total, .@total * .@Amount[.@j]; // Total Amount of Items	if( .@Destiny )	{ // Check Storage Space Limit		if( .@cID )		{			if( checkspace(.@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff) == 0 )			{				mes "[Telma]";				mes "It's seen your storage cannot accept more items.";				mes "Go to your store and check the free space.";				close;			}		}		else		{			if( checkspace(.@Items[.@j],.@total,1,0,0,0,0,0,0) == 0 )			{				mes "[Telma]";				mes "It's seen your storage cannot accept more items.";				mes "Go to your store and check the free space.";				close;			}		}	}	else	{ // Check Weight Limit		if( checkweight(.@Items[.@j],.@total) == 0 )		{			mes "[Telma]";			mes "It's seen you can't carry the stuff you want to buy.";			mes "Go and store some items on your Kafra Storage.";			close;		}	}	if( countitem(7828) + countitem(7829) + countitem(7773) < .@vtotal )	{		mes "[Telma]";		mes "Required Badges: ^0000FF" + .@vtotal + "^000000";		mes "You do not have enough badges. Sorry...";		mes "Participate in Battleground arenas to receive it.";		close;	}	set .@vcount, .@vtotal;	set .@i7828, 0;	set .@i7829, 0;	set .@i7773, 0;	// Bravery Badges	if( countitem(7828) > 0 )	{		mes "[Telma]";		mes "Required Badges: ^0000FF" + .@vcount + "^000000";		mes "Bravery Badges to expend:";		next;		input .@i7828;		if( .@i7828 < 0 || .@i7828 > countitem(7828) )		{			mes "[Telma]";			mes "Invalid number... Sorry.";			close;		}				if( .@i7828 > .@vcount ) set .@i7828,.@vcount;		set .@vcount, .@vcount - .@i7828;	}	// Valor Badges	if( .@vcount && countitem(7829) > 0 )	{		mes "[Telma]";		mes "Required Badges: ^0000FF" + .@vcount + "^000000";		mes "Valor Badges to expend:";		next;		input .@i7829;		if( .@i7829 < 0 || .@i7829 > countitem(7829) )		{			mes "[Telma]";			mes "Invalid number... Sorry.";			close;		}				if( .@i7829 > .@vcount ) set .@i7829,.@vcount;		set .@vcount, .@vcount - .@i7829;	}	// Heroism Badges	if( .@vcount && countitem(7773) > 0 )	{		mes "[Telma]";		mes "Required Badges: ^0000FF" + .@vcount + "^000000";		mes "Heroism Badges to expend:";		next;		input .@i7773;		if( .@i7773 < 0 || .@i7773 > countitem(7773) )		{			mes "[Telma]";			mes "Invalid number... Sorry.";			close;		}		if( .@i7773 > .@vcount ) set .@i7773, .@vcount;		set .@vcount, .@vcount - .@i7773;	}	// Final Checks	if( .@vcount != 0 )	{		mes "[Telma]";		mes "Sorry, not enough badges to pay the total value.";		close;	}	mes "[Telma]";	mes "Are you ready to pay and receive your items?";	mes "Your payment details:";	mes "^0000FF" + .@i7828 + "^000000 Bravery Badges";	mes "^0000FF" + .@i7829 + "^000000 Valor Badges";	mes "^0000FF" + .@i7773 + "^000000 Heroism Badges";	next;	if( select("Yes, let's do it:I am sorry... not this time") == 2 )	{		mes "[Telma]";		mes "Ok, come again if you change your mind.";		close;	}	if( .@Destiny )	{ // Check Storage Space Limit		if( .@cID )		{			if( checkspace(.@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff) == 0 )			{				mes "[Telma]";				mes "It's seen your storage cannot accept more items.";				mes "Go to your store and check the free space.";				close;			}		}		else		{			if( checkspace(.@Items[.@j],.@total,1,0,0,0,0,0,0) == 0 )			{				mes "[Telma]";				mes "It's seen your storage cannot accept more items.";				mes "Go to your store and check the free space.";				close;			}		}	}	else	{ // Check Weight Limit		if( checkweight(.@Items[.@j],.@total) == 0 )		{			mes "[Telma]";			mes "It's seen you can't carry the stuff you want to buy.";			mes "Go and store some items on your Kafra Storage.";			close;		}	}	if( .@i7828 > countitem(7828) || .@i7829 > countitem(7829) || .@i7773 > countitem(7773) )	{		mes "[Telma]";		mes "What!?, are you a magician or a thief? What did you do with your badges!?";		mes "Get out of here!";		close;	}	delitem 7828,.@i7828;	delitem 7829,.@i7829;	delitem 7773,.@i7773;	if( .@cID )	{		if( .@Destiny )			storeitem2 .@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff;		else			getitem2 .@Items[.@j],.@total,1,0,0,254,0,.@cID&0xffff,(.@cID>>16)&0xffff;	}	else	{		if( .@Destiny )			storeitem .@Items[.@j],.@total;		else			getitem .@Items[.@j],.@total;	}	mes "[Telma]";	mes "Here it is... Now take care and fight for the honor and glory of your prince.";	close;}bat_room,1,1,3,7828	sshop	BraveryExchanger	111,13036:100,13411:100,1425:100,1632:100,1634:100,1543:100,1924:100,1978:100,1574:100,1824:100,1183:100,1380:100,13305:100,1279:100,1739:100,13108:100,13172:100,2538:50,2539:50,2540:50,2435:50,2436:50,2437:50,2376:80,2377:80,2378:80,2379:80,2380:80,2381:80,2382:80,2720:500,2721:500,2722:500,2723:500,2724:500,2725:500,2733:500bat_room,1,1,3,7829	sshop	ValorExchanger	111,13037:100,13410:100,1633:100,1635:100,1542:100,1923:100,1977:100,1575:100,1823:100,1184:100,1482:100,1379:100,13306:100,1280:100,1738:100,13171:100,13173:100,13174:100,2538:50,2539:50,2540:50,2435:50,2436:50,2437:50,2376:80,2377:80,2378:80,2379:80,2380:80,2381:80,2382:80,2720:500,2721:500,2722:500,2723:500,2724:500,2725:500,2733:500bat_room,1,1,3,7773	sshop	HeroismExchanger	111,1187:2000,1281:2000,1282:2000,1310:2000,1382:2000,1426:2000,1486:2000,1546:2000,1576:2000,1577:2000,1640:2000,1641:2000,1743:2000,1826:2000,1827:2000,1927:2000,1981:2000,2002:2000,13042:2000,13110:2000,13176:2000,13177:2000,13178:2000,13179:2000,13307:2000,13416:2000,13417:2000,13418:2000,2394:840,2395:170,2396:25,2444:580,2445:70,2446:15,2549:630,2772:1200,2773:280,2774:40bat_room,163,154,2	script	Erundek	109,{	mes "[Erundek]";	mes "Welcome, mighty warrior.";	mes "What can I do for you today ?";	next;	switch( select("Exchange Bravery Badges","Exchange Valor Badges","Exchange Heroism Badges","Hmm, nothing I guess.") )	{		case 4:			mes "[Erundek]";			mes "As you wish.";			mes "See you later.";			close;		case 1: // Bravery Badges			mes "[Erundek]";			mes "So you want to exchange ^0000FFBravery Badges^000000 from the Battle of Tierra Valley.";			mes "Close this window to open shop.";			close2;			callshop "BraveryExchanger",0;			end;		case 2: // Valor Badges			mes "[Erundek]";			mes "So you want to exchange ^FF0000Valor Badges^000000 from the Battle of Flavius.";			mes "Close this window to open shop.";			close2;			callshop "ValorExchanger",0;			end;		case 3: // Heroism Badges			mes "[Erundek]";			mes "So you want to exchange ^FFA500Heroism Badges^000000 from the Battle of Kriger Von Midgard.";			mes "Close this window to open shop.";			close2;			callshop "HeroismExchanger",0;			end;	}} 


    first thank you very much ...
     
    the bg eamod works like this ... it exists several modules which you can choose which want to use that line ...
     
    // Battleground Rotation - Main NPC name
    setarray .BG_Arenas$[0], "Flavius_CTF", "Tierra_EOS", "Tierra_TI", "Flavius_TD","Tierra_Boss","Conquest", "Flavius_SC","Tierra_DOM", "Rush";  
    // Battleground Arena Name - for announcements
    setarray .BG_Names$[0], "Capture the Flag","Eye of Storm","Triple Inferno","Team DeathMatch", "Bossnia","Conquest","Stone Control","Domination", "Rush"
    // Minimum Players to start the BG
    setarray .BG_Min[0], 5, 5, 5, 5, 5, 20, 5, 5, 15;  
    // Maximum Players per Team
    setarray .BG_Max[0], 35, 35, 35, 35, 35, 50, 35, 35, 30; << maximum number supported by BG BG
    // BG Message Colors
    setarray .BG_Color$[0], "0xA0522D", "0x4169E1", "0x696969", "0x808000", "0x483D8B","0xFFA500", "0x9ACD32", "0x4169E1","0xDDA0DD"
     
    In my case I want to just use the Conquest ... so most want players poçam choose which side they want to play or the red side and blue side ... because of the unique way the choice side is automatic ...
     
     
     
     

    If you follow the help dowload BG and eamulador Hercules complete eamod ...

    Full BG eamod Queue 2015

     

    eAHecules


  2. I wanted when the person using the comman @joinbg seemed the option to choose the blue side or red.

     

     

     

    // (c) 2008 - 2012 eAmod Project; Andres Garbanzo / Zephyrus////  - [email protected]//  - MSN [email protected]//  - Skype: Zephyrus_cr//  - Site: http://dev.terra-gaming.com//// This file is NOT public - you are not allowed to distribute it.// Authorized Server List : http://dev.terra-gaming.com/index.php?/topic/72-authorized-eamod-servers/// eAmod is a non Free, extended version of eAthena Ragnarok Private Server. // ==============================================================================// BattleGround System - Common NPCs// ============================================================================== // MapFlags// ********************************************************************* bat_room	mapflag	nomemobat_room	mapflag	nowarptobat_room	mapflag	nobranchbat_room	mapflag	nopenaltybat_room	mapflag	noteleportbat_room	mapflag	nosave	SavePointbat_room	mapflag	allow_bg_items// Mapflag Town is required to Join BG Queuesbat_room	mapflag	town // Battleground Queue Admin// *********************************************************************-	script	BG_Queue_Join	-1,{	end; OnInit:	// Configuration	// *****************************************************	// Battleground Rotation - Main NPC name	setarray .BG_Arenas$[0],	     "Conquest";	// Battleground Arena Name - for announcements	setarray .BG_Names$[0],		"Conquest";	// Minimum Players to start the BG	setarray .BG_Min[0],	                         5;	// Maximum Players per Team	setarray .BG_Max[0],	                        30;	// BG Message Colors	setarray .BG_Color$[0],	                "0x4169E1";	// Team Building Mode : 0 = Lineal | 1 = Random | 2 = Class Priority | 3 = Faction Mode | 4 = Team Color ( by script set Bat_Team,N; )	set .TeamMode, 2;	// Main Code	// *****************************************************	set .BG_Count, getarraysize(.BG_Arenas$);	set .BG_Queue, bg_queue_create("Battleground Arena","BG_Queue_Join::OnJoinEvent",80);	set .VS_Queue, bg_queue_create("Free For All Arena","BG_Queue_Join::OnVersusJoin",80);	// Move to Next Arena	if( $BG_Index >= .BG_Count ) set $BG_Index,1; // Restart Rotation	set .BG_Arena$,.BG_Arenas$[$BG_Index];	set .Ready, 1;	donpcevent "BG_Queue_Join::OnDoHappyHour";	initnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method	 // Comment the next two lines if you don't want to allow @joinbg and @leavebg commands.	bindatcmd "joinbg","BG_Queue_Join::OnDoJoin",0,200;	bindatcmd "leavebg","BG_Queue_Join::OnDoLeave",0,200;	end; OnDoJoin: // @joinbg	if( checkquest(8506,PLAYTIME) == 2 )		erasequest 8506;	 if( checkquest(8506,PLAYTIME) != -1 )	{		dispbottom "[Você é um desertor. Você não pode participar até que o indicador se apague]";		end;	}	 bg_queue_join .BG_Queue;	end; OnDoLeave: // @leavebg	bg_queue_leave .BG_Queue;	end; OnRotate:OnTimer740000: // Rotation if BG don't start... Comment if you don't want to use this method. 120 = 2 Minutes	set $@BG_Status, 0;	// Warps Teams	bg_warp $@BG_Team1,"bat_room",155,150;	bg_warp $@BG_Team2,"bat_room",155,150;	bg_warp $@BG_Team3,"bat_room",155,150;	// Destroy Teams	bg_destroy $@BG_Team1; set $@BG_Team1, 0;	bg_destroy $@BG_Team2; set $@BG_Team2, 0;	bg_destroy $@BG_Team3; set $@BG_Team3, 0;	 // Move to Next Arena	if( set($BG_Index,$BG_Index + 1) >= .BG_Count )		set $BG_Index,0; // Restart Rotation	 set .BG_Arena$,.BG_Arenas$[$BG_Index];	initnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method	 // Trigger the Event - Maybe people is waiting...OnJoinEvent:	if( $@BG_Status == 2 )		end; // BG Ending... Must wait until OnRotate is called	 set .@Queue_Count, bg_queue_data(.BG_Queue,0);	switch( $@BG_Status )	{	case 0: // Idle - Ready to Start		if( .BG_Arena$ == "Tierra_TI" )			set .@Req, .BG_Min[$BG_Index] * 3;		else			set .@Req, .BG_Min[$BG_Index] * 2;		 if( bg_queue_checkstart(.BG_Queue,.TeamMode,( (.BG_Arena$ == "Tierra_TI") ? 3 : 2 ),.BG_Min[$BG_Index]) )		{			donpcevent .BG_Arena$ + "::OnBuildTeams";			 // Fill Teams with Queue Members						if( .BG_Arenas$[$BG_Index] == "Tierra_TI" )				bg_queue2teams .BG_Queue,.BG_Min[$BG_Index],.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;			else				bg_queue2teams .BG_Queue,.BG_Min[$BG_Index],.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2;			 stopnpctimer; // Rotation if BG don't start... Comment if you don't want to use this method			 set $@BG_Status,1;			set .@msg$, "Batalha Campal -- " + .BG_Names$[$BG_Index] + " -- Começando";			announce .@msg$,.BG_Color$[$BG_Index];			 donpcevent .BG_Arena$ + "::OnReady";		}		else		{			set .@msg$, "Batalha Campal -- " + .BG_Names$[$BG_Index] + " -- " + (.@Req - .@Queue_Count) + " Jogadores Para Começar, Use @joinbg Para Participar.";			announce .@msg$,0,.BG_Color$[$BG_Index];		}		break;	case 1: // Running - Others can join		if( .@Queue_Count > 0 )		{			if( .BG_Arena$ == "Tierra_TI" )			{				bg_balance_teams .BG_Queue,.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;				set .@BG_Count1, bg_get_data($@BG_Team1,0);				set .@BG_Count2, bg_get_data($@BG_Team2,0);				set .@BG_Count3, bg_get_data($@BG_Team3,0);				set .@msg$, "Batalha Campal -- " + .BG_Names$[$BG_Index] + " -- B: " + .@BG_Count1 + "/" + .BG_Max[$BG_Index] + ", R: " + .@BG_Count2 + "/" + .BG_Max[$BG_Index] + ", G: " + .@BG_Count3 + "/" + .BG_Max[$BG_Index] + " (Em andamento) Use @joinbg Para Participar.";			}			else			{				bg_balance_teams .BG_Queue,.BG_Max[$BG_Index],.TeamMode,$@BG_Team1,$@BG_Team2;				set .@BG_Count1, bg_get_data($@BG_Team1,0);				set .@BG_Count2, bg_get_data($@BG_Team2,0);				set .@msg$, "Batalha Campal -- " + .BG_Names$[$BG_Index] + " -- B: " + .@BG_Count1 + "/" + .BG_Max[$BG_Index] + ", R: " + .@BG_Count2 + "/" + .BG_Max[$BG_Index] + " (Em andamento) Use @joinbg Para Participar.";			}			 announce .@msg$,.BG_Color$[$BG_Index];		}		break;	}	end; OnVersusJoin:	if( $@VS_Status != 0 )		end;	 set .@Queue_Count, bg_queue_data(.VS_Queue,0);	if( .@Queue_Count >= 10 )	{		donpcevent "FFA_Arena::OnBuildTeams";		bg_queue2teams .VS_Queue,1,1,0,$@VS_Team[0],$@VS_Team[1],$@VS_Team[2],$@VS_Team[3],$@VS_Team[4],$@VS_Team[5],$@VS_Team[6],$@VS_Team[7],$@VS_Team[8],$@VS_Team[9];		set $@VS_Status,1;		announce "Batalha Campal -- Free For All -- Começando",0,0x483D8B;		donpcevent "FFA_Arena::OnReady";	}	else		announce "Batalha Campal -- Free For All -- " + (10 - .@Queue_Count) + " Jogadores Para Começar, Use @joinbg Para Participar.",0,0x483D8B;	end; OnFri0600: // Friday, 6 a.m.	rankreset 1; // Ranking Reset	end; // BattleGround Happy HourOnDoHappyHour:OnClock1600:OnClock1800:OnClock2000:OnClock2200:	switch( gettime(4) )	{	case 1:	case 3:	case 5:		if( gettime(3) >= 20 && gettime(3) < 22 )		{			announce "-- Battleground Happy Hour has begun | Ranked Arena Mode --",0,0x00FF00;			setbattleflag "bg_reward_rates",120; // +20% Reward Rates			setbattleflag "bg_ranked_mode",1;			end;		}				if( gettime(3) == 22 )		{			announce "-- Battleground Happy Hour is over | Regular Arena Mode --",0,0x00BFFF;			setbattleflag "bg_reward_rates",100; // Normal Rates			setbattleflag "bg_ranked_mode",0;			end;		}		break;	case 2:	case 4:	case 6:		if( gettime(3) >= 16 && gettime(3) < 18 )		{			announce "-- Battleground Happy Hour has begun | Ranked Arena Mode --",0,0x00FF00;			setbattleflag "bg_reward_rates",120; // +20% Reward Rates			setbattleflag "bg_ranked_mode",1;			end;		}				if( gettime(3) == 18 )		{			announce "-- Battleground Happy Hour is over | Regular Arena Mode --",0,0x00BFFF;			setbattleflag "bg_reward_rates",100; // Normal Rates			setbattleflag "bg_ranked_mode",0;			end;		}		break;	}	end;} // Registration NPC// *********************************************************************-	script	BG_Register	-1,{	 if( getvariableofnpc(.Ready,"BG_Queue_Join") == 0 )		donpcevent "BG_Queue_Join::OnInit";	 mes "[^FFA500Battle Recruiter^000000]";	mes "Bem Vindo ao novo sistema de Batalha Campal! Aqui você pode registrar-se ou registrar seu Grupo no sistema. O sistema seleciona os Times e Arena radomicamente e segue alternando as Arenas de forma consecutiva. Conquest -->Rush -->Conquest --> Conquest e por ai vai.";	mes "O que você quer fazer?";	next;	switch( select("^FFA500Batalha Campal Arenas^000000:^0000FFFree For All Arena^000000:Ir as lojas da Batalha Campal") )	{	case 1:		mes "[^FFA500Recrutadora de Batalha^000000]";		mes "Batalha Campal, diferentes tipos de jogos onde as equipes lutam pela vitória.";		mes "Oque você quer fazer?";		next;		switch( select("Registrar:Registrar Grupo:Cancelar Registro:Battleground Help") )		{		case 1:			if( BaseLevel < 80 )			{				mes "[^FFA500Recrutadora Batalha Campal^000000]";				mes "Nível necessário para participar de um campo de batalha é de 80.";				close;			}			if( checkquest(8506,PLAYTIME) == 2 )				erasequest 8506;			if( checkquest(8506,PLAYTIME) != -1 )			{				mes "[^FFA500Recrutadora Batalha Campal^000000]";				mes "Você é um desertor. Você não pode participar até que o indicador se apaga";				close;			}			 mes "[^FFA500Recrutadora Batalha Campal^000000]";			mes "Vamos prosseguir com o registro...";			mes "Você pode esperar em qualquer cidade até BG começa.";			mes "Feche esta janela para continuar...";			close2;			bg_queue_join getvariableofnpc(.BG_Queue,"BG_Queue_Join");			end;		case 2:			if( getcharid(1) == 0 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Você não estar em um grupo.";				close;			}			 mes "[^FFA500Battle Recruiter^000000]";			mes "Vamos prosseguir com o registro...";			mes "Você pode esperar em qualquer cidade até BG começa.";			mes "Feche esta janela para continuar...";			close2;			bg_queue_partyjoin getcharid(1),getvariableofnpc(.BG_Queue,"BG_Queue_Join");			end;		case 3:			mes "[^FFA500Battle Recruiter^000000]";			mes "Se você estiver registrado, você será removido.";			mes "Você tem certeza?";			next;			if( select("Sim, sair da fila:Não, eu vou ficar") == 2 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Ok, nada para mudar.";				close;			}			 mes "[^FFA500Battle Recruiter^000000]";			mes "Feche esta janela para continuar ...";			close2;			bg_queue_leave getvariableofnpc(.BG_Queue,"BG_Queue_Join");			end;		case 4:			mes "[^FFA500Battle Recruiter^000000]";			mes "Tell me... what battleground you don't understand?";			next;			switch( select("Capture the Flag:Team DeathMatch:Stone Control:Eye of Storm:Bossnia:Domination:Triple Inferno:Conquest:Rush") )			{			case 1:				mes "[^FFA500Battle Recruiter^000000]";				mes "The objective of the Flavius Battle CTF is to score 3 points before your enemy, by capture their Flag.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "To capture a Flag you need to take the enemy flag, and bring it to your base flag.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If your base flag is captured too, you need to kill the flag carrier and take the flag back to your base.";				break;			case 2:				mes "[^FFA500Battle Recruiter^000000]";				mes "Kill all the enemy players to let their Team without points.";				mes "Protect our army.";				break;			case 3:				mes "[^FFA500Battle Recruiter^000000]";				mes "Take the Stones in the middle of the battlefield and put in on your base, in the Stone Points.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each Stone will give points to your team. First team reach 99 points wins the game.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Protect your stones from to be captured by the enemy.";				break;			case 4:				mes "[^FFA500Battle Recruiter^000000]";				mes "There are two bases, North and South which teams can capture by holding position on the Base more than the other team.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each base will give you points each 5 seconds of Domination. If your Team control both bases the amount of points increases.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "To get aditional points, in the middle there is a Flag spawn, capture it and put it on any of your team Bases.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "The first Team reach 99 points wins the match.";				break;			case 5:				mes "[^FFA500Battle Recruiter^000000]";				mes "Attack the enemy base and destroy each MVP Guardian. To do damage to the guardian your team must capture the Balance Flag in the middle base.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each team have 5 guardian to be protected or killed.";				break;			case 6:				mes "[^FFA500Battle Recruiter^000000]";				mes "There are three bases, North, Center and South which teams can capture by holding position on the Base more than the other team.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Each base will give you points each 5 seconds of Domination.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "The first Team reach 99 points wins the match.";				break;			case 7:				mes "[^FFA500Battle Recruiter^000000]";				mes "There are 3 teams in the battlefield, your team and other 2 enemies.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "Kill the enemy players, collect the skulls and bring then to the Sacrifice Totem to win points.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "You can collect your own team skulls and bring then to your Sacrifice Totem to avoid other teams to score.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If you get killed all your skulls will be drop to the floor, including your own skull. First Team to get 80 points wins the battle.";				break;			case 8:				mes "[^FFA500Battle Recruiter^000000]";				mes "If you are Attacking, destroy the enemy defenses and it's Flag.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If you are Defending, protect your castle defenses and the Flag.";				break;			case 9:				mes "[^FFA500Battle Recruiter^000000]";				mes "Fight to capture the Castle and organize your team to defend it.";				next;				mes "[^FFA500Battle Recruiter^000000]";				mes "If you fail on the first capture, kill the defender and take it for your team.";				break;			}			break;		}		close;	case 2:		mes "[^FFA500Battle Recruiter^000000]";		mes "Free For All Arena is a Duel between 10 players with No Teams.";		mes "The target is to kill 25 players.";		mes "What do you want to do?";		next;		switch( select("Register:Leave Queue") )		{		case 1:			if( BaseLevel < 80 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Min required level to join a battleground is 80.";				close;			}			if( checkquest(8506,PLAYTIME) == 2 )				erasequest 8506;			if( checkquest(8506,PLAYTIME) != -1 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "You are a Deserter. You can't participate until the indicator goes off";				close;			}			 mes "[^FFA500Battle Recruiter^000000]";			mes "Let's proceed with the registration...";			mes "You must wait on any City until BG starts.";			mes "Close this window to continue...";			close2;			bg_queue_join getvariableofnpc(.VS_Queue,"BG_Queue_Join");			end;		case 2:			mes "[^FFA500Battle Recruiter^000000]";			mes "If you are registered, you will be removed.";			mes "Are you sure?";			next;			if( select("Yes, leave queue:No, I will stay") == 2 )			{				mes "[^FFA500Battle Recruiter^000000]";				mes "Ok, nothing to change.";				close;			}			 mes "[^FFA500Battle Recruiter^000000]";			mes "Close this window to continue...";			close2;			bg_queue_leave getvariableofnpc(.VS_Queue,"BG_Queue_Join");			end;		}		break;	case 3:		mes "[^FFA500Battle Recruiter^000000]";		mes "May the War God bless you.";		close2;		warp "bat_room",155,150;		end;		OnInit:		waitingroom "Batalha Campal",0;	}	end;} bat_room,156,150,3	duplicate(BG_Register)	Battle Recruiter#bat	728prontera,162,191,4	duplicate(BG_Register)	Battle Recruiter#prt	728 // General Guillaume// *********************************************************************bat_room,160,159,3	script	General Guillaume	420,{	cutin "bat_kiyom2",2;	mes "[General Guillaume]";	mes "Hot-blooded adventurer, we need your ability to win this battle.";	next;	cutin "bat_kiyom1",2;	mes "[General Guillaume]";	mes "Our great king, Marcel Marollo VII, is very sick lately. His Majesty has declared that he chosen either me or Prince Croix as the next king amongst his 9 sons.";	next;	mes "[General Guillaume]";	mes "Two kings can't share a nation!";	mes "Only the one victorious from His Majesty's appointed battle will be enthroned.";	next;	mes "[General Guillaume]";	mes "This is however, not just a battle between us. This battle will determine the future of this country. I pledge on my honor to prove that I'm the one who can protect this Maroll from outside threats.";	next;	switch( select("Join the Blue Team","Join the Green Team","End Conversation") )	{	case 1:		cutin "bat_kiyom2",2;		mes "[General Guillaume]";		mes "Welcome to my army, comrade.";		mes "Your eyes tell me that you're a soldier that I can trust.";		set Bat_Team,1;		next;		mes "[General Guillaume]";		mes "Now, go upstairs and apply for battle with your comrades. I'm sure they'll welcome you whole-heartedly!";		break;	case 2:		cutin "bat_kiyom2",2;		mes "[General Guillaume]";		mes "So you will take this fight as your own...";		mes "Then you are my enemy.";		set Bat_Team,0;		next;		mes "[General Guillaume]";		mes "Go now, We will meet again in the Battlefield.";		break;	case 3:		mes "[General Guillaume]";		mes "I'll be the one who will capture the flag!";		break;	}	 close2;	cutin "",255;	end;} // General Croix// *********************************************************************bat_room,160,140,3	script	Prince Croix	416,{	cutin "bat_crua1",2;	mes "[Prince Croix]";	mes "Wise adventurer, why don't you lend us your power for victory?";	next;	cutin "bat_crua2",2;	mes "[Prince Croix]";	mes "I do not wish to shed blood, but I have no choice but to fight for the possibility of peace and for the sake of my people.";	next;	mes "[Prince Croix]";	mes "General Guillaume may have an advantage in this battle as he is the great general of Maroll, but that doesn't automatically mean he'll win. I want to win this battle so that I can grant a better future for my people.";	next;		switch( select("Join the Red Team","Join the Green Team","End Conversation") )	{	case 1:		mes "[Prince Croix]";		mes "Thank you so much. I feel like I can win with the help of adventurers like you. Now, please go downstairs and join your comrades in sharpening their skills to fight the enemy!";		set Bat_Team,2;		break;	case 2:		mes "[Prince Croix]";		mes "So you will take this fight as your own...";		mes "Then you are my enemy.";		set Bat_Team,0;		next;		mes "[Prince Croix]";		mes "Go now, We will meet again in the Battlefield.";		break;	case 3:		mes "[Prince Croix]";		mes "For Maroll!";		break;	}			close2;	cutin "",255;	end;} // Guard Dummy// ********************************************************************* bat_room,161,141,3	script	Prince Croix's Aid::bat_aid	415,{ end; }bat_room,161,139,3	duplicate(bat_aid)	Prince Croix's Aid::bat_aid2	415bat_room,161,160,3	duplicate(bat_aid)	General Guillaume's Aid::bat_aid3	419bat_room,161,158,3	duplicate(bat_aid)	General Guillaume's Aid::bat_aid4	419 // Flags// ********************************************************************* -	script	Base Flag#bg	-1,{ end; } // BattleGround Warper - Exit// ********************************************************************* bat_room,148,150,4	script	Teleporter#bat	124,{	mes "[Teleporter]";	mes "Do you wish to leave the battlefield? Use my service to return to town.";	next;	if( select("Leave:Don't Leave") == 2 )	{		mes "[Teleporter]";		mes "I'll be here whenever you're in need of my service.";		close;	}	 switch( @ArenaPVP_out )	{		// Rune Midgard Republic		case 1: warp "prontera",138,86; break;		case 2: warp "payon",165,98; break;		case 3: warp "morocc",153,94; break;		case 4: warp "umbala",121,143; break;		case 5: warp "comodo",196,140; break;		case 6: warp "niflheim",214,193; break;		case 7: warp "aldebaran",143,111; break;		case 8: warp "geffen",107,53; break;		// Schwarzard Republic		case 9: warp "yuno",151,177; break;		case 10: warp "hugel",99,143; break;		case 11: warp "lighthalzen",167,93; break;		case 12: warp "einbroch",70,194; break;		case 13: warp "einbech",168,130; break;		// Arunafelz Republic		case 14: warp "rachel",118,114; break;		case 15: warp "veins",207,122; break;		// Islands		case 16: warp "nameless_n",161,179; break;		case 17: warp "louyang",213,106; break;		case 18: warp "gonryun",154,111; break;		case 19: warp "ayothaya",148,109; break;		case 20: warp "moscovia",229,195; break;		case 21: warp "xmas",151,127; break;		case 22: warp "amatsu",203,107; break;		case 23: warp "izlude",126,114; break;		case 24: warp "brasilis",195,211; break;		case 25: warp "manuk",279,214; break;		case 26: warp "splendide",200,174; break;		// Anyplace else		default:			set .@spoint$, getsavepoint(0);			set .@x, getsavepoint(1);			set .@y, getsavepoint(2);			mes "[Teleporter]";			mes "You will be sent back to " + .@spoint$ + ".";			close2;			warp .@spoint$, .@x, .@y;			break;	}		set @ArenaPVP_out, 0;	end;} // Kafra// *********************************************************************bat_room,148,147,4	script	Kafra Staff::kaf_bat	861,{	cutin "kafra_09",2;	callfunc "F_Kafra",0,2,1,150,0;} // Badges Exchange// *********************************************************************

  3. I would change the formula of the SPD,

    Example: A character with 186 SPD has the movement of attack as if it had 191


    Achei esso no status.c onde eu edito para obter resultado desejado?

     

     

    // ----- ASPD CALCULATION -----// Unlike other stats, ASPD rate modifiers from skills/SCs/items/etc are first all added together, then the final modifier is applied    // Basic ASPD value    i = status_base_amotion_pc(sd,status);    status->amotion = cap_value(i,battle_config.max_aspd,2000);    // Relative modifiers from passive skills    if((skill=pc_checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK)        status->aspd_rate -= 5*skill;    if((skill = pc_checkskill(sd,SG_DEVIL)) > 0 && !pc_nextjobexp(sd))        status->aspd_rate -= 30*skill;    if((skill=pc_checkskill(sd,GS_SINGLEACTION))>0 &&        (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE))        status->aspd_rate -= ((skill+1)/2) * 10;    if(pc_isriding(sd))        status->aspd_rate += 500-100*pc_checkskill(sd,KN_CAVALIERMASTERY);    status->adelay = 2*status->amotion;

  4. I have a controller woe which made ​​a modification to make an award to each member of the winning guild castle, only at the end of the script woe not be doing the delivery. I wonder why.

     

     

     

    Controller

     

     

     

    //======================================================================================================
    //= Toasty's WoE Controller (formerly WoE Info Banner)
    //===== By: ============================================================================================
    //= ToastOfDoom (aka: iHeart)
    //===== Current Version: ===============================================================================
    //= 1.22
    //===== Description: ===================================================================================
    //= A WoE Controller function which controls castle based WoE by utilising npc events.
    //= Includes a NPC that provides information on the next WoE session
    //=
    //= This script is kinda @reloadscript/@loadnpc safe, provided that someone clicks the NPCs afterwards
    //= to start the OnInit function. That said..it is recommended that you don't use @reloadscript/@loadnpc
    //= but reset your server.
    //===== Changelog: =====================================================================================
    //= 1.22
    //= - Fixed an issue regarding the controller getting confused when using @reloadscript/loadnpc while
    //= WoE was still active. (thanks to annie for pointing out)
    //= 1.21
    //= - Fixed a misspelt variable name (thanks to rahuldev345 for pointing out)
    //= 1.20
    //= - Project renamed to 'Toasty's WoE Controller'. The script originally was only used to display WoE
    //= times then I 1st wrote it 3yrs ago and I feel it's purpose is more to control WoE these days. So
    //= name change to better reflect purpose.
    //= - Added support for novice WoE. Region teleport goes to the Novice Warper NPC (default in prontera)
    //= Change position in .region_maps, .region_x, .region_y if needed.
    //= - Region warp now only displays regions that have castles used at least once. (eg. If you don't
    //= configure any castles for Payon region, payon will not show up)
    //= - Optimised WoE Active/Inactive map notifier. Old method used too many loops for something that
    //= can happen alot.
    //= - Adjusted menus to be abit more friendly. 'next's will always display before 'menu's
    //= - Fixed bug with WoE autostarting when only configured for 2 sessions in one day
    //= - Added some nifty code that prevents catastrophic failure of the script if you try to run a trunk
    //= version on a stable server (ie. if you do, it will show an error message, but script will still
    //= run perfectly fine - check out WoEToggler function for those that want to peek at it =P)
    //= 1.11
    //= - Fixed timer glitch when players only configured sessions for one day of the week
    //= - Adjusted timer to show remaining time more accurately
    //= - Modified .num_woes calculation due to bug regarding 0's being counted as unset values in arrays
    //= 1.10
    //= - Expanded script to allow castle based configuration
    //= - Moved away from portal based woe control. Now using donpcevents to OnAgitEnd/2 events. Provided
    //= castles are linked to the main agit commands in this manner, they will be controllable using this
    //= script.
    //= - Added an onLoadMap WoE available notifier. Can be disabled by setting .notify_woe to 0 in the
    //= CONFIG section.
    //= - Did some funky color coding.
    //= - Added Coordinate based warping per region (see .region_x & .region_y in the CONSTANTS section)
    //= 1.02
    //= - Added delwaitingroom to banner npc to prevent memory leaks from bug #2325
    //= - To reduce spamming of waitingroom packets to players banner NPC only now updates when the banner
    //= text changes. Thus min time between updates is now 1sec regardless of setting.
    //= - Added setting for rate which banner time is updated (.banner_refresh_rate) in the CONFIG section.
    //= - Added agitstart2/end2 to provide WoE2 support (Hope it works happy.pngwink.png
    //= 1.01
    //= - Hardcoded in refresh value for banner npc instead of getting it from config from WoEInfoBase. Had
    //= issues starting the script after @reloadscript/@loadnpc
    //======================================================================================================
    -  script  WoEInfoBase  -1,{

     OnStartMenu:
       if(.init == 0)
         donpcevent strnpcinfo(3)+"::OnInit";
     
     OnStartMenu2:
       mes "The " + ((.state)?"^00DD00current":"^DD0000next") + "^000000 WoE session is: ";
       mes " ";
       mes "Day: ^0000DD" + .daysOfWeek$[.woe_day[.woe_index]];
       mes "^000000Start time: ^00DD00" + .woe_0_str$[.woe_index];
       mes "^000000End time: ^DD0000" + .woe_1_str$[.woe_index];
       mes "^000000Region:";

       set .@state_strs$, ".woe_state_str_" + .woe_state[.woe_index] + "$";
       for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
         set .@output$, getd(.@state_strs$ + "[" + .@i + "]");
         if(.@output$ != "")
           mes "^000000- ^0000DD" + .@output$;
       }
       next;
       
       if(getgmlevel() >= .gm_access)
         select(
           "Warp to Castle Grounds",
           "View Castle Owners",
           "View all WoE times",
           ((!.state)?"Start next WoE":"End current WoE"),
           ((.state)?"":"Skip next WoE session")
           );
       else
         select(
           "Warp to Castle Grounds",
           "View Castle Owners",
           "View all WoE times");
         
       switch(@menu) {
         case 1:    //warp
           mes "Which region would you like to warp to?";
           next;
           select(.region_warp$[.woe_state[.woe_index]]);
           if(@menu < 1 || @menu > .num_regions)
             close;
                   
           close2;
           warp .region_maps$[@menu - 1], .region_x[@menu - 1], .region_y[@menu - 1];
           end;
         case 2:    //view      
           set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index];
           for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
             set .@k, 0;
             set .@castles$, ".castles_" + .regions$[.@i] + "$";
             set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]");
             while(.@castle_check && .@k < .num_castles[.@i]) {
               if(.@castle_check & (1 << .@k)) {
                 set .@map$, getd(.@castles$+"["+.@k+"]");
                 if (GetCastleData(.@map$,1)) {

                   dispbottom "The [" + GetCastleName(.@map$)
    + "] castle of the [" + .region_names$[.@i] + "] region is currently
    held by the [" + GetGuildName(GetCastleData(.@map$,1)) + "] guild.";
                 } else {

                   dispbottom "The [" + GetCastleName(.@map$)
    + "] castle of the [" + .region_names$[.@i] + "] region is currently
    unoccupied.";
                 }
                 set .@castle_check, .@castle_check - (1 << .@k);
               }
               set .@k, .@k + 1;    
             }
           }
           break;
         case 3:    //woe times
           for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) {              
             dispbottom "- " + .daysOfWeek$[.woe_day[.@i]] + " " + .woe_0_str$[.@i] + "-" + .woe_1_str$[.@i];
             set .@woe_state_str_array$, ".woe_state_str_" + .woe_state[.@i] + "$";
             for(set .@k, 0; .@k < .num_regions; set .@k, .@k + 1) {
               set .@output$, getd(.@woe_state_str_array$ + "[" + .@k + "]");
               if(.@output$ != "")
                 dispbottom "   " + .@output$;
             }
           }
           break;
         case 4:    //start next;
           if(getgmlevel() <.gm_access) close;
           

           mes "^FF0000Are you sure you want to " + ((!.state)?"start
    the next WoE session?":"end the current WoE session?");
           next;
           if(select("Yes:No") == 2) break;
           
           set .remainTime, 0;  //might not work sometimes...you have like a 500ms window out of 505ms i guess..

           sleep2 .timer_refresh_rate;  //wait abit so the menu
    doesn't screw up (how long it takes for the timer to update)
           break;
         case 5:    //skip next;
           if(getgmlevel() <.gm_access || .state) close;
           
           mes "^FF0000Are you sure you want to skip the next WoE session^000000";
           next;
           if(select("Yes:No") == 2) break;
           if(.state) {  //you really can't do this with woe active
             next;
             mes "Sorry, in the time you took making your decision, WoE started";
             mes "Please either manually end it first or wait";
             break;      
           }
           set .woe_index, (.woe_index + 1) % .num_woes;
           donpcevent strnpcinfo(3)+"::OnUpdateCountTick";
           sleep2 .timer_refresh_rate;
           break;
         default: close;    
       }
       goto OnStartMenu2;
     
     OnInit:

       //-----------------------------------------------------------------------------------------//
       //CONFIG START //
       //-----------------------------------------------------------------------------------------//
       
       set .gm_access, 60;
       
       //WoE timings needs to be ordered ascendingly unless you want to do weird
       //stuff like skip a region every other week or so...
       //Also times can't overlap. Uses second of day(gettimetick(1)) for timing
       // eg 1am -> 3600, 2:30pm -> 52200, midnight -> 86400 (anything past that doesn't work)
       //Note: woe_0 is start times, woe_1 is end times. Ignore how it's called but
       //     don't change it either since it's dynamically used
       //     Also..woe has to end on the same day it starts (it's easier that way..)
       setarray .woe_day[0],  0,   3,   6;
       setarray .woe_0[0],  68400,68400,68400;
       setarray .woe_1[0],  72000,72000,72000;
       setarray .woe_state[0],  0,   1,   2;
       
       //WoE state settings. Every WoE session can be defined as a particular state of castle configuration.
       //.woe_state_#[%] = $
       // # - state number
       // % - region number
       // $ - binary representation of castles that are active for that region in that state (
       // (ie. 0 is no castles, 5 is castle 0 and 2  (2^0 + 2^2 = 5))
       setarray .woe_state_0[0],4,0,0,0,0,0,0;
       setarray .woe_state_1[0],1,0,0,0,0,0,0;
       setarray .woe_state_2[0],2,0,0,0,0,0,0;
       
       //Setting for if script handles WoE controller function. Disable agit_controller.txt if you are using this.
       //For if you want to use something else to handle your woe stuff but only this script
       //to show info (1 - on, 0 - off...duh)
       set .active_woe, 1;
       
       
       //WoE inactive on map notifier. Basically notifies player if the castle they are entering is
       //WoE active or not
       set .notify_woe, 1;
       
       //-----------------------------------------------------------------------------------------//
       //CONFIG END //
       //-----------------------------------------------------------------------------------------//
       
       
       //-----------------------------------------------------------------------------------------//
       //CONSTANTS START - Don't touch this unless you know what you are doing   //
       //-----------------------------------------------------------------------------------------//
       
       //castle maps by region
       setarray .castles_prtg$[0],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05";
       setarray .castles_payg$[0],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05";
       setarray .castles_gefg$[0],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05";
       setarray .castles_aldeg$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05";
       setarray .castles_arug$[0],"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05";
       setarray .castles_schg$[0],"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
       setarray .castles_novi$[0],"nguild_alde","nguild_gef","nguild_pay","nguild_prt";
       
       //woe kill functions for each castle

       setarray
    .woe_kill_prtg$[0],"Agit#prtg_cas01::OnAgitEnd","Agit#prtg_cas02::OnAgitEnd","Agit#prtg_cas03::OnAgitEnd","Agit#prtg_cas04::OnAgitEnd","Agit#prtg_cas05::OnAgitEnd";

       setarray
    .woe_kill_payg$[0],"Agit#payg_cas01::OnAgitEnd","Agit#payg_cas02::OnAgitEnd","Agit#payg_cas03::OnAgitEnd","Agit#payg_cas04::OnAgitEnd","Agit#payg_cas05::OnAgitEnd";

       setarray
    .woe_kill_gefg$[0],"Agit#gefg_cas01::OnAgitEnd","Agit#gefg_cas02::OnAgitEnd","Agit#gefg_cas03::OnAgitEnd","Agit#gefg_cas04::OnAgitEnd","Agit#gefg_cas05::OnAgitEnd";

       setarray
    .woe_kill_aldeg$[0],"Agit#aldeg_cas01::OnAgitEnd","Agit#aldeg_cas02::OnAgitEnd","Agit#aldeg_cas03::OnAgitEnd","Agit#aldeg_cas04::OnAgitEnd","Agit#aldeg_cas05::OnAgitEnd";

       setarray
    .woe_kill_arug$[0],"Manager#aru01_02::OnAgitEnd2","Manager#aru02_02::OnAgitEnd2","Manager#aru03_02::OnAgitEnd2","Manager#aru04_02::OnAgitEnd2","Manager#aru05_02::OnAgitEnd2";

       setarray
    .woe_kill_schg$[0],"Manager#sch01_02::OnAgitEnd2","Manager#sch02_02::OnAgitEnd2","Manager#sch03_02::OnAgitEnd2","Manager#sch04_02::OnAgitEnd2","Manager#sch05_02::OnAgitEnd2";
       setarray .woe_kill_novi$[0],"Agit_N01::OnAgitEnd","Agit_N02::OnAgitEnd","Agit_N03::OnAgitEnd","Agit_N04::OnAgitEnd";
       
       //region prefixs
       setarray .regions$[0],"prtg","payg","gefg","aldeg","arug","schg","novi";
       
       //region info
       setarray .region_names$[0],"Prontera", "Payon", "Geffen", "Aldebaran", "Arunafeltz", "Schwarzwald", "Novice Castles";
       setarray .region_maps$[0],"prt_gld", "pay_gld", "gef_fild13", "alde_gld", "aru_gld", "sch_gld", "prontera";
       //coords to warp player to region (0 is random)
       setarray .region_x[0],0, 0, 0, 0, 0, 0, 148;
       setarray .region_y[0],0, 0, 0, 0, 0, 0, 163;

       setarray .waitMsg$[0], "WoE Starts: ", "WoE Ends: ";
       setarray .startMsg$[0], "WoE is Starting", "WoE is Ending";
     
       set .ticks_in_day, 86400;  //mmm...magic numbers
       setarray .daysOfWeek$[0], "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday";

       set .timer_refresh_rate, 500;  //how many ms per timer refresh...keep less than 1000 (in milliseconds)
       set .change_state_sleep, 3000;  //how long to show "WoE is Start|End-ing" msg for in ms. (in milliseconds)
                       //Make sure WoE sessions are longer than this xD
       set .banner_refresh_rate, 10;  //how many seconds per banner refresh...keep 1 or above (in seconds)
       
       //-----------------------------------------------------------------------------------------//
       //CONSTANTS END   //
       //-----------------------------------------------------------------------------------------//

       set .num_regions, getarraysize(.regions$);
       set .num_woes, getarraysize(.woe_1);
       
       //force WoE to end if active
       callfunc "WoEToggler", 0;
       
       for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
         //count num castles per region
         set .num_castles[.@i], getarraysize(getd(".castles_" + .regions$[.@i] + "$"));
       }
       
       //convert timestamps to readable format
       for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1)
       {
         set .@hrs, .woe_0[.@i] / 3600;
         set .@mins, .woe_0[.@i] % 3600 / 60;

         set .@output$, ((.@hrs % 12)?.@hrs%12:12) + ":" + ((.@mins
    < 10)?"0"+.@mins:.@mins) + " " + ((.@hrs > 12)?"PM":"AM");  
         
         set .woe_0_str$[.@i], .@output$;    
         
         set .@hrs, .woe_1[.@i] / 3600;
         set .@mins, .woe_1[.@i] % 3600 / 60;

         set .@output$, ((.@hrs % 12)?.@hrs%12:12) + ":" + ((.@mins
    < 10)?"0"+.@mins:.@mins) + " " + ((.@hrs > 12)?"PM":"AM");  
         
         set .woe_1_str$[.@i], .@output$;    
       }
       
       //calc number of woe states and consolidate states to create list of castles used
       set .num_states, 0;
       while(getarraysize(getd(".woe_state_" + (.num_states)))) {
         set .@state$, ".woe_state_" + .num_states;
         set .@i, 0;
         while(.@i < getarraysize(getd(.@state$))) {
           set .castleUsage[.@i], .castleUsage[.@i] | getd(.@state$ + "[" + .@i + "]");
           set .@i, .@i + 1;
         }
         set .num_states, .num_states + 1;      
       }

       for(set .@i, 0; .@i < .num_states; set .@i, .@i + 1) {              
         set .@woe_state_array$, ".woe_state_" + .@i;
         for(set .@k, 0; .@k < .num_regions; set .@k, .@k + 1) {
           if(.castleUsage[.@k] > 0) {
             set .@castles$, ".castles_" + .regions$[.@k] + "$";
             set .@castle_check, getd(.@woe_state_array$ + "[" + .@k + "]");
             if(.@castle_check == 0) { //region not in this state
               //region warp menu string
               set .region_warp$[.@i], .region_warp$[.@i] + "^DD0000" + .region_names$[.@k] + "^000000:";
               continue;
             } else {
               if(.@castle_check >= ((1 << .num_castles[.@k]) - 1)) {
                 //includes all castles...just list as region.
                 setd(".woe_state_str_" + .@i + "$[" + .@k + "]", .region_names$[.@k]);
                 
                 //region warp menu string
                 set .region_warp$[.@i], .region_warp$[.@i] + "^00DD00" + .region_names$[.@k] + "^000000:";
               } else {
                 set .@j, 0;
                 set .@output$, "";
                 while(.@j < .num_castles[.@k]) {
                   if(.@castle_check & (1 << .@j)) {
                     set .@output$, .@output$ + GetCastleName(getd(.@castles$+"["+.@j+"]"));
                     set .@castle_check, .@castle_check - (1 << .@j);
                     if(.@castle_check) {
                       if(.@output$ != "")
                       set .@output$, .@output$ + ", ";
                     } else
                       break;
                   }
                   set .@j, .@j + 1;
                 }
                 setd(".woe_state_str_" + .@i + "$[" + .@k + "]", .region_names$[.@k] + " ("+  .@output$ + ")");
                 
                 //region warp menu string

                 set .region_warp$[.@i], .region_warp$[.@i] +
    "^00DD00" + .region_names$[.@k] + " ("+  .@output$ + ")^000000:";
               }
             }
           } else {
             set .region_warp$[.@i], .region_warp$[.@i] + ":";
           }
         }
       }
       
       donpcevent strnpcinfo(3)+"::OnFindCurIndex";
       donpcevent strnpcinfo(3)+"::OnUpdateCountTick";
         
       if(.active_woe) {
         if(.notify_woe) {
           //set mapflag for all castle maps
           for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
             set .@region_array$, ".castles_" + .regions$[.@i] + "$";
             for(set .@k, 0; .@k < .num_castles[.@i]; set .@k, .@k + 1) {
               setmapflag getd(.@region_array$ + "[" + .@k + "]"), mf_loadevent;
               setd(".loadmap_region_" + getd(.@region_array$ + "[" + .@k + "]"), .@i + 1);
               setd(".loadmap_castleIndex_" + getd(.@region_array$ + "[" + .@k + "]"), .@k);
             }
           }
         }
         //activates WoE if needed
         donpcevent strnpcinfo(3)+"::OnDoWoE";
       }
       //flag that init occured
       set .init, 1;
     
     OnWoETimer:
       //timer stuff
       while (1) {
         set .remainTime, .count_tick - gettimetick(2);
         set .bannerTimer, .remainTime - (.remainTime % .banner_refresh_rate) + .banner_refresh_rate;
         set .min, .bannerTimer / 60;
         set .sec, .bannerTimer - .min * 60;
         set .hr, .min / 60;
         set .min, .min - .hr * 60;

         set .roomMsg$, .waitMsg$[.state] + .hr + ":" + ((.min < 10
    )?"0":"") + .min + ":" + ((.sec < 10 )?"0":"") + .sec;
         sleep .timer_refresh_rate;
         
         if(.remainTime <= 0) {
           if(.active_woe) {
             donpcevent strnpcinfo(3)+"::OnDoWoE";
             }
           set .roomMsg$, .startMsg$[.state];
           
           set .woe_index, (.woe_index + .state) % .num_woes;  //go to next index if needed
           set .state, (.state + 1) % 2;            //flip state

           donpcevent strnpcinfo(3)+"::OnUpdateCountTick";
           sleep .change_state_sleep;
         }
       }
       end;  //obligatory end =D    

     OnUpdateCountTick:
       set .count_tick, getd(".woe_" + .state + "[" + .woe_index + "]");

       set .count_tick, gettimetick(2) + .count_tick - gettimetick(1) +
    (.woe_day[.woe_index] - gettime(4) + 7) % 7 * .ticks_in_day;

       if(gettimetick(2) > .count_tick)
         set .count_tick, .count_tick + 7 * .ticks_in_day;
       end;
     
     OnFindCurIndex:
     
       set .@cur_day, gettime(4);    
       set .@cur_tick, gettimetick(1);
       
       set .woe_index, 0;
       set .state, 0;

       for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) {
         if(.woe_day[.@i] < .@cur_day)
           continue;
       
         if(.woe_day[.@i] == .@cur_day) {
           if(.woe_0[.@i] >= .@cur_tick) {
             set .woe_index, .@i;
             set .state, 0;
             break;
           }
           if(.woe_1[.@i] >= .@cur_tick) {
             set .woe_index, .@i;
             set .state, 1;
             break;
           }
         }
         if(.woe_day[.@i] > .@cur_day) {
           set .woe_index, .@i;
           set .state, 0;
           break;
         }    
       }
       end;
         
     //On map notifier
     //Comment out OnPCLoadMapEvent label if .notify_woe is disabled to prevent unnecessary triggering
     OnPCLoadMapEvent:
       if(.state && .notify_woe) {
         getmapxy(.@map$, .@x, .@y, 0);
         set .@region, getd(".loadmap_region_" + .@map$) - 1;
         if(.@region >= 0) {
           set .@castleIndex, getd(".loadmap_castleIndex_" + .@map$);
           if(getd(".woe_state_" + .woe_state[.woe_index] + "[" + .@region + "]") & 1 << .@castleIndex)
             dispbottom "The [" + GetCastleName(.@map$) + "] castle is available for conquering during this WoE session";
           else

             dispbottom "The [" + GetCastleName(.@map$) + "] castle
    is NOT available for conquering during this WoE session";
         }
       }
       end;
       
     //------------------------------------------------------------------------------
     // WoE Controller Stuff Here
     //------------------------------------------------------------------------------
       
     OnDoWoE:  
       if((.state == 0 && .init) || (.state == 1 && !agitcheck())) {  //starting
         callfunc "WoEToggler", 1;  
         
         //kills WoE in all castles that shouldn't have WoE
         set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index];
         for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
           set .@castles$, ".castles_" + .regions$[.@i] + "$";
           set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]");
           
           for(set .@k, 0; .@k < .num_castles[.@i]; set .@k, .@k + 1) {
             set .@map$, getd(.@castles$+"["+.@k+"]");
             if((.@castle_check & (1 << .@k)) == 0) {
               donpcevent getd(".woe_kill_" + .regions$[.@i] + "$[" + .@k + "]");
             }
           }
         }

       announce "The War Of Emperium has begun!",bc_all;
         callsub "OnDisplayOwners";
       } else {      //ending
         if(agitcheck()) {
           callfunc "WoEToggler", 0;
           announce "The War Of Emperium is over!",bc_all;
           callsub "OnDisplayOwners",1;
         }
       }
       end;
       
     OnDisplayOwners:  //displays based on current region
       set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index];
       for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
         set .@k, 0;
         
         set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]");
         set .@castles$, ".castles_" + .regions$[.@i] + "$";
         
         while(.@castle_check && .@k < .num_castles[.@i]) {
           if(.@castle_check & (1 << .@k)) {
             set .@map$, getd(.@castles$+"["+.@k+"]");
             set .@gid, GetCastleData(.@map$,1);
             if ( .@gid ) {

               announce "The [" + GetCastleName(.@map$) + "]
    castle of the [" + .region_names$[.@i] + "] region is currently held by
    the [" + GetGuildName(GetCastleData(.@map$,1)) + "] guild.",bc_all;
               if ( getarg(0,0) ) {

                 set .@nb, query_sql( "select account_id from
    `char` where guild_id = "+ .@gid +" and online = 1", .@aid );
                 for ( set .@n, 0; .@n < .@nb; set .@n, .@n +1 )
                   getitem 7539,40, .@aid[.@n];
               }
             } else {

               announce "The [" + GetCastleName(.@map$) + "]
    castle of the [" + .region_names$[.@i] + "] region is currently
    unoccupied.",bc_all;
             }
             set .@castle_check, .@castle_check - (1 << .@k);
           }        
           set .@k, .@k + 1;    
         }
       }
       end;
    }
    cydonia,125,166,4  script  WoE Info  837,{
     if(getwaitingroomstate(3, strnpcinfo(3)) == -1)
       donpcevent strnpcinfo(3)+"::OnInit";

     doevent "WoEInfoBase::OnStartMenu";
     end;
     
     OnInit:
       while (1) {
         //only updates if msg is different
         set .banner$, getwaitingroomstate(4, strnpcinfo(3));
         if(getvariableofnpc(.roomMsg$, "WoEInfoBase") != .banner$) {
           delwaitingroom;
           waitingroom getvariableofnpc(.roomMsg$, "WoEInfoBase"), 0;
         }
         sleep 500;
       }
       end;
    }

    //zomg! it duplicates!!
    cydonia,137,109,6  duplicate(WoE Info)  WoE Info#2winfo  837

    //---------------------------------------------------------------------------------------------------------------------

    //These two functions handle WoE's activation/deactivation. Since stable does not have AgitStart2/AgitEnd2,
    //using the trunk version will result in catastrophic failure of the script. Double declaration of the following
    //functions fixes this (you will get warning messages though)

    function  script  WoEToggler  { //<state> = 0|1
     if(getarg(0)) {
       AgitStart;  
     } else {
       AgitEnd;
     }
     return;
    }

    //if stable script will fail parsing this function, but the rest of the script will still be usable
    function  script  WoEToggler  { //<state> = 0|1
     if(getarg(0)) {
       AgitStart;
       AgitStart2;    
     } else {
       AgitEnd;
       AgitEnd2;  
     }
     return;
    }

     

     

     

     

     

    MOD

     

      announce "The War Of Emperium has begun!",bc_all;
    callsub "OnDisplayOwners";
    } else { //ending
    if(agitcheck()) {
    callfunc "WoEToggler", 0;
    announce "The War Of Emperium is over!",bc_all;
    callsub "OnDisplayOwners",1;
    }
    }
    end;

    OnDisplayOwners: //displays based on current region
    set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index];
    for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) {
    set .@k, 0;

    set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]");
    set .@castles$, ".castles_" + .regions$[.@i] + "$";

    while(.@castle_check && .@k < .num_castles[.@i]) {
    if(.@castle_check & (1 << .@k)) {
    set .@map$, getd(.@castles$+"["+.@k+"]");
    set .@gid, GetCastleData(.@map$,1);
    if ( .@gid ) {
    announce
    "The [" + GetCastleName(.@map$) + "] castle of the [" +
    .region_names$[.@i] + "] region is currently held by the [" +
    GetGuildName(GetCastleData(.@map$,1)) + "] guild.",bc_all;
    if ( getarg(0,0) ) {
    set
    .@nb, query_sql( "select account_id from `char` where guild_id = "+
    .@gid +" and online = 1", .@aid );
    for ( set .@n, 0; .@n < .@nb; set .@n, .@n +1 )
    getitem 7539,15, .@aid[.@n];
    }
    } else {
    announce
    "The [" + GetCastleName(.@map$) + "] castle of the [" +
    .region_names$[.@i] + "] region is currently unoccupied.",bc_all;
    }
    set .@castle_check, .@castle_check - (1 << .@k);
    }
    set .@k, .@k + 1;
    }
    }
    end;

     

     

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.