private void OnProcessSpellCast(GameObject sender, GameObjectProcessSpellCastEventArgs args) { if (sender is AIHeroClient) { var champion = (AIHeroClient)sender; if (champion.IsEnemy && args.SData.Name == champion.Spellbook.GetSpell(SpellSlot.R).Name) { Player.IssueOrder(GameObjectOrder.MoveTo, champion.Position); // move to interrupt } } }
private void OnProcessSpellCast(GameObject sender, GameObjectProcessSpellCastEventArgs args) { if (sender is AIHeroClient) { var champion = (AIHeroClient)sender; Chat.Print($"{champion.ChampionName} is casting {args.SData.Name}."); } }Overall, GameObjectProcessSpellCastEventArgs is a useful class for handling spell-casting events in League of Legends and is part of the LeagueSharp package library in C#.