Takumirai

party vs party (blue team v.s. red team)

Recommended Posts

- Emperium Wars [ party v.s. party ] modified by: AnnieRuru

 

 

 

 Game Configuration    setarray .rewarditem, 29003, 5; // Just Change ID,Number of Item ID [29003,5]	set .winningscore, 3; // Set How many times do each team need to destroy the emperium	set .eventlasting, 20 * 60; // abort the system if there's no progress, 20 mins * seconds	set .register_lasting, 1 * 60; // 3 minutes to joins, else abort registration, 10 mins * seconds 

 

Game Info: 

- How to win?

A: You need to destroy the Emperium of you opponent and Defend your own Emperium.

- What happen if we die?

A: You will be spawn again in your base with full hp/sp and you can't be attack by enemy for 5 sec. or just modify this part.

 

OnRedDead:OnBlueDead:	sleep2 1500;	percentheal 100,100;	sc_start SC_BASILICA,5000,1;	end; 

- Is there any tower or Monster in the area?.

A: yes there is each team have Guardian in there area so you need to kill those guardian also.

 

 

Note: Please support this topic. If you have suggestion or any add-ons to make this script awesome feel free to comment here.

- This Script is Free to use 

- Special Thanks to Annie for making this script :)

 

Emperium War [party v.s. party] v.1 http://upaste.me/309471

 

 
 
 
 
Edited by Takumirai

Share this post


Link to post
Share on other sites

 

- This script i used long ago in rAthena

- Note: AnnieRuru modified this script.

- I just put some idea on the script but the problem is the script is too long.

 

Mechanics:

- Red team v.s. Blue team

- form 7 member in a team and choose if you want team red or blue.

- a timer will set to the 2nd team to register

- after all team are set you will be warp on the waiting room with pub (team must enter the pub)

- all team will be warp in there designated position.

- the base will have 1 emperium (the goal is you must protect your emperium and attack other base and destroy there emperium)

Note: there will be a guardian in your base to protect your emperium. 

- First Player who will destroy enemy emperium will win.

- Note: If player dies he will respawn with full hp/sp but cant attack on 10sec and cant be attack by enemy on 10sec.

 

- Hoping that AnnieRuru will rescript this to be able to work on hercules and to be able to shorten the script.

 

http://pastebin.com/30ciq6Tq

 

 

NOTE: Make quiz_01 no teleport no warp.

 

 

 

-	script	bg_emp#control	-1,{OnInit:	setarray .rewarditem, 29003, 5; // reward to the winning team	set .winningscore, 3; // final score to win	set .eventlasting, 20 * 60; // abort the system if there's no progress, 20 mins * seconds	set .register_lasting, 1 * 60; // 3 minutes to joins, else abort registration, 10 mins * seconds	sleep 1;	disablenpc .rednpcname$;	disablenpc .bluenpcname$;	end;OnStart:	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end;	set .red, waitingroom2bg( "bat_a01", 171,346, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );	copyarray .team1aid, [email protected], [email protected];	set .blue, waitingroom2bg( "bat_a01", 162,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );	copyarray .team2aid, [email protected], [email protected];	.inprogress = 2;	bg_warp .red, "bat_a01", 171,346;	bg_warp .blue, "bat_a01", 162,50;	setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue";	setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";	bg_updatescore "bat_a01", 0, 0;	sleep 6000; if ( .inprogress == 0 ) goto L_Abort;	mapannounce "bat_a01", "Rules are simple. The first one to break the opponent's emperium will get a score.", 0;	sleep 3000; if ( .inprogress == 0 ) goto L_Abort;	mapannounce "bat_a01", "Score "+ .winningscore +" rounds to win ! ... GET READY", 0;	sleep 2000; if ( .inprogress == 0 ) goto L_Abort;	while (1) {		for ( [email protected] = 5; [email protected] > 0; [email protected] ) {			mapannounce "bat_a01", [email protected] +"", 0;			sleep 1000; if ( .inprogress == 0 ) goto L_Abort;		}		if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 )			mapannounce "bat_a01", "Final Round start!", 0;		else			mapannounce "bat_a01", "Round "+ .round++ +" start!", 0;		bg_monster .red,"bat_a01",157,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown";		bg_monster .blue,"bat_a01",148,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown";		bg_monster .red,"bat_a01",171,346, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",171,346, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",171,346, "--ja--",1287, strnpcinfo(3)+"::Onguardian";			bg_monster .blue,"bat_a01",162,50, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",162,50, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",162,50, "--ja--",1287, strnpcinfo(3)+"::Onguardian";		//Outside		bg_monster .red,"bat_a01",193,271, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",193,271, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",193,271, "--ja--",1287, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",177,123, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",177,123, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",177,123, "--ja--",1287, strnpcinfo(3)+"::Onguardian";			//Outside Left Side		bg_monster .red,"bat_a01",279,235, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",279,235, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",279,235, "--ja--",1287, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",279,235, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",279,235, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .red,"bat_a01",279,235, "--ja--",1287, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",268,163, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",268,163, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",268,163, "--ja--",1287, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",268,163, "--ja--",1285, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",268,163, "--ja--",1286, strnpcinfo(3)+"::Onguardian";		bg_monster .blue,"bat_a01",268,163, "--ja--",1287, strnpcinfo(3)+"::Onguardian";		delwall "bg_emp_town_red";		delwall "bg_emp_town_blue";		sleep .eventlasting * 1000; if ( .inprogress == 0 ) goto L_Abort;		.score[ .winside ]++;		bg_updatescore "bat_a01", .score[1], .score[2];		killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";		killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";		killmonster "bat_a01", strnpcinfo(3)+"::Onguardian";		if ( .winside )			mapannounce "bat_a01", .empkiller$ +" has Destroy "+( ( .winside == 1 )?"Blue":"Red" )+"'s side Emperium. "+( ( .winside == 1 )?"Red":"Blue" )+" team score a point !", 0;		if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break;		sleep 5000; if ( .inprogress == 0 ) goto L_Abort;		bg_warp .red, "bat_a01", 171,346;		bg_warp .blue, "bat_a01", 162,50;		setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue";		setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";		.winside = 0;	}	if ( .winside ) {		mapannounce "bat_a01", ( ( .winside == 1 )?"Red":"Blue" )+" side wins !", 0;		[email protected] = getarraysize( getd(".team"+ .winside +"aid") );		for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )			getitem .rewarditem[0], .rewarditem[1], getd(".team"+ .winside +"aid["+ [email protected] +"]" );			goto L_Abort;	} else		mapannounce "bat_a01", "Time Out. Aborting the match.", 0;		goto L_Abort;	sleep 5000;L_Abort:	bg_warp .red, "prontera", 155,182;	bg_warp .blue, "prontera", 158,182;	bg_destroy .red;	bg_destroy .blue;	set [email protected],0;	set [email protected],0;	set [email protected],0;	killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";	killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";	killmonster "bat_a01", strnpcinfo(3)+"::Onguardian";	delwall "bg_emp_town_red";	delwall "bg_emp_town_blue";	deletearray .team1aid;	deletearray .team2aid;	.round = .winside = .score[2] = .score[1] = .inprogress = 0;	end;OnRedDown: callsub L_EmpDown, 2;OnBlueDown: callsub L_EmpDown, 1;L_EmpDown:	.empkiller$ = strcharinfo(0);	.winside = getarg(0);	awake strnpcinfo(3);OnRedDead:OnBlueDead:	sleep2 1500;	percentheal 100,100;	sc_start SC_BASILICA,5000,1;	end;Onguardian: end;OnRedQuit: callsub L_quit, .red, "Red", "Blue", 2;OnBlueQuit: callsub L_quit, .blue, "Blue", "Red", 1;L_quit:	if ( bg_get_data( getarg(0), 0 ) ) end;	mapannounce "bat_a01", "All "+ getarg(1) +" team members has Quit ! "+ getarg(2) +" side wins !", 0;	[email protected] = getarraysize( getd(".team"+ getarg(3) +"aid") );	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(3) +"aid["+ [email protected] +"]" );	goto L_Abort;OnAutoAbort:	sleep .register_lasting * 1000;	delwaitingroom .rednpcname$;	delwaitingroom .bluenpcname$;	disablenpc .rednpcname$;	disablenpc .bluenpcname$;	set [email protected],0;	set [email protected],0;	set [email protected],0;	mapwarp "quiz_01","prontera",156,191;	if ( .inprogress == 1 ) {		.inprogress = 0;		announce "battleground has self-aborted because not enough members", 0;	}	end;}gonryun,151,110,6	script	Crystal Wars::crystalwar	456,{	if (getgmlevel() >= 99){		menu "Register Team",standard,"Reset",lend;	}standard:	set [email protected],7; // number of party members change this to your party size you want	set [email protected],7; // number of party members change this to your party size you want	set getvariableofnpc( .minplayer2start, "bg_emp#control" ), [email protected];	enablenpc getvariableofnpc( .rednpcname$, "bg_emp#control" );	enablenpc getvariableofnpc( .bluenpcname$, "bg_emp#control" );	donpcevent getvariableofnpc( .rednpcname$, "bg_emp#control" ) +"::OnStart";	donpcevent getvariableofnpc( .bluenpcname$, "bg_emp#control" ) +"::OnStart";	set getvariableofnpc( .inprogress, "bg_emp#control" ), 1;	set [email protected],0;	getpartymember(getcharid(1));	set @partymembercount,[email protected];	if ( [email protected] == 1 ) {		mes "The Sign Ups are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!";		close;	}	if ( @partymembercount == [email protected] ) {		if ( [email protected] == getcharid(1) ) {			mes "Do you wish to sign out your team in crystal wars?";				next;				if (select("I Give up ~.","Never Say Quit !!")==2) close;				announce "Team 1 : [ " + getpartyname([email protected]) + " ] has sign out. We need another Party to sign up now!",bc_yellow|bc_map;				set [email protected], 0;			close;			}		if ([email protected]==getcharid(1)) {				mes "Do you wish to sign out your team in crystal wars?";			next;				if (select("I Give up ~.","Never Say Quit !!")==2) close;			announce "Team 2 : [ " + getpartyname([email protected]) + " ] has sign out. We need another Party to sign up now!",bc_yellow|bc_map;				set [email protected], 0;				close;			}		mes "Hello "+strcharinfo(0)+" what do you want?";		if (([email protected]!=0) && ([email protected]!=0)) {			mes "The Sign Ups are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!";			close;		}		if ( getpartyleader(getcharid(1),2) != getcharid(0) ) {			mes "Only party leader have the right to sign up / out from the game with me..";			close;		}		mes "Choose your team to register.";		switch(select("Red Team - [" + GetPartyName([email protected]) + "] :Blue Team - [" + GetPartyName([email protected]) + "]")) {		case 1:	mes "[  Crystal War  ]";			if ([email protected]==0 || getpartyname([email protected])=="null") {				getpartymember(getcharid(1)),1;				getpartymember(getcharid(1)),2;				copyarray [email protected][0],[email protected][0],[email protected];				copyarray [email protected][0],[email protected][0],[email protected];				for (set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) {					if(isloggedin([email protected][[email protected]],[email protected][[email protected]]))  set [email protected],[email protected]+1;				}				if([email protected] < [email protected]) {					mes "You need all your party members to be online to Register";					close;				}				set [email protected], getcharid(1);					initnpctimer;					mes "Your Party is now subscribed, good luck!";					announce "Team 1 : [ " +getpartyname([email protected])+ " ] has sign up For the Crystal Wars!",bc_blue|bc_map;					donpcevent "bg_emp#control::OnAutoAbort";				doevent "crystalwar::OnSubscriptionTeam";					close;				} else {				mes "I'm sorry! Another Team has sign up before you...";					close;				}		case 2:	mes "[  Crystal War  ]";			if ([email protected]==0 || getpartyname([email protected])=="null") {					getpartymember(getcharid(1)),1;				getpartymember(getcharid(1)),2;				copyarray [email protected][0],[email protected][0],[email protected];				copyarray [email protected][0],[email protected][0],[email protected]bers;				for (set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) {					if(isloggedin([email protected][[email protected]],[email protected][[email protected]])) set [email protected],[email protected]+1;				}				if([email protected] < [email protected]) {					mes "You need all your party members to be online to Register";					close;				}				set [email protected], getcharid(1);					initnpctimer;					mes "Your Party is now subscribed, good luck!";					announce "Team 2 : [ " +getpartyname([email protected])+ " ] has sign up For the Crystal Wars!",bc_blue|bc_map;				donpcevent "bg_emp#control::OnAutoAbort";				doevent "crystalwar::OnSubscriptionTeam";					close;				} else {					mes "I'm sorry! Another Team has sign up before you...";					close;			}		}	} else {		mes "[Event Handler]";		mes "Please contact your party leader.";		mes "Your team must have a party consisting of "[email protected]+" members.";		close;	}OnSubscriptionTeam:	getpartymember([email protected]),1;	getpartymember([email protected]),2;	copyarray [email protected][0],[email protected][0],[email protected];	copyarray [email protected][0],[email protected][0],[email protected];	for (set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) {		if(isloggedin([email protected][[email protected]],[email protected]2[[email protected]])) set [email protected],[email protected]+1;	}	if([email protected] < [email protected]) {		announce "Crystal War : "+getpartyname([email protected])+"are not all online the match has been canceled",0;		announce "Crystal War : Registration for [2] New Team is now Available",0;		goto lend;	}	if ( [email protected] && [email protected] != [email protected] ) {		announce getpartyname([email protected]) +" has extra party members, Registration is now Reset!", 0;		goto lend;	}	getpartymember([email protected]),1;	getpartymember([email protected]),2;	copyarray [email protected][0],[email protected][0],[email protected];	copyarray [email protected][0],[email protected][0],[email protected];	for (set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) {		if(isloggedin([email protected][[email protected]],[email protected][[email protected]])) set [email protected],[email protected]+1;	}	if([email protected] < [email protected]) {		announce "Crystal War : "+getpartyname([email protected])+"are not all online the match has been canceled",0;		announce "Crystal War : Registration for [2] New Team is now Available",0;		goto lend;	}	if ( [email protected] &&  [email protected] != [email protected] ) {		announce getpartyname([email protected]) +" has extra party members !", 0;		goto lend;	}	if([email protected]!=0 && [email protected]!=0){		announce "Crystal War : We have 2 Teams signed up now : "+getpartyname([email protected])+" and "+getpartyname([email protected])+".",bc_blue|bc_map;		warpparty "quiz_01",37,74,[email protected];		warpparty "quiz_01",73,73,[email protected];		setcell "quiz_01",34,81,40,81,cell_walkable,0;		setcell "quiz_01",70,81,76,81,cell_walkable,0;	}	end;lend:	stopnpctimer;	set [email protected],0;	set [email protected],0;	set [email protected],0;	set @partymembercount,[email protected];	awake "bg_emp#control";	killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";	killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";	delwaitingroom getvariableofnpc( .rednpcname$, "bg_emp#control" );	delwaitingroom getvariableofnpc( .bluenpcname$, "bg_emp#control" );	disablenpc getvariableofnpc( .rednpcname$, "bg_emp#control" );	disablenpc getvariableofnpc( .bluenpcname$, "bg_emp#control" );	announce "Thanks for playing",0;	end;}quiz_01,37,74,5	script	Red side#bg_emp	100,{	end;OnStart:	waitingroom "Red side", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" );	end;OnInit:	set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0);	end;}quiz_01,73,76,5	script	Blue side#bg_emp	100,{	end;OnStart:	waitingroom "Blue side", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" );	end;OnInit:	set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0);	end;}bat_a01	mapflag	battleground	2bat_a01	mapflag	nosave	SavePointbat_a01	mapflag	nowarpbat_a01	mapflag	nowarptobat_a01	mapflag	noteleportbat_a01	mapflag	nomemobat_a01	mapflag	nopenaltybat_a01	mapflag	nobranchbat_a01	mapflag	noicewall

i hadthe same error 

 

i got the npc at gonryun but its not working see this attachments

Share this post


Link to post
Share on other sites

my 1st impression is that ... why not just use my setbgid ?

just setbgid the whole party into battleground team without having to use waitingroom

.

.

.

tlacson7, on 22 Aug 2014 - 21:50, said:

getting this error: [Error]: chat_createnpcchat: npc 'Red side#bg_emp' already has a chatroom, cannot create new one!

try this

http://upaste.me/309471

 

though, not only this script uses older techniques, those custom stuffs are too unoptimized

that will be a lot of time needed if I want to rewrite everything from scratch

so ... just stick with it

Share this post


Link to post
Share on other sites

 

my 1st impression is that ... why not just use my setbgid ?

just setbgid the whole party into battleground team without having to use waitingroom

.

.

.

tlacson7, on 22 Aug 2014 - 21:50, said:

getting this error: [Error]: chat_createnpcchat: npc 'Red side#bg_emp' already has a chatroom, cannot create new one!

try this

http://upaste.me/309471

 

though, not only this script uses older techniques, those custom stuffs are too unoptimized

that will be a lot of time needed if I want to rewrite everything from scratch

so ... just stick with it

 

 

Thank you wonderful, i lost that error, but found another one. :D..  

 

When you select "Reset"  it stuck from there and need to character select.  I think its the "end;" thing.

Share this post


Link to post
Share on other sites

 

Why I can't use this script?

If you will post more information about why, maybe someone can answer your question..

 

It said error in line 33 

parse_line : expect command, missing function name or calling undeclared function and in line 33 is .inprogress 

and I have another problem it said It can't find npc bg_emp#control

plz answer me cause I really want to use this cool script

Edited by aaaa

Share this post


Link to post
Share on other sites

Can there be a queue system for this ? I mean change the registration type. Make it a waiting room and select randomly.

Example.

Two people are waiting outside. Then round 1 ends. Those two will be warped to each respected team.

Edited by - Mariel

Share this post


Link to post
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
Reply to this topic...

×   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.

Loading...