Jump to content
  • 0

How to add reward on winning team?


topechi

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  11/13/16
  • Last Seen:  

How do i add a reward on the winning team/party on the end of the match? Thanks!

// ------------------------------------------------------------------------------------------
// ------ rAthena Script Release
// Title: Simple 4 vs 4 PVP Gateway
// Author: jTynne - [email protected]
// Version: 0.1 (Beta)
// Modification: paopao - [email protected]
// ------------------------------------------------------------------------------------------

prontera,161,190,4	script	pao	91,{
set .@n$,"[^FF0000Party Battle Royale Manager^000000]";
set .@charid,getcharid(0);
mes .@n$;
mes "Would you like to register to the Party Battle Royale Tournament?";
next;
menu "Yes",-,"No",L_cancel;
if(getmapusers("bat_b02") > 0)
{
mes .@n$; mes "There appears to be a match currently in session. Check back momentarily."; close;
end;
}
mes .@n$;
mes "Which side of the arena would you like to join?";
next;
menu "Odin ("+$pvp4nA+"/2)",L_odinparty,"Freya ("+$pvp4nB+"/2)",L_freyaparty,"Cancel",L_cancel,"CLEAR",L_clear;

L_odinparty:
if (getcharid(1) == 0)
{
mes "You must be a member of a party to register.";
close;
end;
}
if ($pvp4nA == 0)
{
set $partyid1,getcharid(1);
mes "You have registered " + getpartyname($partyid1) + " for this tournament session.";
mes " ";
goto L_odin;
}
if (getcharid(1) != $partyid1)
{
mes "Team " + getpartyname($partyid1) + " has already registered for this match. Please wait until the match is over or renewed.";
close;
end;
}
if ($pvp4nA > 0)
{
goto L_odin;
}


L_freyaparty:
if (getcharid(1) == 0)
{
mes "You must be a member of a party to register.";
close;
end;
}
if ($pvp4nB == 0)
{
set $partyid2,getcharid(1);
mes "You have registered " + getpartyname($partyid2) + " for this tournament session.";
mes " ";
goto L_freya;
}
if (getcharid(1) != $partyid2)
{
mes "Team " + getpartyname($partyid2) + " has already registered for this match. Please wait until the match is over or renewed.";
close;
end;
}
if ($pvp4nB > 0)
{
goto L_freya;
}


L_odin:
if(.@charid == $pvp4nAchar1 || .@charid == $pvp4nAchar2 || .@charid == $pvp4nBchar1 || .@charid == $pvp4nBchar2)
{ mes "Registration Cancelled! You may only register once per round."; close; end; }

if($pvp4nA < 2) {
set $pvp4nA,$pvp4nA+1;
if($pvp4nA == 1) { set $pvp4nAchar1,getcharid(0); set $regidA1,getcharid(3); }
if($pvp4nA == 2) { set $pvp4nAchar2,getcharid(0); set $regidA2,getcharid(3);}

if($pvp4nA == 1 || $pvp4nB == 1)
	{ if($pvp4timer == 0 )
		{ initnpctimer; }
	else
		{set $pvp4timer,1; }
	}

mes "You've joined the selected team. Once the other four teams have filled up, you'll automatically be transferred into the PVP arena. If all four teams do not fill up within the next 30 seconds, this session will be cleared.";
npctalk strcharinfo(0)+" has entered the round on the West side.";
if($pvp4nA == 2 && $pvp4nB == 2) { stopnpctimer; goto L_begin;}
close;
end;
}

goto L_full;

L_freya:
if(.@charid == $pvp4nAchar1 || .@charid == $pvp4nAchar2 || .@charid == $pvp4nBchar1 || .@charid == $pvp4nBchar2)
{ mes "Registration Cancelled! You may only register once per round."; close; end; }

if($pvp4nB < 2) {
set $pvp4nB,$pvp4nB+1;
if($pvp4nB == 1) { set $pvp4nBchar1,getcharid(0); set $regidB1,getcharid(3); }
if($pvp4nB == 2) { set $pvp4nBchar2,getcharid(0); set $regidB2,getcharid(3); }

if($pvp4nA == 1 || $pvp4nB == 1)
	{ if($pvp4timer == 0 )
		{ initnpctimer; }
	else
		{set $pvp4timer,1; }
	}

mes "You've joined the selected team. Once the other four teams have filled up, you'll automatically be transferred into the PVP arena. If all four teams do not fill up within the next 30 seconds, this session will be cleared.";
npctalk strcharinfo(0)+" has entered the round on the East side.";
if($pvp4nA == 2 && $pvp4nB == 2) { stopnpctimer; goto L_begin;}
close;
end;
}

goto L_full;

L_full:
mes .@n$;
mes "Sorry, but this team is full. Try another team, please.";
close;
end;

L_begin:
pvpon "bat_b02";
gvgoff "bat_b02";
npctalk "All four teams have been filled. All participants currently logged in will be transferred to the arena in ten seconds.";
sleep2 10000;
set .@x,0;
L_warploop:
	while (.@x < 5) {
		if (.@x == 0)
			{ warpchar "bat_b02",59,149,$pvp4nAchar1; }
		else if (.@x == 1)
			{ warpchar "bat_b02",59,149,$pvp4nAchar2; }
		else if (.@x == 2)
			{ warpchar "bat_b02",331,149,$pvp4nBchar1; }
		else if (.@x == 3)
			{ warpchar "bat_b02",331,149,$pvp4nBchar2; }

		else
			{
			npctalk "A round is now in session.";
			announce "[Party Battle Royale] Battle Royale match has started.",bc_all,0xD6A4E6;
			goto L_startround;
			}
	set .@x, .@x + 1;
	}
goto L_warploop;
end;

L_cancel:
mes .@n$;
mes "Do come back if you change your mind.";
close;
end;

OnTimer10000:
announce "[Party Battle Royale] Entry to the Battle Royale ends in 20 seconds.",bc_all,0xD6A4E6;
npctalk "Ten seconds have passed. Entry to the round ends in 20 seconds.";
end;

OnTimer20000:
announce "[Party Battle Royale] Entry to the Battle Royale ends in 10 seconds.",bc_all,0xD6A4E6;
npctalk "Twenty seconds have passed. Entry to the round ends in 10 seconds.";
end;

OnTimer30000:
announce "[Party Battle Royale] Battle Royale registration has ended and renewed.",bc_all,0xD6A4E6;
npctalk "Thirty seconds have passed and thus I have canceled the round.";
stopnpctimer;
goto L_clear;

L_clear:
set $pvp4timer,0;
set $pvp4nA,0;
set $pvp4nB,0;
set $pvp4nAchar1,0;
set $pvp4nAchar2,0;
set $pvp4nBchar1,0;
set $pvp4nBchar2,0;
end;

L_startround:
end;
}

-	script	paonpc	-1,{
OnPCDieEvent:
getmapxy (.@map$, .@x, .@y, 0);
if(.@map$ == "bat_b02")
{

}
end;

OnPCKillEvent:
getmapxy (.@map$, .@x, .@y, 0); 
if( .@map$ == "bat_b02")
{ 
		set .@tempn1$,strcharinfo(0);
		set .@tempnid,killedrid;
		set .@tempn2$,rid2name(killedrid);
		mapannounce "bat_b02",""+.@tempn1$+" has killed "+.@tempn2$+".",1,0xD6A4E6;}
		getitem 7829,5;
		mapannounce "bat_b02",""+killedrid+" "+$pvp4nAchar1+""+$pvp4nAchar2+"",1,0xD6A4E6;
		mapannounce "bat_b02",""+killedrid+" "+$pvp4nBchar1+""+$pvp4nBchar2+"",1,0xD6A4E6;
		mapannounce "bat_b02",""+$pvp4nA+""+$pvp4nB+"",1,0xD6A4E6;
		if ($regidA1 == .@tempnid || $regidA2 == .@tempnid)
			{set $pvp4nA, $pvp4nA - 1;}
		if ($regidB1 == .@tempnid || $regidB2 == .@tempnid)
			{set $pvp4nB, $pvp4nB - 1;}
		if ($pvp4nA == 0 || $pvp4nB == 0)
			{
				set $pvp4nA, 0;
				set $pvp4nB, 0;
				set $pvp4nAchar1,0;
				set $pvp4nAchar2,0;
				set $pvp4nBchar1,0;
				set $pvp4nBchar2,0;
				announce "[Party Battle Royale] Battle Royale match has ended.",bc_all,0xD6A4E6;
				mapwarp "bat_b02","prontera",156,185;
			}
		
end;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  191
  • Reputation:   24
  • Joined:  07/19/14
  • Last Seen:  

On 12/3/2016 at 10:25 PM, topechi said:

announce "[Party Battle Royale] Battle Royale match has ended.",bc_all,0xD6A4E6;

getitem itemid,amount;

mapwarp "bat_b02","prontera",156,185;

try this one

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

find

				announce "[Party Battle Royale] Battle Royale match has ended.",bc_all,0xD6A4E6;
				mapwarp "bat_b02","prontera",156,185;

add below.

addrid(2,0,getcharid(1));
getitem 512,1;
getitem 512,2;
getitem 512,3;

 

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