prontera,150,177,5 script League of Legends 120,{
mes "[^FF7700League of Legends^000000]";
mes "Welcome summoner!";
mes "";
mes "Team 1: "+((.team1name$=="")?"^FF0000-none-^000000":"^0077FF"+.team1name$+"^000000");
mes "Team 2: "+((.team2name$=="")?"^FF0000-none-^000000":"^0077FF"+.team2name$+"^000000");
next;
switch(select("Registry:Remove registry:Exit"))
{
case 1:
if(.team1$!="" && .team2$!="")
{
mes "[^FF7700League of Legends^000000]";
mes "Two teams already registered.";
close;
}
else if(.team1name$==getpartyname(getcharid(1)) || .team2name$==getpartyname(getcharid(1)))
{
mes "[^FF7700League of Legends^000000]";
mes "Your team is already registered.";
close;
}
else if(getpartyleader(getcharid(1),2)!=getcharid(0))
{
mes "[^FF7700League of Legends^000000]";
mes "Only the party leader can register.";
close;
}
else
{
getpartymember(getcharid(1));
set @partymembercount,$@partymembercount;
/*if (@partymembercount<5)
{
mes "[^FF7700League of Legends^000000]";
mes "You need 5 partymembers to register!";
close;
}*/
if(.team1name$=="")
{
set .team1name$, getpartyname(getcharid(1));
copyarray .team1players$[0],$@partymembername$[0],@partymembercount;
set .team1id$, getcharid(0);
}
else
{
set .team2name$, getpartyname(getcharid(1));
copyarray .team2players$[0],$@partymembername$[0],@partymembercount;
set .team2id$, getcharid(0);
}
mes "[^FF7700League of Legends^000000]";
mes "Your team is registered now.";
announce "Team "+getpartyname(getcharid(1))+" has registered for League of Legends.",0,0xFF7700;
close2;
sleep2 5000;
if(.team1name$!="" && .team2name$!="")
{
announce "Both Teams registered for League of Legends. You have 5 minutes to enter the match now.",0,0xFF7700;
initnpctimer;
end;
}
end;
}
case 2:
if(.team1name$==getpartyname(getcharid(1)))
{
deletearray .team1$[0],getarraysize(.team1$);
set .team1name$, "";
mes "[^FF7700League of Legends^000000]";
mes "Registry removed.";
close;
}
else if(.team2name$==getpartyname(getcharid(1)))
{
deletearray .team2$[0],getarraysize(.team2$);
set .team2name$, "";
mes "[^FF7700League of Legends^000000]";
mes "Registry removed.";
close;
}
else
{
mes "[^FF7700League of Legends^000000]";
mes "You aren't registered.";
close;
}
case 3:
mes "[^FF7700League of Legends^000000]";
mes "Goodbye!";
close;
}
OnTimer300000:
announce "One Team didn't show up for League of Legends. Resetting Registry...",0,0xFF7700;
deletearray .team1players$[0],getarraysize(.team1players$);
set .team1name$, "";
deletearray .team2players$[0],getarraysize(.team2players$);
set .team2name$, "";
end;
}