forked from MagicBane/Server
Booty moved to LootManager
This commit is contained in:
@@ -2,7 +2,6 @@ package engine.devcmd.cmds;
|
|||||||
|
|
||||||
import engine.devcmd.AbstractDevCmd;
|
import engine.devcmd.AbstractDevCmd;
|
||||||
import engine.gameManager.LootManager;
|
import engine.gameManager.LootManager;
|
||||||
import engine.gameManager.NPCManager;
|
|
||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
import engine.loot.BootySetEntry;
|
import engine.loot.BootySetEntry;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
@@ -33,7 +32,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
|||||||
output += "Special Loot:" + newline;
|
output += "Special Loot:" + newline;
|
||||||
|
|
||||||
if (mob.bootySet != 0) {
|
if (mob.bootySet != 0) {
|
||||||
for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.bootySet)) {
|
for (BootySetEntry entry : LootManager._bootySetMap.get(mob.bootySet)) {
|
||||||
ItemBase item = ItemBase.getItemBase(entry.itemBase);
|
ItemBase item = ItemBase.getItemBase(entry.itemBase);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
output += "[" + entry.bootyType + "] " + item.getName() + " [Chance] " + entry.dropChance + newline;
|
output += "[" + entry.bootyType + "] " + item.getName() + " [Chance] " + entry.dropChance + newline;
|
||||||
@@ -118,7 +117,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
|
|||||||
else
|
else
|
||||||
dropRate = LootManager.NORMAL_DROP_RATE;
|
dropRate = LootManager.NORMAL_DROP_RATE;
|
||||||
|
|
||||||
for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) {
|
for (BootySetEntry entry : LootManager._bootySetMap.get(mob.getMobBase().bootySet)) {
|
||||||
|
|
||||||
if (entry.bootyType.equals("GOLD"))
|
if (entry.bootyType.equals("GOLD"))
|
||||||
output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.genTable + ": " + entry.dropChance + newline;
|
output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.genTable + ": " + entry.dropChance + newline;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public enum LootManager {
|
|||||||
public static float HOTZONE_DROP_RATE;
|
public static float HOTZONE_DROP_RATE;
|
||||||
public static float HOTZONE_EXP_RATE;
|
public static float HOTZONE_EXP_RATE;
|
||||||
public static float HOTZONE_GOLD_RATE;
|
public static float HOTZONE_GOLD_RATE;
|
||||||
|
public static HashMap<Integer, ArrayList<BootySetEntry>> _bootySetMap = new HashMap<>();
|
||||||
|
|
||||||
// Bootstrap routine to initialize the Loot Manager
|
// Bootstrap routine to initialize the Loot Manager
|
||||||
|
|
||||||
@@ -73,11 +74,11 @@ public enum LootManager {
|
|||||||
|
|
||||||
//iterate the booty sets
|
//iterate the booty sets
|
||||||
|
|
||||||
if (mob.getMobBase().bootySet != 0 && NPCManager._bootySetMap.containsKey(mob.getMobBase().bootySet) == true)
|
if (mob.getMobBase().bootySet != 0 && _bootySetMap.containsKey(mob.getMobBase().bootySet) == true)
|
||||||
RunBootySet(NPCManager._bootySetMap.get(mob.getMobBase().bootySet), mob, inHotzone, fromDeath);
|
RunBootySet(_bootySetMap.get(mob.getMobBase().bootySet), mob, inHotzone, fromDeath);
|
||||||
|
|
||||||
if (mob.bootySet != 0 && NPCManager._bootySetMap.containsKey(mob.bootySet) == true)
|
if (mob.bootySet != 0 && _bootySetMap.containsKey(mob.bootySet) == true)
|
||||||
RunBootySet(NPCManager._bootySetMap.get(mob.bootySet), mob, inHotzone, fromDeath);
|
RunBootySet(_bootySetMap.get(mob.bootySet), mob, inHotzone, fromDeath);
|
||||||
|
|
||||||
//lastly, check mobs inventory for godly or disc runes to send a server announcement
|
//lastly, check mobs inventory for godly or disc runes to send a server announcement
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package engine.gameManager;
|
|||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.loot.BootySetEntry;
|
|
||||||
import engine.net.Dispatch;
|
import engine.net.Dispatch;
|
||||||
import engine.net.DispatchMessage;
|
import engine.net.DispatchMessage;
|
||||||
import engine.net.client.msg.PetMsg;
|
import engine.net.client.msg.PetMsg;
|
||||||
@@ -18,14 +17,13 @@ public enum NPCManager {
|
|||||||
|
|
||||||
NPC_MANAGER;
|
NPC_MANAGER;
|
||||||
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 void LoadAllRuneSets() {
|
public static void LoadAllRuneSets() {
|
||||||
_runeSetMap = DbManager.ItemBaseQueries.LOAD_RUNES_FOR_NPC_AND_MOBS();
|
_runeSetMap = DbManager.ItemBaseQueries.LOAD_RUNES_FOR_NPC_AND_MOBS();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LoadAllBootySets() {
|
public static void LoadAllBootySets() {
|
||||||
_bootySetMap = DbManager.LootQueries.LOAD_BOOTY_TABLES();
|
LootManager._bootySetMap = DbManager.LootQueries.LOAD_BOOTY_TABLES();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyRuneSetEffects(Mob mob) {
|
public static void applyRuneSetEffects(Mob mob) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ package engine.objects;
|
|||||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.gameManager.NPCManager;
|
import engine.gameManager.LootManager;
|
||||||
import engine.loot.BootySetEntry;
|
import engine.loot.BootySetEntry;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public class MobBase extends AbstractGameObject {
|
|||||||
if (equipmentSetID == 0)
|
if (equipmentSetID == 0)
|
||||||
return equip;
|
return equip;
|
||||||
|
|
||||||
equipList = NPCManager._bootySetMap.get(equipmentSetID);
|
equipList = LootManager._bootySetMap.get(equipmentSetID);
|
||||||
|
|
||||||
if (equipList == null)
|
if (equipList == null)
|
||||||
return equip;
|
return equip;
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ public class NPC extends AbstractCharacter {
|
|||||||
|
|
||||||
public static boolean UpdateEquipSetID(NPC npc, int equipSetID) {
|
public static boolean UpdateEquipSetID(NPC npc, int equipSetID) {
|
||||||
|
|
||||||
if (!NPCManager._bootySetMap.containsKey(equipSetID))
|
if (!LootManager._bootySetMap.containsKey(equipSetID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!DbManager.NPCQueries.UPDATE_EQUIPSET(npc, equipSetID))
|
if (!DbManager.NPCQueries.UPDATE_EQUIPSET(npc, equipSetID))
|
||||||
|
|||||||
@@ -333,8 +333,8 @@ public class WorldServer {
|
|||||||
Logger.info("Loading NPC and Mob Rune Sets");
|
Logger.info("Loading NPC and Mob Rune Sets");
|
||||||
NPCManager.LoadAllRuneSets();
|
NPCManager.LoadAllRuneSets();
|
||||||
|
|
||||||
Logger.info("Loading Mobile Booty Sets");
|
Logger.info("Loading Booty Sets");
|
||||||
NPCManager.LoadAllBootySets();
|
LootManager._bootySetMap = DbManager.LootQueries.LOAD_BOOTY_TABLES();
|
||||||
|
|
||||||
// Load new loot system
|
// Load new loot system
|
||||||
Logger.info("Initializing Loot Manager");
|
Logger.info("Initializing Loot Manager");
|
||||||
|
|||||||
Reference in New Issue
Block a user