Examples of Siege


Examples of l2p.gameserver.model.entity.siege.Siege

    L2Player player = (L2Player) activeChar;
    if(player.getClan() == null || !player.isClanLeader())
    {
      return false;
    }
    Siege siege = SiegeManager.getSiege(activeChar, true);
    if(siege == null || siege.getSiegeUnit().getType() != ResidenceType.Castle)
    {
      return false;
    }
    if(siege.getAttackerClan(player.getClan()) == null)
    {
      return false;
    }
    if(player.isMounted())
    {
      return false;
    }
    if(!player.isInRangeZ(target, 120))
    {
      player.sendPacket(Msg.YOUR_TARGET_IS_OUT_OF_RANGE);
      return false;
    }
    if(first)
    {
      for(SiegeClan sc : siege.getDefenderClans().values())
      {
        L2Clan clan = sc.getClan();
        if(clan != null)
        {
          clan.broadcastToOnlineMembers(Msg.THE_OPPONENT_CLAN_HAS_BEGUN_TO_ENGRAVE_THE_RULER);
View Full Code Here

Examples of l2p.gameserver.model.entity.siege.Siege

        if(!target.isArtefact())
        {
          continue;
        }
        L2Player player = (L2Player) activeChar;
        Siege siege = SiegeManager.getSiege(activeChar, true);
        if(siege != null)
        {
          siege.announceToPlayer(new SystemMessage(SystemMessage.CLAN_S1_HAS_SUCCEEDED_IN_ENGRAVING_THE_RULER).addString(player.getClan().getName()), false, true);
          siege.Engrave(player.getClan(), target.getObjectId());
        }
      }
    }
  }
View Full Code Here

Examples of l2p.gameserver.model.entity.siege.Siege

  /**
   * Отсылает пакеты о состоянии ловушек всем игрокам которые находятся на поле боя
   */
  private void sendTrapStatus()
  {
    Siege s = SiegeManager.getSiege(this, true);
    if(s == null)
    {
      System.err.println("Errow while getting siege zone for L2FlameControlTowerInstance");
      return;
    }
    for(L2Player p : s.getPlayersInZone())
    {
      s.sendTrapStatus(p, true);
    }
  }
View Full Code Here

Examples of l2p.gameserver.model.entity.siege.Siege

    if(command.startsWith("CastleMassGK"))
    {
      command = command.substring(13); //срезаем ненужное
      String args[] = command.split("_");
      long delay;
      Siege activeSiege = SiegeManager.getSiege(this, true);
      if(TerritorySiege.isInProgress())
      {
        delay = TerritorySiege.getDefenderRespawnTotal(getCastle().getId());
      }
      else if(activeSiege != null)
      {
        delay = activeSiege.getDefenderRespawnTotal();
      }
      else
      {
        delay = Long.parseLong(args[0]);
      } // аргумент 0 = время телепорта
View Full Code Here

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

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

        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
Copyright © 2018 www.massapi.com. 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.