Package com.l2jfrozen.gameserver.model.entity.siege

Examples of com.l2jfrozen.gameserver.model.entity.siege.FortSiege


                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)
      {
        FortSiege fortsiege = FortSiegeManager.getInstance().getSiege(this);
        return fortsiege != null && fortsiege.checkIsAttacker(getClan());
      }
    }
   
    return false;
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.entity.siege.FortSiege

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.