Jump to content
The forums will be going offline for an extended maintenance period at 1400hrs GMT on 19th June 2025. The number of hours for this downtime is intentionally not advertised due to the nature of these upgrades. ×
  • 0

Waiting Room for BG Queue


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

Hi guys... I just want to make a waiting room npc with this codes for queue BG or RAMOD..

OnDoJoin: // @joinbg
	if (agitcheck() || agitcheck2()){
		dispbottom "[Service is disabled during WoE]";
		end;
	}
	if(Bat_Team == 1){
	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;
	}
	set .@Blue_Team,.@Blue_Team+1;
	bg_queue_join .BG_Queue;
	end;
	}
	if(Bat_Team == 2){
	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;
	}
	set .@Red_Team,.@Red_Team+1;
	bg_queue_join .BG_Queue;
	end;
	}
	dispbottom "[Please register to General Guillaume or Prince Croix at prontera.]";
	end;

OnDoLeave: // @leavebg
	if(Bat_Team == 1) {set .@Blue_Team,.@Blue_Team-1;}
	if(Bat_Team == 2) {set .@Red_Team,.@Red_Team-1;}
	bg_queue_leave .BG_Queue;
	end;

OnRotate:

//OnTimer600000: // 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,"prontera",156,187;
	bg_warp $@BG_Team2,"prontera",156,187;
	bg_warp $@BG_Team3,"prontera",156,187;
	// 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;
	// Team Reset
	set .@Blue_Team,0;
	set .@Red_Team1,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] + " -- Beginning";
			bgannounce .@msg$,.BG_Color$[$BG_Index];

			donpcevent .BG_Arena$ + "::OnReady";
		}
		else
		{
			if(.@Queue_Count > 1){
			set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- " + .@Queue_Count + " players are registered.";
			announce .@msg$,0,.BG_Color$[$BG_Index];
			end;
			}
			set .@msg$, "Battleground -- " + .BG_Names$[$BG_Index] + " -- " + .@Queue_Count + " player is registered.";
			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;

 

 

and this is the npc script..

// General Guillaume
// *********************************************************************
prontera,164,177,2	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","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:
		mes "[General Guillaume]";
		mes "I'll be the one who will capture the flag!";
		break;
	}

	close2;
	cutin "",255;
	end;




}

// General Croix
// *********************************************************************
prontera,147,177,7	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","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 "For Maroll!";
		break;
	}	
	
	close2;
	cutin "",255;
	end;
}

Can you give me an example of waiting room that can I attach with this..

Edited by gmprestige
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  200
  • Reputation:   1
  • Joined:  09/25/13
  • Last Seen:  

This BG is working in rAthena17689?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...