strip item enchants

This commit is contained in:
2025-03-03 07:17:12 -06:00
parent 898f6dfa69
commit 46b9da0612
2 changed files with 24 additions and 11 deletions
@@ -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");
} }
+22 -11
View File
@@ -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);
} // }
}
for(Effect eff : ToRemove)//{
this.effects.remove(eff.getEffectsBase().getIDString());
//} //}
//strip procs
if(this.effects.get("EnchantWeapon") != null){
this.effects.remove("EnchantWeapon");
Effect eff = this.effects.get("EnchantWeapon");
eff.endEffectNoPower();
}
//strip forge master hone armor
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){