public static void UseEvadeSpell() { if (!Situation.ShouldUseEvadeSpell()) { return; } //int posDangerlevel = EvadeHelper.CheckPosDangerLevel(ObjectCache.myHeroCache.serverPos2D, 0); if (EvadeUtils.TickCount - lastSpellEvadeCommand.timestamp < 1000) { return; } foreach (var entry in SpellDetector.spells) { var spell = entry.Value; if (ShouldActivateEvadeSpell(spell)) { if (ActivateEvadeSpell(spell)) { Evade.SetAllUndodgeable(); return; } } } }
public static bool PreferEvadeSpell() { if (!Situation.ShouldUseEvadeSpell()) { return(false); } foreach (var entry in SpellDetector.spells) { var spell = entry.Value; if (!ObjectCache.myHeroCache.serverPos2D.InSkillShot(spell, ObjectCache.myHeroCache.boundingRadius)) { continue; } if (ActivateEvadeSpell(spell, true)) { return(true); } } return(false); }