Jump to content
  • 0
Sign in to follow this  
Like it~*

The Battle (Base BG AnnieRuru)

Question

Name: The battle

 

 

 

 

Description:

  • The Game contains 3 teams (modifiable).
  • Each team contains 3 players (modifiable).
  • Each team has its point: return / initial, where it begins and recomposes after being killed.
  • This initial / return point would be random, ranging from 3 (modifiable).
  • Each team has a mission, which is received when entering the map.
  • Each team needs to meet its mission, where it will be subject to many things.
  • PvP will be connected at all times.
  • At death you are automatically directed to the return point.
  • The game lasts for 20 minutes.
  • Each team must score 3 points (modifiable, depending on the number of players in each team).

How it works?

 

There will be a npc of registration with open chat informing the amount of players entered and the amount of players needed to start the battle.By completing the number of subscribers, the battle chat would close, all players would be teleported to the battle map, where 3 teams will be formed randomly, and will be informed the mission of each team (In brodcast will appear at the top of the screen, just for the players of cda time, the name of the team that they will have to eliminate.

Example: Your task is to delete the "Blue" group. And for the "Blue" members, the message would be: Your task is to eliminate the "Red" group and so on ...). Each team will be at its starting point / return. Then a countdown will be made (no one can move) and the battle will begin. The 20-minute count starts. The PvP will be turned on,
And from there, players would have to hunt on the map the assigned team on the mission, this happening on the same map, while other teams also seek their respective missions (times to remove). At death you are automatically directed to the return point. When the death occurs for the hunter team (team that aims to eliminate its team), it counts a point, otherwise, no.
It will win the first team to accomplish its mission, which is: add 3 points, defeating 3 players of the target team.
 
Comments
 
I tried to start the script myself based on a custom BG script from AnnieRuru, but since I'm not a programmer and much less scripter, it did not work very well. So because of this, I decided to bring the idea to the community, and also post here my initial flawed script, for anyone who knows someone who wants to contribute to the community, help us in creating the script. The script of our master AnnieRuru already has some parts (The Battle) and it sure will also help us a lot to start.
 
My initial script. Display error on line 25

 

 

-	script	battle#custom	-1,{
L_Start:
	if ( .signup_count < .min2start *2 ) end;
	for ( .@i = 0; .@i < .signup_count; .@i++ ) {
		if ( attachrid( .signup_aid[.@i] ) ) {
			if ( strcharinfo(3) != strnpcinfo(4) ) { // player is no longer on this map
				deletearray .signup_aid[.@i], 1;
				.signup_count--;
				.@i--;
			}
		}
		else {
			deletearray .signup_aid[.@i], 1;
			.signup_count--;
			.@i--;
		}
	}
	if ( .start || .signup_count < .min2start *2 ) end;
	announce "event started", bc_all;
	.start = 1;
	.red = createbgid( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead" );
	.blue = createbgid( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead" );
	.black = createbgid( "guild_vs3", 49,15, strnpcinfo(0)+"::OnblackQuit", strnpcinfo(0)+"::OnblackDead" );
	for ( .@i = 0; .@i < .min2start *2; .@i++ )
		setbgid ( .@i %3 )? .red : .blue : .black, .signup_aid[.@i];
	deletearray .signup_aid, .min2start *2;
	.signup_count -= .min2start *2;
	bg_warp .red, "guild_vs3", 13,50;
	bg_warp .blue, "guild_vs3", 86,50;
	bg_warp .black, "guild_vs3", 49,15;
	.score[1] = .score[2] .score[3] = .startingscore;
	bg_updatescore "guild_vs3", .score[1], .score[2], .score[3] ;
	sleep .eventlasting * 1000;
	if ( .start == 1 ) {
		if ( .score[1] == .score[2] == .score[3] )
			mapannounce "guild_vs3", "Draw !", bc_map;
		else if ( .score[1] > .score[2] & .score[3]) {
			mapannounce "guild_vs3", " Red side wins !", 0;
			callsub L_reward, .red;
		}
		else if ( .score[1] & .score[3] < .score[2] ) {
			mapannounce "guild_vs3", " Blue side wins !", 0;
			callsub L_reward, .blue;
		}
		else if ( .score[3] > .score[2] & .score[1] ) {
		mapannounce "guild_vs3", " Black side wins !", 0;
		callsub L_reward, .black;
		}
	}
	bg_warp .red, "prt_gld", 155,82;
	bg_warp .blue, "prt_gld", 158,82;
	bg_warp .black, "prt_gld", 158,82;
	bg_destroy .red;
	bg_destroy .blue;
	bg_destroy .black;
	.start = .score[1] = .score[2] = .score[3] = 0;
	goto L_Start;
L_Reward:
	getbgusers getarg(0);
	for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )
		getitem 501, 1, $@arenamembers[.@i]; // item Reward
	return;
OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
OnblackDead: callsub L_dead, 3;
L_dead:
	.score[ getarg(0) ]--;
	bg_updatescore "guild_vs3", .score[1], .score[2] .score[3];
	if ( !.score[ getarg(0) ] )
		awake strnpcinfo(0);
	sleep2 1250;
	percentheal 100,100;
	end;
OnredQuit: callsub L_quit, 1, .red;
OnblueQuit: callsub L_quit, 2, .blue;
OnblackQuit: callsub L_quit, 3, .black;
L_quit:
	percentheal 100, 100;
	if ( bg_get_data( getarg(1), 0 ) ) end;
	.score[ getarg(0) ] = 0;
	awake strnpcinfo(0);
	end;
OnInit:
	.eventlasting = 20 * 60; // how long would the event last or it auto-reset. 30 *60 = 30 mins
	.min2start = 1; // minimum player to start. If 1vs1 (2 players to start), set to 1. If 2vs2 (4 players to start), set to 2.
	.startingscore = 3; // score at start
	end;
//	setarray .rewarditem,
//		501, 10, // reward to the winning team
//		501, 3, // reward to the losing team
//		501, 3; // reward to the losing team
//	set .red_cloth, 1; // color value from red clothing
//	set .blue_cloth, 2; // color value from blue clothing
//	set .black_cloth, ?; // color value from black clothing
//	end;
	}

prt_gld,174,104,5	script	Sala de entrada	100,{
	end;
OnInit:
		waitingroom "Name",4, "battle#custom::L_Start", .min2start *2;
		end;
}

guild_vs3	mapflag	battleground	2
guild_vs3	mapflag	nosave	SavePoint
guild_vs3	mapflag	nowarp
guild_vs3	mapflag	nowarpto
guild_vs3	mapflag	noteleport
guild_vs3	mapflag	nomemo
guild_vs3	mapflag	nopenalty
guild_vs3	mapflag	nobranch
guild_vs3	mapflag	noicewall

function	script	rand__	{
	.@range = getarg(0);
	.@count = getarg(2, 0);
	if ( !.@count || .@count > .@range )		.@count = .@range;
	else if ( .@count > 128 )		.@count = 128;
	while ( .@i < .@count ) {		.@r = .@save = rand( .@i, .@range -1 ) ;
		if ( !getd( ".@tmp1_"+ .@i ) ) {			.@r = ( getd(".@tmp1_"+ .@r ) )? getd( ".@tmp2_"+ .@r ) : .@r;
			setd ".@tmp2_"+ .@i, .@r;
			setd ".@tmp2_"+ .@save , .@i;
			setd ".@tmp1_"+ .@save , 1;
			set getelementofarray( getarg(1), .@i ), .@r;
			if ( .@save < .@count )				set getelementofarray( getarg(1), .@save ), .@i;
		}		.@i++;
	}	return .@count;
}

 

 
AnnieRuru Script base
 

prontera,150,153,5	script	kjdhfkdjsf	100,{
	mes "wanna sign up";
	if ( select( "yes", "no" ) == 2 ) close;
	while ( .signup_aid[.@i] != getcharid(3) && .@i < .signup_count ) .@i++;
	if ( .@i < .signup_count ) {
		mes "you have already sign up in this event";
		close;
	}
	.signup_aid[ .signup_count ] = getcharid(3);
	.signup_count++;
	mes "You are now signed to the BG event";
//	.@i = 0; // DEBUG
//	while ( .signup_aid[.@i] ) {
//		.@signup_name$ = .@signup_name$ +","+ rid2name( .signup_aid[.@i] );
//		.@i++;
//	}
//	mes "[Debug] Currently have "+ .signup_count +" sign-in and they are "+ .@signup_name$;
	close2;
L_Start:
	if ( .signup_count < .min2start *2 ) end;
	for ( .@i = 0; .@i < .signup_count; .@i++ ) {
		if ( attachrid( .signup_aid[.@i] ) ) {
			if ( strcharinfo(3) != strnpcinfo(4) ) { // player is no longer on this map
				deletearray .signup_aid[.@i], 1;
				.signup_count--;
				.@i--;
			}
		}
		else {
			deletearray .signup_aid[.@i], 1;
			.signup_count--;
			.@i--;
		}
	}
	if ( .start || .signup_count < .min2start *2 ) end;
	announce "event started", bc_all;
	.start = 1;
	.red = createbgid( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead" );
	.blue = createbgid( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead" );
	for ( .@i = 0; .@i < .min2start *2; .@i++ )
		setbgid ( .@i %2 )? .red : .blue, .signup_aid[.@i];
	deletearray .signup_aid, .min2start *2;
	.signup_count -= .min2start *2;
	bg_warp .red, "guild_vs3", 13,50;
	bg_warp .blue, "guild_vs3", 86,50;
	.score[1] = .score[2] = .startingscore;
	bg_updatescore "guild_vs3", .score[1], .score[2];
	sleep .eventlasting * 1000;
	if ( .start == 1 ) {
		if ( .score[1] == .score[2] )
			mapannounce "guild_vs3", "Draw !", bc_map;
		else if ( .score[1] > .score[2] ) {
			mapannounce "guild_vs3", " Red side wins !", bc_map;
			callsub L_Reward, .red;
		}
		else if ( .score[1] < .score[2] ) {
			mapannounce "guild_vs3", " Blue side wins !", bc_map;
			callsub L_Reward, .blue;
		}
	}
	bg_warp .red, "prontera", 155,182;
	bg_warp .blue, "prontera", 158,182;
	bg_destroy .red;
	bg_destroy .blue;
	.start = .score[1] = .score[2] = 0;
	goto L_Start;
L_Reward:
	getbgusers getarg(0);
	for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )
		getitem 501, 1, $@arenamembers[.@i]; // item Reward
	return;
OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
	.score[ getarg(0) ]--;
	bg_updatescore "guild_vs3", .score[1], .score[2];
	if ( !.score[ getarg(0) ] )
		awake strnpcinfo(0);
	sleep2 1250;
	percentheal 100,100;
	end;
OnredQuit: callsub L_quit, 1, .red;
OnblueQuit: callsub L_quit, 2, .blue;
L_quit:
	percentheal 100, 100;
	if ( bg_get_data( getarg(1), 0 ) ) end;
	.score[ getarg(0) ] = 0;
	awake strnpcinfo(0);
	end;
OnInit:
	.eventlasting = 30 * 60; // how long would the event last or it auto-reset. 30 *60 = 30 mins
	.min2start = 1; // minimum player to start. If 1vs1 (2 players to start), set to 1. If 2vs2 (4 players to start), set to 2.
	.startingscore = 5; // score at start
	end;
}
guild_vs3	mapflag	battleground	2
guild_vs3	mapflag	nosave	SavePoint
guild_vs3	mapflag	nowarp
guild_vs3	mapflag	nowarpto
guild_vs3	mapflag	noteleport
guild_vs3	mapflag	nomemo
guild_vs3	mapflag	nopenalty
guild_vs3	mapflag	nobranch
guild_vs3	mapflag	noicewall


function	script	rand__	{
	.@range = getarg(0);
	.@count = getarg(2, 0);
	if ( !.@count || .@count > .@range )		.@count = .@range;
	else if ( .@count > 128 )		.@count = 128;
	while ( .@i < .@count ) {		.@r = .@save = rand( .@i, .@range -1 ) ;
		if ( !getd( ".@tmp1_"+ .@i ) ) {			.@r = ( getd(".@tmp1_"+ .@r ) )? getd( ".@tmp2_"+ .@r ) : .@r;
			setd ".@tmp2_"+ .@i, .@r;
			setd ".@tmp2_"+ .@save , .@i;
			setd ".@tmp1_"+ .@save , 1;
			set getelementofarray( getarg(1), .@i ), .@r;
			if ( .@save < .@count )				set getelementofarray( getarg(1), .@save ), .@i;
		}		.@i++;
	}	return .@count;
}

 

 

 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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