public static FindRemnant ( Vector3 pos = default(Vector3), float range = 200 ) : Unit | ||
pos | Vector3 | |
range | float | |
Результат | Unit |
private static void CastAbilities(float distance) { if (!IsEnable) { return; } if (!IsComboHero) { return; } if (GlobalTarget == null || !GlobalTarget.IsValid || !GlobalTarget.IsVisible || GlobalTarget.IsMagicImmune() || !GlobalTarget.IsAlive) { return; } var smash = Abilities.FindAbility("earth_spirit_boulder_smash"); var geomagneticGrip = Abilities.FindAbility("earth_spirit_geomagnetic_grip"); var magnetize = Abilities.FindAbility("earth_spirit_magnetize"); var rollingBoulder = Abilities.FindAbility("earth_spirit_rolling_boulder"); var stoneCaller = Abilities.FindAbility("earth_spirit_stone_caller"); if (distance >= 1000) { return; } var pos = GlobalTarget.NetworkPosition; if (Helper.IsAbilityEnable(smash.StoredName()) && smash.CanBeCasted()) { if (smash.CanBeCasted() && !_spellSleeper.Sleeping("combo" + smash)) { var remnant = Helper.FindRemnant(); if (stoneCaller.CanBeCasted() && remnant == null) { stoneCaller.UseAbility(Members.MyHero.InFront(75)); } if (UsePrediction) { if (smash.CastSkillShot(GlobalTarget)) { _spellSleeper.Sleep(500, "combo" + smash); _spellSleeper.Sleep(distance / 900 * 1000 + 1000, "w8" + smash); Printer.Print($"Time: {distance/900*1000 + 500}ms"); } } else { smash.UseAbility(GlobalTarget.NetworkPosition); _spellSleeper.Sleep(500, "combo" + smash); _spellSleeper.Sleep(distance / 900 * 1000 + 500, "w8" + smash); Printer.Print($"Time: {distance / 900 * 1000 + 1000}ms"); } } } if (Helper.IsAbilityEnable(geomagneticGrip.StoredName()) && geomagneticGrip.CanBeCasted() && !_spellSleeper.Sleeping("combo" + geomagneticGrip)) { if (GlobalTarget.IsStunned()) { Printer.Print("stunned!"); } if (_spellSleeper.Sleeping("w8" + smash) && !GlobalTarget.IsStunned()) { } else { var remnant = Helper.FindRemnant(pos, 250); if (stoneCaller.CanBeCasted() && remnant == null) { stoneCaller.UseAbility(pos); geomagneticGrip.UseAbility(pos, true); Printer.Print("new"); } else if (remnant != null) { Printer.Print("finded"); geomagneticGrip.UseAbility(remnant.NetworkPosition); } _spellSleeper.Sleep(250, "combo" + geomagneticGrip); } } else if (Helper.IsAbilityEnable(rollingBoulder.StoredName()) && rollingBoulder.CanBeCasted() && !_spellSleeper.Sleeping("combo" + rollingBoulder)) { if (UsePrediction) { if (rollingBoulder.CastSkillShot(GlobalTarget)) { } } else /*if (remnant!=null)*/ { rollingBoulder.UseAbility(GlobalTarget.NetworkPosition); } _spellSleeper.Sleep(250, "combo" + rollingBoulder); } else if (rollingBoulder.Cooldown >= 3.5) { var myPos = Members.MyHero.Position; var angle = Members.MyHero.FindAngleBetween(pos, true); var point = new Vector3( (float) (myPos.X + 100 * Math.Cos(angle)), (float) (myPos.Y + 100 * Math.Sin(angle)), 0); var remnant = Helper.FindRemnant(point, 100) ?? Helper.FindRemnantWithModifier(pos, "modifier_earth_spirit_geomagnetic_grip"); if (stoneCaller.CanBeCasted() && remnant == null && Members.MyHero.HasModifier("modifier_earth_spirit_rolling_boulder_caster")) { if (!_spellSleeper.Sleeping("combo" + rollingBoulder + "Caller")) { Printer.Print($"cd: ({rollingBoulder.Cooldown}) | cant find remnant!"); //stoneCaller.UseAbility(point); stoneCaller.UseAbility(Members.MyHero.Position); _spellSleeper.Sleep(2000, "combo" + rollingBoulder + "Caller"); } } } if (Helper.IsAbilityEnable(magnetize.StoredName()) && magnetize.CanBeCasted() && !_spellSleeper.Sleeping("combo" + magnetize)) { if (distance <= 300) { magnetize.UseAbility(); _spellSleeper.Sleep(250, "combo" + magnetize); } } var mod = GlobalTarget.FindModifier("modifier_earth_spirit_magnetize"); if (Helper.IsAbilityEnable(stoneCaller.StoredName()) && mod != null && mod.RemainingTime <= 0.2 && !_spellSleeper.Sleeping("combo" + stoneCaller) && stoneCaller.CanBeCasted()) { Printer.Print($"remTime: {mod.RemainingTime}"); stoneCaller.UseAbility(pos); _spellSleeper.Sleep(1000, "combo" + stoneCaller); } }
public static void Game_OnUpdate(EventArgs args) { if (!IsEnable) { return; } if (_combos == null) { _combos = new MultiSleeper(); } var smash = Abilities.FindAbility("earth_spirit_boulder_smash"); var geomagneticGrip = Abilities.FindAbility("earth_spirit_geomagnetic_grip"); var magnetize = Abilities.FindAbility("earth_spirit_magnetize"); var rollingBoulder = Abilities.FindAbility("earth_spirit_rolling_boulder"); var stoneCaller = Abilities.FindAbility("earth_spirit_stone_caller"); var petrify = Abilities.FindAbility("earth_spirit_petrify"); if (Combo1) { if (smash.CanBeCasted() && !_combos.Sleeping(smash)) { var remnant = Helper.FindRemnant(); if (stoneCaller.CanBeCasted() && remnant == null) { stoneCaller.UseAbility(Prediction.InFront(Members.MyHero, 75)); } //stoneCaller.UseAbility(Members.MyHero.Position); smash.UseAbility(Game.MousePosition); _combos.Sleep(500, smash); } } else if (Combo2) { if (rollingBoulder.CanBeCasted() && !_combos.Sleeping(rollingBoulder)) { var myPos = Members.MyHero.Position; var mousePos = Game.MousePosition; var angle = Members.MyHero.FindAngleBetween(mousePos, true); var point = new Vector3( (float) (myPos.X + 75 * Math.Cos(angle)), (float) (myPos.Y + 75 * Math.Sin(angle)), 0); var remnant = Helper.FindRemnant(range: 100); if (stoneCaller.CanBeCasted() && remnant == null) { stoneCaller.UseAbility(point); } rollingBoulder.UseAbility(Game.MousePosition); _combos.Sleep(500, rollingBoulder); } } else if (Combo3) { var myPos = Members.MyHero.Position; var mousePos = Game.MousePosition; var distance = myPos.Distance2D(mousePos); var myInventory = Members.MyHero.Inventory.Items.ToList(); var extraRange = myInventory.Any(x => x.StoredName() == "item_aether_lens") ? 200 : 0; if (geomagneticGrip.CanBeCasted() && !_combos.Sleeping(geomagneticGrip) && distance <= 1100 + extraRange) { var remnant = Helper.FindRemnant(mousePos); if (stoneCaller.CanBeCasted() && remnant == null) { stoneCaller.UseAbility(mousePos); geomagneticGrip.UseAbility(mousePos); } else { geomagneticGrip.UseAbility(remnant.NetworkPosition); } _combos.Sleep(500, geomagneticGrip); } } if (Combo4) { var myPos = Members.MyHero.Position; var mousePos = Game.MousePosition; var distance = myPos.Distance2D(mousePos); var myInventory = Members.MyHero.Inventory.Items.ToList(); var extraRange = myInventory.Any(x => x.StoredName() == "item_aether_lens") ? 200 : 0; /*Printer.Print( * $"{rollingBoulder.CanBeCasted()}/{geomagneticGrip.CanBeCasted()}/{!_combos.Sleeping(stoneCaller)}/{distance <= 1000 + extraRange}");*/ if (rollingBoulder.CanBeCasted() && geomagneticGrip.CanBeCasted() && !_combos.Sleeping(stoneCaller) && distance <= 11000 + extraRange) { var remnant = Helper.FindRemnant(mousePos); if (remnant != null) { geomagneticGrip.UseAbility(remnant.NetworkPosition); rollingBoulder.UseAbility(mousePos); _combos.Sleep(500, stoneCaller); } } } }