Jump to content
  • 0

Bg script help


Thanna

Question


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

Hello everyone, I'll just ask if you can add a little feature with this BG that Ms. AnnieRuru made

when a player is killed he/she will be warp on area with walls (a place where they will wait for their resurection) , then a timer will be counting down (5 seconds) then he/she will be warp out of the wall so he can go for battle again, this is the script

bg_emp_0.0.txt

Edited by Thanna
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

put this on 

 

 
OnRedDead:
OnBlueDead:
    sleep2 1500;
    percentheal 100,100;
    sc_start SC_TRICKDEAD,5000,1; //5 seconds
    end;
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:  

Trick dead can be dispell with dispell skill - haha logic - but use it is a fun idea

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

ahahaha.. maybe use a perfect hide for 5 sec. ? but i dont know the SC of perfect hide.. 

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:  


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;

}

prontera,149,167,5 script bg_emp_register 100,{

end;

OnStart:

getmapxy .@map$, .@x, .@y, 1;

warpwaitingpc .@map$, .@x, .@y;

callfunc "rand__", .minplayer2start *2, $@rand;

for ( .@i = 0; .@i < $@warpwaitingpcnum; .@i++ )

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

delwaitingroom strnpcinfo(0);

bg_warp .red, "bat_c01", 50,124;

bg_warp .blue, "bat_c01", 149,59;

setwall "bat_c01",54,122,6,7,0,"batc01wall_a";

setwall "bat_c01",55,122,5,7,0,"batc01wall_b";

setwall "bat_c01",140,56,6,7,0,"batc01wall_c";

setwall "bat_c01",140,57,5,7,0,"batc01wall_d";

bg_updatescore "bat_c01", 0, 0;

sleep 6000;

areapercentheal "bat_c01",50,123,58,131,100,100;

areapercentheal "bat_c01",141,52,149,60,100,100;

mapannounce "bat_c01", "Rules are simple. The first one to break the opponent's emperium will get a score.", 0;

sleep 3000;

mapannounce "bat_c01", "Score "+ .winningscore +" rounds to win ! ... GET READY", 0;

setwall "bat_c01",51,121,2,4,0,"batc01wall_e";

setwall "bat_c01",50,120,1,2,0,"batc01wall_f";

setwall "bat_c01",148,62,2,0,0,"batc01wall_g";

setwall "bat_c01",149,63,1,2,0,"batc01wall_h";

while (1) {

for ( .@i = 5; .@i > 0; .@i-- ) {

mapannounce "bat_c01","[ "+ .@i +" ]", 0;

sleep 1000;

}

if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 )

mapannounce "bat_c01", "Final Round start!", 0;

else

mapannounce "bat_c01", "Round "+ .round++ +" Start!", 0;

bg_monster .red,"bat_c01",50,131, "--ja--",1915, strnpcinfo(0)+"::OnRedDown";

bg_monster .blue,"bat_c01",149,52, "--ja--",1914, strnpcinfo(0)+"::OnBlueDown";

delwall "batc01wall_a";

delwall "batc01wall_b";

delwall "batc01wall_c";

delwall "batc01wall_d";

if ( .score[1] != .winningscore || .score[2] != .winningscore )

sleep .eventlasting * 1000;

.score[ .winside ]++;

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

killmonster "bat_c01", strnpcinfo(0)+"::OnRedDown";

killmonster "bat_c01", strnpcinfo(0)+"::OnBlueDown";

if ( .winside && .empkiller$ != "" )

mapannounce "bat_c01","[ "+ .empkiller$ +" ] has Destroy "+( ( .winside == 1 )?"Blue":"Red" )+" Team's Emperium. "+( ( .winside == 1 )?"Red":"Blue" )+" Team score a point !", 0;

if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break;

sleep 5000;

bg_warp .red, "bat_c01", 50,124;

bg_warp .blue, "bat_c01", 149,59;

setwall "bat_c01",54,122,6,7,0,"batc01wall_a";

setwall "bat_c01",55,122,5,7,0,"batc01wall_b";

setwall "bat_c01",140,56,6,7,0,"batc01wall_c";

setwall "bat_c01",140,57,5,7,0,"batc01wall_d";

.winside = 0;

.empkiller$ = "";

sleep 1000;

}

if ( .winside ) {

mapannounce "bat_c01", "[ "+( ( .winside == 1 )?"Red":"Blue" )+" Team] won !", 0;

getbgusers ( .winside == 1 )? .red : .blue;

for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )

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

} else

mapannounce "bat_c01", "Time Out. Aborting the match.", 0;

sleep 5000;

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

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

bg_kickall .red;

bg_kickall .blue;

delwall "batc01wall_a";

delwall "batc01wall_b";

delwall "batc01wall_c";

delwall "batc01wall_d";

delwall "batc01wall_e";

delwall "batc01wall_f";

delwall "batc01wall_g";

delwall "batc01wall_h";

.round = .winside = .score[0] = .score[1] = .score[2] = 0;

.empkiller$ = "";

waitingroom "BG Emperium", .minplayer2start*2 +1, strnpcinfo(0) +"::OnStart", .minplayer2start*2;

end;

OnRedDown: callsub L_EmpDown, 2;

OnBlueDown: callsub L_EmpDown, 1;

L_EmpDown:

.empkiller$ = strcharinfo(0);

.winside = getarg(0);

awake strnpcinfo(0);

end;

OnRedQuit: callsub L_quit, .red, "Red", 2;

OnBlueQuit: callsub L_quit, .blue, "Blue", 1;

L_quit:

if ( bg_get_data( getarg(0), 0 ) ) end;

mapannounce "bat_c01", "All "+ getarg(1) +" team members has Quit !", 0;

.score[ getarg(2) ] = .winningscore -1;

.winside = getarg(2);

awake strnpcinfo(0);

end;

OnRedDead:

// showdigit 5,3; // doesn't work properly

sleep2 1000;

for( .@i = 5; .@i > 0; .@i-- ) {

announce "[ "+ .@i +" ]", bc_self;

sleep2 1000;

}

percentheal 100,100;

warp "bat_c01",60,121;

end;

OnBlueDead:

sleep2 1000;

for( .@i = 5; .@i > 0; .@i-- ) {

announce "[ "+ .@i +" ]", bc_self;

sleep2 1000;

}

percentheal 100,100;

warp "bat_c01",139,62;

// sleep2 1250;

// percentheal 100,100;

end;

OnInit:

.red = 3; // red team bg ID

.blue = 4; // blue team bg ID

set .minplayer2start, 1; // minimum player to start

setarray .rewarditem, 501, 1; // reward to the winning team

set .winningscore, 2; // final score to win

set .eventlasting, 1200; // abort the system if there's no progress, 1200 seconds = 20 mins

.red = createbgid("bat_c01", 50,121, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead");

.blue = createbgid("bat_c01", 149,63, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead");

waitingroom "BG Emperium", .minplayer2start*2 +1, strnpcinfo(0) +"::OnStart", .minplayer2start*2;

// reloadscript debug

delwall "batc01wall_a";

delwall "batc01wall_b";

delwall "batc01wall_c";

delwall "batc01wall_d";

delwall "batc01wall_e";

delwall "batc01wall_f";

delwall "batc01wall_g";

delwall "batc01wall_h";

end;

}

bat_c01 mapflag battleground 2

bat_c01 mapflag nosave SavePoint

bat_c01 mapflag nowarp

bat_c01 mapflag nowarpto

bat_c01 mapflag noteleport

bat_c01 mapflag nomemo

bat_c01 mapflag nopenalty

bat_a01 mapflag nobranch

bat_a01 mapflag noicewall

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

&nbsp;

function	script	rand__	{	.@range = getarg(0);	.@count = getarg(2, 0);	if ( !.@count || .@count &gt; .@range )		.@count = .@range;	else if ( .@count &gt; 128 )		.@count = 128;	while ( .@i &lt; .@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 &lt; .@count )				set getelementofarray( getarg(1), .@save ), .@i;		}		.@i++;	}	return .@count;}prontera,149,167,5	script	bg_emp_register	100,{	end;OnStart:	getmapxy .@map$, .@x, .@y, 1;	warpwaitingpc .@map$, .@x, .@y;	callfunc "rand__", .minplayer2start *2, $@rand;	for ( .@i = 0; .@i &lt; $@warpwaitingpcnum; .@i++ )		setbgid ( .@i % 2 )? .red : .blue, $@warpwaitingpc[ $@rand[.@i] ];	delwaitingroom strnpcinfo(0);	bg_warp .red, "bat_c01", 50,124;	bg_warp .blue, "bat_c01", 149,59;	setwall "bat_c01",54,122,6,7,0,"batc01wall_a";	setwall "bat_c01",55,122,5,7,0,"batc01wall_b";	setwall "bat_c01",140,56,6,7,0,"batc01wall_c";	setwall "bat_c01",140,57,5,7,0,"batc01wall_d";	bg_updatescore "bat_c01", 0, 0;	sleep 6000;	areapercentheal "bat_c01",50,123,58,131,100,100;	areapercentheal "bat_c01",141,52,149,60,100,100;	mapannounce "bat_c01", "Rules are simple. The first one to break the opponent's emperium will get a score.", 0;	sleep 3000;	mapannounce "bat_c01", "Score "+ .winningscore +" rounds to win ! ... GET READY", 0;	setwall "bat_c01",51,121,2,4,0,"batc01wall_e";	setwall "bat_c01",50,120,1,2,0,"batc01wall_f";	setwall "bat_c01",148,62,2,0,0,"batc01wall_g";	setwall "bat_c01",149,63,1,2,0,"batc01wall_h";	while (1) {		for ( .@i = 5; .@i &gt; 0; .@i-- ) {			mapannounce "bat_c01","[ "+ .@i +" ]", 0;			sleep 1000;		}		if ( .score[1] == .winningscore -1 &amp;&amp; .score[2] == .winningscore -1 )			mapannounce "bat_c01", "Final Round start!", 0;		else			mapannounce "bat_c01", "Round "+ .round++ +" Start!", 0;		bg_monster .red,"bat_c01",50,131, "--ja--",1915, strnpcinfo(0)+"::OnRedDown";		bg_monster .blue,"bat_c01",149,52, "--ja--",1914, strnpcinfo(0)+"::OnBlueDown";		delwall "batc01wall_a";		delwall "batc01wall_b";		delwall "batc01wall_c";		delwall "batc01wall_d";		if ( .score[1] != .winningscore || .score[2] != .winningscore )			sleep .eventlasting * 1000;		.score[ .winside ]++;		bg_updatescore "bat_c01", .score[1], .score[2];		killmonster "bat_c01", strnpcinfo(0)+"::OnRedDown";		killmonster "bat_c01", strnpcinfo(0)+"::OnBlueDown";		if ( .winside &amp;&amp; .empkiller$ != "" )			mapannounce "bat_c01","[ "+ .empkiller$ +" ] has Destroy "+( ( .winside == 1 )?"Blue":"Red" )+" Team's Emperium. "+( ( .winside == 1 )?"Red":"Blue" )+" Team score a point !", 0;		if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break;		sleep 5000;		bg_warp .red, "bat_c01", 50,124;		bg_warp .blue, "bat_c01", 149,59;		setwall "bat_c01",54,122,6,7,0,"batc01wall_a";		setwall "bat_c01",55,122,5,7,0,"batc01wall_b";		setwall "bat_c01",140,56,6,7,0,"batc01wall_c";		setwall "bat_c01",140,57,5,7,0,"batc01wall_d";		.winside = 0;		.empkiller$ = "";		sleep 1000;	}	if ( .winside ) {		mapannounce "bat_c01", "[ "+( ( .winside == 1 )?"Red":"Blue" )+" Team] won !", 0;		getbgusers ( .winside == 1 )? .red : .blue;		for ( .@i = 0; .@i &lt; $@arenamembersnum; .@i++ )			getitem .rewarditem[0], .rewarditem[1], $@arenamembers[.@i]; // item reward	} else		mapannounce "bat_c01", "Time Out. Aborting the match.", 0;	sleep 5000;	bg_warp .red, "prontera", 155,182;	bg_warp .blue, "prontera", 158,182;	bg_kickall .red;	bg_kickall .blue;	delwall "batc01wall_a";	delwall "batc01wall_b";	delwall "batc01wall_c";	delwall "batc01wall_d";	delwall "batc01wall_e";	delwall "batc01wall_f";	delwall "batc01wall_g";	delwall "batc01wall_h";	.round = .winside = .score[0] = .score[1] = .score[2] = 0;	.empkiller$ = "";	waitingroom "BG Emperium", .minplayer2start*2 +1, strnpcinfo(0) +"::OnStart", .minplayer2start*2;	end;OnRedDown: callsub L_EmpDown, 2;OnBlueDown: callsub L_EmpDown, 1;L_EmpDown:	.empkiller$ = strcharinfo(0);	.winside = getarg(0);	awake strnpcinfo(0);	end;OnRedQuit: callsub L_quit, .red, "Red", 2;OnBlueQuit: callsub L_quit, .blue, "Blue", 1;L_quit:	if ( bg_get_data( getarg(0), 0 ) ) end;	mapannounce "bat_c01", "All "+ getarg(1) +" team members has Quit !", 0;	.score[ getarg(2) ] = .winningscore -1;	.winside = getarg(2);	awake strnpcinfo(0);	end;OnRedDead:	// showdigit 5,3; // doesn't work properly	sleep2 1000;	for( .@i = 5; .@i &gt; 0; .@i-- ) {		announce "[ "+ .@i +" ]", bc_self;		sleep2 1000;	}	percentheal 100,100;	warp "bat_c01",60,121;	end;OnBlueDead:	sleep2 1000;	for( .@i = 5; .@i &gt; 0; .@i-- ) {		announce "[ "+ .@i +" ]", bc_self;		sleep2 1000;	}	percentheal 100,100;	warp "bat_c01",139,62;	// sleep2 1250;	// percentheal 100,100;	end;OnInit:	.red = 3; // red team bg ID	.blue = 4; // blue team bg ID	set .minplayer2start, 1; // minimum player to start	setarray .rewarditem, 501, 1; // reward to the winning team	set .winningscore, 2; // final score to win	set .eventlasting, 1200; // abort the system if there's no progress, 1200 seconds = 20 mins	.red = createbgid("bat_c01", 50,121, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead");	.blue = createbgid("bat_c01", 149,63, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead");	waitingroom "BG Emperium", .minplayer2start*2 +1, strnpcinfo(0) +"::OnStart", .minplayer2start*2;// reloadscript debug	delwall "batc01wall_a";	delwall "batc01wall_b";	delwall "batc01wall_c";	delwall "batc01wall_d";	delwall "batc01wall_e";	delwall "batc01wall_f";	delwall "batc01wall_g";	delwall "batc01wall_h";	end;}bat_c01	mapflag	battleground	2bat_c01	mapflag	nosave	SavePointbat_c01	mapflag	nowarpbat_c01	mapflag	nowarptobat_c01	mapflag	noteleportbat_c01	mapflag	nomemobat_c01	mapflag	nopenaltybat_a01	mapflag	nobranchbat_a01	mapflag	noicewall

thanks capuche, perfectly working

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