From a09ce6b4fc3de417767d544b7ce27a733c89a411 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:18:05 -0500 Subject: [PATCH 01/12] cleanup and lots of null checks --- src/engine/gameManager/LootManager.java | 65 ++++++++++++++++--------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 4661e3cc..18d94f13 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -100,7 +100,8 @@ public enum LootManager { chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); } - + if (it.getEnchants().isEmpty() == true) + it.setIsID(true); } } } @@ -116,9 +117,11 @@ public enum LootManager { GenerateGoldDrop(mob, bse, inHotzone); break; case "LOOT": + //always run base table loot drop GenerateLootDrop(mob, bse.lootTable, bse.dropChance, multiplier); //generate normal loot drop if (inHotzone) + //run another iteration for the hotzone table if in hotzone if (generalItemTables.containsKey(bse.lootTable + 1)) GenerateLootDrop(mob, bse.lootTable + 1, bse.dropChance, multiplier); //generate loot drop from hotzone table break; @@ -132,20 +135,22 @@ public enum LootManager { public static MobLoot getGenTableItem(int genTableID, Mob mob) { - if (genTableID == 0 || mob == null || generalItemTables.containsKey(genTableID) == false) + if (mob == null || generalItemTables.containsKey(genTableID) == false) return null; MobLoot outItem; - int genRoll; - genRoll = new Random().nextInt(99) + 1; - GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); + int genRoll = new Random().nextInt(99) + 1; + GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); if (selectedRow == null) return null; int itemTableId = selectedRow.itemTableID; + if(itemTables.containsKey(itemTableId) == false) + return null; + //gets the 1-320 roll for this mob int roll2 = TableRoll(mob.level); @@ -193,14 +198,24 @@ public enum LootManager { if (prefixChanceRoll < prefixChance) { GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); + if(selectedRow == null) + return inItem; + ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable); + if(prefixTable == null) + return inItem; int prefixroll = ThreadLocalRandom.current().nextInt(99) + 1; if (modTables.get(prefixTable.getRowForRange(prefixroll).modTableID) != null) { ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(prefixroll).modTableID); + if(prefixModTable == null) + return inItem; + ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level)); + if(prefixMod == null) + return inItem; if (prefixMod != null && prefixMod.action.length() > 0) { inItem.setPrefix(prefixMod.action); @@ -219,13 +234,24 @@ public enum LootManager { if (suffixChanceRoll < suffixChance) { GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); + if(selectedRow == null) + return inItem; + int suffixroll = ThreadLocalRandom.current().nextInt(99) + 1; + ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable); + if(suffixTable == null) + return inItem; if (modTables.get(suffixTable.getRowForRange(suffixroll).modTableID) != null) { ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(suffixroll).modTableID); + if(suffixModTable == null) + return inItem; + ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level)); + if(suffixMod == null) + return inItem; if (suffixMod != null && suffixMod.action.length() > 0) { inItem.setSuffix(suffixMod.action); @@ -246,7 +272,8 @@ public enum LootManager { if (max > 319) max = 319; - int min = (int) (4.469 * mobLevel - 3.469); + int min = (int) (2.089 * mobLevel + 22.14); + int roll = ThreadLocalRandom.current().nextInt(max - min) + min; return roll; @@ -256,7 +283,7 @@ public enum LootManager { int chanceRoll = ThreadLocalRandom.current().nextInt(99) + 1; - //early exit, failed to hit minimum chance roll OR booty was generated from mob's death + //early exit, failed to hit minimum chance roll if (chanceRoll > bse.dropChance) return; @@ -270,7 +297,7 @@ public enum LootManager { if (inHotzone == true) gold = (int) (gold * HOTZONE_GOLD_RATE); else - gold = (int) (NORMAL_GOLD_RATE); + gold = (int) (gold * NORMAL_GOLD_RATE); if (gold > 0) { MobLoot goldAmount = new MobLoot(mob, gold); @@ -292,9 +319,6 @@ public enum LootManager { MobLoot toAdd = getGenTableItem(tableID, mob); if (toAdd != null) { - if (toAdd.getPrefix() == null && toAdd.getSuffix() == null) - toAdd.setIsID(true); - mob.getCharItemManager().addItemToInventory(toAdd); } } catch (Exception e) { @@ -313,17 +337,14 @@ public enum LootManager { if (me.getDropChance() == 0) continue; - float equipmentRoll = ThreadLocalRandom.current().nextInt(101); + float equipmentRoll = ThreadLocalRandom.current().nextInt(99) + 1; float dropChance = me.getDropChance() * 100; - if (equipmentRoll <= (dropChance * multiplier)) { - MobLoot ml = new MobLoot(mob, me.getItemBase(), false); - - if (ml.getPrefix().isEmpty() == true && ml.getSuffix().isEmpty() == true) - ml.setIsID(true); - + if (equipmentRoll > (dropChance * multiplier)) + continue; + MobLoot ml = new MobLoot(mob, me.getItemBase(), false); + if (ml != null) mob.getCharItemManager().addItemToInventory(ml); - } } } } @@ -337,10 +358,10 @@ public enum LootManager { if (chanceRoll > bse.dropChance * multiplier) return; - MobLoot disc = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); + MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); - if (disc != null) - mob.getCharItemManager().addItemToInventory(disc); + if (lootItem != null) + mob.getCharItemManager().addItemToInventory(lootItem); } public static void AddGenTableRow(int tableID, GenTableRow row) { From 0e35eea03664231bf82576326f273367bae69de6 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:21:35 -0500 Subject: [PATCH 02/12] hotzone slightly increase mob min roll --- src/engine/gameManager/LootManager.java | 29 ++++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 18d94f13..4d4ad929 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -118,12 +118,12 @@ public enum LootManager { break; case "LOOT": //always run base table loot drop - GenerateLootDrop(mob, bse.lootTable, bse.dropChance, multiplier); //generate normal loot drop + GenerateLootDrop(mob, bse.lootTable, bse.dropChance, multiplier, false); //generate normal loot drop if (inHotzone) //run another iteration for the hotzone table if in hotzone if (generalItemTables.containsKey(bse.lootTable + 1)) - GenerateLootDrop(mob, bse.lootTable + 1, bse.dropChance, multiplier); //generate loot drop from hotzone table + GenerateLootDrop(mob, bse.lootTable + 1, bse.dropChance, multiplier, true); //generate loot drop from hotzone table break; case "ITEM": GenerateItemLootDrop(mob, bse, multiplier); @@ -133,7 +133,7 @@ public enum LootManager { } } - public static MobLoot getGenTableItem(int genTableID, Mob mob) { + public static MobLoot getGenTableItem(int genTableID, Mob mob, Boolean inHotzone) { if (mob == null || generalItemTables.containsKey(genTableID) == false) return null; @@ -153,7 +153,7 @@ public enum LootManager { //gets the 1-320 roll for this mob - int roll2 = TableRoll(mob.level); + int roll2 = TableRoll(mob.level,inHotzone); ItemTableRow tableRow = itemTables.get(itemTableId).getRowForRange(roll2); @@ -176,12 +176,12 @@ public enum LootManager { if (outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) { if (outItem.getItemBase().isGlass() == false) { try { - outItem = GeneratePrefix(mob, outItem, genTableID, genRoll); + outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone); } catch (Exception e) { Logger.error("Failed to GeneratePrefix for item: " + outItem.getName()); } try { - outItem = GenerateSuffix(mob, outItem, genTableID, genRoll); + outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone); } catch (Exception e) { Logger.error("Failed to GenerateSuffix for item: " + outItem.getName()); } @@ -190,7 +190,7 @@ public enum LootManager { return outItem; } - private static MobLoot GeneratePrefix(Mob mob, MobLoot inItem, int genTableID, int genRoll) { + private static MobLoot GeneratePrefix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) { int prefixChanceRoll = ThreadLocalRandom.current().nextInt(99) + 1; double prefixChance = 2.057 * mob.level - 28.67; @@ -213,7 +213,7 @@ public enum LootManager { if(prefixModTable == null) return inItem; - ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level)); + ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); if(prefixMod == null) return inItem; @@ -226,7 +226,7 @@ public enum LootManager { return inItem; } - private static MobLoot GenerateSuffix(Mob mob, MobLoot inItem, int genTableID, int genRoll) { + private static MobLoot GenerateSuffix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) { int suffixChanceRoll = ThreadLocalRandom.current().nextInt(99) + 1; double suffixChance = 2.057 * mob.level - 28.67; @@ -249,7 +249,7 @@ public enum LootManager { if(suffixModTable == null) return inItem; - ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level)); + ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); if(suffixMod == null) return inItem; @@ -262,7 +262,7 @@ public enum LootManager { return inItem; } - private static int TableRoll(int mobLevel) { + private static int TableRoll(int mobLevel, Boolean inHotzone) { if (mobLevel > 65) mobLevel = 65; @@ -273,6 +273,9 @@ public enum LootManager { max = 319; int min = (int) (2.089 * mobLevel + 22.14); + if(inHotzone){ + min += mobLevel; + } int roll = ThreadLocalRandom.current().nextInt(max - min) + min; @@ -306,7 +309,7 @@ public enum LootManager { } - public static void GenerateLootDrop(Mob mob, int tableID, float dropChance, float multiplier) { + public static void GenerateLootDrop(Mob mob, int tableID, float dropChance, float multiplier, Boolean inHotzone) { try { int chanceRoll = ThreadLocalRandom.current().nextInt(99) + 1; @@ -316,7 +319,7 @@ public enum LootManager { if (chanceRoll > dropChance * multiplier) return; - MobLoot toAdd = getGenTableItem(tableID, mob); + MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone); if (toAdd != null) { mob.getCharItemManager().addItemToInventory(toAdd); From 9a03dc36c634f1007a9bbd878319afca030d2a1c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:24:35 -0500 Subject: [PATCH 03/12] add goldTally to simulateBooty command --- src/engine/devcmd/cmds/simulateBootyCmd.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index ac51788e..76830acf 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -90,6 +90,7 @@ public class simulateBootyCmd extends AbstractDevCmd { ArrayList Offerings = new ArrayList(); ArrayList OtherDrops = new ArrayList(); int failures = 0; + int goldAmount = 0; for (int i = 0; i < 100; ++i) { try { @@ -109,20 +110,16 @@ public class simulateBootyCmd extends AbstractDevCmd { Runes.add(lootItem); break; case WEAPON: //WEAPON - if (lootItem.getItemBase().isGlass()) { + if (lootItem.getItemBase().isGlass()) GlassItems.add(lootItem); - } else { + else OtherDrops.add(lootItem); - if (lootItem.getName().toLowerCase().contains("crimson") || lootItem.getName().toLowerCase().contains("vorgrim") || lootItem.getName().toLowerCase().contains("bell")) { - output += lootItem.getName() + newline; - } - } + break; + case GOLD: + goldAmount += lootItem.getNumOfItems(); break; default: OtherDrops.add(lootItem); - if (lootItem.getName().toLowerCase().contains("crimson") || lootItem.getName().toLowerCase().contains("vorgrim") || lootItem.getName().toLowerCase().contains("bell")) { - output += lootItem.getName() + newline; - } break; } } From 32653216e90327ad6757c5d87de23d0fd569e94f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:27:48 -0500 Subject: [PATCH 04/12] added hotzone tables to simulate booty command --- src/engine/devcmd/cmds/simulateBootyCmd.java | 10 +++++++++- src/engine/gameManager/LootManager.java | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index 76830acf..2f6a520c 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -3,7 +3,9 @@ package engine.devcmd.cmds; import engine.Enum; import engine.devcmd.AbstractDevCmd; import engine.gameManager.BuildingManager; +import engine.gameManager.LootManager; import engine.gameManager.NPCManager; +import engine.gameManager.ZoneManager; import engine.objects.*; import java.util.ArrayList; @@ -135,7 +137,13 @@ public class simulateBootyCmd extends AbstractDevCmd { output += "Mob BootySet: " + mob.bootySet + newline; output += "Tables Rolled On: " + newline; for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) { - output += "[" + entry.bootyType + "] " + entry.lootTable + newline; + output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.lootTable + newline; + } + if(ZoneManager.inHotZone(mob.getLoc())){ + for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) { + if(LootManager.generalItemTables.containsKey(entry.lootTable + 1) == true) + output += "HOTZONE TABLE [" + entry.bootyType + "] " + entry.lootTable + 1 + newline; + } } output += "Time Required To Gain Simulated Booty: " + respawnTime * 100 + " Seconds" + newline; output += "GLASS DROPS: " + GlassItems.size() + newline; diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 4d4ad929..872568d2 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -28,10 +28,10 @@ public enum LootManager { LOOTMANAGER; //new tables - private static final HashMap generalItemTables = new HashMap<>(); - private static final HashMap itemTables = new HashMap<>(); - private static final HashMap modTypeTables = new HashMap<>(); - private static final HashMap modTables = new HashMap<>(); + public static final HashMap generalItemTables = new HashMap<>(); + public static final HashMap itemTables = new HashMap<>(); + public static final HashMap modTypeTables = new HashMap<>(); + public static final HashMap modTables = new HashMap<>(); // Drop Rates From 92cb7418223e71b472847092174c40d683c7ff95 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:34:42 -0500 Subject: [PATCH 05/12] equipment drops added to simulate booty command --- src/engine/devcmd/cmds/simulateBootyCmd.java | 50 +++++++++----------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index 2f6a520c..9c84322c 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -9,6 +9,7 @@ import engine.gameManager.ZoneManager; import engine.objects.*; import java.util.ArrayList; +import java.util.concurrent.ThreadLocalRandom; public class simulateBootyCmd extends AbstractDevCmd { public simulateBootyCmd() { @@ -50,32 +51,14 @@ public class simulateBootyCmd extends AbstractDevCmd { Enum.GameObjectType objType = target.getObjectType(); - int objectUUID = target.getObjectUUID(); String output; output = "Booty Simulation:" + newline; switch (objType) { - case Building: - - break; - case PlayerCharacter: - - break; - - case NPC: - - break; - case Mob: Mob mob = (Mob) target; output += "Name: " + mob.getName() + newline; - int max = (int)(4.882 * mob.level + 127.0); - if(max > 320){ - max = 320; - } - int min = (int)(4.469 * mob.level - 3.469); - output += "Roll Range: " + min + " - " + max + newline; output += "Special Loot:" + newline; if (mob.bootySet != 0) { for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.bootySet)) { @@ -91,6 +74,7 @@ public class simulateBootyCmd extends AbstractDevCmd { ArrayList Contracts = new ArrayList(); ArrayList Offerings = new ArrayList(); ArrayList OtherDrops = new ArrayList(); + ArrayList EquipmentDrops = new ArrayList(); int failures = 0; int goldAmount = 0; for (int i = 0; i < 100; ++i) { @@ -128,10 +112,22 @@ public class simulateBootyCmd extends AbstractDevCmd { } catch (Exception ex) { failures++; } - } - int respawnTime = mob.getMobBase().getSpawnTime(); - if (mob.spawnTime > 0) { - respawnTime = mob.spawnTime; + if (mob.getEquip() != null) { + for (MobEquipment me : mob.getEquip().values()) { + + if (me.getDropChance() == 0) + continue; + + float equipmentRoll = ThreadLocalRandom.current().nextInt(99) + 1; + float dropChance = me.getDropChance() * 100; + + if (equipmentRoll > (dropChance)) + continue; + MobLoot ml = new MobLoot(mob, me.getItemBase(), false); + if (ml != null) + EquipmentDrops.add(ml); + } + } } output += "MobBase BootySet: " + mob.getMobBase().bootySet + newline; output += "Mob BootySet: " + mob.bootySet + newline; @@ -145,18 +141,18 @@ public class simulateBootyCmd extends AbstractDevCmd { output += "HOTZONE TABLE [" + entry.bootyType + "] " + entry.lootTable + 1 + newline; } } - output += "Time Required To Gain Simulated Booty: " + respawnTime * 100 + " Seconds" + newline; output += "GLASS DROPS: " + GlassItems.size() + newline; output += "RUNE DROPS: " + Runes.size() + newline; output += "CONTRACTS DROPS: " + Contracts.size() + newline; - for (Item contract : Contracts){ - output += contract.getName() + newline; - } output += "RESOURCE DROPS: " + Resources.size() + newline; output += "OFFERINGS DROPPED: " + Offerings.size() + newline; - output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline; + output += "ENCHANTED ITEMS DROPPED: " + OtherDrops.size() + newline; + output += "TOTAL GOLD DROPPED: " + goldAmount + newline; + output += "EQUIPMENT DROPPED: " + EquipmentDrops.size() + newline; output += "FAILED ROLLS: " + failures + newline; break; + default: + break; } throwbackInfo(pc, output); } From 42967693d0dba6d35e81e7ebbb6cedf7cbdf99b2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:56:32 -0500 Subject: [PATCH 06/12] autoID if value = baseValue --- src/engine/gameManager/LootManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 872568d2..cc5df328 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -100,7 +100,7 @@ public enum LootManager { chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); } - if (it.getEnchants().isEmpty() == true) + if(it.getBaseValue() == it.getItemBase().getBaseValue()) it.setIsID(true); } } From d903bc767c878dd9047d611da9fc555065497892 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:59:20 -0500 Subject: [PATCH 07/12] fix wrong display for hotzone lot table in simulatebooty --- src/engine/devcmd/cmds/simulateBootyCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index 9c84322c..a27d248b 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -138,7 +138,7 @@ public class simulateBootyCmd extends AbstractDevCmd { if(ZoneManager.inHotZone(mob.getLoc())){ for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) { if(LootManager.generalItemTables.containsKey(entry.lootTable + 1) == true) - output += "HOTZONE TABLE [" + entry.bootyType + "] " + entry.lootTable + 1 + newline; + output += "HOTZONE TABLE [" + entry.bootyType + "] " + (entry.lootTable + 1) + newline; } } output += "GLASS DROPS: " + GlassItems.size() + newline; From 060e9f330c2d18fe3f102bf4041f5d92b3425eaa Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 20:06:47 -0500 Subject: [PATCH 08/12] fix for base value check --- src/engine/gameManager/LootManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index cc5df328..05bf8368 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -100,7 +100,7 @@ public enum LootManager { chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); } - if(it.getBaseValue() == it.getItemBase().getBaseValue()) + if(it.getValue() == it.getItemBase().getBaseValue()) it.setIsID(true); } } From b9f939c8b2b8c4574235ac5ee1f80fad61d4182c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 20:26:44 -0500 Subject: [PATCH 09/12] identify loot without prefix or suffix --- src/engine/gameManager/LootManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 05bf8368..b64d9922 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -100,8 +100,6 @@ public enum LootManager { chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); } - if(it.getValue() == it.getItemBase().getBaseValue()) - it.setIsID(true); } } } @@ -322,6 +320,8 @@ public enum LootManager { MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone); if (toAdd != null) { + if(toAdd.getPrefix() != null || toAdd.getSuffix() != null) + toAdd.setIsID(true); mob.getCharItemManager().addItemToInventory(toAdd); } } catch (Exception e) { @@ -347,6 +347,8 @@ public enum LootManager { continue; MobLoot ml = new MobLoot(mob, me.getItemBase(), false); if (ml != null) + if(ml.getPrefix() != null || ml.getSuffix() != null) + ml.setIsID(true); mob.getCharItemManager().addItemToInventory(ml); } } @@ -364,6 +366,8 @@ public enum LootManager { MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); if (lootItem != null) + if(lootItem.getPrefix() != null || lootItem.getSuffix() != null) + lootItem.setIsID(true); mob.getCharItemManager().addItemToInventory(lootItem); } From f79ac6f8367405741125e315384b0c40528398a1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 20:29:13 -0500 Subject: [PATCH 10/12] revert min roll change --- src/engine/gameManager/LootManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index b64d9922..085110ee 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -270,7 +270,7 @@ public enum LootManager { if (max > 319) max = 319; - int min = (int) (2.089 * mobLevel + 22.14); + int min = (int)(4.469 * mobLevel - 3.469); if(inHotzone){ min += mobLevel; } From c514cad1d9d5df6da96effca6ca11a90d2eefec1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 20:44:25 -0500 Subject: [PATCH 11/12] no enchant item identification --- src/engine/gameManager/LootManager.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 085110ee..eead7c38 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -170,7 +170,8 @@ public enum LootManager { outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); Enum.ItemType outType = outItem.getItemBase().getType(); - + outItem.setIsID(true); + outItem.setIsID(true); if (outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) { if (outItem.getItemBase().isGlass() == false) { try { @@ -218,6 +219,8 @@ public enum LootManager { if (prefixMod != null && prefixMod.action.length() > 0) { inItem.setPrefix(prefixMod.action); inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); + inItem.setIsID(false); + inItem.setIsID(false); } } } @@ -254,6 +257,8 @@ public enum LootManager { if (suffixMod != null && suffixMod.action.length() > 0) { inItem.setSuffix(suffixMod.action); inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false); + inItem.setIsID(false); + inItem.setIsID(false); } } } @@ -320,8 +325,6 @@ public enum LootManager { MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone); if (toAdd != null) { - if(toAdd.getPrefix() != null || toAdd.getSuffix() != null) - toAdd.setIsID(true); mob.getCharItemManager().addItemToInventory(toAdd); } } catch (Exception e) { @@ -347,8 +350,6 @@ public enum LootManager { continue; MobLoot ml = new MobLoot(mob, me.getItemBase(), false); if (ml != null) - if(ml.getPrefix() != null || ml.getSuffix() != null) - ml.setIsID(true); mob.getCharItemManager().addItemToInventory(ml); } } @@ -366,8 +367,6 @@ public enum LootManager { MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); if (lootItem != null) - if(lootItem.getPrefix() != null || lootItem.getSuffix() != null) - lootItem.setIsID(true); mob.getCharItemManager().addItemToInventory(lootItem); } From ef7d75ba9be6eedce510d3ca4d22a5f6e0e287a9 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 21:07:07 -0500 Subject: [PATCH 12/12] min roll increased to 70 --- src/engine/gameManager/LootManager.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index eead7c38..c5baf509 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -171,7 +171,6 @@ public enum LootManager { outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); Enum.ItemType outType = outItem.getItemBase().getType(); outItem.setIsID(true); - outItem.setIsID(true); if (outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) { if (outItem.getItemBase().isGlass() == false) { try { @@ -220,7 +219,6 @@ public enum LootManager { inItem.setPrefix(prefixMod.action); inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); inItem.setIsID(false); - inItem.setIsID(false); } } } @@ -258,7 +256,6 @@ public enum LootManager { inItem.setSuffix(suffixMod.action); inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false); inItem.setIsID(false); - inItem.setIsID(false); } } } @@ -276,6 +273,8 @@ public enum LootManager { max = 319; int min = (int)(4.469 * mobLevel - 3.469); + if(min < 70) + min = 70; if(inHotzone){ min += mobLevel; } @@ -349,8 +348,11 @@ public enum LootManager { if (equipmentRoll > (dropChance * multiplier)) continue; MobLoot ml = new MobLoot(mob, me.getItemBase(), false); - if (ml != null) + if (ml != null) { + ml.setIsID(true); + ml.setIsID(true); mob.getCharItemManager().addItemToInventory(ml); + } } } }