Esempio n. 1
0
        private static void Obj_AI_Base_OnDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs Args)
        {
            //if (sender.IsMe)
            //{
            //	if (args.SData.Name == "JhinRShotMis")
            //	{

            //		RCharge.Index++;
            //		RCharge.CastT = Game.ClockTime;
            //	}
            //	if (args.SData.Name == "JhinRShotMis4")
            //	{

            //		RCharge.Index = 0;
            //		RCharge.CastT = Game.ClockTime;
            //		RCharge.Target = null;
            //	}
            //}

            if (sender.IsMe && !Orbwalking.IsAutoAttack(Args.SData.Name) && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                if (Args.Target is Obj_AI_Hero && Config.Item("ComboW").GetValue <bool>() && W.IsReady())
                {
                    var target = (Obj_AI_Hero)Args.Target;

                    if (!target.IsDead && !target.IsZombie && target.IsValidTarget(W.Range) && target.IsHPBarRendered)
                    {
                        if (target.HasWBuff() && Config.Item("标记W").GetValue <bool>())
                        {
                            W.CastSpell(target);
                            return;
                        }
                        else
                        {
                            var WPred = W.GetPrediction(target);

                            if (WPred.Hitchance >= HitChance.VeryHigh)
                            {
                                W.Cast(WPred.UnitPosition, true);
                                return;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsValidTarget(3000, false) || sender.Team != ObjectManager.Player.Team || sender is Obj_AI_Hero ||
                !Orbwalking.IsAutoAttack(args.SData.Name) || !(args.Target is Obj_AI_Base))
            {
                return;
            }

            var target = (Obj_AI_Base)args.Target;

            ActiveAttacks.Remove(sender.NetworkId);

            var attackData = new PredictedDamage(
                sender, target, Environment.TickCount - Game.Ping / 2, sender.AttackCastDelay * 1000,
                sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0),
                sender.IsMelee() ? int.MaxValue : (int)args.SData.MissileSpeed,
                (float)sender.GetAutoAttackDamage(target, true));

            ActiveAttacks.Add(sender.NetworkId, attackData);
        }
Esempio n. 3
0
 public static bool IsAutoAttack(this SpellDataInst spellData)
 {
     return(Orbwalking.IsAutoAttack(spellData.Name));
 }