Пример #1
0
        private static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args)
        {
            var caster = sender as AIHeroClient;

            if (caster == null)
            {
                return;
            }

            var tpargs = new TrackedTeleport(caster, args);

            tpargs.Duration  = args.Status == TeleportStatus.Finish || args.Status == TeleportStatus.Abort ? 2000 : args.Duration;
            tpargs.StartTick = Core.GameTickCount;
            if (args.Type == TeleportType.Recall)
            {
                tpargs.EndPosition = caster.GetSpawnPoint().Position;
            }
            if (TrackedTeleports.ContainsKey(caster.NetworkId))
            {
                TrackedTeleports[caster.NetworkId] = tpargs;
                Invoke(tpargs);
                return;
            }

            TrackedTeleports.Add(caster.NetworkId, tpargs);
            Invoke(tpargs);
        }
Пример #2
0
        internal static void Invoke(TrackedTeleport args)
        {
            var invocationList = OnTrack?.GetInvocationList();

            if (invocationList != null)
            {
                foreach (var m in invocationList)
                {
                    m?.DynamicInvoke(args);
                }
            }
        }
Пример #3
0
        internal static bool InvokeFinish(TrackedTeleport args)
        {
            var invocationList = OnFinish?.GetInvocationList();

            if (invocationList != null)
            {
                foreach (var m in invocationList)
                {
                    m?.DynamicInvoke(args);
                }
            }

            return(true);
        }