diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 5e743769..0760b057 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -112,22 +112,9 @@ public enum LootManager { case "LOOT": if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) GenerateLootDrop(mob, bse.genTable); //generate normal loot drop - int extraRoll = ThreadLocalRandom.current().nextInt(1,20000); - if(extraRoll == 1000){//0.005% chance - MobLoot extraLoot = null; - int extraItemRoll = ThreadLocalRandom.current().nextInt(1,101); - if(extraItemRoll >= 1 && extraItemRoll <= 47){//0.00235% chance per mob killed or 1 in 425 - extraLoot = tryForContract(bse.genTable,mob); - } - if(extraItemRoll >= 48 && extraItemRoll <= 94){//0.00235% chance per mob killed or 1 in 425 - extraLoot = tryForStatRune(bse.genTable,mob); - } - if(extraItemRoll > 94){//0.0003% chance per mob killed or 1 in 3333 - extraLoot = tryForGlass(mob); - } - if(extraLoot != null){ - extraLoot.setIsID(true); - mob.getCharItemManager().addItemToInventory(extraLoot); + if(ThreadLocalRandom.current().nextInt(1, 20000) < mob.level) { + if (_genTables.containsKey(bse.genTable + 1) && ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) { + GenerateLootDrop(mob, bse.genTable + 1); //generate loot drop from hotzone table } } break; @@ -327,6 +314,7 @@ public enum LootManager { public static void GenerateEquipmentDrop(Mob mob) { //do equipment here + int dropCount = 0; if (mob.getEquip() != null) for (MobEquipment me : mob.getEquip().values()) { @@ -357,18 +345,12 @@ public enum LootManager { } MobLoot ml = new MobLoot(mob, genericIB, false); - if (ml != null) { + if (ml != null && dropCount < 1) { ml.setIsID(true); ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); - - if(ml.getItemBase().isVorg()) { - ml.clearEnchantments(); - for (String enchant : ml.getItemBase().getCustomEnchants()) - ml.addPermanentEnchantment(enchant, 40); - - ml.setName(ml.getItemBase().getName()); - } mob.getCharItemManager().addItemToInventory(ml); + dropCount = 1; + //break; // Exit on first successful roll. } } } @@ -471,86 +453,4 @@ public enum LootManager { itemMan.addItemToInventory(playerWinnings); itemMan.updateInventory(); } - - public static MobLoot tryForContract(int tableID, Mob mob){ - GenTableEntry selectedRow = GenTableEntry.rollTable(tableID, 99, 1.0f); - if (selectedRow == null) - return null; - - int itemTableId = selectedRow.itemTableID; - - if (_itemTables.containsKey(itemTableId) == false) - return null; - - ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(190,321));// 1 in 425 mobs - - MobLoot outItem = null; - - if (tableRow == null) - return null; - - int itemUUID = tableRow.cacheID; - - if (itemUUID == 0) - return null; - - outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); - if(outItem != null){ - return outItem; - } - - return null; - } - public static MobLoot tryForStatRune(int tableID, Mob mob){ - GenTableEntry selectedRow = GenTableEntry.rollTable(tableID, 96, 1.0f); - if (selectedRow == null) - return null; - - int itemTableId = selectedRow.itemTableID; - - if (_itemTables.containsKey(itemTableId) == false) - return null; - - ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(1,321));//76.5% chance for stat rune or 1 in 750 mobs - - MobLoot outItem = null; - - if (tableRow == null) - return null; - - int itemUUID = tableRow.cacheID; - - if (itemUUID == 0) - return null; - - outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); - if(outItem != null){ - return outItem; - } - return null; - } - public static MobLoot tryForGlass(Mob mob){ - int itemTableId = 126; - - if (_itemTables.containsKey(itemTableId) == false) - return null; - - ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(1,321));//30.9% chance to get glass or 1 in 4362 mobs - - MobLoot outItem = null; - - if (tableRow == null) - return null; - - int itemUUID = tableRow.cacheID; - - if (itemUUID == 0) - return null; - - outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); - if(outItem != null){ - return outItem; - } - return null; - } } diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index 1acde538..ad5ff347 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -155,9 +155,7 @@ public class ItemBase { } initBakedInStats(); initializeHashes(); - if (this.isVorg()) { - removeBakedInStats(); - } + } public static void addToCache(ItemBase itemBase) { @@ -349,10 +347,6 @@ public class ItemBase { return this.bakedInStats; } - public void removeBakedInStats(){ - this.bakedInStats.clear(); - } - //returns power tokens granted when using item, such as scrolls and potions public HashMap getUsedStats() { return this.usedStats; @@ -925,101 +919,4 @@ public class ItemBase { public boolean isVorg(){ return LootManager.vorg_ha_uuids.contains(this.uuid) || LootManager.vorg_ma_uuids.contains(this.uuid) || LootManager.vorg_la_uuids.contains(this.uuid) || LootManager.vorg_cloth_uuids.contains(this.uuid); } - public ArrayList getCustomEnchants(){ - ArrayList enchants = new ArrayList<>(); - switch(this.uuid){ - case 27550:// "Vorgrim Auxiliary's Bow" - - break; - case 27560:// "Vorgrim Auxiliary's Dagger" - - break; - case 27570: // "Bellugh Nuathal Hammer" - - break; - case 27580:// "Vorgrim Legionnaire's Axe" - - break; - case 27590:// "Vorgrim Legionnaire's Sword" - - break; - case 27600:// "Staff of the Crimson Circle" - - break; - case 188500:// "Vorgrim Legionnaire's Breastplate" - - break; - case 188510:// "Vorgrim Legionnaire's Armguards" - - break; - case 188520:// "Vorgrim Legionnaire's Legguards" - - break; - case 188530:// "Vorgrim Legionnaire's Gauntlets" - - break; - case 188540:// "Vorgrim Legionnaire's Boots" - - break; - case 188550:// "Vorgrim Legionnaire's Helm" - - break; - case 188700:// "Robe of the Crimson Circle" - - break; - case 188720:// "Hood of the Crimson Circle" - - break; - case 188900:// "Bellugh Nuathal Hauberk" - - break; - case 188910:// "Bellugh Nuathal Sleeves" - - break; - case 188920:// "Bellugh Nuathal Leggings" - - break; - case 188930:// "Bellugh Nuathal Gauntlets" - - break; - case 188940:// "Bellugh Nuathal Boots" - - break; - case 188950:// "Bellugh Nuathal Helmet" - - break; - case 189100:// "Vorgrim Auxiliary's Vest" - - break; - case 189110:// "Vorgrim Auxiliary's Sleeves" - - break; - case 189120:// "Vorgrim Auxiliary's Leggings" - - break; - case 189130:// "Vorgrim Auxiliary's Gloves" - - break; - case 189140:// "Vorgrim Auxiliary's Boots" - - break; - case 189150:// "Vorgrim Auxiliary's Hood" - - break; - case 189500:// "Bellugh Nuathal Shield" - - break; - case 189510:// "Vorgrim Legionnaire's Shield" - - break; - case 189550:// "Gloves of the Crimson Circle" - - break; - case 189560:// "Boots of the Crimson Circle" - - break; - } - - return enchants; - } }