public void CastSpell(int spellId)
        {
            if (!Player.ExistsIn(World))
            {
                return;
            }

            SpellCastRequestEvent spellCastRequest = SpellCastRequestEvent.Create(Bolt.GlobalTargets.OnlyServer);

            spellCastRequest.SpellId       = spellId;
            spellCastRequest.MovementFlags = (int)Player.MovementInfo.Flags;
            spellCastRequest.Send();
        }
示例#2
0
        public void CastSpell(int spellId)
        {
            if (!Player.ExistsIn(World))
            {
                return;
            }

            if (balance.SpellInfosById.TryGetValue(spellId, out SpellInfo spellInfo) && spellInfo.ExplicitTargetType == SpellExplicitTargetType.Destination)
            {
                spellTargeting.SelectSpellTargetDestination(spellInfo);
            }
            else
            {
                SpellCastRequestEvent spellCastRequest = SpellCastRequestEvent.Create(Bolt.GlobalTargets.OnlyServer);
                spellCastRequest.SpellId       = spellId;
                spellCastRequest.MovementFlags = (int)Player.MovementFlags;
                spellCastRequest.Send();
            }
        }