From 93f6d0be0bab5d856f6dd630a714eb5de963e3ef Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 8 Apr 2023 21:49:17 -0500 Subject: [PATCH] new loot system completed --- src/engine/devcmd/cmds/simulateBootyCmd.java | 29 ++++++++++++++------ src/engine/loot/LootManager.java | 6 +++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index 8888998c..e1688e63 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -5,8 +5,6 @@ import engine.devcmd.AbstractDevCmd; import engine.gameManager.*; import engine.objects.*; import java.util.ArrayList; -import java.util.concurrent.ThreadLocalRandom; -import static engine.loot.LootManager.getGenTableItem; public class simulateBootyCmd extends AbstractDevCmd { public simulateBootyCmd() { @@ -69,8 +67,17 @@ public class simulateBootyCmd extends AbstractDevCmd { Mob mob = (Mob) target; output += "Name: " + mob.getName() + newline; int minRollRange = mob.getLevel() + 0 + mob.getParentZone().minLvl; - int maxRollRange = (mob.getLevel() * 2) + 100 + (mob.getParentZone().maxLvl * 2); + int maxRollRange = (mob.getLevel() * 2) + 120 + (mob.getParentZone().maxLvl * 2); output += "Roll Range: " + minRollRange + " - " + maxRollRange + newline; + output += "Special Loot:" + newline; + if(mob.bootySet != 0) { + for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.bootySet)) { + ItemBase item = ItemBase.getItemBase(entry.itemBase); + if (item != null) { + output += "[" + entry.bootyType + "] " + item.getName() + " [Chance] " + entry.dropChance + newline; + } + } + } ArrayList GlassItems = new ArrayList(); ArrayList Resources = new ArrayList(); ArrayList Runes = new ArrayList(); @@ -101,10 +108,16 @@ public class simulateBootyCmd extends AbstractDevCmd { GlassItems.add(lootItem); } 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; 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; } } @@ -116,22 +129,22 @@ public class simulateBootyCmd extends AbstractDevCmd { if(mob.spawnTime > 0){ respawnTime = mob.spawnTime; } - output += "BootySet: " + mob.getMobBase().bootySet + newline; + output += "MobBase BootySet: " + mob.getMobBase().bootySet + newline; + 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 += "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; - output += "RESOURCE DROPS: " + Resources.size() + newline; + output += "RUNE DROPS: " + Runes.size()+ newline; + output += "CONTRACTS DROPS: " + Contracts.size()+ newline; + output += "RESOURCE DROPS: " + Resources.size()+ newline; output += "OFFERINGS DROPPED: " + Offerings.size() + newline; output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline; output += "FAILED ROLLS: " + failures + newline; break; } - throwbackInfo(pc, output); } diff --git a/src/engine/loot/LootManager.java b/src/engine/loot/LootManager.java index 5beec32e..2588e0b6 100644 --- a/src/engine/loot/LootManager.java +++ b/src/engine/loot/LootManager.java @@ -20,6 +20,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; @@ -125,7 +126,8 @@ public class LootManager { } int itemTableId = selectedRow.itemTableID; int minRollRange = mob.getLevel() + roll + mob.getParentZone().minLvl; - int maxRollRange = (mob.getLevel() * 2) + roll + (mob.getParentZone().maxLvl * 2); + //add 20 to max roll range to make dwarven HA and Sage possible + int maxRollRange = (mob.getLevel() * 2) + roll + 20 + (mob.getParentZone().maxLvl * 2); if(maxRollRange > 320){ maxRollRange = 320; } @@ -153,6 +155,7 @@ public class LootManager { ModTableRow prefixMod = prefixModTable.getRowForRange(new Random().nextInt(maxRollRange) + minRollRange); if (prefixMod != null && prefixMod.action.length() > 0) { outItem.setPrefix(prefixMod.action); + outItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); } } if (modTables.get(suffixTable.getRowForRange(100).modTableID) != null) { @@ -160,6 +163,7 @@ public class LootManager { ModTableRow suffixMod = suffixModTable.getRowForRange(new Random().nextInt(maxRollRange) + minRollRange); if (suffixMod != null && suffixMod.action.length() > 0) { outItem.setSuffix(suffixMod.action); + outItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, true); } } }