Пример #1
0
 private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (!sender.IsMe)
     {
         return;
     }
     if (args.Target.IsValid <AttackableUnit>() && args.SData.IsAutoAttack())
     {
         _lastAttack = Utils.GameTimeTickCount - Game.Ping / 2;
         _lastMove   = (int)(Utils.GameTimeTickCount + Player.AttackCastDelay * 1000 - Game.Ping / 2f);
         var target = (AttackableUnit)args.Target;
         if (!_lastTarget.IsValidTarget() || target.NetworkId != _lastTarget.NetworkId)
         {
             FireOnTargetSwitch(target);
             _lastTarget = target;
         }
         if (sender.IsMelee)
         {
             Utility.DelayAction.Add((int)(sender.AttackCastDelay * 1000 + 40), () => FireAfterAttack(target));
         }
         FireOnAttack(target);
     }
     if (Orbwalking.IsAutoAttackReset(args.SData.Name))
     {
         ResetAutoAttack();
     }
 }
Пример #2
0
 private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (!sender.IsMe)
     {
         return;
     }
     if (Orbwalking.IsAutoAttackReset(args.SData.Name))
     {
         Utility.DelayAction.Add(250, ResetAutoAttack);
     }
     if (!args.SData.IsAutoAttack())
     {
         return;
     }
     if (args.Target is Obj_AI_Base || args.Target is Obj_BarracksDampener || args.Target is Obj_HQ)
     {
         _lastAttack      = Utils.GameTimeTickCount - Game.Ping / 2;
         _missileLaunched = false;
         if (args.Target.IsValid <Obj_AI_Base>())
         {
             var target = (AttackableUnit)args.Target;
             FireOnTargetSwitch(target);
             _lastTarget = target;
             Utility.DelayAction.Add(
                 (int)(sender.AttackCastDelay * 1000 + 40), () => FireAfterAttack(_lastTarget));
         }
     }
     FireOnAttack(_lastTarget);
 }
Пример #3
0
 private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (!sender.IsMe)
     {
         return;
     }
     if (Orbwalking.IsAutoAttackReset(args.SData.Name))
     {
         Utility.DelayAction.Add(250, ResetAutoAttack);
     }
     if (!args.SData.IsAutoAttack() || args.SData.Name.ToLower() == "lucianpassiveattack")
     {
         return;
     }
     if (args.Target is AttackableUnit)
     {
         LastAttack = Environment.TickCount - Game.Ping / 2;
         var Target = (AttackableUnit)args.Target;
         if (Target.IsValid)
         {
             FireOnTargetSwitch(Target);
             LastTarget = Target;
         }
         if (sender.IsMelee())
         {
             Utility.DelayAction.Add((int)(sender.AttackCastDelay * 1000 + 40), () => FireAfterAttack(LastTarget));
         }
         FireOnAttack(LastTarget);
     }
 }
Пример #4
0
 private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (!sender.IsMe)
     {
         return;
     }
     if (args.SData.IsAutoAttack())
     {
         LastAutoAttack = 0;
     }
     if (Orbwalking.IsAutoAttackReset(args.SData.Name))
     {
         LastAutoAttack = 0;
     }
 }