예제 #1
0
        private void DrawEvadeStatus()
        {
            if (ObjectCache.menuCache.cache["ShowStatus"].Cast <CheckBox>().CurrentValue)
            {
                var heroPos   = Drawing.WorldToScreen(ObjectManager.Player.Position);
                var dimension = Drawing.GetTextEntent("Evade: ON", 12);

                if (ObjectCache.menuCache.cache["DodgeSkillShots"].Cast <KeyBind>().CurrentValue)
                {
                    if (Evade.isDodging)
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Red, "Evade: ON");
                    }
                    else
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y,
                                         Evade.isDodgeDangerousEnabled() ? Color.Yellow : Color.White, "Evade: ON");
                    }
                }
                else
                {
                    if (ObjectCache.menuCache.cache["ActivateEvadeSpells"].Cast <KeyBind>().CurrentValue)
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Purple, "Evade: Spell");
                    }
                    else
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Gray, "Evade: OFF");
                    }
                }
            }
        }
예제 #2
0
        private static int CreateSpell(Spell newSpell)
        {
            int spellID = spellIDCount++;

            newSpell.spellID = spellID;

            drawSpells.Add(spellID, newSpell);

            if (!(Evade.isDodgeDangerousEnabled() && EvadeHelper.GetSpellDangerLevel(newSpell) < 3) &&
                Evade.menu.SubMenu("Spells").SubMenu(newSpell.info.charName + newSpell.info.spellName + "Settings")
                .Item(newSpell.info.spellName + "DodgeSpell").GetValue <bool>())
            {
                if (newSpell.info.spellType == SpellType.Circular &&
                    Evade.menu.SubMenu("Main").Item("DodgeCircularSpells").GetValue <bool>() == false)
                {
                    return(spellID);
                }

                spells.Add(spellID, newSpell);
                if (OnCreateSpell != null)
                {
                    OnCreateSpell(newSpell);
                }
            }

            return(spellID);
        }
        private static void AddDetectedSpells()
        {
            bool spellAdded = false;

            foreach (KeyValuePair <int, Spell> entry in detectedSpells)
            {
                Spell spell = entry.Value;

                float evadeTime, spellHitTime;
                spell.CanHeroEvade(myHero, out evadeTime, out spellHitTime);

                spell.spellHitTime = spellHitTime;
                spell.evadeTime    = evadeTime;

                if (spell.spellHitTime - spell.evadeTime < 1500 && CanHeroWalkIntoSpell(spell))
                {
                    Spell newSpell = spell;
                    int   spellID  = spell.spellID;

                    if (!drawSpells.ContainsKey(spell.spellID))
                    {
                        drawSpells.Add(spellID, newSpell);
                    }

                    if (!spells.ContainsKey(spell.spellID))
                    {
                        if (!(Evade.isDodgeDangerousEnabled() && newSpell.GetSpellDangerLevel() < 3) &&
                            Evade.menu.SubMenu("Spells").SubMenu(newSpell.info.charName + newSpell.info.spellName + "Settings")
                            .Item(newSpell.info.spellName + "DodgeSpell").GetValue <bool>())
                        {
                            if (newSpell.info.spellType == SpellType.Circular &&
                                Evade.menu.SubMenu("Main").Item("DodgeCircularSpells").GetValue <bool>() == false)
                            {
                                //return spellID;
                                continue;
                            }

                            spells.Add(spellID, newSpell);

                            spellAdded = true;
                        }
                    }
                }
            }

            if (spellAdded && OnProcessDetectedSpells != null)
            {
                OnProcessDetectedSpells();
            }
        }
예제 #4
0
        private void DrawEvadeStatus()
        {
            if (ObjectCache.menuCache.cache["ShowStatus"].GetValue <bool>())
            {
                var heroPos   = Drawing.WorldToScreen(ObjectManager.Player.Position);
                var dimension = Drawing.GetTextEntent("Evade: ON", 0);

                if (ObjectCache.menuCache.cache["DodgeSkillShots"].GetValue <KeyBind>().Active)
                {
                    if (Evade.isDodging)
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Red, "Evade: ON");
                    }
                    else
                    {
                        if (ObjectCache.menuCache.cache["DodgeOnlyOnComboKeyEnabled"].GetValue <bool>() == true &&
                            ObjectCache.menuCache.cache["DodgeComboKey"].GetValue <KeyBind>().Active == false)
                        {
                            Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Gray, "Evade: OFF");
                        }
                        else
                        {
                            if (Evade.isDodgeDangerousEnabled())
                            {
                                Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Yellow, "Evade: ON");
                            }
                            else
                            {
                                Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.White, "Evade: ON");
                            }
                        }
                    }
                }
                else
                {
                    if (ObjectCache.menuCache.cache["ActivateEvadeSpells"].GetValue <KeyBind>().Active)
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Purple, "Evade: Spell");
                    }
                    else
                    {
                        Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Gray, "Evade: OFF");
                    }
                }
            }
        }
예제 #5
0
        private void DrawEvadeStatus()
        {
            if (menu.SubMenu("Draw").Item("ShowStatus").GetValue <bool>())
            {
                var heroPos   = Drawing.WorldToScreen(ObjectManager.Player.Position);
                var dimension = Drawing.GetTextExtent("Evade: ON");

                if (menu.SubMenu("Main").Item("DodgeSkillShots").GetValue <KeyBind>().Active &&
                    Evade.isDodgeDangerousEnabled())
                {
                    Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Red, "Evade: ON");
                }
                else if (menu.SubMenu("Main").Item("DodgeSkillShots").GetValue <KeyBind>().Active)
                {
                    Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.White, "Evade: ON");
                }
            }
        }
예제 #6
0
        private static void AddDetectedSpells()
        {
            bool spellAdded = false;

            foreach (KeyValuePair <int, Spell> entry in detectedSpells)
            {
                Spell spell = entry.Value;

                float evadeTime, spellHitTime;
                spell.CanHeroEvade(myHero, out evadeTime, out spellHitTime);

                spell.spellHitTime = spellHitTime;
                spell.evadeTime    = evadeTime;

                var extraDelay = ObjectCache.gamePing + ObjectCache.menuCache.cache["ExtraPingBuffer"].GetValue <Slider>().Value;

                if (spell.spellHitTime - extraDelay < 1500 && CanHeroWalkIntoSpell(spell))
                //if(true)
                {
                    Spell newSpell = spell;
                    int   spellID  = spell.spellID;

                    if (!drawSpells.ContainsKey(spell.spellID))
                    {
                        drawSpells.Add(spellID, newSpell);
                    }

                    //var spellFlyTime = Evade.GetTickCount - spell.startTime;
                    if (spellHitTime < ObjectCache.menuCache.cache["SpellDetectionTime"].GetValue <Slider>().Value)
                    {
                        continue;
                    }

                    if (EvadeUtils.TickCount - spell.startTime <
                        ObjectCache.menuCache.cache["ReactionTime"].GetValue <Slider>().Value)
                    {
                        continue;
                    }

                    var dodgeInterval = ObjectCache.menuCache.cache["DodgeInterval"].GetValue <Slider>().Value;
                    if (Evade.lastPosInfo != null && dodgeInterval > 0)
                    {
                        var timeElapsed = EvadeUtils.TickCount - Evade.lastPosInfo.timestamp;

                        if (dodgeInterval > timeElapsed)
                        {
                            //var delay = dodgeInterval - timeElapsed;
                            //DelayAction.Add((int)delay, () => SpellDetector_OnProcessDetectedSpells());
                            continue;
                        }
                    }

                    if (!spells.ContainsKey(spell.spellID))
                    {
                        if (!(Evade.isDodgeDangerousEnabled() && newSpell.GetSpellDangerLevel() < 3) &&
                            ObjectCache.menuCache.cache[newSpell.info.spellName + "DodgeSpell"].GetValue <bool>())
                        {
                            if (newSpell.spellType == SpellType.Circular &&
                                ObjectCache.menuCache.cache["DodgeCircularSpells"].GetValue <bool>() == false)
                            {
                                //return spellID;
                                continue;
                            }

                            spells.Add(spellID, newSpell);

                            spellAdded = true;
                        }
                    }

                    if (ObjectCache.menuCache.cache["CheckSpellCollision"].GetValue <bool>() &&
                        spell.predictedEndPos != Vector2.Zero)
                    {
                        spellAdded = false;
                    }
                }
            }

            if (spellAdded && OnProcessDetectedSpells != null)
            {
                OnProcessDetectedSpells();
            }
        }