Browse Source

vorg HA fix

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
b9ec8fd540
  1. 7
      src/engine/gameManager/LootManager.java
  2. 13
      src/engine/objects/Item.java
  3. 7
      src/engine/objects/MobLoot.java

7
src/engine/gameManager/LootManager.java

@ -375,13 +375,18 @@ public enum LootManager { @@ -375,13 +375,18 @@ public enum LootManager {
}
MobLoot ml = new MobLoot(mob, genericIB, false);
if (ml != null && dropCount < 1) {
if (ml != null && dropCount < 1 && genericIB.isVorg() == false) {
ml.setIsID(true);
ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1));
mob.getCharItemManager().addItemToInventory(ml);
dropCount = 1;
//break; // Exit on first successful roll.
}
if(ml != null && genericIB.isVorg()){
ml.setIsID(true);
ml.setDurabilityCurrent(ml.getDurabilityMax());
mob.getCharItemManager().addItemToInventory(ml);
}
}
}

13
src/engine/objects/Item.java

@ -96,7 +96,8 @@ public class Item extends AbstractWorldObject { @@ -96,7 +96,8 @@ public class Item extends AbstractWorldObject {
this.customName = name;
loadEnchantments();
bakeInStats();
if(this.getItemBase().isVorg() == false)
bakeInStats();
}
public Item(ItemBase itemBase, int ownerID,
@ -1232,15 +1233,6 @@ public class Item extends AbstractWorldObject { @@ -1232,15 +1233,6 @@ public class Item extends AbstractWorldObject {
return;
if (this.getItemBase() != null)
if(this.getItemBase().isVorg()){
this.getEnchants().clear();
for(String powerString : this.getItemBase().getVorgStats()){
//AbstractPowerAction apa = PowersManager.getPowerActionByIDString(powerString);
//apa.applyBakedInStatsForItem(this, 0);
this.addPermanentEnchantment(powerString,0);
}
this.setName(this.getItemBase().getName());
}else {
for (Integer token : this.getItemBase().getBakedInStats().keySet()) {
effect = PowersManager.getEffectByToken(token);
@ -1253,7 +1245,6 @@ public class Item extends AbstractWorldObject { @@ -1253,7 +1245,6 @@ public class Item extends AbstractWorldObject {
apa.applyBakedInStatsForItem(this, this.getItemBase().getBakedInStats().get(token));
}
}
}
public final void loadEnchantments() {

7
src/engine/objects/MobLoot.java

@ -164,6 +164,13 @@ public final class MobLoot extends Item { @@ -164,6 +164,13 @@ public final class MobLoot extends Item {
item.addPermanentEnchantment(this.suffix, 0);
this.junk();
if (item.getItemBase().isVorg()) {
item.getEnchants().clear();
for (String powerString : item.getItemBase().getVorgStats()) {
item.addPermanentEnchantment(powerString, 0);
}
this.setName(item.getItemBase().getName());
}
return item;
}

Loading…
Cancel
Save