Commands command = (Commands) comm;
if(!activeChar.getPlayerAccess().CanEditNPC)
{
return false;
}
ClanHall clanhall = null;
if(wordList.length > 1)
{
clanhall = ClanHallManager.getInstance().getClanHall(Integer.parseInt(wordList[1]));
}
if(clanhall == null)
{
showClanHallSelectPage(activeChar);
return true;
}
switch(command)
{
case admin_clanhall:
showClanHallSelectPage(activeChar);
break;
case admin_clanhallset:
L2Object target = activeChar.getTarget();
L2Player player = activeChar;
if(target != null && target.isPlayer())
{
player = (L2Player) target;
}
if(player.getClan() == null)
{
activeChar.sendPacket(Msg.THAT_IS_THE_INCORRECT_TARGET);
}
else
{
clanhall.changeOwner(player.getClan());
Auction auction = AuctionManager.getInstance().getAuction(clanhall.getId());
if(auction != null)
{
auction.cancelAuction();
}
_log.fine("ClanHall " + clanhall.getName() + "(id: " + clanhall.getId() + ") owned by clan " + player.getClan().getName());
}
break;
case admin_clanhalldel:
clanhall.changeOwner(null);
break;
case admin_clanhallopendoors:
clanhall.openCloseDoors(activeChar, true);
break;
case admin_clanhallclosedoors:
clanhall.openCloseDoors(activeChar, false);
break;
case admin_clanhallteleportself:
L2Zone zone = clanhall.getZone();
if(zone != null)
{
activeChar.teleToLocation(zone.getSpawn());
}
break;