public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); double playerAF = 0; double bonusAF; double bonusHP; if (effect?.Owner == null) { effect.Cancel(false); return; } foreach (InventoryItem item in effect.Owner.Inventory.EquippedItems) { if (item.Object_Type >= (int)eObjectType._FirstArmor && item.Object_Type <= (int)eObjectType._LastArmor) { playerAF += item.DPS_AF; } } playerAF += effect.Owner.GetModifiedFromItems(eProperty.ArmorFactor); if (Spell.Value < 0) { bonusAF = Spell.Value * -1 * playerAF / 100; bonusHP = Spell.Value * -1 * effect.Owner.MaxHealth / 100; } else { bonusAF = Spell.Value; bonusHP = Spell.Value; } GameLiving living = effect.Owner; living.TempProperties.setProperty("BONUS_HP", bonusHP); living.TempProperties.setProperty("BONUS_AF", bonusAF); living.AbilityBonus[(int)eProperty.MaxHealth] += (int)bonusHP; living.ItemBonus[(int)eProperty.ArmorFactor] += (int)bonusAF; SendUpdates(effect.Owner); }
public override bool IsNewEffectBetter(GameSpellEffect oldeffect, GameSpellEffect neweffect) { Spell oldProcSpell = SkillBase.GetSpellByID((int)oldeffect.Spell.Value); Spell newProcSpell = SkillBase.GetSpellByID((int)neweffect.Spell.Value); if (oldProcSpell == null || newProcSpell == null) { return(true); } // do not replace active proc with different type proc if (oldProcSpell.SpellType != newProcSpell.SpellType) { return(false); } if (oldProcSpell.Concentration > 0) { return(false); } // if the new spell does less damage return false if (oldProcSpell.Damage > newProcSpell.Damage) { return(false); } // if the new spell is lower than the old one return false if (oldProcSpell.Value > newProcSpell.Value) { return(false); } //makes problems for immunity effects if (oldeffect is GameSpellAndImmunityEffect == false || ((GameSpellAndImmunityEffect)oldeffect).ImmunityState == false) { if (neweffect.Duration <= oldeffect.RemainingTime) { return(false); } } return(true); }
public override void OnEffectStart(GameSpellEffect effect) { int value = (int)Spell.Value; SendEffectAnimation(effect.Owner, 0, false, 1); effect.Owner.AbilityBonus[(int)eProperty.Resist_Body] += value; effect.Owner.AbilityBonus[(int)eProperty.Resist_Cold] += value; effect.Owner.AbilityBonus[(int)eProperty.Resist_Energy] += value; effect.Owner.AbilityBonus[(int)eProperty.Resist_Heat] += value; effect.Owner.AbilityBonus[(int)eProperty.Resist_Matter] += value; effect.Owner.AbilityBonus[(int)eProperty.Resist_Spirit] += value; if (effect.Owner is GamePlayer player) { player.Out.SendCharStatsUpdate(); player.UpdatePlayerStatus(); player.Out.SendCharResistsUpdate(); } }
/// <summary> /// Called when owner release NPC /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="arguments"></param> protected virtual void OnNpcReleaseCommand(DOLEvent e, object sender, EventArgs arguments) { if (!((sender as GameNPC)?.Brain is IControlledBrain)) { return; } GameNPC pet = sender as GameNPC; IControlledBrain brain = pet.Brain as IControlledBrain; GameLiving living = brain.Owner; living.SetControlledBrain(null); GameEventMgr.RemoveHandler(pet, GameLivingEvent.PetReleased, new DOLEventHandler(OnNpcReleaseCommand)); GameSpellEffect effect = FindEffectOnTarget(pet, this); effect?.Cancel(false); }
public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); double percentValue = Spell.Value / 100;// 15 / 100 = 0.15 a.k (15%) 100dex * 0.15 = 15dex debuff DexDebuff = (int)(effect.Owner.GetModified(eProperty.Dexterity) * percentValue); QuiDebuff = (int)(effect.Owner.GetModified(eProperty.Quickness) * percentValue); GameLiving living = effect.Owner; living.DebuffCategory[(int)eProperty.Dexterity] += DexDebuff; living.DebuffCategory[(int)eProperty.Quickness] += QuiDebuff; if (effect.Owner is GamePlayer player) { player.Out.SendCharStatsUpdate(); player.UpdatePlayerStatus(); player.Out.SendUpdatePlayer(); } }
public override bool IsOverwritable(GameSpellEffect compare) { if (Spell.EffectGroup != 0 || compare.Spell.EffectGroup != 0) { return(Spell.EffectGroup == compare.Spell.EffectGroup); } if (base.IsOverwritable(compare) == false) { return(false); } if (compare.Spell.Duration != Spell.Duration) { return(false); } return(true); }
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages) { if (effect.Owner is GamePlayer) { GamePlayer player = effect.Owner as GamePlayer; Spell subspell = SkillBase.GetSpellByID(m_spell.ResurrectMana); if (subspell != null) { subspell.Level = m_spell.Level; ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(Caster, subspell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); if (spellhandler != null) { spellhandler.StartSpell(Caster); } } GameEventMgr.RemoveHandler(player, GamePlayerEvent.AttackedByEnemy, new DOLEventHandler(OnAttack)); } return(base.OnEffectExpires(effect, noMessages)); }
/// <summary> /// execute non duration spell effect on target /// </summary> /// <param name="target"></param> /// <param name="effectiveness"></param> public override void OnDirectEffect(GameLiving target, double effectiveness) { base.OnDirectEffect(target, effectiveness); if (target == null || !target.IsAlive) { return; } // RR4: we remove all the effects foreach (string toRemove in SpellTypesToRemove) { GameSpellEffect effect = target.FindEffectOnTarget(toRemove); if (effect != null) { effect.Cancel(false); } } SendEffectAnimation(target, 0, false, 1); }
public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); GameLiving living = effect.Owner as GameLiving; GamePlayer player = effect.Owner as GamePlayer; int value = (int)Spell.Value; living.BaseBuffBonusCategory[(int)eProperty.Resist_Slash] += value; living.BaseBuffBonusCategory[(int)eProperty.Resist_Crush] += value; living.BaseBuffBonusCategory[(int)eProperty.Resist_Thrust] += value; if (player != null) { player.Out.SendCharStatsUpdate(); player.UpdatePlayerStatus(); player.Out.SendCharResistsUpdate(); } MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell); Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner); }
public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); if (m_focusTargets == null) { m_focusTargets = new ArrayList(); } GameLiving living = effect.Owner as GameLiving; lock (m_focusTargets.SyncRoot) { if (!m_focusTargets.Contains(effect.Owner)) { m_focusTargets.Add(effect.Owner); } MessageToCaster("You concentrated on the spell!", eChatType.CT_Spell); } }
public override void OnEffectStart(GameSpellEffect effect) { if (effect.Owner is GamePlayer) { GamePlayer player = effect.Owner as GamePlayer; if (player.EffectList.GetOfType <ChargeEffect>() == null) { effect.Owner.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, effect, 0); player.Client.Out.SendUpdateMaxSpeed(); check = 1; } effect.Owner.StopAttack(); effect.Owner.StopCurrentSpellcast(); effect.Owner.DisarmedTime = effect.Owner.CurrentRegion.Time + Spell.Duration; } base.OnEffectStart(effect); }
public override void ApplyEffectOnTarget(GameLiving target, double effectiveness) { if (target.HasAbility(Abilities.MezzImmunity)) { MessageToCaster(target.Name + " is immune to this effect!", eChatType.CT_SpellResisted); SendEffectAnimation(target, 0, false, 0); target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster); return; } if (FindStaticEffectOnTarget(target, typeof(MezzRootImmunityEffect)) != null) { MessageToCaster("Your target is immune!", eChatType.CT_System); SendEffectAnimation(target, 0, false, 0); target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster); return; } //Do nothing when already mez, but inform caster GameSpellEffect mezz = SpellHandler.FindEffectOnTarget(target, "Mesmerize"); if (mezz != null) { MessageToCaster("Your target is already mezzed!", eChatType.CT_SpellResisted); SendEffectAnimation(target, 0, false, 0); return; } GameSpellEffect mezblock = SpellHandler.FindEffectOnTarget(target, "CeremonialBracerMezz"); if (mezblock != null) { mezblock.Cancel(false); if (target is GamePlayer) { (target as GamePlayer).Out.SendMessage("Your item effect intercepts the mesmerization spell and fades!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow); } //inform caster MessageToCaster("Ceremonial Bracer intercept your mez!", eChatType.CT_SpellResisted); SendEffectAnimation(target, 0, false, 0); target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster); return; } base.ApplyEffectOnTarget(target, effectiveness); }
/// <summary> /// Handles attacks on player/by player /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="arguments"></param> private void OnMove(DOLEvent e, object sender, EventArgs arguments) { GameLiving living = sender as GameLiving; if (living == null) { return; } if (living.IsMoving) { // remove speed buff if in combat GameSpellEffect effect = SpellHandler.FindEffectOnTarget(living, this); if (effect != null) { effect.Cancel(false); ((GamePlayer)living).Out.SendMessage("You move and break your modification spell.", eChatType.CT_Important, eChatLoc.CL_SystemWindow); } } }
public override void OnEffectStart(GameSpellEffect effect) { m_target = effect.Owner as GamePlayer; if (m_target == null) { return; } if (!m_target.IsAlive || m_target.ObjectState != GameLiving.eObjectState.Active || !m_target.IsSitting) { return; } Caster.BaseBuffBonusCategory[(int)eProperty.Skill_Stealth] += 100; GameEventMgr.AddHandler(m_target, GameLivingEvent.Moving, new DOLEventHandler(PlayerAction)); GameEventMgr.AddHandler(Caster, GameLivingEvent.Moving, new DOLEventHandler(PlayerAction)); new LoockoutOwner().Start(Caster); base.OnEffectStart(effect); }
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages) { if (warder != null) { GameEventMgr.RemoveHandler(warder, GameLivingEvent.Dying, new DOLEventHandler(BattleWarderDie)); warder.RemoveBrain(warder.Brain); warder.Health = 0; warder.Delete(); } if ((effect.Owner is GamePlayer)) { GamePlayer casterPlayer = effect.Owner as GamePlayer; GameEventMgr.RemoveHandler(casterPlayer, GamePlayerEvent.Moving, new DOLEventHandler(PlayerMoves)); GameEventMgr.RemoveHandler(casterPlayer, GamePlayerEvent.CastStarting, new DOLEventHandler(PlayerMoves)); GameEventMgr.RemoveHandler(casterPlayer, GamePlayerEvent.AttackFinished, new DOLEventHandler(PlayerMoves)); } effect.Owner.EffectList.Remove(effect); return(base.OnEffectExpires(effect, noMessages)); }
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages) { GameLiving living = effect.Owner as GameLiving; GamePlayer player = effect.Owner as GamePlayer; int value = (int)Spell.Value; living.BaseBuffBonusCategory[(int)eProperty.Resist_Slash] -= value; living.BaseBuffBonusCategory[(int)eProperty.Resist_Crush] -= value; living.BaseBuffBonusCategory[(int)eProperty.Resist_Thrust] -= value; if (player != null) { player.Out.SendCharStatsUpdate(); player.UpdatePlayerStatus(); player.Out.SendCharResistsUpdate(); } MessageToLiving(effect.Owner, Spell.Message3, eChatType.CT_Spell); Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message4, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner); return(0); }
public override void ApplyEffectOnTarget(GameLiving target, double effectiveness) { GameSpellEffect neweffect = CreateSpellEffect(target, effectiveness); if (target == null) { return; } if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) { return; } neweffect.Start(target); if (target is GamePlayer) { ((GamePlayer)target).Out.SendMessage("You're harder to hit!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow); } }
/// <summary> /// Apply effect on target or do spell action if non duration spell /// </summary> /// <param name="target">target that gets the effect</param> /// <param name="effectiveness">factor from 0..1 (0%-100%)</param> public override void ApplyEffectOnTarget(GameLiving target, double effectiveness) { if (!(Caster is GamePlayer player)) { return; } INpcTemplate template = NpcTemplateMgr.GetTemplate(Spell.LifeDrainReturn); if (template == null) { if (log.IsWarnEnabled) { log.Warn($"NPC template {Spell.LifeDrainReturn} not found! Spell: {Spell}"); } MessageToCaster($"NPC template {Spell.LifeDrainReturn} not found!", eChatType.CT_System); return; } beffect = CreateSpellEffect(target, effectiveness); { var summonloc = target.GetPointFromHeading(target.Heading, 64); BrittleBrain controlledBrain = new BrittleBrain(player); controlledBrain.IsMainPet = false; summoned = new GameNPC(template); summoned.SetOwnBrain(controlledBrain); summoned.X = summonloc.X; summoned.Y = summonloc.Y; summoned.Z = target.Z; summoned.CurrentRegion = target.CurrentRegion; summoned.Heading = (ushort)((target.Heading + 2048) % 4096); summoned.Realm = target.Realm; summoned.CurrentSpeed = 0; summoned.Level = Caster.Level; summoned.Size = 50; summoned.AddToWorld(); controlledBrain.AggressionState = eAggressionState.Passive; beffect.Start(Caster); } }
/// <summary> /// Apply effect on target or do spell action if non duration spell /// </summary> /// <param name="target">target that gets the effect</param> /// <param name="effectiveness">factor from 0..1 (0%-100%)</param> public override void ApplyEffectOnTarget(GameLiving target, double effectiveness) { GamePlayer player = Caster as GamePlayer; if (player == null) { return; } INpcTemplate template = NpcTemplateMgr.GetTemplate(Spell.LifeDrainReturn); if (template == null) { if (log.IsWarnEnabled) { log.WarnFormat("NPC template {0} not found! Spell: {1}", Spell.LifeDrainReturn, Spell.ToString()); } MessageToCaster("NPC template " + Spell.LifeDrainReturn + " not found!", eChatType.CT_System); return; } beffect = CreateSpellEffect(target, effectiveness); var summonloc = GameMath.GetPointFromHeading(target, 64); BrittleBrain controlledBrain = new BrittleBrain(player); controlledBrain.IsMainPet = false; summoned = new GameNPC(template); summoned.SetOwnBrain(controlledBrain); summoned.Position = new Vector3(summonloc, target.Position.Z); summoned.CurrentRegion = target.CurrentRegion; summoned.Heading = (ushort)((target.Heading + 2048) % 4096); summoned.Realm = target.Realm; summoned.CurrentSpeed = 0; summoned.Level = 1; summoned.Size = 10; summoned.AddToWorld(); controlledBrain.AggressionState = eAggressionState.Passive; GameEventMgr.AddHandler(summoned, GameLivingEvent.Dying, new DOLEventHandler(GuardDie)); beffect.Start(Caster); }
/// <summary> /// When an applied effect starts /// duration spells only /// </summary> /// <param name="effect"></param> public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); GamePlayer player = effect.Owner as GamePlayer; if (player == null || !player.IsStealthed) { effect.Owner.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, Spell.Value / 100.0); SendUpdates(effect.Owner); } GameEventMgr.AddHandler(effect.Owner, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttack)); GameEventMgr.AddHandler(effect.Owner, GameLivingEvent.AttackFinished, new DOLEventHandler(OnAttack)); GameEventMgr.AddHandler(effect.Owner, GameLivingEvent.CastFinished, new DOLEventHandler(OnAttack)); if (player != null) { GameEventMgr.AddHandler(player, GamePlayerEvent.StealthStateChanged, new DOLEventHandler(OnStealthStateChanged)); } }
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages) { if (effect.Owner == null) { return(0); } base.OnEffectExpires(effect, noMessages); GamePlayer player = effect.Owner as GamePlayer; if (check > 0 && player != null) { effect.Owner.BuffBonusMultCategory1.Remove((int)eProperty.MaxSpeed, effect); player.Client.Out.SendUpdateMaxSpeed(); } //effect.Owner.IsDisarmed = false; return(0); }
/// <summary> /// On Effect Start Replace Brain with Fear Brain. /// </summary> /// <param name="effect"></param> public override void OnEffectStart(GameSpellEffect effect) { var npcTarget = effect.Owner as GameNPC; var currentBrain = npcTarget.Brain as IOldAggressiveBrain; var friendBrain = new FriendBrain(this); m_NPCFriendBrain.AddOrReplace(npcTarget, friendBrain); npcTarget.AddBrain(friendBrain); friendBrain.Think(); // Prevent Aggro on Effect Expires. if (currentBrain != null) { currentBrain.ClearAggroList(); } base.OnEffectStart(effect); }
/// <summary> /// [Ganrod] Nidel: Can remove TurretFNF /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="arguments"></param> protected override void OnNpcReleaseCommand(DOLEvent e, object sender, EventArgs arguments) { m_pet = sender as GamePet; if (!(m_pet?.Brain is TurretFNFBrain)) { return; } if (Caster.ControlledBrain == null) { ((GamePlayer)Caster).Out.SendPetWindow(null, ePetWindowAction.Close, 0, 0); } GameEventMgr.RemoveHandler(m_pet, GameLivingEvent.PetReleased, OnNpcReleaseCommand); GameSpellEffect effect = FindEffectOnTarget(m_pet, this); effect?.Cancel(false); }
public override void OnEffectStart(GameSpellEffect effect) { if (effect.Owner is GamePlayer player) { player.CanBreathUnderWater = true; player.BaseBuffBonusCategory[(int)eProperty.WaterSpeed] += (int)Spell.Value; player.Out.SendUpdateMaxSpeed(); } eChatType toLiving = Spell.Pulse == 0 ? eChatType.CT_Spell : eChatType.CT_SpellPulse; eChatType toOther = Spell.Pulse == 0 ? eChatType.CT_System : eChatType.CT_SpellPulse; if (Spell.Message2 != string.Empty) { Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, false)), toOther, effect.Owner); } MessageToLiving(effect.Owner, Spell.Message1 == string.Empty ? "You find yourself able to move freely and breathe water like air!" : Spell.Message1, toLiving); base.OnEffectStart(effect); }
private void PlayerAction(DOLEvent e, object sender, EventArgs args) { GamePlayer player = (GamePlayer)sender; if (player == null) { return; } MessageToLiving(player, "You are moving. Your concentration fades!", eChatType.CT_SpellResisted); GameSpellEffect effect = FindEffectOnTarget(m_target, "Loockout"); effect?.Cancel(false); IGameEffect effect2 = FindStaticEffectOnTarget(Caster, typeof(LoockoutOwner)); effect2?.Cancel(false); OnEffectExpires(effect, true); }
public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); if (effect.Owner is GamePlayer player) { for (int i = (int)eProperty.Skill_First; i <= (int)eProperty.Skill_Last; i++) { if (player.GetModifiedSpecLevel(SkillBase.GetPropertyName((eProperty)i)) != 0) { player.BaseBuffBonusCategory[i] = -player.GetModifiedSpecLevel(SkillBase.GetPropertyName((eProperty)i)); } } player.PropertiesChanged(); player.Out.SendCharStatsUpdate(); player.UpdatePlayerStatus(); MessageToLiving(player, Spell.Message1, eChatType.CT_Spell); Message.SystemToArea(player, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner); } }
public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); effect.Owner.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, effect, 1.0 - Spell.Value * 0.01); SendUpdates(effect.Owner); MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell); Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner); RestoreSpeedTimer timer = new RestoreSpeedTimer(effect); effect.Owner.TempProperties.setProperty(effect, timer); // REVOIR timer.Interval = 650; timer.Start(1 + (effect.Duration >> 1)); effect.Owner.StartInterruptTimer(effect.Owner.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster); }
public override PlayerXEffect GetSavedEffect(GameSpellEffect e) { if ( // VaNaTiC-> this cannot work, cause PulsingSpellEffect is derived from object and only implements IConcEffect // e is PulsingSpellEffect || // VaNaTiC<- Spell.Pulse != 0 || Spell.Concentration != 0 || e.RemainingTime < 1) { return(null); } PlayerXEffect eff = new PlayerXEffect { Var1 = Spell.ID, Duration = e.RemainingTime, IsHandler = true, SpellLine = SpellLine.KeyName }; return(eff); }
/// <summary> /// When an applied effect expires. /// Duration spells only. /// </summary> /// <param name="effect">The expired effect</param> /// <param name="noMessages">true, when no messages should be sent to player and surrounding</param> /// <returns>immunity duration in milliseconds</returns> public override int OnEffectExpires(GameSpellEffect effect, bool noMessages) { GamePlayer player = effect.Owner as GamePlayer; GameEventMgr.RemoveHandler(effect.Owner, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttack)); GameEventMgr.RemoveHandler(effect.Owner, GameLivingEvent.AttackFinished, new DOLEventHandler(OnAttack)); if (player != null) { GameEventMgr.RemoveHandler(player, GamePlayerEvent.StealthStateChanged, new DOLEventHandler(OnStealthStateChanged)); } effect.Owner.BuffBonusMultCategory1.Remove((int)eProperty.MaxSpeed, this); if (!noMessages) { SendUpdates(effect.Owner); } return(0); }
/// <summary> /// When an applied effect starts /// duration spells only /// </summary> /// <param name="effect"></param> public override void OnEffectStart(GameSpellEffect effect) { base.OnEffectStart(effect); MessageToLiving(effect.Owner, Spell.Message1, eChatType.CT_Spell); MessageToCaster(Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell); Message.SystemToArea(effect.Owner, Util.MakeSentence(Spell.Message2, effect.Owner.GetName(0, true)), eChatType.CT_Spell, effect.Owner, Caster); if (effect.Owner is GamePlayer player) { player.Client.Out.SendUpdateMaxSpeed(); player.Group?.UpdateMember(player, false, false); } else { effect.Owner.StopAttack(); } effect.Owner.Notify(GameLivingEvent.CrowdControlled, effect.Owner); }
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages) { if (effect.Owner == null) return 0; base.OnEffectExpires(effect, noMessages); return 0; }