From dcc92fd89d27fae253165099d8cadab628f8f493 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 2 Apr 2024 19:53:16 -0500 Subject: [PATCH] removed non-gold drops form safehold mobs --- src/engine/gameManager/LootManager.java | 63 +++++++++++++++---------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 367242ad..81d21b4b 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -117,43 +117,43 @@ public enum LootManager { float dropRate = NORMAL_DROP_RATE; //roll the geenric world drop table - GenerateLootDrop(mob, 1300); - if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) { - MobLoot extraLoot = rollForGlass(mob); - if (extraLoot != null) { - mob.getCharItemManager().addItemToInventory(extraLoot); + if(mob.parentZone.getSafeZone() == 0) { + GenerateLootDrop(mob, 1300); + if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) { + MobLoot extraLoot = rollForGlass(mob); + if (extraLoot != null) { + mob.getCharItemManager().addItemToInventory(extraLoot); + } } } + // Iterate all entries in this bootySet and process accordingly boolean hasExtraRolled = false; for (BootySetEntry bse : entries) { - switch (bse.bootyType) { case "GOLD": GenerateGoldDrop(mob, bse); break; case "LOOT": - if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) - GenerateLootDrop(mob, bse.genTable); //generate normal loot drop - if(mob.parentZone.getSafeZone() == 0) { - if (hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 10000) < 5 * dropRate) { - int roll = ThreadLocalRandom.current().nextInt(1, 101); - MobLoot extraLoot = null; - if (roll >= 1 && roll <= 50) { - extraLoot = rollForContract(bse.genTable, mob); - } - if (roll >= 51 && roll <= 94) { - extraLoot = rollForRune(bse.genTable, mob); - } - //if (roll >= 95) { - // extraLoot = rollForGlass(mob); - //} - if (extraLoot != null) { - mob.getCharItemManager().addItemToInventory(extraLoot); - } + if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) + GenerateLootDrop(mob, bse.genTable); //generate normal loot drop + if (mob.parentZone.getSafeZone() == 0 && hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 10000) < 5 * dropRate) { + int roll = ThreadLocalRandom.current().nextInt(1, 101); + MobLoot extraLoot = null; + if (roll >= 1 && roll <= 50) { + extraLoot = rollForContract(bse.genTable, mob); + } + if (roll >= 51 && roll <= 94) { + extraLoot = rollForRune(bse.genTable, mob); + } + //if (roll >= 95) { + // extraLoot = rollForGlass(mob); + //} + if (extraLoot != null) { + mob.getCharItemManager().addItemToInventory(extraLoot); + } hasExtraRolled = true; } - } break; case "ITEM": GenerateInventoryDrop(mob, bse); @@ -338,7 +338,9 @@ public enum LootManager { public static void GenerateLootDrop(Mob mob, int tableID) { try { - + if(mob.parentZone.getSafeZone() == 1) { + return; + } MobLoot toAdd = getGenTableItem(tableID, mob); if(toAdd.getItemBase().getType().equals(Enum.ItemType.CONTRACT) || toAdd.getItemBase().getType().equals(Enum.ItemType.RUNE)) return;//block all contracts and runes that drop outside the confines of the new system @@ -354,6 +356,10 @@ public enum LootManager { public static void GenerateEquipmentDrop(Mob mob) { + if(mob.parentZone.getSafeZone() == 1) { + return; + } + //do equipment here int dropCount = 0; if (mob.getEquip() != null) @@ -403,6 +409,10 @@ public enum LootManager { public static void GenerateInventoryDrop(Mob mob, BootySetEntry bse) { + if(mob.parentZone.getSafeZone() == 1) { + return; + } + int chanceRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1); //early exit, failed to hit minimum chance roll @@ -501,6 +511,7 @@ public enum LootManager { } public static MobLoot rollForContract(int table, Mob mob){ + int roll = 99; if (table == 1900 || table == 1500) roll = 73;