Browse Source

Rework of drop rate usage.

master
MagicBot 1 year ago
parent
commit
7ac78df913
  1. 46
      src/engine/gameManager/LootManager.java

46
src/engine/gameManager/LootManager.java

@ -106,27 +106,37 @@ public enum LootManager {
private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob, float multiplier, boolean inHotzone, boolean fromDeath) { private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob, float multiplier, boolean inHotzone, boolean fromDeath) {
if (fromDeath) boolean hotzoneWasRan = false;
if (fromDeath) {
GenerateEquipmentDrop(mob, multiplier); GenerateEquipmentDrop(mob, multiplier);
else { return;
for (BootySetEntry bse : entries) { }
switch (bse.bootyType) {
case "GOLD": // Iterate all entries in this bootyset and process accordingly
GenerateGoldDrop(mob, bse, inHotzone);
break; for (BootySetEntry bse : entries) {
case "LOOT": switch (bse.bootyType) {
//always run base table loot drop case "GOLD":
GenerateGoldDrop(mob, bse, inHotzone);
break;
case "LOOT":
if (ThreadLocalRandom.current().nextInt(100) > NORMAL_DROP_RATE)
GenerateLootDrop(mob, bse.lootTable, bse.dropChance, multiplier, false); //generate normal loot drop GenerateLootDrop(mob, bse.lootTable, bse.dropChance, multiplier, false); //generate normal loot drop
//run another iteration for the hotzone table if in hotzone // Generate hotzone loot if in hotzone
if (inHotzone)
if (generalItemTables.containsKey(bse.lootTable + 1)) if (inHotzone == true && hotzoneWasRan == false)
GenerateLootDrop(mob, bse.lootTable + 1, bse.dropChance, multiplier, true); //generate loot drop from hotzone table if (generalItemTables.containsKey(bse.lootTable + 1) && ThreadLocalRandom.current().nextInt(100) > HOTZONE_DROP_RATE) {
break; GenerateLootDrop(mob, bse.lootTable + 1, bse.dropChance, multiplier, true); //generate loot drop from hotzone table
case "ITEM": hotzoneWasRan = true;
GenerateInventoryDrop(mob, bse, multiplier); }
break;
} break;
case "ITEM":
GenerateInventoryDrop(mob, bse, multiplier);
break;
} }
} }
} }

Loading…
Cancel
Save