Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.L2DropData


    // get the drops
    Connection con = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection(false);
      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);
      }
View Full Code Here


    L2NpcTemplate npc = npcTable.getTemplate(npcID);
    if(npc == null){
      _log.info("FeanorInterface: Npc "+npcID+" is null..");
      return;
    }
    L2DropData drop = new L2DropData();
    drop.setItemId(itemID);
    drop.setMinDrop(min);
    drop.setMaxDrop(max);
    drop.setChance(chance);
    drop.setQuestID(questID);
    drop.addStates(states);
    addDrop(npc, drop, false);
  }
View Full Code Here

      {
        _log.warning("Npc doesnt Exist");
      }
      throw new NullPointerException();
    }
    L2DropData drop = new L2DropData();
    drop.setItemId(itemID);
    drop.setMinDrop(min);
    drop.setMaxDrop(max);
    drop.setChance(chance);

    addDrop(npc, drop, sweep);
  }
View Full Code Here

            {
              _log.warning("NPCTable: CUSTOM DROPLIST No npc correlating with id: {}"+" "+ mobId);
              continue;
            }

            L2DropData dropDat = new L2DropData();
            dropDat.setItemId(dropData.getInt("itemId"));
            dropDat.setMinDrop(dropData.getInt("min"));
            dropDat.setMaxDrop(dropData.getInt("max"));
            dropDat.setChance(dropData.getInt("chance"));

            int category = dropData.getInt("category");

            npcDat.addDropData(dropDat, category);
            cCount++;
            //dropDat = null;
          }
          dropData.close();
          statement.close();
          _log.finest("CustomDropList : Added {} custom droplist"+" "+ cCount);

          if(Config.ENABLE_CACHE_INFO)
          {
            FillDropList();
          }
        }
        catch(Exception e)
        {
          _log.severe("NPCTable: Error reading NPC CUSTOM drop data"+" "+ e);
        }

      try
      {
        if (con == null)
        {
          con = L2DatabaseFactory.getInstance().getConnection(false);
        }
        statement = con.prepareStatement("SELECT " + L2DatabaseFactory.getInstance().safetyString(new String[]
        {
            "mobId", "itemId", "min", "max", "category", "chance"
        }) + " FROM droplist ORDER BY mobId, chance DESC");
        ResultSet dropData = statement.executeQuery();
        L2DropData dropDat = null;
        L2NpcTemplate npcDat = null;

        while(dropData.next())
        {
          int mobId = dropData.getInt("mobId");

          npcDat = _npcs.get(mobId);

          if(npcDat == null)
          {
            _log.warning("NPCTable: No npc correlating with id: {}"+" "+ mobId);
            continue;
          }

          dropDat = new L2DropData();

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

          int category = dropData.getInt("category");

          npcDat.addDropData(dropDat, category);
          //dropDat = null;
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.L2DropData

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.