rendered paste bodypackage net.sf.l2j.gameserver.handler.usercommandhandlers;
import net.sf.l2j.gameserver.handler.IUserCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.TvT;
import net.sf.l2j.gameserver.util.Broadcast;
public class Join implements IUserCommandHandler
{
private static String[] _commands = {"join"};
public boolean useUserCommand(String command, L2PcInstance activeChar)
{
if (command.equals("join"))
{
if (Config.TvT_EVEN_TEAMS.equals("SHUFFLE"))
{
replyMSG.append("<center><table border=\"0\">");
replyMSG.append("Do you want to join the event?");
for (String team : _teams)
replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font></td>");
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_tvt_player_join eventShuffle\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
replyMSG.append("Teams will be reandomly generated");
replyMSG.append("</table></center>");
}
if (Config.LMS_EVEN_TEAMS.equals("NO") || Config.TvT_EVEN_TEAMS.equals("BALANCE"))
{
replyMSG.append("<center><table border=\"0\">");
replyMSG.append("Do you want to join the event?");
for (String team : _teams)
{
replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font> (" + teamPlayersCount(team) + " joined)</td>");
replyMSG.append("<td width=\"60\"><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_tvt_player_join " + team + "\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
}
replyMSG.append("</table></center>");
}
else if (eventPlayer.getLevel()<_minlvl || eventPlayer.getLevel()>_maxlvl )
{
replyMSG.append("Your lvl is : <font color=\"00FF00\">" + eventPlayer.getLevel() +"</font><br>");
replyMSG.append("Min lvl to join : <font color=\"00FF00\">" + _minlvl + "</font><br>");
replyMSG.append("Max lvl to join : <font color=\"00FF00\">" + _maxlvl + "</font><br><br>");
replyMSG.append("<font color=\"FFFF00\">You can't join this event.</font><br>");
}
}
}
}