Examples of Castle


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

    L2Clan clan = activeChar.getClan();
    if (clan != null)
    {
      if (clan.getHasCastle() > 0)
      {
        Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle());
        if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
          Announcements.getInstance().announceToAll("Lord " + activeChar.getName() + " Ruler Of " + castle.getName() + " Castle is now Online!");
      }
    }
  }
View Full Code Here

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

  @Override
  protected void runImpl()
  {
    if(_castleId < 100)
    {
      Castle castle = CastleManager.getInstance().getCastleById(_castleId);

      if(castle == null)
        return;

      SiegeDefenderList sdl = new SiegeDefenderList(castle);
View Full Code Here

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

      // 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());
View Full Code Here

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

  @Override
  protected void runImpl()
  {
    if(_castleId < 100)
    {
      Castle castle = CastleManager.getInstance().getCastleById(_castleId);

      if(castle == null)
        return;

      SiegeAttackerList sal = new SiegeAttackerList(castle);
View Full Code Here

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

    };
    int castleIndex = castleidarray[townId];

    if(castleIndex > 0)
    {
      Castle castle = CastleManager.getInstance().getCastles().get(CastleManager.getInstance().getCastleIndex(castleIndex));
      if(castle != null)
        return castle.getSiege().getIsInProgress();
    }
    return false;
  }
View Full Code Here

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

    };
    //find an instance of the castle for this town.
    int castleIndex = castleidarray[curtown];
    if(castleIndex > 0)
    {
      Castle castle = CastleManager.getInstance().getCastles().get(CastleManager.getInstance().getCastleIndex(castleIndex));
      if(castle != null)
        return castle.getSiege().getIsInProgress();
    }
    return false;
  }
View Full Code Here

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

  @Override
  public void useItem(L2PlayableInstance playable, L2ItemInstance item)
  {
    int itemId = item.getItemId();
    L2PcInstance activeChar = (L2PcInstance) playable;
    Castle castle = CastleManager.getInstance().getCastle(activeChar);
    int castleId = -1;

    if(castle != null)
    {
      castleId = castle.getCastleId();
    }

    //add check that certain tickets can only be placed in certain castles
    if(MercTicketManager.getInstance().getTicketCastleId(itemId) != castleId)
    {
      switch(castleId)
      {
        case 1:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Gludio.");
          return;
        case 2:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Dion.");
          return;
        case 3:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Giran.");
          return;
        case 4:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Oren.");
          return;
        case 5:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Aden.");
          return;
        case 6:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Heine.");
          return;
        case 7:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Goddard.");
          return;
        case 8:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Rune.");
          return;
        case 9:
          activeChar.sendMessage("This Mercenary Ticket can only be used in Schuttgart.");
          return;
          // player is not in a castle
        default:
          activeChar.sendMessage("Mercenary Tickets can only be used in a castle.");
          return;
      }
    }

    if(!activeChar.isCastleLord(castleId))
    {
      activeChar.sendMessage("You are not the lord of this castle!");
      return;
    }

    if((castle == null) || castle.getSiege().getIsInProgress())
    {
      activeChar.sendMessage("You cannot hire mercenary while siege is in progress!");
      return;
    }
View Full Code Here

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

      {
        npcId = rs.getInt("npcId");
        x = rs.getInt("x");
        y = rs.getInt("y");
        z = rs.getInt("z");
        Castle castle = CastleManager.getInstance().getCastle(x, y, z);
        if(castle != null)
        {
          startindex = 10*(castle.getCastleId() - 1);
        }

        // find the FIRST ticket itemId with spawns the saved NPC in the saved location
        for(int i = startindex; i < NPC_IDS.length; i++)
          if(NPC_IDS[i] == npcId) // Find the index of the item used
          {
            // only handle tickets if a siege is not ongoing in this npc's castle

            if(castle != null && !castle.getSiege().getIsInProgress())
            {
              itemId = ITEM_IDS[i];
              // create the ticket in the gameworld
              L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
              dropticket.setLocation(L2ItemInstance.ItemLocation.VOID);
View Full Code Here

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

    int x = activeChar.getX();
    int y = activeChar.getY();
    int z = activeChar.getZ();
    int heading = activeChar.getHeading();

    Castle castle = CastleManager.getInstance().getCastle(activeChar);
    if(castle == null) //this should never happen at this point
      return -1;

    //check if this item can be added here
    for(int i = 0; i < ITEM_IDS.length; i++)
    {
      if(ITEM_IDS[i] == itemId) // Find the index of the item used
      {
        spawnMercenary(NPC_IDS[i], x, y, z, 3000, messages, 0);

        // Hire merc for this caslte.  NpcId is at the same index as the item used.
        castle.getSiege().getSiegeGuardManager().hireMerc(x, y, z, heading, NPC_IDS[i]);

        // create the ticket in the gameworld
        L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
        dropticket.setLocation(L2ItemInstance.ItemLocation.INVENTORY);
        dropticket.dropMe(null, x, y, z);
View Full Code Here

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

      {
        npcId = NPC_IDS[i];
        break;
      }
    // find the castle where this item is
    Castle castle = CastleManager.getInstance().getCastleById(getTicketCastleId(itemId));

    if(npcId > 0 && castle != null)
    {
      new SiegeGuardManager(castle).removeMerc(npcId, item.getX(), item.getY(), item.getZ());
    }
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.