private static void OnCombo() { var target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical); if (target == null) { return; } var useQ = menu.SubMenu("combo").Item("comboUseQ").GetValue <bool>(); var useW = menu.SubMenu("combo").Item("comboUseW").GetValue <bool>(); var useE = menu.SubMenu("combo").Item("comboUseE").GetValue <bool>(); var useR = menu.SubMenu("combo").Item("comboUseR").GetValue <bool>(); var comboResult = GetComboDamage(target); var eResult = EventHorizon.GetCastPosition(target); if (target.Health < comboResult) { if (IgniteSlot != SpellSlot.Unknown && Player.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready && Player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite) > target.Health) { Player.Spellbook.CastSpell(IgniteSlot, target); } if (Dfg.IsReady() && target.Health < Player.GetItemDamage(target, Damage.DamageItems.Dfg)) { Dfg.Cast(target); } if (E.IsReady() && useE && eResult.Valid) { E.Cast(eResult.CastPosition); } if (W.IsReady() && useW && W.IsInRange(target.ServerPosition)) { W.Cast(target.Position); } if (Q.IsReady() && useQ && Q.IsInRange(target.ServerPosition)) { Q.CastOnUnit(target); } if (R.IsReady() && useR && R.IsInRange(target.ServerPosition)) { R.CastOnUnit(target); } } else { if (Q.IsReady() && useQ && Q.IsInRange(target.ServerPosition)) { Q.CastOnUnit(target); } if (W.IsReady() && useW && W.IsInRange(target.ServerPosition)) { W.Cast(target.Position); } if (E.IsReady() && useE && eResult.Valid) { E.Cast(eResult.CastPosition); } } }
private static void OnCombo() { var target = SimpleTs.GetTarget(W.Range, SimpleTs.DamageType.Magical); if (target == null) { return; } bool useQ = menu.SubMenu("combo").Item("comboUseQ").GetValue <bool>(); bool useE = menu.SubMenu("combo").Item("comboUseE").GetValue <bool>(); bool useR = menu.SubMenu("combo").Item("comboUseR").GetValue <bool>(); var comboResult = Combo.CalculateResult(target, mainCombo); // Combo killable status bool comboKillable = false; if (comboResult.Killable) { if (comboResult.SpellUsage.Contains(DamageLib.SpellType.IGNITE)) { comboKillable = Vector2.DistanceSquared(player.Position.To2D(), target.ServerPosition.To2D()) < 600 * 600; } else { comboKillable = Vector2.DistanceSquared(player.Position.To2D(), target.ServerPosition.To2D()) < Q.Range * Q.Range; } } // Ignite & DFG if (comboKillable) { if (comboResult.SpellUsage.Contains(DamageLib.SpellType.IGNITE)) { player.SummonerSpellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target); } if (comboResult.SpellUsage.Contains(DamageLib.SpellType.DFG)) { Items.UseItem(3128, target); } if (comboResult.SpellUsage.Contains(DamageLib.SpellType.BLACKFIRETORCH)) { Items.UseItem(3188, target); } } foreach (var spell in spellList) { // Continue if spell not ready if (!spell.IsReady()) { continue; } switch (spell.Slot) { case SpellSlot.Q: if (!useQ) { continue; } if (comboKillable || Q.InRange(target.ServerPosition)) { Q.CastOnUnit(target); } break; case SpellSlot.E: if (!useE || comboKillable) { continue; } var result = EventHorizon.GetCastPosition(target); if (result.Valid) { E.Cast(result.CastPosition); } break; case SpellSlot.R: if (!useR) { continue; } if (comboKillable && comboResult.SpellUsage.Contains(DamageLib.SpellType.R)) { R.CastOnUnit(target); } break; } } }