Ejemplo n.º 1
0
        public static bool SetCurrentMove(Mobile m, SpecialMove move)
        {
            if (!Core.SE)
            {
                ClearCurrentMove(m);
                return(false);
            }

            if (move != null && !move.Validate(m))
            {
                ClearCurrentMove(m);
                return(false);
            }

            bool sameMove = (move == GetCurrentMove(m));

            ClearCurrentMove(m);

            if (sameMove)
            {
                return(true);
            }

            if (move != null)
            {
                WeaponAbility.ClearCurrentAbility(m);

                m_Table[m] = move;

                move.OnUse(m);

                int moveID = SpellRegistry.GetRegistryNumber(move);

                if (moveID > 0)
                {
                    m.Send(new ToggleSpecialAbility(moveID + 1, true));
                }

                TextDefinition.SendMessageTo(m, move.AbilityMessage);
            }

            return(true);
        }