Beispiel #1
0
        static void DrawHPBarDamage()
        {
            const int XOffset = 10;
            const int YOffset = 20;
            const int Width   = 103;
            const int Height  = 8;

            foreach (var unit in ObjectManager.Get <Obj_AI_Hero>().Where(h => h.IsValid && h.IsHPBarRendered && h.IsEnemy))
            {
                var   barPos = unit.HPBarPosition;
                float damage = SpellDamage.getComboDamage(unit);
                float percentHealthAfterDamage = Math.Max(0, unit.Health - damage) / unit.MaxHealth;
                float yPos          = barPos.Y + YOffset;
                float xPosDamage    = barPos.X + XOffset + Width * percentHealthAfterDamage;
                float xPosCurrentHp = barPos.X + XOffset + Width * unit.Health / unit.MaxHealth;

                if (damage > unit.Health)
                {
                    text.X    = (int)barPos.X + XOffset;
                    text.Y    = (int)barPos.Y + YOffset - 13;
                    text.text = ((int)(unit.Health - damage)).ToString();
                    text.OnEndScene();
                }
                Drawing.DrawLine(xPosDamage, yPos, xPosDamage, yPos + Height, 2, System.Drawing.Color.Yellow);
            }
        }
Beispiel #2
0
        public static void performCombo()
        {
            //Gets best target in Q range
            Obj_AI_Hero target = TargetSelector.GetTarget(Program.q.Range, TargetSelector.DamageType.Magical);

            //Ignite handler
            if (Program.menuController.getMenu().Item("useIgnite").GetValue<bool>())
            {
                if (SpellDamage.getComboDamage(target) > target.Health && target.Distance(Program.player.Position) < 500)
                {
                    Program.player.Spellbook.CastSpell(Program.ignite);
                }
            }
            //Ulti handler in combo
            if (Program.menuController.getMenu().Item("comboUseR").GetValue<bool>())
            {
                List<Obj_AI_Hero> targets;
                /* if (Program.menuController.getMenu().Item("faceOnlyR").GetValue<bool>())
                 {
                     //Gets all facing enemies who can get hit by R
                     targets = HeroManager.Enemies.Where(o => Program.r.WillHit(o, target.Position) && o.IsFacing(Program.player)).ToList<Obj_AI_Hero>();
                 }
                 else
                 {*/
                //Gets all enemies who can get hit by R
                targets = HeroManager.Enemies.Where(o => Program.r.WillHit(o, target.Position) && o.Distance(Program.player.Position) < 500).ToList<Obj_AI_Hero>();

                // }
                if (targets.Count >= Program.menuController.getMenu().Item("minEnemies").GetValue<Slider>().Value)
                {
                    Program.r.Cast(target.Position);
                }
            }
            //Casts Q if selected in menu
            if (Program.menuController.getMenu().Item("comboUseQ").GetValue<bool>())
            {
                if (target != null)
                {
                    Program.q.CastIfHitchanceEquals(target, HitChance.High);
                }
            }
            //Casts E if selected in menu and in E range and target is poisoned
            if (Program.menuController.getMenu().Item("comboUseE").GetValue<bool>())
            {
                if (target != null && target.Distance(Program.player.Position) < Program.e.Range && (Environment.TickCount - lastECast) > Program.menuController.getMenu().Item("eDelay").GetValue<Slider>().Value)
                {
                    if (target.HasBuffOfType(BuffType.Poison))
                    {
                        Program.e.CastOnUnit(target);
                        lastECast = Environment.TickCount;

                    }
                }
            }
            //Casts W if selected in menu
            if (Program.menuController.getMenu().Item("comboUseW").GetValue<bool>())
            {
                if (target != null)
                {
                    Program.w.CastIfHitchanceEquals(target, HitChance.High);
                }
            }
        }