diff --git a/src/engine/powers/poweractions/ApplyEffectPowerAction.java b/src/engine/powers/poweractions/ApplyEffectPowerAction.java index 3f2a9c4b..a9eb6c89 100644 --- a/src/engine/powers/poweractions/ApplyEffectPowerAction.java +++ b/src/engine/powers/poweractions/ApplyEffectPowerAction.java @@ -11,6 +11,7 @@ package engine.powers.poweractions; import engine.Enum.GameObjectType; import engine.Enum.ModType; import engine.Enum.SourceType; +import engine.InterestManagement.WorldGrid; import engine.gameManager.ChatManager; import engine.jobs.ChantJob; import engine.jobs.DeferredPowerJob; @@ -22,6 +23,7 @@ import engine.objects.*; import engine.powers.ActionsBase; import engine.powers.EffectsBase; import engine.powers.PowersBase; +import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; import java.sql.ResultSet; @@ -117,21 +119,12 @@ public class ApplyEffectPowerAction extends AbstractPowerAction { awo.addEffect(stackType, duration, eff, effect, trains); } else awo.applyAllBonuses(); - // //TODO if chant, start cycle - // if (pb.isChant() && source.equals(awo)) { - // ChantJob cj = new ChantJob(source, awo, stackType, trains, ab, pb, effect, eff); - // source.setLastChant((int)(pb.getChantDuration()-2) * 1000, cj); - // eff.setChant(true); - // } if (this.effectID.equals("TAUNT")) { if (awo != null && awo.getObjectType() == GameObjectType.Mob) { - //((Mob) awo).setCombatTarget(source); LOL DUMB - ChatSystemMsg msg = ChatManager.CombatInfo(source, awo); DispatchMessage.sendToAllInRange(source, msg); - //((Mob)awo).refresh(); why the fuck? causes a blink effect and players to lose target of the mob } } if (awo != null && awo.getObjectType() == GameObjectType.Mob) { @@ -141,7 +134,21 @@ public class ApplyEffectPowerAction extends AbstractPowerAction { } this.effect.startEffect(source, awo, trains, eff); } + //apply effects to mobs within range for chants + if(pb.isChant){ + for(AbstractGameObject ago : WorldGrid.getObjectsInRangePartial(awo.loc,pb.range, MBServerStatics.MASK_MOB)){ + Mob mob = (Mob)ago; + if(mob.playerAgroMap.containsKey(source.getObjectUUID())) + mob.playerAgroMap.put(source.getObjectUUID(), mob.playerAgroMap.get(source.getObjectUUID()).floatValue() + pb.hateValue); + } + }else { + if (awo != null && awo.getObjectType() == GameObjectType.Mob) { + Mob mob = (Mob) awo; + if (mob.playerAgroMap.containsKey(source.getObjectUUID())) + mob.playerAgroMap.put(source.getObjectUUID(), mob.playerAgroMap.get(source.getObjectUUID()).floatValue() + pb.hateValue); + } + } } protected void _applyEffectForItem(Item item, int trains) {