Browse Source

strip item enchants

lakebane-jobs
FatBoy-DOTC 22 hours ago
parent
commit
46b9da0612
  1. 2
      src/engine/objects/CharacterItemManager.java
  2. 31
      src/engine/objects/Item.java

2
src/engine/objects/CharacterItemManager.java

@ -1058,6 +1058,7 @@ public class CharacterItemManager {
i.addToCache(); i.addToCache();
try { try {
i.stripCastableEnchants(); i.stripCastableEnchants();
this.updateInventory();
}catch(Exception ignored){ }catch(Exception ignored){
Logger.error("FAILED TO STRIP CASTABLE ENCHANTS: Move Item To Bank"); Logger.error("FAILED TO STRIP CASTABLE ENCHANTS: Move Item To Bank");
} }
@ -1203,6 +1204,7 @@ public class CharacterItemManager {
try { try {
i.stripCastableEnchants(); i.stripCastableEnchants();
this.updateInventory();
}catch(Exception ignored){ }catch(Exception ignored){
Logger.error("FAILED TO STRIP CASTABLE ENCHANTS: Move Item To Vault"); Logger.error("FAILED TO STRIP CASTABLE ENCHANTS: Move Item To Vault");
} }

31
src/engine/objects/Item.java

@ -819,19 +819,30 @@ public class Item extends AbstractWorldObject {
public void stripCastableEnchants(){ public void stripCastableEnchants(){
try { try {
ArrayList<Effect> ToRemove = new ArrayList<>(); //ArrayList<Effect> ToRemove = new ArrayList<>();
for (Effect eff : this.effects.values()) { //for (Effect eff : this.effects.values()) {
if (eff.getJobContainer() != null && !eff.getJobContainer().noTimer()) { // if (eff.getJobContainer() != null && !eff.getJobContainer().noTimer()) {
eff.endEffectNoPower(); // eff.endEffectNoPower();
eff.getJobContainer().cancelJob(); // eff.getJobContainer().cancelJob();
ToRemove.add(eff); // ToRemove.add(eff);
} // }
//}
//strip procs
if(this.effects.get("EnchantWeapon") != null){
this.effects.remove("EnchantWeapon");
Effect eff = this.effects.get("EnchantWeapon");
eff.endEffectNoPower();
} }
for(Effect eff : ToRemove)//{ //strip forge master hone armor
this.effects.remove(eff.getEffectsBase().getIDString()); if(this.effects.get("1000") != null){
//} this.effects.remove("1000");
Effect eff = this.effects.get("1000");
eff.endEffectNoPower();
}
this.applyAllBonuses();
//this.effects.values().removeAll(ToRemove); //this.effects.values().removeAll(ToRemove);
}catch(Exception ignored){ }catch(Exception ignored){

Loading…
Cancel
Save