EquipmentSets merged into bootySet system.
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user