forked from MagicBane/Server
EquipmentSets merged into bootySet system.
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
package engine.db.handlers;
|
package engine.db.handlers;
|
||||||
|
|
||||||
import engine.objects.BootySetEntry;
|
import engine.objects.BootySetEntry;
|
||||||
import engine.objects.EquipmentSetEntry;
|
|
||||||
import engine.objects.ItemBase;
|
import engine.objects.ItemBase;
|
||||||
import org.pmw.tinylog.Logger;
|
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;
|
HashMap<Integer, ArrayList<BootySetEntry>> equipmentSets;
|
||||||
EquipmentSetEntry equipmentSetEntry;
|
BootySetEntry equipmentSetEntry;
|
||||||
int equipSetID;
|
int equipSetID;
|
||||||
|
|
||||||
equipmentSets = new HashMap<>();
|
equipmentSets = new HashMap<>();
|
||||||
int recordsRead = 0;
|
int recordsRead = 0;
|
||||||
|
|
||||||
prepareCallable("SELECT * FROM static_npc_equipmentset");
|
prepareCallable("SELECT * FROM static_npc_bootySet WHERE bootyType='EQUIP'");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ResultSet rs = executeQuery();
|
ResultSet rs = executeQuery();
|
||||||
@@ -126,16 +125,16 @@ public class dbItemBaseHandler extends dbHandlerBase {
|
|||||||
|
|
||||||
recordsRead++;
|
recordsRead++;
|
||||||
|
|
||||||
equipSetID = rs.getInt("equipmentSet");
|
equipSetID = rs.getInt("bootySet");
|
||||||
equipmentSetEntry = new EquipmentSetEntry(rs);
|
equipmentSetEntry = new BootySetEntry(rs);
|
||||||
|
|
||||||
if (equipmentSets.get(equipSetID) == null){
|
if (equipmentSets.get(equipSetID) == null){
|
||||||
ArrayList<EquipmentSetEntry> equipList = new ArrayList<>();
|
ArrayList<BootySetEntry> equipList = new ArrayList<>();
|
||||||
equipList.add(equipmentSetEntry);
|
equipList.add(equipmentSetEntry);
|
||||||
equipmentSets.put(equipSetID, equipList);
|
equipmentSets.put(equipSetID, equipList);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ArrayList<EquipmentSetEntry>equipList = equipmentSets.get(equipSetID);
|
ArrayList<BootySetEntry>equipList = equipmentSets.get(equipSetID);
|
||||||
equipList.add(equipmentSetEntry);
|
equipList.add(equipmentSetEntry);
|
||||||
equipmentSets.put(equipSetID, equipList);
|
equipmentSets.put(equipSetID, equipList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.util.HashMap;
|
|||||||
public enum NPCManager {
|
public enum NPCManager {
|
||||||
|
|
||||||
NPC_MANAGER;
|
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<Integer>> _runeSetMap = new HashMap<>();
|
||||||
public static HashMap<Integer, ArrayList<BootySetEntry>> _bootySetMap = 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){
|
public static HashMap<Integer, MobEquipment> loadEquipmentSet(int equipmentSetID){
|
||||||
|
|
||||||
ArrayList<EquipmentSetEntry> equipList;
|
ArrayList<BootySetEntry> equipList;
|
||||||
HashMap<Integer, MobEquipment> equip = new HashMap<>();
|
HashMap<Integer, MobEquipment> equip = new HashMap<>();
|
||||||
|
|
||||||
if (equipmentSetID == 0)
|
if (equipmentSetID == 0)
|
||||||
@@ -157,9 +157,9 @@ public class MobBase extends AbstractGameObject {
|
|||||||
if (equipList == null)
|
if (equipList == null)
|
||||||
return equip;
|
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();
|
ItemBase itemBase = mobEquipment.getItemBase();
|
||||||
|
|
||||||
if (itemBase != null) {
|
if (itemBase != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user