Browse Source

Removed extra squigglies

combat-2
MagicBot 8 months ago
parent
commit
cdd746e0df
  1. 38
      src/engine/gameManager/LootManager.java

38
src/engine/gameManager/LootManager.java

@ -159,14 +159,16 @@ public enum LootManager {
return null; return null;
//gets the 1-320 roll for this mob //gets the 1-320 roll for this mob
int itemTableRoll = 0; int itemTableRoll = 0;
int objectType = mob.getObjectType().ordinal();
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, inHotzone);
}
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, itemTableRoll); ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, itemTableRoll);
if (tableRow == null) if (tableRow == null)
return null; return null;
@ -182,22 +184,22 @@ public enum LootManager {
outItem = new MobLoot(mob, ItemTemplate.templates.get(itemUUID), false); outItem = new MobLoot(mob, ItemTemplate.templates.get(itemUUID), false);
if (selectedRow.pModTable != 0) { if (selectedRow.pModTable != 0)
try { try {
outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone); outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.flags.remove(Enum.ItemFlags.Identified); outItem.flags.remove(Enum.ItemFlags.Identified);
} catch (Exception e) { } catch (Exception e) {
Logger.error("Failed to GeneratePrefix for item: " + outItem.getName()); Logger.error("Failed to GeneratePrefix for item: " + outItem.getName());
} }
}
if (selectedRow.sModTable != 0) { if (selectedRow.sModTable != 0)
try { try {
outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone); outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.flags.remove(Enum.ItemFlags.Identified); outItem.flags.remove(Enum.ItemFlags.Identified);
} catch (Exception e) { } catch (Exception e) {
Logger.error("Failed to GenerateSuffix for item: " + outItem.getName()); Logger.error("Failed to GenerateSuffix for item: " + outItem.getName());
} }
}
return outItem; return outItem;
} }
@ -214,12 +216,14 @@ public enum LootManager {
if (prefixTable == null) if (prefixTable == null)
return inItem; return inItem;
int prefixTableRoll = 0; int prefixTableRoll = 0;
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, inHotzone); prefixTableRoll = TableRoll(mob.level, inHotzone);
}
ModTableEntry prefixMod = ModTableEntry.rollTable(prefixTable.modTableID, prefixTableRoll); ModTableEntry prefixMod = ModTableEntry.rollTable(prefixTable.modTableID, prefixTableRoll);
if (prefixMod == null) if (prefixMod == null)
@ -246,12 +250,14 @@ public enum LootManager {
if (suffixTable == null) if (suffixTable == null)
return inItem; return inItem;
int suffixTableRoll = 0;
if (mob.getObjectType().ordinal() == 52) { int suffixTableRoll;
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, inHotzone); suffixTableRoll = TableRoll(mob.level, inHotzone);
}
ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll); ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll);
if (suffixMod == null) if (suffixMod == null)
@ -336,6 +342,7 @@ public enum LootManager {
return; // safehold guards don't drop their equipment return; // safehold guards don't drop their equipment
//do equipment here //do equipment here
int dropCount = 0; int dropCount = 0;
if (mob.charItemManager.equipped.isEmpty() == false) if (mob.charItemManager.equipped.isEmpty() == false)
for (Item item : mob.charItemManager.equipped.values()) { for (Item item : mob.charItemManager.equipped.values()) {
@ -447,7 +454,6 @@ public enum LootManager {
winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true); winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true);
} }
winnings.flags.add(Enum.ItemFlags.Identified); winnings.flags.add(Enum.ItemFlags.Identified);
;
//remove gift from inventory //remove gift from inventory

Loading…
Cancel
Save