Browse Source

better roll chance for high level vendors

lakebane-strongholds
FatBoy-DOTC 3 months ago
parent
commit
a4cba1a352
  1. 18
      src/engine/gameManager/LootManager.java

18
src/engine/gameManager/LootManager.java

@ -309,7 +309,7 @@ public enum LootManager {
if(mob.getObjectType().ordinal() == 52) { //52 = player character if(mob.getObjectType().ordinal() == 52) { //52 = player character
itemTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1); itemTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{ } else{
itemTableRoll = TableRoll(mob.level, inHotzone); itemTableRoll = TableRoll(mob.level * 2);
} }
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, itemTableRoll); ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, itemTableRoll);
if (tableRow == null) if (tableRow == null)
@ -381,7 +381,7 @@ public enum LootManager {
if(mob.getObjectType().ordinal() == 52) { if(mob.getObjectType().ordinal() == 52) {
prefixTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1); prefixTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{ } else{
prefixTableRoll = TableRoll(mob.level * 2, inHotzone); prefixTableRoll = TableRoll(mob.level * 2);
} }
ModTableEntry prefixMod = ModTableEntry.rollTable(prefixTable.modTableID, prefixTableRoll); ModTableEntry prefixMod = ModTableEntry.rollTable(prefixTable.modTableID, prefixTableRoll);
@ -413,7 +413,7 @@ public enum LootManager {
if(mob.getObjectType().ordinal() == 52) { if(mob.getObjectType().ordinal() == 52) {
suffixTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1); suffixTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{ } else{
suffixTableRoll = TableRoll(mob.level * 2, inHotzone); suffixTableRoll = TableRoll(mob.level * 2);
} }
ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll); ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll);
@ -428,7 +428,10 @@ public enum LootManager {
return inItem; return inItem;
} }
public static int TableRoll(int mobLevel, Boolean inHotzone) { public static int TableRoll(int mobLevel) {
if(mobLevel > 65)
mobLevel = 65;
int max = (int) (4.882 * mobLevel + 127.0); int max = (int) (4.882 * mobLevel + 127.0);
@ -437,11 +440,8 @@ public enum LootManager {
int min = (int) (4.469 * mobLevel - 3.469); int min = (int) (4.469 * mobLevel - 3.469);
if (min < 70) if (min < 140)
min = 70; min = 140;
if (inHotzone)
min += mobLevel;
int roll = ThreadLocalRandom.current().nextInt(min, max + 1); int roll = ThreadLocalRandom.current().nextInt(min, max + 1);

Loading…
Cancel
Save