Browse Source

hotfix mob roll chance

master
FatBoy-DOTC 1 year ago
parent
commit
39ceef99ea
  1. 6
      src/engine/loot/LootManager.java

6
src/engine/loot/LootManager.java

@ -85,7 +85,7 @@ public class LootManager {
continue; continue;
float equipmentRoll = ThreadLocalRandom.current().nextInt(101); float equipmentRoll = ThreadLocalRandom.current().nextInt(101);
float dropChance = me.getDropChance() * 100; float dropChance = me.getDropChance() * 100;
if (equipmentRoll <= dropChance) { if (equipmentRoll <= (dropChance * multiplier)) {
MobLoot ml = new MobLoot(mob, me.getItemBase(), false); MobLoot ml = new MobLoot(mob, me.getItemBase(), false);
mob.getCharItemManager().addItemToInventory(ml); mob.getCharItemManager().addItemToInventory(ml);
} }
@ -97,7 +97,7 @@ public class LootManager {
int roll = ThreadLocalRandom.current().nextInt(101); int roll = ThreadLocalRandom.current().nextInt(101);
switch (bse.bootyType) { switch (bse.bootyType) {
case "GOLD": case "GOLD":
if (roll * multiplier > (bse.dropChance)) { if (roll >= (bse.dropChance * multiplier)) {
//early exit, failed to hit minimum chance roll OR booty was generated from mob's death //early exit, failed to hit minimum chance roll OR booty was generated from mob's death
break; break;
} }
@ -109,7 +109,7 @@ public class LootManager {
} }
break; break;
case "LOOT": case "LOOT":
if (roll * multiplier > (bse.dropChance)) { if (roll >= (bse.dropChance * multiplier)) {
//early exit, failed to hit minimum chance roll OR booty was generated from mob's death //early exit, failed to hit minimum chance roll OR booty was generated from mob's death
break; break;
} }

Loading…
Cancel
Save