{
announceToPlayer(new SystemMessage(SystemMessage.THE_SIEGE_OF_S1_HAS_ENDED_IN_A_DRAW).addString(getSiegeUnit().getName()), false, true);
}
else
{
L2Clan oldOwner = null;
if(_ownerBeforeStart != 0)
{
oldOwner = ClanTable.getInstance().getClan(_ownerBeforeStart);
}
L2Clan newOwner = ClanTable.getInstance().getClan(getSiegeUnit().getOwnerId());
if(oldOwner == null)
{ // fortress was taken over from scratch
if(newOwner.getLevel() >= 5)
{
newOwner.broadcastToOnlineMembers(new SystemMessage(SystemMessage.SINCE_YOUR_CLAN_EMERGED_VICTORIOUS_FROM_THE_SIEGE_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION_SCORE).addNumber(newOwner.incReputation(200, true, "FortressSiege")));
}
SiegeManager.clearFortressRegistrations(newOwner);
}
else if(newOwner.equals(oldOwner))
{ // fortress was defended
if(newOwner.getLevel() >= 5)
{
newOwner.broadcastToOnlineMembers(new SystemMessage(SystemMessage.SINCE_YOUR_CLAN_EMERGED_VICTORIOUS_FROM_THE_SIEGE_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION_SCORE).addNumber(newOwner.incReputation(200, true, "FortressSiege")));
}
SiegeManager.clearFortressRegistrations(newOwner);
}
else
{ // fortress was taken over by another clan
announceToPlayer(new SystemMessage(SystemMessage.S1_CLAN_IS_VICTORIOUS_IN_THE_FORTRESS_BATLE_OF_S2).addString(newOwner.getName()).addString(getSiegeUnit().getName()), false, true);
if(newOwner.getLevel() >= 5)
{
newOwner.broadcastToOnlineMembers(new SystemMessage(SystemMessage.SINCE_YOUR_CLAN_EMERGED_VICTORIOUS_FROM_THE_SIEGE_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION_SCORE).addNumber(newOwner.incReputation(500, true, "FortressSiege")));
}
if(oldOwner.getLevel() >= 5)
{
oldOwner.broadcastToOnlineMembers(new SystemMessage(SystemMessage.YOUR_CLAN_HAS_FAILED_TO_DEFEND_THE_CASTLE_S1_POINTS_HAVE_BEEN_DEDUCTED_FROM_YOUR_CLAN_REPUTATION_SCORE).addNumber(-oldOwner.incReputation(-500, true, "FortressSiege")));
}