Jump to content
  • 0

party vs party script @ random map Feedback


Josap

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  08/12/14
  • Last Seen:  

Hi -

 

I'm new to rathena and scripting. I'm trying to create a party vs party script then warp the party to a random map. Havn't checked my script if its going to work since I'm not at home. Can you please check and test my script. Feedback is very much encourage.

//CUSTOM PARTY VS PARTY SCRIPT
//RANDOM Guild_vs1-5 MAP
//SCRIPT BY JOSAP

prontera,147,175,6	script	GVGNPC	90,{
mes "Hi! I'm the GVG dude. Please choose a team";
next;
menu "Team 1",L_Team1,"Team 2",L_Team2;


L_Team1:
if getpartyleader == strcharinfo(0){
//if strcharinfo(1) != 0 {													//check if Player is the party leader
	if strcharinfo(1) != partyN2{
		set partyN1,strcharinfo(1);
		mes "Your party is now registered for Team 1";
		set PL1,strcharinfo(0);
		announce "Team " +partyN1+ " has registered. Teamleader: " +PL1;
		goto L_checkTeams;
	else
	mes "Your team is already registered under Team 2";
	end;
	}
else
mes "Only party leaders can register";
close;
end;	
}


L_Team2:
if getpartyleader == strcharinfo(0){
//if strcharinfo(1) !=0 {
	if strcharinfo(1) != partyN1{
		set partyN2,strcharinfo(1);
		mes "Your party is now registered for Team 2";
		set PL2,strcharinfo(0);
		announce "Team " +partyN2+ " has registered. Teamleader: " +PL2;
		goto L_checkTeams;
	else
	mes "Your team is already registered under Team 1";
	end;
	}
else
mes "You need a party to register";
close;
end;
}

L_checkTeams:
	if partyN1 != 0 && partyN2 != 0 {
		set $@ran, rand(1,5);
		announce "Teams have now registered.";
		sleep2 2000;
		announce "Team " +partyN1+ " vs Team " +partyN2+ "at MAP " +$@ran+ "Will now begin shortly";
		sleep2 5000;
		announce "Warping both teams now."
		switch($@ran){
			case 1:
					warpparty "guild_vs1",50,50,partyN1;
					warpparty "guild_vs1",50,50,partyN2;
			break;
			case 2:
					warpparty "guild_vs2",50,50,partyN1;
					warpparty "guild_vs2",50,50,partyN2;
			break;
			case 3:
					warpparty "guild_vs3",50,50,partyN1;
					warpparty "guild_vs3",50,50,partyN2;
			break;
			case 4:
					warpparty "guild_vs4",50,50,partyN1;
					warpparty "guild_vs4",50,50,partyN2;
			break;
			case 5:
					warpparty "guild_vs5",50,50,partyN1;
					warpparty "guild_vs5",50,50,partyN2;
			break;
		}
		sleep2 5000;
		announce "BUFFS READY!!!"
		sleep2 5000;
		announce "Battle will commence in: 3";
		sleep2 1500;
		announce "Battle will commence in: 2";
		sleep2 1500;
		announce "Battle will commence in: 1";
		sleep2 1500;
		announce "GO!!!";
	else
		mes "We are still waiting for your opponent"
		close;
		end;		
	}
close;
}

Thanks in advance

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  01/07/12
  • Last Seen:  

you need to use ( ) on the ifs

 

like

if ( strcharinfo(1) != partyN2 )

instead of

if strcharinfo(1) != partyN2

also, there is no need to put end; after close;

 

like

mes "Only party leaders can register";
close;
end;

you must use

mes "Only party leaders can register";
close;

and you do not use { } on else

else
mes "Only party leaders can register";
close;

you must use:

else {
  mes "Only party leaders can register";
  close;
}

you can avoid using { } only if there is 1 instruction following, like:

else
   set @var,1;

and you can use only 1 close; for the if and else, like:

 

 
if ( @var == 1 ){
  do something
  do something
} else{
   do something else
   do something else
}
close; //This will work for both, for the if, and for the else
 
Edited by eKoh
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...