Пример #1
0
        private static void OnCreateMissileDelay(MissileClient missile, Obj_AI_Base caster, SpellData data)
        {
            var spellArgs = new SpellArgs();

            OnCreateSpell?.Invoke(caster, missile, data, spellArgs);

            if (spellArgs.NoProcess)
            {
                return;
            }

            if (spellArgs.NewData != null)
            {
                data = spellArgs.NewData;
            }

            AddSpell(caster, missile.StartPosition, missile.EndPosition, data, missile);
        }
Пример #2
0
        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy && !Configs.Debug)
            {
                return;
            }

            if (Configs.Debug && sender.IsMe)
            {
                Console.WriteLine(
                    $"{args.SData.Name}: {Utils.GameTimeTickCount - lastCast} | {args.SData.CastRange} | {args.SData.CastRangeDisplayOverride} | {args.SData.LineWidth} | {args.SData.MissileSpeed} | {args.SData.CastRadius} | {args.SData.CastRadiusSecondary}");
                lastCast = Utils.GameTimeTickCount;
            }

            SpellData data;

            if (!Evade.OnProcessSpells.TryGetValue(args.SData.Name, out data) || data.MissileOnly)
            {
                return;
            }

            var spellArgs = new SpellArgs();

            OnProcessSpell?.Invoke(sender, args, data, spellArgs);

            if (spellArgs.NoProcess)
            {
                return;
            }

            if (spellArgs.NewData != null)
            {
                data = spellArgs.NewData;
            }

            AddSpell(sender, sender.ServerPosition, args.End, data);
        }