Browse Source

EquipmentSets merged into bootySet system.

master
MagicBot 2 years ago
parent
commit
5d0166a29a
  1. 17
      src/engine/db/handlers/dbItemBaseHandler.java
  2. 2
      src/engine/gameManager/NPCManager.java
  3. 29
      src/engine/objects/EquipmentSetEntry.java
  4. 6
      src/engine/objects/MobBase.java

17
src/engine/db/handlers/dbItemBaseHandler.java

@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
package engine.db.handlers;
import engine.objects.BootySetEntry;
import engine.objects.EquipmentSetEntry;
import engine.objects.ItemBase;
import org.pmw.tinylog.Logger;
@ -108,16 +107,16 @@ public class dbItemBaseHandler extends dbHandlerBase { @@ -108,16 +107,16 @@ public class dbItemBaseHandler extends dbHandlerBase {
}
}
public HashMap<Integer, ArrayList<EquipmentSetEntry>> LOAD_EQUIPMENT_FOR_NPC_AND_MOBS() {
public HashMap<Integer, ArrayList<BootySetEntry>> LOAD_EQUIPMENT_FOR_NPC_AND_MOBS() {
HashMap<Integer, ArrayList<EquipmentSetEntry>> equipmentSets;
EquipmentSetEntry equipmentSetEntry;
HashMap<Integer, ArrayList<BootySetEntry>> equipmentSets;
BootySetEntry equipmentSetEntry;
int equipSetID;
equipmentSets = new HashMap<>();
int recordsRead = 0;
prepareCallable("SELECT * FROM static_npc_equipmentset");
prepareCallable("SELECT * FROM static_npc_bootySet WHERE bootyType='EQUIP'");
try {
ResultSet rs = executeQuery();
@ -126,16 +125,16 @@ public class dbItemBaseHandler extends dbHandlerBase { @@ -126,16 +125,16 @@ public class dbItemBaseHandler extends dbHandlerBase {
recordsRead++;
equipSetID = rs.getInt("equipmentSet");
equipmentSetEntry = new EquipmentSetEntry(rs);
equipSetID = rs.getInt("bootySet");
equipmentSetEntry = new BootySetEntry(rs);
if (equipmentSets.get(equipSetID) == null){
ArrayList<EquipmentSetEntry> equipList = new ArrayList<>();
ArrayList<BootySetEntry> equipList = new ArrayList<>();
equipList.add(equipmentSetEntry);
equipmentSets.put(equipSetID, equipList);
}
else{
ArrayList<EquipmentSetEntry>equipList = equipmentSets.get(equipSetID);
ArrayList<BootySetEntry>equipList = equipmentSets.get(equipSetID);
equipList.add(equipmentSetEntry);
equipmentSets.put(equipSetID, equipList);
}

2
src/engine/gameManager/NPCManager.java

@ -18,7 +18,7 @@ import java.util.HashMap; @@ -18,7 +18,7 @@ import java.util.HashMap;
public enum NPCManager {
NPC_MANAGER;
public static HashMap<Integer, ArrayList<EquipmentSetEntry>> _equipmentSetMap = new HashMap<>();
public static HashMap<Integer, ArrayList<BootySetEntry>> _equipmentSetMap = new HashMap<>();
public static HashMap<Integer, ArrayList<Integer>> _runeSetMap = new HashMap<>();
public static HashMap<Integer, ArrayList<BootySetEntry>> _bootySetMap = new HashMap<>();

29
src/engine/objects/EquipmentSetEntry.java

@ -1,29 +0,0 @@ @@ -1,29 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.objects;
import java.sql.ResultSet;
import java.sql.SQLException;
public class EquipmentSetEntry {
public int itemID;
public float dropChance;
/**
* ResultSet Constructor
*/
public EquipmentSetEntry(ResultSet rs) throws SQLException {
this.itemID = (rs.getInt("itemID"));
this.dropChance = (rs.getFloat("dropChance"));
}
}

6
src/engine/objects/MobBase.java

@ -146,7 +146,7 @@ public class MobBase extends AbstractGameObject { @@ -146,7 +146,7 @@ public class MobBase extends AbstractGameObject {
public static HashMap<Integer, MobEquipment> loadEquipmentSet(int equipmentSetID){
ArrayList<EquipmentSetEntry> equipList;
ArrayList<BootySetEntry> equipList;
HashMap<Integer, MobEquipment> equip = new HashMap<>();
if (equipmentSetID == 0)
@ -157,9 +157,9 @@ public class MobBase extends AbstractGameObject { @@ -157,9 +157,9 @@ public class MobBase extends AbstractGameObject {
if (equipList == null)
return equip;
for (EquipmentSetEntry equipmentSetEntry : equipList) {
for (BootySetEntry equipmentSetEntry : equipList) {
MobEquipment mobEquipment = new MobEquipment(equipmentSetEntry.itemID, equipmentSetEntry.dropChance);
MobEquipment mobEquipment = new MobEquipment(equipmentSetEntry.itemBase, equipmentSetEntry.dropChance);
ItemBase itemBase = mobEquipment.getItemBase();
if (itemBase != null) {

Loading…
Cancel
Save