コード例 #1
0
ファイル: Program.cs プロジェクト: wade1990/PortAIO
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            //Draw the ranges of the spells.
            var menuItem = Config.Item("QERange").GetValue <Circle>();

            if (menuItem.Active)
            {
                Render.Circle.DrawCircle(Player.Position, Eq.Range, menuItem.Color);
            }

            foreach (var spell in SpellList)
            {
                menuItem = Config.Item(spell.Slot + "Range").GetValue <Circle>();
                if (menuItem.Active)
                {
                    Render.Circle.DrawCircle(Player.Position, spell.Range, menuItem.Color);
                }
            }

            if (OrbManager.WObject(false) != null)
            {
                Render.Circle.DrawCircle(OrbManager.WObject(false).Position, 100, System.Drawing.Color.White);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: wade1990/PortAIO
 private static Vector3 GetGrabableObjectPos(bool onlyOrbs)
 {
     if (!onlyOrbs)
     {
         foreach (var minion in ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget(W.Range)))
         {
             return(minion.ServerPosition);
         }
     }
     return(OrbManager.GetOrbToGrab((int)W.Range));
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: wade1990/PortAIO
 private static void UseE(Obj_AI_Base enemy)
 {
     foreach (var orb in OrbManager.GetOrbs(true))
     {
         if (Player.Distance(orb) < E.Range + 100)
         {
             var startPoint = orb.To2D().Extend(Player.ServerPosition.To2D(), 100);
             var endPoint   = Player.ServerPosition.To2D()
                              .Extend(orb.To2D(), Player.Distance(orb) > 200 ? 1300 : 1000);
             Eq.Delay = E.Delay + Player.Distance(orb) / E.Speed;
             Eq.From  = orb;
             var enemyPred = Eq.GetPrediction(enemy);
             if (enemyPred.Hitchance >= HitChance.High &&
                 enemyPred.UnitPosition.To2D().Distance(startPoint, endPoint, false)
                 < Eq.Width + enemy.BoundingRadius)
             {
                 E.Cast(orb, true);
                 W.LastCastAttemptT = Utils.TickCount;
                 return;
             }
         }
     }
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: wade1990/PortAIO
        private static void UseSpells(bool useQ, bool useW, bool useE, bool useR, bool useQe,
                                      bool useIgnite, bool isHarass)
        {
            var qTarget     = TargetSelector.GetTarget(Q.Range + (isHarass ? Q.Width / 3 : Q.Width), TargetSelector.DamageType.Magical);
            var wTarget     = TargetSelector.GetTarget(W.Range + W.Width, TargetSelector.DamageType.Magical);
            var rTarget     = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);
            var qeTarget    = TargetSelector.GetTarget(Eq.Range, TargetSelector.DamageType.Magical);
            var comboDamage = rTarget != null?GetComboDamage(rTarget) : 0;

            //Q
            if (qTarget != null && useQ)
            {
                Q.Cast(qTarget, false, true);
            }

            //E
            if (Utils.TickCount - W.LastCastAttemptT > Game.Ping + 150 && E.IsReady() && useE)
            {
                foreach (var enemy in HeroManager.Enemies)
                {
                    if (enemy.IsValidTarget(Eq.Range))
                    {
                        UseE(enemy);
                    }
                }
            }


            //W
            if (useW)
            {
                if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).ToggleState == 1 && W.IsReady() && qeTarget != null)
                {
                    var gObjectPos = GetGrabableObjectPos(wTarget == null);

                    if (gObjectPos.To2D().IsValid() && Utils.TickCount - W.LastCastAttemptT > Game.Ping + 300 &&
                        Utils.TickCount - E.LastCastAttemptT > Game.Ping + 600)
                    {
                        W.Cast(gObjectPos);
                        W.LastCastAttemptT = Utils.TickCount;
                    }
                }
                else if (wTarget != null && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).ToggleState != 1 && W.IsReady() &&
                         Utils.TickCount - W.LastCastAttemptT > Game.Ping + 100)
                {
                    if (OrbManager.WObject(false) != null)
                    {
                        W.From = OrbManager.WObject(false).ServerPosition;
                        W.Cast(wTarget, false, true);
                    }
                }
            }


            if (rTarget != null && useR)
            {
                useR = (Config.Item("DontUlt" + rTarget.BaseSkinName) != null &&
                        Config.Item("DontUlt" + rTarget.BaseSkinName).GetValue <bool>() == false);
            }


            if (rTarget != null && useR && R.IsReady() && comboDamage > rTarget.Health && !rTarget.IsZombie && !Q.IsReady())
            {
                R.Cast(rTarget);
            }

            //Ignite
            if (rTarget != null && useIgnite && IgniteSlot != SpellSlot.Unknown &&
                ObjectManager.Player.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready)
            {
                if (comboDamage > rTarget.Health)
                {
                    ObjectManager.Player.Spellbook.CastSpell(IgniteSlot, rTarget);
                }
            }

            //QE
            if (wTarget == null && qeTarget != null && Q.IsReady() && E.IsReady() && useQe)
            {
                UseQe(qeTarget);
            }

            //WE
            if (wTarget == null && qeTarget != null && E.IsReady() && useE && OrbManager.WObject(true) != null)
            {
                Eq.Delay = E.Delay + Q.Range / W.Speed;
                Eq.From  = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                var prediction = Eq.GetPrediction(qeTarget);
                if (prediction.Hitchance >= HitChance.High)
                {
                    W.Cast(Player.ServerPosition.To2D().Extend(prediction.CastPosition.To2D(), Q.Range - 100));
                    weComboT = Utils.TickCount;
                }
            }
        }