Browse Source

vorg HA fix

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
b9ec8fd540
  1. 7
      src/engine/gameManager/LootManager.java
  2. 11
      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 {
} }
MobLoot ml = new MobLoot(mob, genericIB, false); MobLoot ml = new MobLoot(mob, genericIB, false);
if (ml != null && dropCount < 1) { if (ml != null && dropCount < 1 && genericIB.isVorg() == false) {
ml.setIsID(true); ml.setIsID(true);
ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1));
mob.getCharItemManager().addItemToInventory(ml); mob.getCharItemManager().addItemToInventory(ml);
dropCount = 1; dropCount = 1;
//break; // Exit on first successful roll. //break; // Exit on first successful roll.
} }
if(ml != null && genericIB.isVorg()){
ml.setIsID(true);
ml.setDurabilityCurrent(ml.getDurabilityMax());
mob.getCharItemManager().addItemToInventory(ml);
}
} }
} }

11
src/engine/objects/Item.java

@ -96,6 +96,7 @@ public class Item extends AbstractWorldObject {
this.customName = name; this.customName = name;
loadEnchantments(); loadEnchantments();
if(this.getItemBase().isVorg() == false)
bakeInStats(); bakeInStats();
} }
@ -1232,15 +1233,6 @@ public class Item extends AbstractWorldObject {
return; return;
if (this.getItemBase() != null) 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()) { for (Integer token : this.getItemBase().getBakedInStats().keySet()) {
effect = PowersManager.getEffectByToken(token); effect = PowersManager.getEffectByToken(token);
@ -1254,7 +1246,6 @@ public class Item extends AbstractWorldObject {
} }
} }
}
public final void loadEnchantments() { public final void loadEnchantments() {
//dont load mobloot enchantments, they arent in db. //dont load mobloot enchantments, they arent in db.

7
src/engine/objects/MobLoot.java

@ -164,6 +164,13 @@ public final class MobLoot extends Item {
item.addPermanentEnchantment(this.suffix, 0); item.addPermanentEnchantment(this.suffix, 0);
this.junk(); 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; return item;
} }

Loading…
Cancel
Save