Can someone teach me how to add the codes to give the winning team a reward item, as well as when a player kills a player he gets an item too.
// ------------------------------------------------------------------------------------------
// ------ rAthena Script Release
// Title: Simple 4 versus 4 PVP Gateway
// Author: jTynne - [email protected]
// Modified by: Scene - [email protected]
// Version: 0.1 (Beta)
// ------------------------------------------------------------------------------------------
prontera,145,186,6 script Party Battle Recruiter 416,{
set [email protected]$,"[^FF0000Party Battle Recruiter^000000]";
set [email protected],getcharid(0);
mes [email protected]$;
mes "Would you like to register for a 4 versus 4 Party Battle?";
next;
menu "Yes",-,"No",L_cancel;
if(getmapusers("guild_vs3") > 0) { mes [email protected]$; mes "There appears to be a match currently in session. Check back momentarily."; close; end; }
mes [email protected]$;
mes "Which side of the arena would you like to join?";
next;
menu "Odin ("+$pvp4nA+"/4)",L_odin,"Freya ("+$pvp4nB+"/4)",L_freya;
L_odin:
if([email protected] == $pvp4nAchar1 || [email protected] == $pvp4nAchar2 || [email protected] == $pvp4nAchar3 || [email protected] == $pvp4nAchar4 || [email protected] == $pvp4nBchar1 || [email protected] == $pvp4nBchar2 || [email protected] == $pvp4nBchar3 || [email protected] == $pvp4nBchar4) { mes [email protected]$; mes "You may only register once per round."; close; end; }
if($pvp4nA < 4) {
set $pvp4nA,$pvp4nA+1;
if($pvp4nA == 1) { set $pvp4nAchar1,getcharid(0); }
if($pvp4nA == 2) { set $pvp4nAchar2,getcharid(0); }
if($pvp4nA == 3) { set $pvp4nAchar3,getcharid(0); }
if($pvp4nA == 4) { set $pvp4nAchar4,getcharid(0); }
if($pvp4nA == 1 || $pvp4nB == 1) { if($pvp4timer == 0 ) { initnpctimer; set $pvp4timer,1; } }
mes [email protected]$;
mes "You've joined the selected team. Once the other team have filled up, you'll automatically be transferred into the Colosseum. If the other team do not fill up within the next 30 seconds, this session will be cleared.";
npctalk strcharinfo(0)+" has entered the round on Odin's Side.";
if($pvp4nA == 4 && $pvp4nB == 4) { stopnpctimer; goto L_begin;}
close;
end;
}
L_freya:
if([email protected] == $pvp4nAchar1 || [email protected] == $pvp4nAchar2 || [email protected] == $pvp4nAchar3 || [email protected] == $pvp4nAchar4 || [email protected] == $pvp4nAchar5 || [email protected] == $pvp4nAchar6 || [email protected] == $pvp4nAchar7 || [email protected] == $pvp4nBchar1 || [email protected] == $pvp4nBchar2 || [email protected] == $pvp4nBchar3 || [email protected] == $pvp4nBchar4 || [email protected] == $pvp4nBchar5 || [email protected] == $pvp4nBchar6 || [email protected] == $pvp4nBchar7) { mes [email protected]$; mes "You may only register once per round."; close; end; }
if($pvp4nB < 4) {
set $pvp4nB,$pvp4nB+1;
if($pvp4nB == 1) { set $pvp4nBchar1,getcharid(0); }
if($pvp4nB == 2) { set $pvp4nBchar2,getcharid(0); }
if($pvp4nB == 3) { set $pvp4nBchar3,getcharid(0); }
if($pvp4nB == 4) { set $pvp4nBchar4,getcharid(0); }
if($pvp4nA == 1 || $pvp4nB == 1) { if($pvp4timer == 0 ) { initnpctimer; set $pvp4timer,1; } }
mes [email protected]$;
mes "You've joined the selected team. Once the other team have filled up, you'll automatically be transferred into the Colosseum. If the other team do not fill up within the next 30 seconds, this session will be cleared.";
npctalk strcharinfo(0)+" has entered the round on Freya's Side.";
if($pvp4nA == 4 && $pvp4nB == 4) { stopnpctimer; goto L_begin;}
close;
end;
}
goto L_full;
L_full:
mes [email protected]$;
mes "Sorry, but this team is full. Try another team, please.";
close;
end;
L_begin:
npctalk "Both teams have been filled. All participants currently logged in will be transferred to the arena in ten seconds.";
sleep2 10000;
set [email protected],0;
L_warploop:
while ([email protected] < 7) {
if ([email protected] == 0)
{ warpchar "guild_vs3",18,50,$pvp4nAchar1; }
else if ([email protected] == 1)
{ warpchar "guild_vs3",18,50,$pvp4nAchar2; }
else if ([email protected] == 2)
{ warpchar "guild_vs3",18,50,$pvp4nAchar3; }
else if ([email protected] == 3)
{ warpchar "guild_vs3",18,50,$pvp4nAchar4; }
else if ([email protected] == 4)
{ warpchar "guild_vs3",83,50,$pvp4nBchar1; }
else if ([email protected] == 5)
{ warpchar "guild_vs3",83,50,$pvp4nBchar2; }
else if ([email protected] == 6)
{ warpchar "guild_vs3",83,50,$pvp4nBchar3; }
else if ([email protected] == 7)
{ warpchar "guild_vs3",83,50,$pvp4nBchar4; }
else
{ npctalk "A round is now in session."; goto L_clear;}
set [email protected], [email protected] + 1;
}
goto L_warploop;
end;
L_cancel:
mes [email protected]$;
mes "Do come back if you change your mind.";
close;
end;
OnTimer10000:
npctalk "Ten seconds have passed. Entry to the round ends in 20 seconds.";
end;
OnTimer20000:
npctalk "Twenty seconds have passed. Entry to the round ends in 10 seconds.";
end;
OnTimer30000:
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 $pvp4nAchar3,0;
set $pvp4nAchar4,0;
set $pvp4nBchar1,0;
set $pvp4nBchar2,0;
set $pvp4nBchar3,0;
set $pvp4nBchar4,0;
end;
}
- script pvp4vs4#1 -1,{
OnPCDieEvent:
getmapxy ([email protected]$, [email protected], [email protected], 0);
if([email protected]$ == "guild_vs3") { warp "SavePoint",0,0;}
end;
OnPCKillEvent:
getmapxy ([email protected]$, [email protected], [email protected], 0);
if( [email protected]$ == "guild_vs3") {
set [email protected]$,strcharinfo(0);
set [email protected]$,rid2name(killedrid);
mapannounce "guild_vs3",""[email protected]$+" has killed "[email protected]$+".",1,0xD6A4E6;}
end;
}
Can someone teach me how to add the codes to give the winning team a reward item, as well as when a player kills a player he gets an item too.
Link to comment
Share on other sites