}
try
{
// Spawn a new flag
L2SiegeFlagInstance flag = new L2SiegeFlagInstance(player, IdFactory.getInstance().getNextId(), NpcTable.getInstance().getTemplate(35062));
if (skill.is_advancedFlag())
{
flag.set_advanceFlag(true);
flag.set_advanceMultiplier(skill.get_advancedMultiplier());
}
flag.setTitle(player.getClan().getName());
flag.setCurrentHpMp(flag.getMaxHp(), flag.getMaxMp());
flag.setHeading(player.getHeading());
flag.spawnMe(player.getX(), player.getY(), player.getZ() + 50);
if (castle != null)
castle.getSiege().getFlag(player.getClan()).add(flag);
else
fort.getSiege().getFlag(player.getClan()).add(flag);