Package net.sf.l2j.gameserver.model.entity

Examples of net.sf.l2j.gameserver.model.entity.Siege


  public final double calcSiegeRegenModifer(L2PcInstance activeChar)
  {
    if (activeChar == null || activeChar.getClan() == null) return 0;

    Siege siege = SiegeManager.getInstance().getSiege(activeChar.getPosition().getX(),
                              activeChar.getPosition().getY(),
                              activeChar.getPosition().getZ());
    if (siege == null || !siege.getIsInProgress()) return 0;

    L2SiegeClan siegeClan = siege.getAttackerClan(activeChar.getClan().getClanId());
    if (siegeClan == null || siegeClan.getFlag().size() == 0
      || !Util.checkIfInRange(200, activeChar, siegeClan.getFlag().get(0), true)) return 0;

    return 1.5; // If all is true, then modifer will be 50% more
  }
View Full Code Here


        return true;
      }
     
      if (getClan() != null)
      {
        Siege siege = SiegeManager.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()))
          {
            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()))
          {
            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()));
      }
    }
   
    return false;
  }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.entity.Siege

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.