temporary enchant stripping

This commit is contained in:
2025-01-27 12:08:01 -06:00
parent 58a0b6150f
commit fd30e52741
2 changed files with 10 additions and 23 deletions
+4 -4
View File
@@ -610,7 +610,7 @@ public class CharacterItemManager {
if (i == null)
return false;
i.stripCastableEnchants();
//i.stripCastableEnchants();
if (!this.doesCharOwnThisItem(i.getObjectUUID()))
return false;
@@ -1056,7 +1056,7 @@ public class CharacterItemManager {
// add to Bank
this.bank.add(i);
i.addToCache();
i.stripCastableEnchants();
//i.stripCastableEnchants();
calculateWeights();
@@ -1205,7 +1205,7 @@ public class CharacterItemManager {
calculateWeights();
i.stripCastableEnchants();
//i.stripCastableEnchants();
return true;
}
@@ -2013,7 +2013,7 @@ public class CharacterItemManager {
if (item.getItemBase().getType().equals(ItemType.GOLD)) {
int amt = item.getNumOfItems();
item.setNumOfItems(0);
item.stripCastableEnchants();
//item.stripCastableEnchants();
MobLoot ml = new MobLoot(this.absCharacter, amt);
ml.zeroItem();
ml.containerType = Enum.ItemContainerType.INVENTORY;
+6 -19
View File
@@ -818,22 +818,9 @@ public class Item extends AbstractWorldObject {
}
public void stripCastableEnchants(){
ArrayList<String> keys =new ArrayList<>();
for(String eff : this.effects.keySet()){
for(AbstractEffectModifier mod : this.effects.get(eff).getEffectsBase().getModifiers()){
if(mod.modType.equals(ModType.WeaponProc)){
keys.add(eff);
}
}
}
for(String eff : keys){
try {
this.effects.get(eff).endEffect();
this.effects.remove(eff);
}catch(Exception e){
for(Effect eff : this.effects.values()){
if(eff.getJobContainer() != null && !eff.getJobContainer().noTimer()){
eff.endEffect();
}
}
}
@@ -1085,7 +1072,7 @@ public class Item extends AbstractWorldObject {
this.ownerID = pc.getObjectUUID();
this.ownerType = OwnerType.PlayerCharacter;
this.containerType = ItemContainerType.INVENTORY;
this.stripCastableEnchants();
//this.stripCastableEnchants();
return true;
}
@@ -1106,7 +1093,7 @@ public class Item extends AbstractWorldObject {
this.ownerID = npc.getObjectUUID();
this.ownerType = OwnerType.Npc;
this.containerType = Enum.ItemContainerType.INVENTORY;
this.stripCastableEnchants();
//this.stripCastableEnchants();
return true;
}
@@ -1124,7 +1111,7 @@ public class Item extends AbstractWorldObject {
this.ownerID = 0;
this.ownerType = null;
this.containerType = Enum.ItemContainerType.INVENTORY;
this.stripCastableEnchants();
//this.stripCastableEnchants();
return true;
}