if (castle == null || !checkIfOkToPlaceFlag(player, castle, true)) return;
try
{
// Spawn a new flag
L2SiegeFlagInstance flag = new L2SiegeFlagInstance(player, IdFactory.getInstance().getNextId(), NpcTable.getInstance().getTemplate(35062));
flag.setTitle(player.getClan().getName());
flag.setCurrentHpMp(flag.getMaxHp(), flag.getMaxMp());
flag.setHeading(player.getHeading());
flag.spawnMe(player.getX(), player.getY(), player.getZ() + 50);
castle.getSiege().getFlag(player.getClan()).add(flag);
}
catch (Exception e)
{
player.sendMessage("Error placing flag:" + e);