Examples of Fort


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

      }
      try
      {
        Location loc = null;
        Castle castle = null;
        Fort fort = null;
       
        if (activeChar.isInJail())
        {
          _requestedPointType = 27;
        }
        else if (activeChar.isFestivalParticipant())
        {
          _requestedPointType = 4;
        }
       
        if (activeChar.isPhoenixBlessed())
          activeChar.stopPhoenixBlessing(null);
       
        switch (_requestedPointType)
        {
          case 1: // to clanhall
           
            if (activeChar.getClan() != null)
            {
             
              if (activeChar.getClan().getHasHideout() == 0)
              {
                // cheater
                activeChar.sendMessage("You may not use this respawn point!");
                Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " used respawn cheat.", IllegalPlayerAction.PUNISH_KICK);
                return;
              }
              loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.ClanHall);
             
              if (ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan()) != null && ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null)
              {
                activeChar.restoreExp(ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl());
              }
             
              break;       
            }
           
            loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
            break;
          case 2: // to castle
            Boolean isInDefense = false;
            castle = CastleManager.getInstance().getCastle(activeChar);
            fort = FortManager.getInstance().getFort(activeChar);
            MapRegionTable.TeleportWhereType teleportWhere = MapRegionTable.TeleportWhereType.Town;
           
            if (castle != null && castle.getSiege().getIsInProgress())
            {
              // siege in progress
              if (castle.getSiege().checkIsDefender(activeChar.getClan()))
              {
                isInDefense = true;
              }
            }
           
            if (fort != null && fort.getSiege().getIsInProgress())
            {
              // siege in progress
              if (fort.getSiege().checkIsDefender(activeChar.getClan()))
              {
                isInDefense = true;
              }
            }
           
            if (activeChar.getClan().getHasCastle() == 0 && activeChar.getClan().getHasFort() == 0 && !isInDefense)
            {
              // cheater
              activeChar.sendMessage("You may not use this respawn point!");
              Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " used respawn cheat.", IllegalPlayerAction.PUNISH_KICK);
              return;
            }
           
            if (CastleManager.getInstance().getCastleByOwner(activeChar.getClan()) != null)
              teleportWhere = MapRegionTable.TeleportWhereType.Castle;
            else if (FortManager.getInstance().getFortByOwner(activeChar.getClan()) != null)
              teleportWhere = MapRegionTable.TeleportWhereType.Fortress;
           
            loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, teleportWhere);
            break;
         
          case 3: // to siege HQ
            L2SiegeClan siegeClan = null;
            castle = CastleManager.getInstance().getCastle(activeChar);
            fort = FortManager.getInstance().getFort(activeChar);
           
            if (castle != null && castle.getSiege().getIsInProgress())
            {
              siegeClan = castle.getSiege().getAttackerClan(activeChar.getClan());
            }
            else if (fort != null && fort.getSiege().getIsInProgress())
            {
              siegeClan = fort.getSiege().getAttackerClan(activeChar.getClan());
            }
           
            if (siegeClan == null || siegeClan.getFlag().size() == 0)
            {
              // cheater
View Full Code Here

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

      SiegeDefenderList sdl = new SiegeDefenderList(castle);
      sendPacket(sdl);
    }
    else
    {
      Fort fort = FortManager.getInstance().getFortById(_castleId);

      if(fort == null)
        return;

      FortSiegeDefenderList sdl = new FortSiegeDefenderList(fort);
View Full Code Here

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

      // If in Monster Derby Track
      if(player.isInsideZone(L2Character.ZONE_MONSTERTRACK))
        return new Location(12661, 181687, -3560);

      Castle castle = null;
      Fort fort = null;
      ClanHall clanhall = null;

      if(player.getClan() != null)
      {
        // If teleport to clan hall
        if(teleportWhere == TeleportWhereType.ClanHall)
        {

          clanhall = ClanHallManager.getInstance().getClanHallByOwner(player.getClan());
          if(clanhall != null)
          {
            L2ClanHallZone zone = clanhall.getZone();
            if(zone != null)
              return zone.getSpawn();
          }
        }

        // If teleport to castle
        if(teleportWhere == TeleportWhereType.Castle)
        {
          castle = CastleManager.getInstance().getCastleByOwner(player.getClan());
        }

        // If teleport to fort
        if(teleportWhere == TeleportWhereType.Fortress)
        {
          fort = FortManager.getInstance().getFortByOwner(player.getClan());
        }

        // Check if player is on castle&fortress ground
        if(castle == null)
        {
          castle = CastleManager.getInstance().getCastle(player);
        }

        if(fort == null)
        {
          fort = FortManager.getInstance().getFort(player);
        }

        if(castle != null && castle.getCastleId() > 0)
        {
          // If Teleporting to castle or
          // If is on caslte with siege and player's clan is defender
          if(teleportWhere == TeleportWhereType.Castle || teleportWhere == TeleportWhereType.Castle && castle.getSiege().getIsInProgress() && castle.getSiege().getDefenderClan(player.getClan()) != null)
          {
            coord = castle.getZone().getSpawn();
            return new Location(coord[0], coord[1], coord[2]);
          }

          if(teleportWhere == TeleportWhereType.SiegeFlag && castle.getSiege().getIsInProgress())
          {
            // Check if player's clan is attacker
            List<L2NpcInstance> flags = castle.getSiege().getFlag(player.getClan());
            if(flags != null && !flags.isEmpty())
            {
              // Spawn to flag - Need more work to get player to the nearest flag
              L2NpcInstance flag = flags.get(0);
              return new Location(flag.getX(), flag.getY(), flag.getZ());
            }
            flags = null;
          }
        }

        else if(fort != null && fort.getFortId() > 0)
        {
          // teleporting to castle or fortress
          // is on caslte with siege and player's clan is defender
          if(teleportWhere == TeleportWhereType.Fortress || teleportWhere == TeleportWhereType.Fortress && fort.getSiege().getIsInProgress() && fort.getSiege().getDefenderClan(player.getClan()) != null)
          {
            coord = fort.getZone().getSpawn();
            return new Location(coord[0], coord[1], coord[2]);
          }

          if(teleportWhere == TeleportWhereType.SiegeFlag && fort.getSiege().getIsInProgress())
          {
            // check if player's clan is attacker
            List<L2NpcInstance> flags = fort.getSiege().getFlag(player.getClan());

            if(flags != null && !flags.isEmpty())
            {
              // spawn to flag
              L2NpcInstance flag = flags.get(0);
View Full Code Here

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

      SiegeAttackerList sal = new SiegeAttackerList(castle);
      sendPacket(sal);
    }
    else
    {
      Fort fort = FortManager.getInstance().getFortById(_castleId);

      if(fort == null)
        return;

      FortSiegeAttackerList sal = new FortSiegeAttackerList(fort);
View Full Code Here

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

    L2PcInstance player = (L2PcInstance) activeChar;
    if (player.getClan() == null || player.getClan().getLeaderId() != player.getObjectId())
      return;
   
    Castle castle = CastleManager.getInstance().getCastle(player);
    Fort fort = FortManager.getInstance().getFort(player);
    if ((castle == null) && (fort == null))
      return;
   
    if (castle != null)
    {
      if (!checkIfOkToPlaceFlag(player, castle, true))
        return;
    }
    else
    {
      if (!checkIfOkToPlaceFlag(player, fort, true))
        return;
    }
   
    try
    {
      // Spawn a new flag
      L2SiegeFlagInstance flag = new L2SiegeFlagInstance(player, IdFactory.getInstance().getNextId(), NpcTable.getInstance().getTemplate(35062));
     
      if (skill.is_advancedFlag())
      {
        flag.set_advanceFlag(true);
        flag.set_advanceMultiplier(skill.get_advancedMultiplier());
      }
     
      flag.setTitle(player.getClan().getName());
      flag.setCurrentHpMp(flag.getMaxHp(), flag.getMaxMp());
      flag.setHeading(player.getHeading());
      flag.spawnMe(player.getX(), player.getY(), player.getZ() + 50);
     
      if (castle != null)
        castle.getSiege().getFlag(player.getClan()).add(flag);
      else
        fort.getSiege().getFlag(player.getClan()).add(flag);
     
      flag = null;
    }
    catch (Exception e)
    {
View Full Code Here

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

   * @return
   */
  public static boolean checkIfOkToPlaceFlag(L2Character activeChar, boolean isCheckOnly)
  {
    Castle castle = CastleManager.getInstance().getCastle(activeChar);
    Fort fort = FortManager.getInstance().getFort(activeChar);
    if ((castle == null) && (fort == null))
      return false;
   
    if (castle != null)
      return checkIfOkToPlaceFlag(activeChar, castle, isCheckOnly);
View Full Code Here

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

    if(activeChar == null || !(activeChar instanceof L2PcInstance))
      return false;

    SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
    L2PcInstance player = (L2PcInstance) activeChar;
    Fort fort = FortManager.getInstance().getFort(player);

    if(fort == null || fort.getFortId() <= 0)
    {
      sm.addString("You must be on fort ground to summon this");
    }
    else if(!fort.getSiege().getIsInProgress())
    {
      sm.addString("You can only summon this during a siege.");
    }
    else if(player.getClanId() != 0 && fort.getSiege().getAttackerClan(player.getClanId()) == null)
    {
      sm.addString("You can only summon this as a registered attacker.");
    }
    else
      return true;
View Full Code Here

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

    if(player.getClan() == null || player.getClan().getLeaderId() != player.getObjectId())
      return;

    Castle castle = CastleManager.getInstance().getCastle(player);
    Fort fort = FortManager.getInstance().getFort(player);

    if(castle != null && fort == null){
      if(!checkIfOkToCastSealOfRule(player, castle, true))
        return;
   
    }else if(fort != null && castle == null){
      if(!checkIfOkToCastFlagDisplay(player, fort, true))
        return;
    }
   
    if(castle == null && fort == null)
      return;

    try
    {
      if((castle != null) && (targets[0] instanceof L2ArtefactInstance))
        castle.Engrave(player.getClan(), targets[0].getObjectId());
      else if(fort != null)
        fort.EndOfSiege(player.getClan());
    }
    catch(Exception e)
    {
      if(Config.ENABLE_ALL_EXCEPTIONS)
        e.printStackTrace();
View Full Code Here

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

   * @return
   */
  public static boolean checkIfOkToCastSealOfRule(L2Character activeChar, boolean isCheckOnly)
  {
    Castle castle = CastleManager.getInstance().getCastle(activeChar);
    Fort fort = FortManager.getInstance().getFort(activeChar);

    if(fort != null && castle == null)
    {
      return checkIfOkToCastFlagDisplay(activeChar, fort, isCheckOnly);
    }
View Full Code Here

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

  public final Fort getFort()
  {
    // Get Fort this NPC belongs to (excluding L2Attackable)
    if (_fortIndex < 0)
    {
      Fort fort = FortManager.getInstance().getFort(getX(), getY(), getZ());
      if (fort != null)
      {
        _fortIndex = FortManager.getInstance().getFortIndex(fort.getFortId());
      }
      if (_fortIndex < 0)
      {
        _fortIndex = FortManager.getInstance().findNearestFortIndex(this);
      }
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.