Jump to content
  • 0

Help in Battleground script


brunoshp

Question


  • Group:  Members
  • Topic Count:  64
  • Topics Per Day:  0.02
  • Content Count:  180
  • Reputation:   7
  • Joined:  12/19/12
  • Last Seen:  

in this script :

prontera,156,185,5 script kjdhfkdjsf 100,{
mes "wanna sign up";
if ( select( "yes", "no" ) == 2 ) close;
else if ( .signup_count == 128 ) {
 mes "Sorry the whole queue is full";
 close;
}
while ( .signup_aid[.@i] != getcharid(3) && .@i < .signup_count )
 set .@i, .@i +1;
if ( .@i < .signup_count ) {
 mes "you have already sign up in this event";
 close;
}
set .signup_aid[ .signup_count ], getcharid(3);
set .signup_count, .signup_count +1;
mes "You are now signed to the BG event";
// set .@i, 0; // DEBUG
// while ( .signup_aid[.@i] ) {
//  set .@signup_name$, .@signup_name$ +","+ rid2name( .signup_aid[.@i] );
//  set .@i, .@i +1;
// }
// mes "[Debug] Currently have "+ .signup_count +" sign-in and they are "+ .@signup_name$;
close2;
L_start:
if ( .signup_count < .min2start ) end;
for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 ) {
 if ( attachrid( .signup_aid[.@i] ) ) {
  if ( getmapflag( strcharinfo(3), mf_nowarp ) ) { // player has went into another event
   deletearray .signup_aid[.@i], 1;
   set .signup_count, .signup_count -1;
   set .@i, .@i -1;
  }
 }
 else {
  deletearray .signup_aid[.@i], 1;
  set .signup_count, .signup_count -1;
  set .@i, .@i -1;
 }
}
if ( .start || .signup_count < .min2start ) end;
announce "event started", 0;
set .start, 1;
for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 )
 setbgid ( .@i %2 )? .red : .blue, .signup_aid[.@i];
deletearray .signup_aid, .min2start;
set .signup_count, .signup_count - .min2start;
bg_warp .red, "guild_vs3", 13,50;
bg_warp .blue, "guild_vs3", 86,50;
bg_updatescore "guild_vs3", 0,0;
sleep .eventlasting * 1000;
if ( .start == 1 ) {
 if ( .score[1] == .score[2] )
  mapannounce "guild_vs3", "Draw !", 0;
 else if ( .score[1] > .score[2] ) {
  mapannounce "guild_vs3", " Red side wins !", 0;
  callsub L_reward, .red;
 }
 else if ( .score[1] < .score[2] ) {
  mapannounce "guild_vs3", " Blue side wins !", 0;
  callsub L_reward, .blue;
 }
}
bg_warp .red, "prontera", 155,182;
bg_warp .blue, "prontera", 158,182;
bg_kickall .red;
bg_kickall .blue;
set .start, 0;
deletearray .score;
goto L_start;
L_reward:
getbgusers getarg(0);
for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 )
 getitem 501, 1, $@arenamembers[.@i]; // item reward
return;
Onredout: callsub L_out, 2;
Onblueout: callsub L_out, 1;
L_out:
announce strcharinfo(0) +" is out from the match !", 1;
bg_leave;
warp "SavePoint", 0,0;
set .score[ getarg(0) ], .score[ getarg(0) ] +1;
bg_updatescore "guild_vs3", .score[1], .score[2];
if ( .score[ getarg(0) ] == .min2start /2 )
 awake strnpcinfo(0);
end;
OnInit:
set .eventlasting, 30 * 60; // how long would the event last or it auto-reset. 30 *60 = 30 mins
set .min2start, 2; // minimum player to start
set .red, createbgid( "guild_vs3", 13,50, strnpcinfo(0)+"::Onredout", strnpcinfo(0)+"::Onredout" );
set .blue, createbgid( "guild_vs3", 86,50, strnpcinfo(0)+"::Onblueout", strnpcinfo(0)+"::Onblueout" );
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

I need to make only end round when red or blue team have 3 points.

and add OnPCLogoutEvent.

Edited by AnnieRuru
use [codebox] if the script > 10 lines, and move to script request
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,156,185,5	script	kjdhfkdjsf	100,{
mes "wanna sign up";
if ( select( "yes", "no" ) == 2 ) close;
else if ( .signup_count == 128 ) {
	mes "Sorry the whole queue is full";
	close;
}
while ( .signup_aid[.@i] != getcharid(3) && .@i < .signup_count )
	set .@i, .@i +1;
if ( .@i < .signup_count ) {
	mes "you have already sign up in this event";
	close;
}
set .signup_aid[ .signup_count ], getcharid(3);
set .signup_count, .signup_count +1;
mes "You are now signed to the BG event";
//	set .@i, 0; // DEBUG
//	while ( .signup_aid[.@i] ) {
//		set .@signup_name$, .@signup_name$ +","+ rid2name( .signup_aid[.@i] );
//		set .@i, .@i +1;
//	}
//	mes "[Debug] Currently have "+ .signup_count +" sign-in and they are "+ .@signup_name$;
close2;
L_start:
if ( .signup_count < .min2start ) end;
for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 ) {
	if ( attachrid( .signup_aid[.@i] ) ) {
		if ( getmapflag( strcharinfo(3), mf_nowarp ) ) { // player has went into another event
			deletearray .signup_aid[.@i], 1;
			set .signup_count, .signup_count -1;
			set .@i, .@i -1;
		}
	}
	else {
		deletearray .signup_aid[.@i], 1;
		set .signup_count, .signup_count -1;
		set .@i, .@i -1;
	}	
}
if ( .start || .signup_count < .min2start ) end;
announce "event started", 0;
set .start, 1;
for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 )
	setbgid ( .@i %2 )? .red : .blue, .signup_aid[.@i];
deletearray .signup_aid, .min2start;
set .signup_count, .signup_count - .min2start;
bg_warp .red, "guild_vs3", 13,50;
bg_warp .blue, "guild_vs3", 86,50;
cleararray .score[1], .startingscore, 2;
bg_updatescore "guild_vs3", .score[1], .score[2];
sleep .eventlasting * 1000;
if ( .start == 1 ) {
	if ( .score[1] == .score[2] )
		mapannounce "guild_vs3", "Draw !", 0;
	else if ( .score[1] > .score[2] ) {
		mapannounce "guild_vs3", " Red side wins !", 0;
		callsub L_reward, .red;
	}
	else if ( .score[1] < .score[2] ) {
		mapannounce "guild_vs3", " Blue side wins !", 0;
		callsub L_reward, .blue;
	}
}
bg_warp .red, "prontera", 155,182;
bg_warp .blue, "prontera", 158,182;
bg_kickall .red;
bg_kickall .blue;
set .start, 0;
deletearray .score;
goto L_start;
L_reward:
getbgusers getarg(0);
for ( set .@i, 0; .@i < $@arenamembersnum; set .@i, .@i +1 )
	getitem 501, 1, $@arenamembers[.@i]; // item reward
return;
OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
set .score[ getarg(0) ], .score[ getarg(0) ] -1;
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;
set .score[ getarg(0) ], 0;
awake strnpcinfo(0);
end;
OnInit:
set .eventlasting, 30 * 60; // how long would the event last or it auto-reset. 30 *60 = 30 mins
set .min2start, 2; // minimum player to start
set .startingscore, 3; // score at start

set .red, createbgid( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead" );
set .blue, createbgid( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead" );
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

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  64
  • Topics Per Day:  0.02
  • Content Count:  180
  • Reputation:   7
  • Joined:  12/19/12
  • Last Seen:  

the OnPCLogoutEvent is out arena! is waiting in queue.

When player dead , the player return arena not prontera!

thz for all!

Edited by brunoshp
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

OnPCLogoutEvent is out arena! is waiting in queue.
my script should have check them with *attachrid command ( if attachrid ... else {here} )

if they are log out, the next time player register, the attachrid condition will unqueue them

When player dead , the player return arena not prontera!
yes ... in fact this how how my bg_pvp script looks like if you search bg_pvp around this forum

the team need to kill the opponent team the amount of points to win,

and if they respawn to the amount of starting value, that team lost

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  64
  • Topics Per Day:  0.02
  • Content Count:  180
  • Reputation:   7
  • Joined:  12/19/12
  • Last Seen:  

or it is possible to make point without killing?

Solved

Edited by brunoshp
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  567
  • Reputation:   18
  • Joined:  04/15/13
  • Last Seen:  

prontera,156,185,5	script	kjdhfkdjsf	100,{

	mes "wanna sign up";

	if ( select( "yes", "no" ) == 2 ) close;

	else if ( .signup_count == 128 ) {

		mes "Sorry the whole queue is full";

		close;

	}

	while ( .signup_aid[.@i] != getcharid(3) && .@i < .signup_count )

		set .@i, .@i +1;

	if ( .@i < .signup_count ) {

		mes "you have already sign up in this event";

		close;

	}

	set .signup_aid[ .signup_count ], getcharid(3);

	set .signup_count, .signup_count +1;

	mes "You are now signed to the BG event";

//	set .@i, 0; // DEBUG

//	while ( .signup_aid[.@i] ) {

//		set .@signup_name$, .@signup_name$ +","+ rid2name( .signup_aid[.@i] );

//		set .@i, .@i +1;

//	}

//	mes "[Debug] Currently have "+ .signup_count +" sign-in and they are "+ .@signup_name$;

	close2;

L_start:

	if ( .signup_count < .min2start ) end;

	for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 ) {

		if ( attachrid( .signup_aid[.@i] ) ) {

			if ( getmapflag( strcharinfo(3), mf_nowarp ) ) { // player has went into another event

				deletearray .signup_aid[.@i], 1;

				set .signup_count, .signup_count -1;

				set .@i, .@i -1;

			}

		}

		else {

			deletearray .signup_aid[.@i], 1;

			set .signup_count, .signup_count -1;

			set .@i, .@i -1;

		}	

	}

	if ( .start || .signup_count < .min2start ) end;

	announce "event started", 0;

	set .start, 1;

	for ( set .@i, 0; .@i < .signup_count; set .@i, .@i +1 )

		setbgid ( .@i %2 )? .red : .blue, .signup_aid[.@i];

	deletearray .signup_aid, .min2start;

	set .signup_count, .signup_count - .min2start;

	bg_warp .red, "guild_vs3", 13,50;

	bg_warp .blue, "guild_vs3", 86,50;

	cleararray .score[1], .startingscore, 2;

	bg_updatescore "guild_vs3", .score[1], .score[2];

	sleep .eventlasting * 1000;

	if ( .start == 1 ) {

		if ( .score[1] == .score[2] )

			mapannounce "guild_vs3", "Draw !", 0;

		else if ( .score[1] > .score[2] ) {

			mapannounce "guild_vs3", " Red side wins !", 0;

			callsub L_reward, .red;

		}

		else if ( .score[1] < .score[2] ) {

			mapannounce "guild_vs3", " Blue side wins !", 0;

			callsub L_reward, .blue;

		}

	}

	bg_warp .red, "prontera", 155,182;

	bg_warp .blue, "prontera", 158,182;

	bg_kickall .red;

	bg_kickall .blue;

	set .start, 0;

	deletearray .score;

	goto L_start;

L_reward:

	getbgusers getarg(0);

	for ( set .@i, 0; .@i < $@arenamembersnum; set .@i, .@i +1 )

		getitem 501, 1, $@arenamembers[.@i]; // item reward

	return;

OnredDead: callsub L_dead, 1;

OnblueDead: callsub L_dead, 2;

L_dead:

	set .score[ getarg(0) ], .score[ getarg(0) ] -1;

	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;

	set .score[ getarg(0) ], 0;

	awake strnpcinfo(0);

	end;

OnInit:

	set .eventlasting, 30 * 60; // how long would the event last or it auto-reset. 30 *60 = 30 mins

	set .min2start, 2; // minimum player to start

	set .startingscore, 3; // score at start



	set .red, createbgid( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead" );

	set .blue, createbgid( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead" );

	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

 

 

Annie? i tried your script and error at line 87.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

[paste=qzoynvnjiwh]

just kinda wants to update this script using newer techniques

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  64
  • Topics Per Day:  0.02
  • Content Count:  180
  • Reputation:   7
  • Joined:  12/19/12
  • Last Seen:  

When player dead he go to prontera. IT HAS to go the Place Which pair appeared on the map .

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

When player dead he go to prontera. IT HAS to go the Place Which pair appeared on the map .

 

can you show the script you are using?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  64
  • Topics Per Day:  0.02
  • Content Count:  180
  • Reputation:   7
  • Joined:  12/19/12
  • Last Seen:  

i fixed Thz.

Edited by brunoshp
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...