private static void Main(string[] args) { try { evade = new Evade(); } catch (Exception e) { Console.WriteLine(e); throw; } }
private static void AddDetectedSpells() { var spellAdded = false; foreach (var entry in detectedSpells) { var spell = entry.Value; if (spell.info.spellName.Contains("_trap")) { // todo: } else { EvadeHelper.fastEvadeMode = Evade.spellMenu[spell.info.charName + spell.info.spellName + "Settings"][ spell.info.spellName + "FastEvade"].As <MenuBool>().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"].As <MenuSlider>() .Value; if (spell.spellHitTime - extraDelay < 1500 && CanHeroWalkIntoSpell(spell)) //if(true) { var newSpell = spell; var spellID = spell.spellID; if (!drawSpells.ContainsKey(spell.spellID)) { drawSpells.Add(spellID, newSpell); } //var spellFlyTime = Evade.GetTickCount - spell.startTime; if (spellHitTime < ObjectCache.menuCache.cache["SpellDetectionTime"].As <MenuSlider>().Value && !Evade.spellMenu[spell.info.charName + spell.info.spellName + "Settings"][ spell.info.spellName + "FastEvade"].As <MenuBool>().Enabled) { continue; } if (EvadeUtils.TickCount - spell.startTime < ObjectCache.menuCache.cache["ReactionTime"].As <MenuSlider>().Value && !Evade.spellMenu[spell.info.charName + spell.info.spellName + "Settings"][ spell.info.spellName + "FastEvade"].As <MenuBool>().Enabled) { continue; } var dodgeInterval = ObjectCache.menuCache.cache["DodgeInterval"].As <MenuSlider>().Value; if (Evade.lastPosInfo != null && dodgeInterval > 0) { var timeElapsed = EvadeUtils.TickCount - Evade.lastPosInfo.timestamp; if (dodgeInterval > timeElapsed && !Evade.spellMenu[spell.info.charName + spell.info.spellName + "Settings"][ spell.info.spellName + "FastEvade"].As <MenuBool>().Enabled) { continue; } } if (!spells.ContainsKey(spell.spellID)) { if (!(Evade.isDodgeDangerousEnabled() && newSpell.GetSpellDangerLevel() < 3) && Evade.spellMenu[spell.info.charName + spell.info.spellName + "Settings"][ newSpell.info.spellName + "DodgeSpell"].As <MenuBool>().Enabled) { if (newSpell.spellType == SpellType.Circular && ObjectCache.menuCache.cache["DodgeCircularSpells"].As <MenuBool>().Value == false) { continue; } var healthThreshold = Evade.spellMenu[spell.info.charName + spell.info.spellName + "Settings"][ spell.info.spellName + "DodgeIgnoreHP"].As <MenuSlider>().Value; if (myHero.HealthPercent() <= healthThreshold) { spells.Add(spellID, newSpell); spellAdded = true; } } } if (ObjectCache.menuCache.cache["CheckSpellCollision"].As <MenuBool>().Enabled && spell.predictedEndPos != Vector2.Zero) { spellAdded = false; } } } if (spellAdded) { OnProcessDetectedSpells?.Invoke(); } }
private void DrawEvadeStatus() { // fix if (ObjectCache.menuCache.cache["ShowStatus"].As <MenuBool>().Enabled) { Vector2 heroPos; Render.WorldToScreen(ObjectManager.GetLocalPlayer().Position, out heroPos); if (ObjectCache.menuCache.cache["DodgeSkillShots"].As <MenuKeyBind>().Enabled) { if (Evade.isDodging) { Render.Text(heroPos.X - 10, heroPos.Y, Color.Red, "Evade: ON"); } else { if (ObjectCache.menuCache.cache["DodgeOnlyOnComboKeyEnabled"].As <MenuBool>().Enabled && ObjectCache.menuCache.cache["DodgeComboKey"].As <MenuKeyBind>().Enabled == false) { Render.Text(heroPos.X - 10, heroPos.Y, Color.Gray, "Evade: OFF"); } else { if (ObjectCache.menuCache.cache["DontDodgeKeyEnabled"].As <MenuBool>().Value && ObjectCache.menuCache.cache["DontDodgeKey"].As <MenuKeyBind>().Enabled) { Render.Text(heroPos.X - 10, heroPos.Y, Color.Gray, "Evade: OFF"); } else if (Evade.isDodgeDangerousEnabled()) { Render.Text(heroPos.X - 10, heroPos.Y, Color.Yellow, "Evade: ON"); } else { Render.Text(heroPos.X - 10, heroPos.Y, Color.Lime, "Evade: ON"); } } } } else { if (ObjectCache.menuCache.cache["ActivateEvadeSpells"].As <MenuKeyBind>().Enabled) { if (ObjectCache.menuCache.cache["DodgeOnlyOnComboKeyEnabled"].As <MenuBool>().Enabled && ObjectCache.menuCache.cache["DodgeComboKey"].As <MenuKeyBind>().Enabled == false) { Render.Text(heroPos.X - 10, heroPos.Y, Color.Gray, "Evade: OFF"); } else { if (Evade.isDodgeDangerousEnabled()) { Render.Text(heroPos.X - 10, heroPos.Y, Color.Yellow, "Evade: Spell"); } else { Render.Text(heroPos.X - 10, heroPos.Y, Color.DeepSkyBlue, "Evade: Spell"); } } } else { Render.Text(heroPos.X - 10, heroPos.Y, Color.Gray, "Evade: OFF"); } } } }