Browse Source

temporary enchant stripping

lakebane
FatBoy-DOTC 3 days ago
parent
commit
fd30e52741
  1. 8
      src/engine/objects/CharacterItemManager.java
  2. 25
      src/engine/objects/Item.java

8
src/engine/objects/CharacterItemManager.java

@ -610,7 +610,7 @@ public class CharacterItemManager { @@ -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 { @@ -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 { @@ -1205,7 +1205,7 @@ public class CharacterItemManager {
calculateWeights();
i.stripCastableEnchants();
//i.stripCastableEnchants();
return true;
}
@ -2013,7 +2013,7 @@ public class CharacterItemManager { @@ -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;

25
src/engine/objects/Item.java

@ -818,22 +818,9 @@ public class Item extends AbstractWorldObject { @@ -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 { @@ -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 { @@ -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 { @@ -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;
}

Loading…
Cancel
Save