}
if(Rnd.chance(95))
{
return;
}
L2Player player = attacker.getPlayer();
if(player == null || player.getClan() == null || player.getClan().getHasCastle() == 0)
{
return;
}
if(player.getTerritorySiege() == _currentTerritoryId || player.getClan().getHasCastle() == _currentTerritoryId)
{
return;
}
if(player.isMounted())
{
return;
}
if(player.isTerritoryFlagEquipped())
{
return;
}
decayMe();
L2ItemInstance item = ItemTable.getInstance().createItem(_itemId);
item.setCustomFlags(L2ItemInstance.FLAG_EQUIP_ON_PICKUP | L2ItemInstance.FLAG_NO_DESTROY | L2ItemInstance.FLAG_NO_TRADE | L2ItemInstance.FLAG_NO_UNEQUIP, false);
player.getInventory().addItem(item);
player.getInventory().equipItem(item, false);
player.sendChanges();
_item = item;
player.sendPacket(Msg.YOU_VE_ACQUIRED_THE_WARD_MOVE_QUICKLY_TO_YOUR_FORCES__OUTPOST);
String terrName = CastleManager.getInstance().getCastleByIndex(_baseTerritoryId).getName();
TerritorySiege.announceToPlayer(new SystemMessage(SystemMessage.THE_S1_WARD_HAS_BEEN_DESTROYED_C2_NOW_HAS_THE_TERRITORY_WARD).addString(terrName).addName(player), true);
}