public override void Execute(GameLiving living) { if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) { return; } GamePlayer caster = living as GamePlayer; if (caster == null) { return; } MasteryofConcentrationEffect MoCEffect = caster.EffectList.GetOfType <MasteryofConcentrationEffect>(); if (MoCEffect != null) { MoCEffect.Cancel(false); return; } // Check for the RA5L on the Sorceror: he cannot cast MoC when the other is up ShieldOfImmunityEffect ra5l = caster.EffectList.GetOfType <ShieldOfImmunityEffect>(); if (ra5l != null) { caster.Out.SendMessage("You cannot currently use this ability", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow); return; } SendCasterSpellEffectAndCastMessage(living, 7007, true); foreach (GamePlayer player in caster.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { if (caster.IsWithinRadius(player, WorldMgr.INFO_DISTANCE)) { if (player == caster) { player.MessageToSelf("You cast " + this.Name + "!", eChatType.CT_Spell); player.MessageToSelf("You become steadier in your casting abilities!", eChatType.CT_Spell); } else { player.MessageFromArea(caster, caster.Name + " casts a spell!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow); player.Out.SendMessage(caster.Name + "'s castings have perfect poise!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } } } DisableSkill(living); new MasteryofConcentrationEffect().Start(caster); }
/// <summary> /// Action /// </summary> /// <param name="living"></param> public override void Execute(GameLiving living) { if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) { return; } GamePlayer player = living as GamePlayer; if (player == null) { return; } // Check for MoC on the Sorceror: he cannot cast RA5L when the other is up MasteryofConcentrationEffect ra5l = null; lock (player.EffectList) { foreach (object effect in player.EffectList) { if (effect is MasteryofConcentrationEffect) { ra5l = effect as MasteryofConcentrationEffect; break; } } } if (ra5l != null) { player.Out.SendMessage("You cannot currently use this ability", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow); return; } SendCasterSpellEffectAndCastMessage(player, 7048, true); ShieldOfImmunityEffect raEffect = new ShieldOfImmunityEffect(); raEffect.Start(player); DisableSkill(living); }