Example #1
0
 public static void InvokeTargetedSpellCast(TargetedSpellEventArgs e)
 {
     if (TargetedSpellCast != null)
     {
         TargetedSpellCast(e);
     }
 }
Example #2
0
        private static void Targeted_Spell(TargetedSpellEventArgs e)
        {
            Mobile from = e.NetState.Mobile;

            if (!Multis.DesignContext.Check(from))
                return; // They are customizing

            int spellID = e.SpellID;

            SpecialMove move = SpellRegistry.GetSpecialMove(spellID);

            if (move != null)
                SpecialMove.SetCurrentMove(from, move);
            else
            {
                Spell spell = SpellRegistry.NewSpell(spellID, from, null);
                if (spell != null)
                {
                    try
                    {
                        from.TargetLocked = true;
                        Mobile targeted = World.FindMobile(e.Target.Serial);
                        spell.DefineTargetForeignSpell(targeted);
                        spell.Cast();
                    }
                    catch { Console.WriteLine("Erro target Spell."); }
                    finally { from.TargetLocked = false; }
                }
                else
                    from.SendLocalizedMessage(502345); // This spell has been temporarily disabled. 
            }
        }
 public static void InvokeTargetedSpellCast(TargetedSpellEventArgs e)
 {
     if (TargetedSpellCast != null)
         TargetedSpellCast(e);
 }