• 0
Jade

How to get this script automated pvp

Question

Posted (edited)

can anyone help me with this ... thanks a lot ...
• automated every 2hrs, (opens a warp in prontera to go in the event waiting room map "g_room2 40 370")
• broadcast: warp opens for 5mins.... bla bla bla ...
• warps opens for 5mins only
• warp will closed automatically if 10 person is in the event map "g_room2"
• if less than 10 players in g_room2 (after that 5mins warp) . all players will be warp back to prontera.

here's the script

-	script	bg_pvp#control	-1,{
OnInit:
	.eventlasting = 20*60; // how long would the event last or it auto-reset. 20*60 = 20 mins
	.minplayer2start = 5; // how many players require to start ? if 5vs5, set to 5
	setarray .rewarditem,
		674, 1; // reward to the winning team
	end;
OnStart:
	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .blacknpcname$ ) < .minplayer2start ) end;
	.red = waitingroom2bg( "guild_vs2", 9,50, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
	copyarray .team1aid, [email protected], [email protected];
	.team1count = .minplayer2start;
	.black = waitingroom2bg( "guild_vs2", 90,50, strnpcinfo(0)+"::OnblackQuit", strnpcinfo(0)+"::OnblackDead", .blacknpcname$ );
	copyarray .team2aid, [email protected], [email protected];
	.team2count = .minplayer2start;
	delwaitingroom .rednpcname$;
	delwaitingroom .blacknpcname$;
	bg_warp .red, "guild_vs2", 9,50;
	bg_warp .black, "guild_vs2", 90,50;
	.score[1] = .score[2] = .minplayer2start;
	bg_updatescore "guild_vs2", .score[1], .score[2];
	sleep .eventlasting * 1000;
	if ( .score[1] > .score[2] ) {
		mapannounce "guild_vs2","Red Side Wins !",0;
		callsub L_reward, 1;
	}
	else if ( .score[1] < .score[2] ) {
		mapannounce "guild_vs2","Black Side Wins !",0;
		callsub L_reward, 2;
	}
	else
		mapannounce "guild_vs2", "Draw !", 0;
	bg_warp .red, "prontera",152,178;
	bg_warp .black, "prontera",154,178;
	bg_destroy .red;
	bg_destroy .black;
	donpcevent .rednpcname$ +"::OnStart";
	donpcevent .blacknpcname$ +"::OnStart";
	end;
L_reward:
	for ( [email protected] = 0; [email protected] < getd(".team"+ getarg(0) +"count"); [email protected]++ )
		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(0) +"aid["+ [email protected] +"]" );
	return;
OnRedDead: callsub L_dead, 1;
OnblackDead: callsub L_dead, 2;
L_dead:
	.score[ getarg(0) ]--;
	bg_updatescore "guild_vs2", .score[1], .score[2];
	if ( !.score[ getarg(0) ] )
		awake strnpcinfo(0);
	bg_leave;
	sleep2 1250;
	percentheal 100,100;
	end;
OnRedQuit: callsub L_quit, 1, .red;
OnblackQuit: callsub L_quit, 2, .black;
L_quit:
	.score[ getarg(0) ]--;
	bg_updatescore "guild_vs2", .score[1], .score[2];
	percentheal 100, 100;
	while ( getd( ".team"+ getarg(0) +"aid["+ [email protected] +"]" ) != getcharid(3) && [email protected] < getd(".team"+ getarg(0) +"count") ) [email protected]++;
	deletearray getd( ".team"+ getarg(0) +"aid["+ [email protected] +"]" ), 1;
	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
	if ( .score[ getarg(0) ] ) end;
	awake strnpcinfo(0);
	end;
}
g_room2,38,379,5	script	Red Side	733,{
	end;
OnInit:
	set getvariableofnpc( .rednpcname$, "bg_pvp#control" ), strnpcinfo(0);
OnStart:
	waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_pvp#control" ) +1, "bg_pvp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp#control" );
	end;
}
g_room2,45,379,4	script	Black Side	734,{
	end;
OnInit:
	set getvariableofnpc( .blacknpcname$, "bg_pvp#control" ), strnpcinfo(0);
OnStart:
	waitingroom "Black Team", getvariableofnpc( .minplayer2start, "bg_pvp#control" ) +1, "bg_pvp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp#control" );
	end;
}
guild_vs2	mapflag	battleground	2
guild_vs2	mapflag	nosave	SavePoint
guild_vs2	mapflag	nowarp
guild_vs2	mapflag	nowarpto
guild_vs2	mapflag	noteleport
guild_vs2	mapflag	nomemo
guild_vs2	mapflag	nopenalty
guild_vs2	mapflag	nobranch
guild_vs2	mapflag	noicewall

screenAutoplayRO371.jpg.31de39fa1f63b3d756fe050c4622d9bb.jpg

Edited by Jade

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now