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
+22 -11
View File
@@ -819,19 +819,30 @@ public class Item extends AbstractWorldObject {
public void stripCastableEnchants(){
try {
ArrayList<Effect> ToRemove = new ArrayList<>();
for (Effect eff : this.effects.values()) {
if (eff.getJobContainer() != null && !eff.getJobContainer().noTimer()) {
eff.endEffectNoPower();
eff.getJobContainer().cancelJob();
ToRemove.add(eff);
}
}
for(Effect eff : ToRemove)//{
this.effects.remove(eff.getEffectsBase().getIDString());
//ArrayList<Effect> ToRemove = new ArrayList<>();
//for (Effect eff : this.effects.values()) {
// if (eff.getJobContainer() != null && !eff.getJobContainer().noTimer()) {
// eff.endEffectNoPower();
// eff.getJobContainer().cancelJob();
// ToRemove.add(eff);
// }
//}
//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);
}catch(Exception ignored){