public static void AddRTracker(EloBuddy.Champion hero, string rObjectName, int timeToWait)
 {
     if (EntityManager.Heroes.Enemies.Any(h => h.Hero == hero))
     {
         GameObject rObject     = null;
         var        rObjectTime = 0;
         var        allyCastedR = false;
         Game.OnTick += delegate
         {
             if (SpellSlot.E.IsReady())
             {
                 if (rObject != null)
                 {
                     if (rObjectTime > 0 && Core.GameTickCount - rObjectTime >= timeToWait &&
                         Core.GameTickCount - rObjectTime <= 4000)
                     {
                         if (MenuManager.GetSubMenu("Automatic").CheckBox("E.Spells") || Combo.IsActive)
                         {
                             SpellManager.E.Cast(rObject.Position);
                         }
                     }
                 }
             }
         };
         Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
         {
             var senderHero = sender as AIHeroClient;
             if (senderHero != null && senderHero.IsAlly && senderHero.Hero == hero)
             {
                 if (args.Slot == SpellSlot.R)
                 {
                     allyCastedR = true;
                     Core.DelayAction(delegate { allyCastedR = false; }, 10000);
                 }
             }
         };
         GameObject.OnCreate += delegate(GameObject sender, EventArgs args)
         {
             if (sender.Name.Equals(rObjectName) && !allyCastedR)
             {
                 rObject     = sender;
                 rObjectTime = Core.GameTickCount;
                 Core.DelayAction(delegate
                 {
                     rObject     = null;
                     rObjectTime = 0;
                 }, 5200);
             }
         };
         GameObject.OnDelete += delegate(GameObject sender, EventArgs args)
         {
             if (rObject != null && rObject.IdEquals(sender))
             {
                 //rObject = null;
                 //rObjectTime = 0;
             }
         };
     }
 }
Пример #2
0
        private static Logic.Champion GetChampionLogic(Champion champion)
        {
            switch (champion)
            {
            case Champion.DrMundo:
                return(new DrMundo());

            case Champion.Shen:
                return(new Shen());
            }
            return(null);
        }