Addition of Player isAutoAttackable siege check for same clan.

This commit is contained in:
MobiusDevelopment 2022-11-18 02:10:37 +00:00
parent 8f778d9d40
commit 774fcbd8c3
29 changed files with 612 additions and 597 deletions

View File

@ -8245,28 +8245,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8307,13 +8310,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8248,28 +8248,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8310,13 +8313,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8250,28 +8250,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8312,13 +8315,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8268,28 +8268,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8330,13 +8333,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8285,28 +8285,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8347,13 +8350,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8298,28 +8298,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8360,13 +8363,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8299,28 +8299,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8361,13 +8364,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8327,28 +8327,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8389,13 +8392,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8437,28 +8437,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8499,13 +8502,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8463,28 +8463,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8525,13 +8528,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8522,28 +8522,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8584,13 +8587,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8552,28 +8552,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8614,13 +8617,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -7989,28 +7989,33 @@ public class Player extends Playable
// Get Player
final Player attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember() && clan.isAtWarWith(attackerPlayer.getClanId()) && attackerClan.isAtWarWith(getClanId()))
{
return true;
}
@ -8024,7 +8029,7 @@ public class Player extends Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@ -8036,7 +8041,7 @@ public class Player extends Playable
}
// Now check again if the Player is in pvp zone, but this time at siege PvP zone, applying clan/ally checks
if ((isInsideZone(ZoneId.PVP) && attackerPlayer.isInsideZone(ZoneId.PVP)) && (isInsideZone(ZoneId.SIEGE) && attackerPlayer.isInsideZone(ZoneId.SIEGE)))
if (isInsideZone(ZoneId.PVP) && attackerPlayer.isInsideZone(ZoneId.PVP) && isInsideZone(ZoneId.SIEGE) && attackerPlayer.isInsideZone(ZoneId.SIEGE))
{
return true;
}

View File

@ -8454,28 +8454,33 @@ public class Player extends Playable
// Get Player
final Player attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember() && clan.isAtWarWith(attackerPlayer.getClanId()) && attackerClan.isAtWarWith(getClanId()))
{
return true;
}
@ -8489,7 +8494,7 @@ public class Player extends Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@ -8501,7 +8506,7 @@ public class Player extends Playable
}
// Now check again if the Player is in pvp zone, but this time at siege PvP zone, applying clan/ally checks
if ((isInsideZone(ZoneId.PVP) && attackerPlayer.isInsideZone(ZoneId.PVP)) && (isInsideZone(ZoneId.SIEGE) && attackerPlayer.isInsideZone(ZoneId.SIEGE)))
if (isInsideZone(ZoneId.PVP) && attackerPlayer.isInsideZone(ZoneId.PVP) && isInsideZone(ZoneId.SIEGE) && attackerPlayer.isInsideZone(ZoneId.SIEGE))
{
return true;
}

View File

@ -8338,28 +8338,33 @@ public class Player extends Playable
// Get Player
final Player attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember() && clan.isAtWarWith(attackerPlayer.getClanId()) && attackerClan.isAtWarWith(getClanId()))
{
return true;
}
@ -8373,7 +8378,7 @@ public class Player extends Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@ -8385,7 +8390,7 @@ public class Player extends Playable
}
// Now check again if the Player is in pvp zone, but this time at siege PvP zone, applying clan/ally checks
if ((isInsideZone(ZoneId.PVP) && attackerPlayer.isInsideZone(ZoneId.PVP)) && (isInsideZone(ZoneId.SIEGE) && attackerPlayer.isInsideZone(ZoneId.SIEGE)))
if (isInsideZone(ZoneId.PVP) && attackerPlayer.isInsideZone(ZoneId.PVP) && isInsideZone(ZoneId.SIEGE) && attackerPlayer.isInsideZone(ZoneId.SIEGE))
{
return true;
}

View File

@ -8146,28 +8146,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8208,13 +8211,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8157,28 +8157,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8219,13 +8222,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8157,28 +8157,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8219,13 +8222,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8157,28 +8157,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8219,13 +8222,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8143,28 +8143,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8205,13 +8208,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8186,28 +8186,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8248,13 +8251,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8233,28 +8233,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8295,13 +8298,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8186,28 +8186,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8248,13 +8251,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8143,28 +8143,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8205,13 +8208,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8132,28 +8132,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8194,13 +8197,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8286,28 +8286,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8348,13 +8351,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8410,28 +8410,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8472,13 +8475,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8648,28 +8648,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8710,13 +8713,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)

View File

@ -8648,28 +8648,31 @@ public class Player extends Playable
final Player attackerPlayer = attacker.getActingPlayer();
final Clan clan = getClan();
final Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
if ((clan != null) && (attackerClan != null))
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
if (clan != attackerClan)
{
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
// Check if a siege is in progress and if attacker and the Player aren't in the Defender clan.
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the Player aren't in the Attacker clan.
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
// If first mid victory is achieved, attackers can attack attackers.
final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
return (castle != null) && castle.isFirstMidVictory();
}
}
}
// Check if clan is at war
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && ((war.getState() == ClanWarState.MUTUAL) || (((war.getState() == ClanWarState.BLOOD_DECLARATION) || (war.getState() == ClanWarState.DECLARATION)) && (war.getAttackerClanId() == attackerClan.getId()))))
@ -8710,13 +8713,10 @@ public class Player extends Playable
}
}
if (attacker instanceof Defender)
if ((attacker instanceof Defender) && (_clan != null))
{
if (_clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(this);
return ((siege != null) && siege.checkIsAttacker(_clan));
}
final Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null) && siege.checkIsAttacker(_clan);
}
if (attacker instanceof Guard)