Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2DropData


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


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

        while (dropData.next())
        {
          int mobId = dropData.getInt("mobId");
          npcDat = _npcs.get(mobId);
          if (npcDat == null)
          {
            _log.severe("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);
        }
View Full Code Here

        L2NpcTemplate npc = npcTable.getTemplate(npcID);
        if (npc == null)
        {
            throw new NullPointerException();
        }
        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

        if (npc == null)
        {
            if (Config.DEBUG) System.out.print("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

TOP

Related Classes of net.sf.l2j.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.