static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { // Modified Kalista Soulbound code from Corey // Need to check in fountain otherwise recalls could make you swallow /*if (sender.Type == GameObjectType.obj_AI_Hero && sender.IsEnemy && !Player.InFountain()) { try { var swallowAlly = ObjectManager.Get<Obj_AI_Hero>().FirstOrDefault( x => x.HealthPercent < mainMenu.SubMenu("Shield").Item("Devour Ally at Percent HP").GetValue<Slider>().Value && x.IsAlly && Player.Distance(x) <= 500 && !x.IsDead); if (swallowAlly != null && current == SwallowedTarget.None && W.IsReady()) { W.CastOnUnit(swallowAlly); } } catch { } Obj_AI_Hero enemy = (Obj_AI_Hero)sender; try { SpellDataInst s = enemy.Spellbook.Spells.FirstOrDefault(x => x.SData.Name.Equals(args.SData.Name)); if (enemy.GetSpellDamage(Player, s.Slot) > Player.Health && mainMenu.SubMenu("Shield").Item("E Only Dangerous").IsActive()) E.Cast(); else if ((enemy.GetSpellDamage(Player, s.Slot)) / Player.MaxHealth <= mainMenu.SubMenu("Shield").Item("E for Percent of HP Damage").GetValue<Slider>().Value) E.Cast(); } catch { } }*/ if (sender.IsMe) { SpellSlot s = Player.Spellbook.Spells.First(x => x.SData.Name == args.SData.Name).Slot; if (s.ToString().Equals("W")) { if (args.Target.Type == GameObjectType.obj_AI_Hero) current = (args.Target.IsAlly) ? SwallowedTarget.Ally : SwallowedTarget.Enemy; else current = SwallowedTarget.Minion; } else if(s.ToString().Equals("46")) current = SwallowedTarget.None; } }
void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { //Modified Kalista Soulbound code from Corey //Need to check in fountain otherwise recalls could make you swallow if (player.IsInFountainRange()) { return; } try { var hero = sender as AIHeroClient; if (hero != null && hero.IsEnemy && !player.IsInFountainRange()) { var swallowAlly = EntityManager.Heroes.Allies.FirstOrDefault( x => x.HealthPercent < 25 && ARAMSimulator.inDanger && x.IsAlly && player.Distance(x) <= 500 && !x.IsDead); if (swallowAlly != null && current == SwallowedTarget.None && W.IsReady()) { W.CastOnUnit(swallowAlly); current = SwallowedTarget.Ally; } AIHeroClient enemy = hero; if (E.IsReady()) { SpellDataInst s = enemy.Spellbook.Spells.FirstOrDefault(x => x.SData.Name.Equals(args.SData.Name)); if (s == null) { return; } if (enemy.GetSpellDamage(player, s.Slot) > player.Health) { E.Cast(); } else if (player.HealthPercent <= 45) { E.Cast(); } } } else if (sender.IsMe) { var spell = player.Spellbook.Spells.FirstOrDefault(x => x.SData.Name == args.SData.Name); if (spell == null) { return; } SpellSlot s = spell.Slot; if (s == SpellSlot.W) { if (args.Target is AIHeroClient) { current = (args.Target.IsAlly) ? SwallowedTarget.Ally : SwallowedTarget.Enemy; } else { current = SwallowedTarget.Minion; } } else if (s.ToString().Equals("46")) { current = SwallowedTarget.None; } } } catch (Exception) { } }