diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 31e11440..02103393 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -850,14 +850,14 @@ public enum PowersManager { // return; //} - if(HandleItemEnchantments(playerCharacter, msg)) { - playerCharacter.setIsCasting(false); - PerformActionMsg castMsg = new PerformActionMsg(msg); - castMsg.setNumTrains(9999); - castMsg.setUnknown04(2); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); - return; - } + //if(HandleItemEnchantments(playerCharacter, msg)) { + // playerCharacter.setIsCasting(false); + // PerformActionMsg castMsg = new PerformActionMsg(msg); + // castMsg.setNumTrains(9999); + // castMsg.setUnknown04(2); + // DispatchMessage.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + // return; + //} PerformActionMsg performActionMsg; Dispatch dispatch; @@ -3149,11 +3149,12 @@ public enum PowersManager { // Logger.error(pc.getFirstName() + " failed to apply self buff: " + msg.getPowerUsedID()); //} - UsePowerJob asj =new UsePowerJob(pc,msg,eb.getToken(),pb,pc.getLiveCounter(),pc.getLiveCounter()); + UsePowerJob asj = new UsePowerJob(pc,msg,pb.getToken(),pb,pc.getLiveCounter(),pc.getLiveCounter()); JobContainer jc = JobScheduler.getInstance().scheduleJob(asj, 1800000); Effect eff = new Effect(jc, eb, msg.getNumTrains()); - pc.effects.put("CASTABLE", eff); + // pc.effects.put("CASTABLE", eff); + pc.addEffect("CASTABLE",1800,asj,eb,msg.getNumTrains()); pc.applyAllBonuses(); ApplyEffectMsg pum = new ApplyEffectMsg(); diff --git a/src/engine/objects/PlayerCombatStats.java b/src/engine/objects/PlayerCombatStats.java index e02ac836..e1799dd9 100644 --- a/src/engine/objects/PlayerCombatStats.java +++ b/src/engine/objects/PlayerCombatStats.java @@ -6,6 +6,7 @@ import engine.powers.EffectsBase; import engine.powers.PowersBase; import engine.powers.effectmodifiers.AbstractEffectModifier; import engine.server.MBServerStatics; +import org.pmw.tinylog.Logger; import java.math.BigDecimal; import java.math.RoundingMode; @@ -384,15 +385,19 @@ public class PlayerCombatStats { } } } else { - for (AbstractEffectModifier mod : this.owner.effects.get(effID).getEffectModifiers()) { - if (mod.modType.equals(Enum.ModType.OCV)) { - if(mod.getPercentMod() == 0) { - float value = mod.getMinMod(); - int trains = this.owner.effects.get(effID).getTrains(); - float modValue = value + (trains * mod.getRamp()); - atrEnchants += modValue; + try { + for (AbstractEffectModifier mod : this.owner.effects.get(effID).getEffectModifiers()) { + if (mod.modType.equals(Enum.ModType.OCV)) { + if (mod.getPercentMod() == 0) { + float value = mod.getMinMod(); + int trains = this.owner.effects.get(effID).getTrains(); + float modValue = value + (trains * mod.getRamp()); + atrEnchants += modValue; + } } } + }catch(Exception e){ + //Logger.error(e.getMessage()); } } }