Browse Source

mob roll levels

lakebane-strongholds
FatBoy-DOTC 3 months ago
parent
commit
9d93944dd1
  1. 46
      src/engine/gameManager/LootManager.java

46
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 * 2); itemTableRoll = TableRoll(mob.level);
} }
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); prefixTableRoll = TableRoll(mob.level);
} }
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); suffixTableRoll = TableRoll(mob.level);
} }
ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll); ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll);
@ -430,18 +430,34 @@ public enum LootManager {
public static int TableRoll(int mobLevel) { public static int TableRoll(int mobLevel) {
if(mobLevel > 65) int rank = (int)(mobLevel * 0.1f);
mobLevel = 65; int min = 50;
int max = 100;
int max = (int) (4.882 * mobLevel + 127.0); switch(rank){
case 1:
if (max > 319) min = 200;
max = 319; max = 250;
break;
int min = (int) (4.469 * mobLevel - 3.469); case 2:
min = 210;
if (min < 140) max = 275;
min = 140; break;
case 3:
min = 220;
max = 300;
break;
case 4:
min = 230;
max = 320;
break;
case 5:
case 6:
case 7:
case 8:
min = 240;
max = 320;
break;
}
int roll = ThreadLocalRandom.current().nextInt(min, max + 1); int roll = ThreadLocalRandom.current().nextInt(min, max + 1);

Loading…
Cancel
Save