From cc9b5a93ee1b6ab76434747d425243449f4e1807 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 5 Aug 2023 19:28:53 -0400 Subject: [PATCH] Header added to new files. --- src/engine/gameManager/LootManager.java | 80 +++++++++++++------------ src/engine/loot/GenTable.java | 8 +++ src/engine/loot/GenTableRow.java | 8 +++ src/engine/loot/ItemTable.java | 8 +++ src/engine/loot/ItemTableRow.java | 8 +++ src/engine/loot/ModTable.java | 8 +++ src/engine/loot/ModTableRow.java | 8 +++ src/engine/loot/ModTypeTable.java | 8 +++ src/engine/loot/ModTypeTableRow.java | 8 +++ 9 files changed, 106 insertions(+), 38 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index bc0d9af3..d5a3c3a7 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -179,6 +179,7 @@ public enum LootManager { outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); Enum.ItemType outType = outItem.getItemBase().getType(); + if (outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) { if (outItem.getItemBase().isGlass() == false) { @@ -195,79 +196,81 @@ public enum LootManager { } } } - if(outItem.getPrefix() != null && outItem.getPrefix().isEmpty() == false) + + if (outItem.getPrefix() != null && outItem.getPrefix().isEmpty() == false) outItem.setIsID(false); - if(outItem.getSuffix() != null && outItem.getSuffix().isEmpty() == false) + + if (outItem.getSuffix() != null && outItem.getSuffix().isEmpty() == false) outItem.setIsID(false); + return outItem; } private static MobLoot GeneratePrefix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) { - GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); + GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); - if (selectedRow == null) - return inItem; + if (selectedRow == null) + return inItem; - ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable); + ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable); - if (prefixTable == null) - return inItem; + if (prefixTable == null) + return inItem; int prefixroll = ThreadLocalRandom.current().nextInt(1, 100 + 1); - if (modTables.get(prefixTable.getRowForRange(prefixroll).modTableID) != null) { - ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(prefixroll).modTableID); + if (modTables.get(prefixTable.getRowForRange(prefixroll).modTableID) != null) { + ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(prefixroll).modTableID); - if (prefixModTable == null) - return inItem; + if (prefixModTable == null) + return inItem; - ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); + ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); - if (prefixMod == null) - return inItem; + if (prefixMod == null) + return inItem; - if (prefixMod != null && prefixMod.action.length() > 0) { - inItem.setPrefix(prefixMod.action); - inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); - } + if (prefixMod != null && prefixMod.action.length() > 0) { + inItem.setPrefix(prefixMod.action); + inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); } + } //} return inItem; } private static MobLoot GenerateSuffix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) { - GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); + GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); - if (selectedRow == null) - return inItem; + if (selectedRow == null) + return inItem; int suffixroll = ThreadLocalRandom.current().nextInt(1, 100 + 1); - ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable); + ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable); - if (suffixTable == null) - return inItem; + if (suffixTable == null) + return inItem; - if (modTables.get(suffixTable.getRowForRange(suffixroll).modTableID) != null) { + if (modTables.get(suffixTable.getRowForRange(suffixroll).modTableID) != null) { - ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(suffixroll).modTableID); + ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(suffixroll).modTableID); - if (suffixModTable == null) - return inItem; + if (suffixModTable == null) + return inItem; - ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); + ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); - if (suffixMod == null) - return inItem; + if (suffixMod == null) + return inItem; - if (suffixMod != null && suffixMod.action.length() > 0) { - inItem.setSuffix(suffixMod.action); - inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false); - } + if (suffixMod != null && suffixMod.action.length() > 0) { + inItem.setSuffix(suffixMod.action); + inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false); } - //} + } return inItem; } @@ -326,6 +329,7 @@ public enum LootManager { try { MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone); + if (toAdd != null) mob.getCharItemManager().addItemToInventory(toAdd); @@ -355,7 +359,7 @@ public enum LootManager { if (ml != null) { ml.setIsID(true); - ml.setDurabilityCurrent((short)(ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); + ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); mob.getCharItemManager().addItemToInventory(ml); } } diff --git a/src/engine/loot/GenTable.java b/src/engine/loot/GenTable.java index 5b5dd997..af2a97e4 100644 --- a/src/engine/loot/GenTable.java +++ b/src/engine/loot/GenTable.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.util.ArrayList; diff --git a/src/engine/loot/GenTableRow.java b/src/engine/loot/GenTableRow.java index 4ce81a32..85443caa 100644 --- a/src/engine/loot/GenTableRow.java +++ b/src/engine/loot/GenTableRow.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.sql.ResultSet; diff --git a/src/engine/loot/ItemTable.java b/src/engine/loot/ItemTable.java index e2afc1b4..b3a248f2 100644 --- a/src/engine/loot/ItemTable.java +++ b/src/engine/loot/ItemTable.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.util.ArrayList; diff --git a/src/engine/loot/ItemTableRow.java b/src/engine/loot/ItemTableRow.java index 00a20b8a..9655e287 100644 --- a/src/engine/loot/ItemTableRow.java +++ b/src/engine/loot/ItemTableRow.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.sql.ResultSet; diff --git a/src/engine/loot/ModTable.java b/src/engine/loot/ModTable.java index 06908938..2dee3c86 100644 --- a/src/engine/loot/ModTable.java +++ b/src/engine/loot/ModTable.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.util.ArrayList; diff --git a/src/engine/loot/ModTableRow.java b/src/engine/loot/ModTableRow.java index 94665cf6..0c3927a4 100644 --- a/src/engine/loot/ModTableRow.java +++ b/src/engine/loot/ModTableRow.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.sql.ResultSet; diff --git a/src/engine/loot/ModTypeTable.java b/src/engine/loot/ModTypeTable.java index b444a73b..0e40e395 100644 --- a/src/engine/loot/ModTypeTable.java +++ b/src/engine/loot/ModTypeTable.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.util.ArrayList; diff --git a/src/engine/loot/ModTypeTableRow.java b/src/engine/loot/ModTypeTableRow.java index 13b8cef9..7c395ed0 100644 --- a/src/engine/loot/ModTypeTableRow.java +++ b/src/engine/loot/ModTypeTableRow.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import java.sql.ResultSet;