private static void Game_OnUpdate(EventArgs args) { if (!Program.Menu.Item("WSpells").IsActive() || !SpellManager.W.IsReady()) { return; } foreach (var skillshot in EvadeTree.GetSkillshotsAboutToHit( ObjectManager.Player, (int)(SpellManager.W.Delay * 1000f + Game.Ping / 2f))) { if (!SpellManager.W.IsReady()) { return; } var enemy = skillshot.Unit as AIHeroClient; if (enemy == null) { continue; } List <BlockedSpell> spells; BlockedSpells.TryGetValue(enemy.ChampionName, out spells); if (spells == null || spells.Count == 0) { continue; } foreach (var spell in spells) { var item = Menu.Item(enemy.ChampionName + spell.MenuName); if (item == null || !item.IsActive()) { continue; } if (!spell.PassesSlotCondition(skillshot.SpellData.Slot)) { continue; } if (spell.IsAutoAttack || !spell.PassesBuffCondition(enemy) || !spell.PassesModelCondition(enemy)) { continue; } if (!spell.PassesSpellCondition(skillshot.SpellData.SpellName)) { continue; } Program.CastW(skillshot.Unit); } } }
public static void Initialize() { if (_initialized) { return; } _initialized = true; Menu = new Menu("TreeLib", "TreeLib", true); Menu.AddToMainMenu(); SpellManager.Initialize(); EvadeTree.Init(); }
public static float GetPredictedHealthPercent(this AIHeroClient hero) { var dmg = 0d; foreach (var skillshot in EvadeTree.GetSkillshotsAboutToHit(hero, 400)) { try { dmg += skillshot.Unit.GetDamageSpell(hero, skillshot.SpellData.SpellName).CalculatedDamage; } catch {} } return((float)((hero.Health - dmg) / hero.MaxHealth * 100)); }