public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if(command.startsWith("open doors") && target.equals("castle") && activeChar.isClanLeader())
{
L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getHasCastle());
if(door == null || castle == null)
return false;
if(castle.checkIfInZone(door.getX(), door.getY(), door.getZ()))
{
door.openMe();
}
door = null;
castle = null;
}
else if(command.startsWith("close doors") && target.equals("castle") && activeChar.isClanLeader())
{
L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getHasCastle());
if(door == null || castle == null)
return false;
if(castle.checkIfInZone(door.getX(), door.getY(), door.getZ()))
{
door.closeMe();
}
door = null;
castle = null;