if (isInsideZone(ZONE_CHAOTIC) && ((L2PcInstance) attacker).isInsideZone(ZONE_CHAOTIC))
return true;
if (getClan() != null)
{
Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
FortSiege fortsiege = FortSiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(((L2PcInstance) attacker).getClan()) && siege.checkIsDefender(getClan()))
{
siege = null;
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(((L2PcInstance) attacker).getClan()) && siege.checkIsAttacker(getClan()))
{
siege = null;
return false;
}
}
if (fortsiege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (fortsiege.checkIsDefender(((L2PcInstance) attacker).getClan()) && fortsiege.checkIsDefender(getClan()))
{
fortsiege = null;
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (fortsiege.checkIsAttacker(((L2PcInstance) attacker).getClan()) && fortsiege.checkIsAttacker(getClan()))
{
fortsiege = null;
return false;
}
}
// Check if clan is at war
if (getClan() != null && ((L2PcInstance) attacker).getClan() != null && getClan().isAtWarWith(((L2PcInstance) attacker).getClanId()) && getWantsPeace() == 0 && ((L2PcInstance) attacker).getWantsPeace() == 0 && !isAcademyMember())
return true;
}
}
else if (attacker instanceof L2SiegeGuardInstance)
{
if (getClan() != null)
{
Siege siege = SiegeManager.getInstance().getSiege(this);
return siege != null && siege.checkIsAttacker(getClan()) || DevastatedCastle.getInstance().getIsInProgress();
}
}
else if (attacker instanceof L2FortSiegeGuardInstance)
{
if (getClan() != null)