Jump to content
  • 0

annie battleground


Mushimaru

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   5
  • Joined:  11/19/13
  • Last Seen:  

firstly sorry if i post in wrong section...cause did not really know should be in which part....

need help somebody to explain to me about this...annie battleground without waiting room....i have read from this thread https://rathena.org/board/topic/72571-battleground-system-without-waitingroom/

 

i have add the source modification and recompile...and have tried the sample script too and works fine..is it the sample script worked for official bg (flavius/kvm/tiera)

my question is, how to implant this feature on custom bg script....for example for this script from annie..can i remove that waiting room since i have update the source mod??

-	script	bg_pvp_round#control	-1,{
OnInit:
	.minplayer2start = 1; // minimum player to start
	.winningscore = 2; // how many rounds to win
	.eventlasting = 20*60; // event last 20 minutes or the system abort itself
	setarray .rewardwin, 501,10, 502,5, 503,3; // reward to winning team
	setarray .rewardlose, 501,5, 502,3, 503,1; // reward to losing team

	.rewardwinsize = getarraysize( .rewardwin );
	.rewardlosesize = getarraysize( .rewardlose );
	.teamname$[1] = "Red";
	.teamname$[2] = "Blue";
	end;
OnStart:
	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) {
		announce "[ Battle Ground DeathMatch System ]  Blue Team : "+ getwaitingroomstate( 0, .bluenpcname$ ) + "/" + .minplayer2start + ". Red Team : "+ getwaitingroomstate( 0, .rednpcname$ ) + "/" + .minplayer2start,bc_all,0x00CED1;
		end;
	}
	announce "[ Battle Ground DeathMatch System ]  Battleground has started", bc_all, 0x00CED1;
	.red = waitingroom2bg( "bat_b01", 61,150, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
	copyarray .team1aid, $@arenamembers, $@arenamembersnum;
	.team1count = .minplayer2start;
	.blue = waitingroom2bg( "bat_b01", 327,150, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
	copyarray .team2aid, $@arenamembers, $@arenamembersnum;
	.team2count = .minplayer2start;
	.life[1] = .life[2] = .minplayer2start;
	delwaitingroom .rednpcname$;
	delwaitingroom .bluenpcname$;
	disablenpc .rednpcname$;
	disablenpc .bluenpcname$;
	callsub L_setwall;
	bg_updatescore "bat_b01", 0, 0;
	bg_warp .red, "bat_b01", 61,150;
	bg_warp .blue, "bat_b01", 327,150;
	sleep 4000 * !.skip;
	mapannounce "bat_b01", "Kill all opponent team to gain 1 point, score "+ .winningscore +" points to win !", 0;
	sleep 2000 * !.skip;
	while (1) {
		for ( .@i = 5; .@i > 0; .@i-- ) {
			mapannounce "bat_b01", "["+ .@i +"]", 0;
			sleep 1000 * !.skip;
		}
		if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 )
			mapannounce "bat_b01", "Final Round start!", 0;
		else
			mapannounce "bat_b01", "Round "+ .round++ +" start!", 0;
		callsub L_delwall;
		.life[1] = .team1count;
		.life[2] = .team2count;
		sleep .eventlasting * 1000 * !.skip;
		bg_updatescore "bat_b01", .score[1], .score[2];
		if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break;
		sleep 5000 * !.skip;
		callsub L_make_player_move;
		bg_warp .red, "bat_b01", 61,150;
		bg_warp .blue, "bat_b01", 327,150;
		callsub L_setwall;
		sleep 1000 * !.skip;
		.winside = 0;
	}
	if ( .winside ) {
		mapannounce "bat_b01", " "+ .teamname$[ .winside ] +" side wins !", bc_all;
		callsub L_reward, .winside, .rewardwin, .rewardwinsize;
		callsub L_reward, ( .winside == 1 )? 2:1, .rewardlose, .rewardlosesize;
	} else
		mapannounce "bat_b01", "Time Out. Aborting the match.", bc_all;
	sleep 5000;
	callsub L_make_player_move;
	bg_warp .red, "prontera", 155,182;
	bg_warp .blue, "prontera", 158,182;
	bg_destroy .red;
	bg_destroy .blue;
	callsub L_delwall;
	deletearray .team1aid;
	deletearray .team2aid;
	.round = .winside = .skip = .score[1] = .score[2] = .team1count = .team2count = .life[1] = .life[2] = 0;
	enablenpc .rednpcname$;
	enablenpc .bluenpcname$;
	donpcevent .rednpcname$ +"::OnStart";
	donpcevent .bluenpcname$ +"::OnStart";
	end;
L_reward:
	.@size = getarraysize( getd(".team"+ getarg(0) +"aid") );
	for ( .@i = 0; .@i < .@size; .@i++ )
		for ( .@j = 0; .@j < getarg(2); .@j += 2 )
			getitem getelementofarray( getarg(1), .@j ), getelementofarray( getarg(1), .@j +1 ), getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
	return;
L_setwall:
	setwall "bat_b01", 58,153, 6, 6, 0, "bg_pvp_round_red_1";
	setwall "bat_b01", 64,153, 6, 4, 0, "bg_pvp_round_red_2";
	setwall "bat_b01", 64,147, 6, 2, 0, "bg_pvp_round_red_3";
	setwall "bat_b01", 58,147, 6, 0, 0, "bg_pvp_round_red_4";
	setwall "bat_b01", 324,153, 6, 6, 0, "bg_pvp_round_blue_1";
	setwall "bat_b01", 330,153, 6, 4, 0, "bg_pvp_round_blue_2";
	setwall "bat_b01", 330,147, 6, 2, 0, "bg_pvp_round_blue_3";
	setwall "bat_b01", 324,147, 6, 0, 0, "bg_pvp_round_blue_4";
	return;
L_delwall:
	delwall "bg_pvp_round_red_1";
	delwall "bg_pvp_round_red_2";
	delwall "bg_pvp_round_red_3";
	delwall "bg_pvp_round_red_4";
	delwall "bg_pvp_round_blue_1";
	delwall "bg_pvp_round_blue_2";
	delwall "bg_pvp_round_blue_3";
	delwall "bg_pvp_round_blue_4";
	return;
L_make_player_move:
	for ( .@j = 1; .@j <= 2; .@j++ ) {
		for ( .@i = 0; .@i < getd(".team"+ .@j +"count"); .@i++ ) {
			attachrid getd(".team"+ .@j +"aid["+ .@i +"]" );
			setoption Option_Xmas | Option_Invisible, 0;
			pcblockmove getcharid(3), 0;
		}
	}
	return;
OnRedQuit: callsub L_quit, 1, 2;
OnBlueQuit: callsub L_quit, 2, 1;
L_quit:
	percentheal 100, 100;
	setoption Option_Xmas | Option_Invisible, 0;
	pcblockmove getcharid(3), 0;
	while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++;
	deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
	.life[ getarg(0) ]--;
	if ( !getd(".team"+ getarg(0) +"count") ) {
		mapannounce "bat_b01", "All "+ .teamname$[ getarg(0) ] +" team members has Quit !", bc_all, 0xff3333; // purposely use different color
		.score[ getarg(1) ] = .winningscore;
		.winside = getarg(1);
		.skip = 1;
		awake strnpcinfo(0);
	}
	else if ( !.life[ getarg(0) ] ) {
		.winside = getarg(1);
		mapannounce "bat_b01", " "+ .teamname$[ getarg(1) ] +" team has defeated the opponent team, "+ .teamname$[ getarg(1) ] +" team score a point !", bc_all;
		.score[ getarg(1) ]++;
		awake strnpcinfo(0);
	}
	end;
OnRedDead: callsub L_dead, 1, 2;
OnBlueDead: callsub L_dead, 2, 1;
L_dead:
	.life[ getarg(0) ]--;
	if ( !.life[ getarg(0) ] ) {
		.winside = getarg(1);
		mapannounce "bat_b01", " "+ .teamname$[ getarg(1) ] +" team has defeated the opponent team, "+ .teamname$[ getarg(1) ] +" team score a point !", bc_all;
		.score[ getarg(1) ]++;
		awake strnpcinfo(0);
	}
	sleep2 1250;
	percentheal 100,100;
	if ( getcharid(4) ) {
		setoption Option_Xmas | Option_Invisible, 1;
		pcblockmove getcharid(3), 1;
	}
	end;
}

prontera,155,182,5	script	Red side#bg_pvp_r	100,{
	end;
OnInit:
	sleep 1;
	set getvariableofnpc( .rednpcname$, "bg_pvp_round#control" ), strnpcinfo(0);
OnStart:
	waitingroom "Red side", getvariableofnpc( .minplayer2start, "bg_pvp_round#control" ) +1, "bg_pvp_round#control::OnStart", 1;
	end;
}

prontera,158,182,5	script	Blue side#bg_pvp_r	100,{
	end;
OnInit:
	sleep 1;
	set getvariableofnpc( .bluenpcname$, "bg_pvp_round#control" ), strnpcinfo(0);
OnStart:
	waitingroom "Blue side", getvariableofnpc( .minplayer2start, "bg_pvp_round#control" ) +1, "bg_pvp_round#control::OnStart", 1;
	end;
}

bat_b01	mapflag	battleground	2
bat_b01	mapflag	nosave	SavePoint
bat_b01	mapflag	nowarp
bat_b01	mapflag	nowarpto
bat_b01	mapflag	noteleport
bat_b01	mapflag	nomemo
bat_b01	mapflag	nopenalty
bat_b01	mapflag	nobranch
bat_b01	mapflag	noicewall
Link to comment
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.   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...