Exemplo n.º 1
0
        private static void DrawAssign(Spell spell)
        {
            try
            {
                if (spell.SpellType == SpellType.Spell && !Config.Menu.CheckboxValue("sTimer"))
                    return;

                if (spell.SpellType == SpellType.SummonerSpell && !Config.Menu.CheckboxValue("ssTimer"))
                    return;

                if (spell.SpellType == SpellType.Item && !Config.Menu.CheckboxValue("itemTimer"))
                    return;

                if (spell.SpellType == SpellType.Spell && Config.SpellMenu.CheckboxValue(spell.MenuCode + "onlyme") && Player.Instance.BaseSkinName != spell.ChampionName)
                    return;

                if (spell.SpellType == SpellType.Spell && !Config.SpellMenu.CheckboxValue(spell.MenuCode + "draw"))
                    return;

                if (spell.SpellType == SpellType.SummonerSpell && !Config.SummonerMenu.CheckboxValue(spell.MenuCode + "draw"))
                    return;

                if (spell.SpellType == SpellType.Item && !Config.ItemMenu.CheckboxValue(spell.MenuCode + "draw"))
                    return;

                if (spell.SpellType == SpellType.Item && !Config.ItemMenu.CheckboxValue(spell.MenuCode + "ally") && spell.Team == Team.Ally)
                    return;

                if (spell.SpellType == SpellType.Item && !Config.ItemMenu.CheckboxValue(spell.MenuCode + "enemy") && spell.Team == Team.Enemy)
                    return;

                switch (spell.SpellType)
                {
                    case SpellType.Blink:
                        if (Config.Menu.CheckboxValue("blinkTracker"))
                            DrawBlink(spell);
                        return;

                    case SpellType.Trap:
                        if (Config.Menu.CheckboxValue("trapTimer"))
                            DrawTrap(spell);
                        return;

                    case SpellType.Ward:
                        if (Config.Menu.CheckboxValue("wardTimer"))
                            DrawWard(spell);
                        return;

                    case SpellType.SummonerSpell:
                        if (spell.Teleport == true)
                        {
                            DrawTeleport(spell);
                            return;
                        }
                        break;
                }

                if (Line.Contains(spell) || Timer.Contains(spell) || TimerLine.Contains(spell))
                    return;

                switch (spell.GetDrawType())
                {
                    case DrawType.Default:
                        if (spell.GameObject)
                        {
                            TimerLine.Add(spell);
                            return;
                        }
                        if (spell.SkillShot)
                        {
                            TimerLine.Add(spell);
                            return;
                        }
                        Line.Add(spell);
                        return;

                    case DrawType.HPLine:
                        Line.Add(spell);
                        return;

                    case DrawType.Number:
                        Timer.Add(spell);
                        return;

                    case DrawType.NumberLine:
                        TimerLine.Add(spell);
                        return;
                }
            }
            catch (Exception e)
            {
                e.ErrorMessage("DRAW_ASSIGN", spell.Name + " " + spell.DrawType.ToString());
            }
        }
Exemplo n.º 2
0
 public static void DrawSprite(Vector2 pos, Spell spell)
 {
     try
     {
         SpriteList[spell.MenuCode].Draw(pos);
     }
     catch (Exception e)
     {
         e.ErrorMessage("DRAW_SPRITE", spell.MenuCode);
     }
 }
Exemplo n.º 3
0
        private static void DrawTimerLine(Spell spell)
        {
            try
            {
                Vector2 centerpos = Drawing.WorldToScreen(spell.GameObject ? spell.Object.Position : spell.SkillShot ? spell.CastPosition : spell.Target.Position) + new Vector2(0, 25);

                float remain = spell.GetRemainTime();
                float full = spell.GetFullTime();
                bool dynamic = full >= 3000 ? true : false;

                float length = dynamic ? remain / full * 70f : remain / full * 55f;

                if (spell.GetFullTime() >= 3500 && full - remain <= 500)
                {
                    float length2 = (full - remain) / 500f * length;
                    length = length2;
                }

                string text = spell.GetRemainTimeString();
                Vector2 textpos = centerpos + new Vector2(-15, -13);
                SharpDX.Color color = spell.GetColor();
                SpellFont.DrawText(null, text, (int)textpos.X, (int)textpos.Y, color);

                Color barColor = spell.Team == Team.Ally ? Color.LawnGreen : spell.Team == Team.Enemy ? Color.Red : Color.Orange;

                Vector2 linepos = centerpos + new Vector2(0, 15);
                Vector2 linestart = linepos - new Vector2(length, 0);
                Vector2 lineend = linepos + new Vector2(length, 0);

                Drawing.DrawLine(linestart - new Vector2(1, 0), lineend + new Vector2(1, 0), 6, Color.Black);
                Drawing.DrawLine(linestart, lineend, 4, barColor);
            }
            catch (Exception e)
            {
                e.ErrorMessage("DRAW_TIMER_LINE", spell.Caster.BaseSkinName + " " + spell.Name);
            }
        }
Exemplo n.º 4
0
        private static void DrawWard(Spell spell)
        {
            try
            {
                if (!Config.WardMenu.CheckboxValue(spell.MenuCode + "draw"))
                    return;

                if (!Config.WardMenu.CheckboxValue(spell.MenuCode + "ally") && spell.Team == Team.Ally)
                    return;

                if (!Config.WardMenu.CheckboxValue(spell.MenuCode + "enemy") && spell.Team == Team.Enemy)
                    return;

                if (spell.FullTime != 77777777)
                {
                    string text = (spell.GetRemainTime() / 1000).ClockStyle();
                    Vector2 position = Drawing.WorldToScreen(spell.Object.Position) + new Vector2(-12, 0);
                    SharpDX.Color color = spell.GetColor();

                    WardFont.DrawText(null, text, (int)position.X, (int)position.Y, color);
                }

                if (Config.WardMenu.CheckboxValue(spell.MenuCode + "drawCircle") && DrawWardFix == false)
                {
                    Circle.Draw(spell.GetColor(), 50, 4, spell.Object.Position);
                }
            }
            catch (Exception e)
            {
                /*Console.WriteLine(e);
                Chat.Print("<font color='#FF0000'>ERROR:</font> CODE DRAW_WARD " + spell.Caster.BaseSkinName + " " + spell.Name, Color.SpringGreen);
                if (DrawWardFix == false)
                {
                    Chat.Print("Temporarily Fix Ward Timer", Color.Gold);
                    DrawWardFix = true;
                }
                else
                {
                    Chat.Print("Fixing failed, Disable Ward Timer, Please report bugs with CODE", Color.Gold);
                    Config.Menu["wardTimer"].Cast<CheckBox>().CurrentValue = false;
                }*/
                e.ErrorMessage("DRAW_WARD " + spell.Caster.BaseSkinName + " " + spell.Name);
            }
        }
Exemplo n.º 5
0
 private static void DrawTeleport(Spell spell)
 {
     try
     {
         Vector2 centerpos = Drawing.WorldToScreen(spell.Object.Position) + new Vector2(0, 25);
         string text = spell.ChampionName;
         Vector2 textpos = centerpos + new Vector2(-35, 18);
         SharpDX.Color color = SharpDX.Color.Orange;
         SpellFont.DrawText(null, text, (int)textpos.X, (int)textpos.Y, color);
         DrawTimerLine(spell);
     }
     catch (Exception e)
     {
         e.ErrorMessage("DRAW_TELEPORT" + spell.Caster.BaseSkinName + " " + spell.Name);
     }
 }
Exemplo n.º 6
0
        private static void DrawTimer(Spell spell)
        {
            try
            {
                string text = spell.GetRemainTimeString();
                Vector2 position;
                if (spell.GameObject)
                    position = Drawing.WorldToScreen(spell.Object.Position);
                else if (spell.SkillShot)
                    position = Drawing.WorldToScreen(spell.CastPosition);
                else
                    position = Drawing.WorldToScreen(spell.Target.Position);
                position += new Vector2(-15, 0);
                SharpDX.Color color = spell.GetColor();

                SpellFont.DrawText(null, text, (int)position.X, (int)position.Y, color);
            }
            catch (Exception e)
            {
                e.ErrorMessage("DRAW_TIMER", spell.Caster.BaseSkinName + " " + spell.Name);
            }
        }
Exemplo n.º 7
0
        private static void DrawLine(Spell spell)
        {
            try
            {
                Obj_AI_Base hero = spell.Caster;

                if (!hero.VisibleOnScreen || !hero.IsHPBarRendered || !hero.IsHero())
                    return;

                float length = spell.GetRemainTime() / spell.GetFullTime() * 100f;

                Vector2 mainpos = hero.HPBarPosition;
                Vector2 startpos = hero.IsMe ? mainpos + new Vector2(26, 25) : mainpos + new Vector2(1, 30);
                Vector2 endpos = startpos + new Vector2(length, 0);
                Vector2 endpos2 = endpos + new Vector2(0, 6);
                Vector2 textpos = endpos2 + new Vector2(10, 3);
                Vector2 spritepos = textpos + new Vector2(-18, 0);

                Color lineColor = spell.GetColor().ConvertColor();
                SharpDX.Color textColor = spell.GetColor();

                Drawing.DrawLine(startpos, endpos, 1f, lineColor);
                Drawing.DrawLine(endpos, endpos2, 1f, lineColor);

                LineFont.DrawText(null, spell.GetRemainTimeString(), (int)textpos.X, (int)textpos.Y, textColor);
                TextureDraw.DrawSprite(spritepos, spell);
            }
            catch (Exception e)
            {
                e.ErrorMessage("DRAW_LINE" + spell.Caster.BaseSkinName + " " + spell.Name);
            }
        }
Exemplo n.º 8
0
        private static void DrawBlink(Spell spell)
        {
            try
            {
                if (!Config.MiscMenu.CheckboxValue("blinkAlly") && spell.Team == Team.Ally)
                    return;

                if (!Config.MiscMenu.CheckboxValue("blinkEnemy") && spell.Team == Team.Enemy)
                    return;

                Vector3 startpos = spell.StartPosition;
                Vector3 endpos = spell.KappaRoss();

                Drawing.DrawLine(Drawing.WorldToScreen(startpos), Drawing.WorldToScreen(endpos), 2, spell.Color.ConvertColor());
                Drawing.DrawText(Drawing.WorldToScreen(endpos) + new Vector2(-20, 15), Color.White, spell.Caster.BaseSkinName, 10);
                if (DrawBlinkFix == false)
                    ;Circle.Draw(spell.GetColor(), 30f, endpos);
            }
            catch (Exception e)
            {
                /*Console.WriteLine(e);
                Chat.Print("<font color='#FF0000'>ERROR:</font> CODE DRAW_BLINK " + spell.Caster.BaseSkinName, Color.SpringGreen);
                if (DrawBlinkFix == false)
                {
                    Chat.Print("Temporarily Fix Blink Tracker", Color.Gold);
                    DrawBlinkFix = true;
                }
                else
                {
                    Chat.Print("Fixing failed, Disable Blink Tracker, Please report bugs with CODE", Color.Gold);
                    Config.Menu["blinkTracker"].Cast<CheckBox>().CurrentValue = false;
                }*/
                e.ErrorMessage("DRAW_BLINK " + spell.Caster.BaseSkinName + " " + spell.Name);
            }
        }
Exemplo n.º 9
0
        private static void DrawTrap(Spell spell)
        {
            try
            {
                if (!Config.TrapMenu.CheckboxValue(spell.MenuCode + "draw"))
                    return;

                if (!Config.TrapMenu.CheckboxValue(spell.MenuCode + "ally") && spell.Team == Team.Ally)
                    return;

                if (!Config.TrapMenu.CheckboxValue(spell.MenuCode + "enemy") && spell.Team == Team.Enemy)
                    return;

                string text = (spell.GetRemainTime() / 1000).ClockStyle();
                Vector2 position = Drawing.WorldToScreen(spell.Object.Position) + new Vector2(-15, 0);
                SharpDX.Color color = spell.GetColor();

                TrapFont.DrawText(null, text, (int)position.X, (int)position.Y, color);

                if (Config.TrapMenu.CheckboxValue(spell.MenuCode + "drawCircle") && DrawTrapFix == false)
                {
                    if (spell.Team == Team.Ally && Config.TrapMenu.CheckboxValue("circleOnlyEnemy"))
                        return;

                    // Kappa Circle.Draw(spell.GetColor(), spell.Object.BoundingRadius, 4, spell.Object.Position);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                Chat.Print("<font color='#FF0000'>ERROR:</font> CODE DRAW_TRAP " + spell.Caster.BaseSkinName + " " + spell.Name, Color.SpringGreen);
                if (DrawTrapFix == false)
                {
                    Chat.Print("Temporarily Fix Trap Timer", Color.Gold);
                    DrawTrapFix = true;
                }
                else
                {
                    Chat.Print("Fixing failed, Disable Trap Timer, Please report bugs with CODE", Color.Gold);
                    Config.Menu["trapTimer"].Cast<CheckBox>().CurrentValue = false;
                }
            }
        }
Exemplo n.º 10
0
        public static Obj_AI_Base FindCasterWard(this GameObject sender, Spell database)
        {
            try
            {
                WardCaster caster;
                switch (database.ObjectName)
                {
                    case "YellowTrinket":
                        caster = Program.WardCasterList.FirstOrDefault(d => d.Name == "TrinketTotemLvl1");

                        if (caster != null)
                            return caster.Caster;
                        break;
                    case "SightWard":
                        caster = Program.WardCasterList.FirstOrDefault(d => d.Name == "ItemGhostWard");

                        if (caster != null)
                            return caster.Caster;
                        break;
                    case "BlueTrinket":
                        caster = Program.WardCasterList.FirstOrDefault(d => d.Name == "TrinketOrbLvl3");

                        if (caster != null)
                            return caster.Caster;
                        break;
                    case "VisionWard":
                        caster = Program.WardCasterList.FirstOrDefault(d => d.Name == "VisionWard");

                        if (caster != null)
                            return caster.Caster;
                        break;
                }

                if (sender.Team.IsAlly())
                {
                    var hero = EntityManager.Heroes.Allies.OrderBy(d => d.Distance(sender.Position)).First();

                    if (hero != null)
                        return hero;
                }

                if (sender.Team.IsEnemy())
                {
                    var hero = EntityManager.Heroes.Enemies.OrderBy(d => d.Distance(sender.Position)).First();

                    if (hero != null)
                        return hero;
                }

                return Player.Instance;
            }
            catch (Exception e)
            {
                e.ErrorMessage("FIND_CASTER_WARD", sender.Name);
                return Player.Instance;
            }
        }
Exemplo n.º 11
0
        public static Obj_AI_Base FIndCaster(this GameObject sender, Spell database)
        {
            try
            {
                Obj_AI_Base result;

                if (database.SpellType == SpellType.Item)
                {
                    result = EntityManager.Heroes.AllHeroes.OrderBy(d => d.Position.Distance(sender.Position)).FirstOrDefault();
                    if (result != null)
                    {
                        return result;
                    }
                }

                if (database.SpellType == SpellType.SummonerSpell)
                {
                    var caster = Program.CasterList.FirstOrDefault(c => c.SpellType == SpellType.SummonerSpell);
                    if (caster != null)
                    {
                        result = caster.Caster;
                        Program.CasterList.Remove(caster);
                        return caster.Caster;
                    }
                }

                if (database.GameObject == true)
                {
                    var heroList = EntityManager.Heroes.AllHeroes.Where(h => h.BaseSkinName == database.ChampionName).ToList();

                    if (heroList.Count == 1)
                    {
                        result = heroList.First();
                        Program.CasterList.Remove(Program.CasterList.FirstOrDefault(d => d.Caster.BaseSkinName == database.ChampionName && d.Slot == database.Slot));
                        return result;
                    }

                    var caster = Program.CasterList.FirstOrDefault(c => c.Caster.BaseSkinName == database.ChampionName && c.Slot == database.Slot);

                    if (caster != null)
                    {
                        result = caster.Caster;
                        Program.CasterList.Remove(caster);
                        return caster.Caster;
                    }
                }
                result = EntityManager.Heroes.AllHeroes.Where(d => d.BaseSkinName == database.ChampionName).OrderBy(d => d.Distance(sender.Position)).FirstOrDefault();
                if (result != null)
                {
                    return result;
                }

                return Player.Instance;
            }
            catch (Exception e)
            {
                e.ErrorMessage("FIND_CASTER", database.Name);
                return Player.Instance;
            }
        }