private static void OnGameUpdate(EventArgs args) { try { //Remove the detected skillshots that have expired. ActiveSkillshots.RemoveAll(s => !s.IsActive); //Trigger OnGameUpdate on each skillshot. foreach (var skillshot in ActiveSkillshots) { skillshot.Game_OnGameUpdate(); } // Protect foreach (var ally in ObjectManager.Get <Obj_AI_Hero>() .Where(h => h.IsAlly && h.IsValidTarget(2000, false)) .OrderByDescending(h => h.FlatPhysicalDamageMod)) { var allySafeResult = IsSafe(ally.ServerPosition.To2D()); if (!allySafeResult.IsSafe && IsAboutToHit(ally, 100)) { // is about to hit } } } catch (Exception e) { Console.WriteLine(e); } }
private static void OnGameUpdate(EventArgs args) { try { if (OnTargetSpell == null) { return; // only if subscribers } ActiveTargeted.RemoveAll(s => !s.IsActive); foreach (var spell in ActiveTargeted) { OnTargetSpell(spell); } } catch (Exception e) { Console.WriteLine(e); } }