Package l2p.gameserver.model.entity.siege

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


    }
    // Siege Golem, Wild Hog Cannon, Swoop Cannon
    if(_id == 13 || _id == 299 || _id == 448)
    {
      SystemMessage sm = null;
      Siege siege = SiegeManager.getSiege(player, true);
      if(siege == null)
      {
        sm = Msg.YOU_ARE_NOT_IN_SIEGE;
      }
      else if(player.getClanId() != 0 && siege.getAttackerClan(player.getClan()) == null)
      {
        sm = Msg.OBSERVATION_IS_ONLY_POSSIBLE_DURING_A_SIEGE;
      }
      if(sm != null)
      {
View Full Code Here


      }
      Location loc = null;
      long ref = 0;
      boolean isInDefense;
      L2Clan clan = activeChar.getClan();
      Siege siege = SiegeManager.getSiege(activeChar, true);
      switch(_requestedPointType)
      {
        case TO_CLANHALL:
          if(clan == null || clan.getHasHideout() == 0)
          {
            loc = MapRegion.getTeleToClosestTown(activeChar);
          }
          else
          {
            ClanHall clanHall = activeChar.getClanHall();
            loc = MapRegion.getTeleToClanHall(activeChar);
            if(clanHall.getFunction(ResidenceFunction.RESTORE_EXP) != null)
            {
              activeChar.restoreExp(clanHall.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
            }
          }
          break;
        case TO_CASTLE:
          isInDefense = false;
          if(siege != null && siege.checkIsDefender(clan))
          {
            isInDefense = true;
          }
          if((clan == null || clan.getHasCastle() == 0) && !isInDefense)
          {
            sendPacket(Msg.ActionFail, new Die(activeChar));
            return;
          }
          Castle castle = activeChar.getCastle();
          loc = MapRegion.getTeleToCastle(activeChar);
          if(castle.getFunction(ResidenceFunction.RESTORE_EXP) != null)
          {
            activeChar.restoreExp(castle.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
          }
          break;
        case TO_FORTRESS:
          isInDefense = false;
          if(siege != null && siege.checkIsDefender(clan))
          {
            isInDefense = true;
          }
          if((clan == null || clan.getHasFortress() == 0) && !isInDefense)
          {
            sendPacket(Msg.ActionFail, new Die(activeChar));
            return;
          }
          Fortress fort = activeChar.getFortress();
          loc = MapRegion.getTeleToFortress(activeChar);
          if(fort.getFunction(ResidenceFunction.RESTORE_EXP) != null)
          {
            activeChar.restoreExp(fort.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
          }
          break;
        case TO_SIEGEHQ:
          SiegeClan siegeClan = null;
          if(siege != null)
          {
            siegeClan = siege.getAttackerClan(clan);
          }
          else if(TerritorySiege.checkIfInZone(activeChar))
          {
            siegeClan = TerritorySiege.getSiegeClan(clan);
          }
View Full Code Here

        if(teleportWhere == TeleportWhereType.Fortress && clan.getHasFortress() != 0)
        {
          return FortressManager.getInstance().getFortressByIndex(clan.getHasFortress()).getZone().getSpawn();
        }
        // Checking if in siege
        Siege siege = SiegeManager.getSiege(activeChar, true);
        if(siege != null)
        {
          if(teleportWhere == TeleportWhereType.Headquarter)
          {
            // Check if player's clan is attacker
            L2NpcInstance flag = siege.getHeadquarter(player.getClan());
            if(flag != null)
            {
              return flag.getLoc().rnd(50, 75, false);
            } // Спаун рядом с флагом
            return TownManager.getInstance().getClosestTown(activeChar).getSpawn();
          }
          // Check if player's clan is defender
          if((teleportWhere == TeleportWhereType.Castle || teleportWhere == TeleportWhereType.Fortress) && siege.getDefenderClan(player.getClan()) != null && siege.getSiegeUnit() != null && siege.getSiegeUnit().getZone() != null)
          {
            return player.getKarma() > 1 ? siege.getSiegeUnit().getZone().getPKSpawn() : siege.getSiegeUnit().getZone().getSpawn();
          }
          return player.getKarma() > 1 ? TownManager.getInstance().getClosestTown(activeChar).getPKSpawn() : TownManager.getInstance().getClosestTown(activeChar).getSpawn();
        }
        if(TerritorySiege.checkIfInZone(activeChar))
        {
View Full Code Here

      _sweepable = ((L2MonsterInstance) cha).isSweepActive();
    }
    if(_clan != null)
    {
      SiegeClan siegeClan = null;
      Siege siege = SiegeManager.getSiege(_cha, true);
      if(siege != null)
      {
        siegeClan = siege.getAttackerClan(_clan);
      }
      if(TerritorySiege.checkIfInZone(_cha))
      {
        siegeClan = TerritorySiege.getSiegeClan(_clan);
      }
View Full Code Here

    {
      player.sendMessage("You already have the combat flag");
      return false;
    }
    L2Clan clan = player.getClan();
    Siege siege = getSiege(player);
    if(siege == null || clan == null || clan.getSiege() != siege || !clan.isAttacker())
    {
      player.sendMessage("You must be in attacker clan to pickup Combat Flag");
      return false;
    }
View Full Code Here

      L2Player player = object.getPlayer();
      if(player != null)
      {
        if(player.isFlying() && !player.isBlocked() && player.getMountNpcId() == PetDataTable.WYVERN_ID)
        {
          Siege siege = SiegeManager.getSiege(player, false);
          if(siege != null)
          {
            Residence unit = siege.getSiegeUnit();
            if(unit != null && player.getClan() != null && player.isClanLeader() && (player.getClan().getHasCastle() == unit.getId() || player.getClan().getHasFortress() == unit.getId()))
            {
              return;
            }
          }
View Full Code Here

    lostexp *= deathPenaltyBonus;
    lostexp = (int) calcStat(Stats.EXP_LOST, lostexp, killer, null);
    // На зарегистрированной осаде нет потери опыта, на чужой осаде - как при обычной смерти от *моба*
    if(isInZone(Siege))
    {
      Siege siege = SiegeManager.getSiege(this, true);
      if(siege != null && siege.isParticipant(this))
      {
        lostexp = 0;
      }
      if(getTerritorySiege() > -1 && TerritorySiege.checkIfInZone(this))
      {
View Full Code Here

            player.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.EnterWorld.TeleportedReasonNoRestart", player));
            player.setXYZInvisible(MapRegion.getTeleToClosestTown(player));
          }
          if(player.isInZone(Siege))
          {
            Siege siege = SiegeManager.getSiege(player, true);
            if(siege != null && !siege.checkIsDefender(player.getClan()))
            {
              if(siege.getHeadquarter(player.getClan()) == null)
              {
                player.setXYZInvisible(MapRegion.getTeleToClosestTown(player));
              }
              else
              {
View Full Code Here

  {
    if(isInZone(no_landing))
    {
      return false;
    }
    Siege siege = SiegeManager.getSiege(this, false);
    if(siege != null)
    {
      Residence unit = siege.getSiegeUnit();
      if(unit != null && getClan() != null && isClanLeader() && (getClan().getHasCastle() == unit.getId() || getClan().getHasFortress() == unit.getId()))
      {
        return true;
      }
      return false;
View Full Code Here

    }
    L2Clan clan1 = getClan();
    L2Clan clan2 = target.getClan();
    if(clan1 != null && clan2 != null)
    {
      Siege siege1 = clan1.getSiege();
      Siege siege2 = clan2.getSiege();
      int state1 = getSiegeState();
      int state2 = target.getSiegeState();
      if(siege1 != null && siege2 != null && siege1 == siege2 && siege1.isInProgress() && state1 != 0 && state2 != 0)
      {
        result |= RelationChanged.RELATION_INSIEGE;
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.entity.siege.Siege$SiegeFameTask

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.