}
if (action.equals("create"))
{
long cet=player.getClanCreateExpiryTime();
player.setClanCreateExpiryTime(0);
L2Clan clan = ClanTable.getInstance().createClan(player, parameter);
if (clan != null)
activeChar.sendMessage("Clan " + parameter + " created. Leader: " + player.getName());
else
{
player.setClanCreateExpiryTime(cet);
activeChar.sendMessage("There was a problem while creating the clan.");
}
}
else if (!player.isClanLeader())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.S1_IS_NOT_A_CLAN_LEADER).addString(name));
showMainPage(activeChar);
return false;
}
else if (action.equals("dismiss"))
{
ClanTable.getInstance().destroyClan(player.getClanId());
L2Clan clan = player.getClan();
if (clan==null)
activeChar.sendMessage("Clan disbanded.");
else
activeChar.sendMessage("There was a problem while destroying the clan.");
}
else if (action.equals("info"))
{
activeChar.sendPacket(new GMViewPledgeInfo(player.getClan(),player));
}
else if (parameter == null)
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
else if(action.equals("setlevel"))
{
int level = Integer.parseInt(parameter);
if (level>=0 && level <9)
{
player.getClan().changeLevel(level);
activeChar.sendMessage("You set level " + level + " for clan " + player.getClan().getName());
}
else
activeChar.sendMessage("Level incorrect.");
}
else if (action.startsWith("rep"))
{
try
{
int points = Integer.parseInt(parameter);
L2Clan clan = player.getClan();
if (clan.getLevel() < 5)
{
activeChar.sendMessage("Only clans of level 5 or above may receive reputation points.");
showMainPage(activeChar);
return false;
}
clan.setReputationScore(clan.getReputationScore()+points, true);
activeChar.sendMessage("You "+(points>0?"add ":"remove ")+Math.abs(points)+" points "+(points>0?"to ":"from ")+clan.getName()+"'s reputation. Their current score is "+clan.getReputationScore());
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //pledge <rep> <number>");
}