Package net.sf.l2j.gameserver.templates

Examples of net.sf.l2j.gameserver.templates.L2NpcTemplate


  }

  private void reLoadNpcDropList(int npcId)
  {
    L2NpcTemplate npcData = NpcTable.getInstance().getTemplate(npcId);
    if (npcData == null)
      return;

    // reset the drop lists
    npcData.clearAllDropData();

    // get the drops
    java.sql.Connection con = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      L2DropData dropData = null;

      npcData.getDropData().clear();

      PreparedStatement statement = con.prepareStatement("SELECT " + L2DatabaseFactory.getInstance().safetyString(new String[] {"mobId", "itemId", "min", "max", "category", "chance"}) + " FROM droplist WHERE mobId=?");
      statement.setInt(1, npcId);
      ResultSet dropDataList = statement.executeQuery();

      while(dropDataList.next())
      {
        dropData = new L2DropData();

        dropData.setItemId(dropDataList.getInt("itemId"));
        dropData.setMinDrop(dropDataList.getInt("min"));
        dropData.setMaxDrop(dropDataList.getInt("max"));
        dropData.setChance(dropDataList.getInt("chance"));

        int category = dropDataList.getInt("category");
        npcData.addDropData(dropData, category);
      }
      dropDataList.close();
      statement.close();
    }
    catch(Exception e){}
View Full Code Here


        return;
    }

    if (_activeChar.getPoly().isMorphed())
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(_activeChar.getPoly().getPolyId());

      if (template != null)
      {
        writeC(0x16);
        writeD(_activeChar.getObjectId());
View Full Code Here

              {
                // deleteMe handling should teleport party out in case of disconnect
              }
            }

            L2NpcTemplate witchTemplate = NpcTable.getInstance().getTemplate(_witchSpawn._npcId);

            // Spawn the festival witch for this arena
            try
            {
                L2Spawn npcSpawn = new L2Spawn(witchTemplate);
View Full Code Here

                // Only spawn archers/marksmen if specified to do so.
                if (spawnType == 1 && isFestivalArcher(currSpawn._npcId))
                    continue;

                L2NpcTemplate npcTemplate = NpcTable.getInstance().getTemplate(currSpawn._npcId);

                try
                {
                    L2Spawn npcSpawn = new L2Spawn(npcTemplate);
View Full Code Here

                }
                break;
            }
            try
            {
                L2NpcTemplate template = NpcTable.getInstance().getTemplate(id+random);
                _constructor = Class.forName("net.sf.l2j.gameserver.model.actor.instance." + template.type + "Instance").getConstructors()[0];
                int objectId = IdFactory.getInstance().getNextId();
                _monsters[i] = (L2NpcInstance)_constructor.newInstance(objectId, template);
            }
            catch (Exception e)
View Full Code Here

            con = L2DatabaseFactory.getInstance().getConnection();
            PreparedStatement statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, loc_id, periodOfDay FROM spawnlist ORDER BY id");
            ResultSet rset = statement.executeQuery();

            L2Spawn spawnDat;
            L2NpcTemplate template1;

            while (rset.next())
            {
                template1 = NpcTable.getInstance().getTemplate(rset.getInt("npc_templateid"));
                if (template1 != null)
View Full Code Here

            PreparedStatement statement = con.prepareStatement("SELECT * from raidboss_spawnlist ORDER BY boss_id");
            ResultSet rset = statement.executeQuery();

            L2Spawn spawnDat;
            L2NpcTemplate template;
            long respawnTime;
            while (rset.next())
            {
                template = getValidTemplate(rset.getInt("boss_id"));
                if (template != null)
View Full Code Here

            return StatusEnum.UNDEFINED;
    }

    public L2NpcTemplate getValidTemplate(int bossId)
    {
        L2NpcTemplate template = NpcTable.getInstance().getTemplate(bossId);
        if (template == null) return null;
        if (!template.type.equalsIgnoreCase("L2RaidBoss")) return null;
        return template;
    }
View Full Code Here

        return -1;
    }

    private void spawnMercenary(int npcId, int x, int y, int z, int despawnDelay, String[] messages, int chatDelay)
    {
      L2NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
        if (template != null)
        {
            final L2SiegeGuardInstance npc = new L2SiegeGuardInstance(IdFactory.getInstance().getNextId(), template);
            npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
            npc.setDecayed(false);
View Full Code Here

     *
     */
    public void spawnSingleMinion(int minionid)
    {
        // Get the template of the Minion to spawn
        L2NpcTemplate minionTemplate = NpcTable.getInstance().getTemplate(minionid);

        // Create and Init the Minion and generate its Identifier
        L2MinionInstance monster = new L2MinionInstance(IdFactory.getInstance().getNextId(),
                                                        minionTemplate);

View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.templates.L2NpcTemplate

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.