if(siegeClan.getHeadquarter() != null)
{
activeChar.sendMessage("You already has a flag.");
return;
}
L2SiegeHeadquarterInstance flag = new L2SiegeHeadquarterInstance(player, IdFactory.getInstance().getNextId(), NpcTable.getTemplate(35062));
if(_advanced)
{
flag.addStatFunc(new FuncMul(Stats.MAX_HP, 0x50, flag, _advancedMult));
}
flag.setCurrentHpMp(flag.getMaxHp(), flag.getMaxMp(), true);
flag.setHeading(player.getHeading());
// Ставим флаг перед чаром
int x = (int) (player.getX() + 100 * Math.cos(player.headingToRadians(player.getHeading() - 32768)));
int y = (int) (player.getY() + 100 * Math.sin(player.headingToRadians(player.getHeading() - 32768)));
flag.spawnMe(GeoEngine.moveCheck(player.getX(), player.getY(), player.getZ(), x, y, player.getReflection().getGeoIndex()));
siegeClan.setHeadquarter(flag);
}