Item flags refactored

This commit is contained in:
2024-03-22 13:03:47 -04:00
parent f01fb6f848
commit eca71fa685
7 changed files with 45 additions and 46 deletions
+7 -6
View File
@@ -185,7 +185,7 @@ public enum LootManager {
if(selectedRow.pModTable != 0){
try {
outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.setIsID(false);
outItem.flags.remove(Enum.ItemFlags.Identified);
} catch (Exception e) {
Logger.error("Failed to GeneratePrefix for item: " + outItem.getName());
}
@@ -193,7 +193,7 @@ public enum LootManager {
if(selectedRow.sModTable != 0){
try {
outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.setIsID(false);
outItem.flags.remove(Enum.ItemFlags.Identified);
} catch (Exception e) {
Logger.error("Failed to GenerateSuffix for item: " + outItem.getName());
}
@@ -351,7 +351,7 @@ public enum LootManager {
MobLoot ml = new MobLoot(mob, item.template, false);
if (ml != null && dropCount < 1) {
ml.setIsID(true);
ml.flags.add(Enum.ItemFlags.Identified);
ml.setDurabilityCurrent((short) ((short) ml.durabilityCurrent - ThreadLocalRandom.current().nextInt(5) + 1));
mob.charItemManager.addItemToInventory(ml);
dropCount = 1;
@@ -440,13 +440,14 @@ public enum LootManager {
//determine if the winning item needs a suffix
if(selectedRow.sModTable != 0){
int suffixRoll = ThreadLocalRandom.current().nextInt(220,320 + 1);
if (selectedRow.sModTable != 0) {
int suffixRoll = ThreadLocalRandom.current().nextInt(220, 320 + 1);
ModTableEntry suffix = ModTableEntry.rollTable(selectedRow.sModTable, suffixRoll);
if (suffix != null)
winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true);
}
winnings.setIsID(true);
winnings.flags.add(Enum.ItemFlags.Identified);
;
//remove gift from inventory