private void load() { sBook = _player.Spellbook; qData = sBook.GetSpell(SpellSlot.Q); wData = sBook.GetSpell(SpellSlot.W); eData = sBook.GetSpell(SpellSlot.E); rData = sBook.GetSpell(SpellSlot.R); }
public static SpellDataInst[] GetMainSpells(this Spellbook spellbook) { return(new[] { spellbook.GetSpell(SpellSlot.Q), spellbook.GetSpell(SpellSlot.W), spellbook.GetSpell(SpellSlot.E), spellbook.GetSpell(SpellSlot.R) }); }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) { return; } var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { //Evade.isChanneling = true; //Evade.channelPosition = myHero.ServerPosition.To2D(); lastStopEvadeTime = GetTickCount() + Game.Ping + 100; } if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + Game.Ping + 100 > GetTickCount()) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = GetTickCount(); }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) { return; } var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { //Evade.isChanneling = true; //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D; lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; //moved from processPacket if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Count() > 0) { foreach (KeyValuePair <String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot) { lastPosInfo = PositionInfo.SetAllUndodgeable(); if (evadeSpell.evadeType == EvadeType.Blink || evadeSpell.evadeType == EvadeType.Dash) { DelayAction.Add(1, () => EvadeCommand.MoveTo(Game.CursorPos.To2D())); } return; } } } } }
private bool IsWard(Spellbook spellBook, SpellbookCastSpellEventArgs args) { return (SAssemblies.Ward.WardItems.Exists( y => y.Id == (int) ObjectManager.Player.InventoryItems.Find( x => x.SpellSlot == spellBook.GetSpell(args.Slot).Slot).Id)); }
private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args) { if (sender == null || !sender.HasSpellCaster || !sender.Owner.IsMe) { return; } var target = args.Target as Obj_AI_Base; var castTime = sender.GetSpell(args.Slot).SData.CastFrame / 30f * 1000f + Game.Ping / 2f; // target offscreen if (target != null) { if (!target.IsHPBarRendered) { } //StartPathWorld(target.ServerPosition); } //StartPathWorld(args.StartPosition); }
private bool IsWard(Spellbook spellBook, SpellbookCastSpellEventArgs args) { return SAssemblies.Ward.WardItems.Exists( y => y.Id == (int) ObjectManager.Player.InventoryItems.Find( x => x.SpellSlot == spellBook.GetSpell(args.Slot).Slot).Id); }
private void load() { sBook = _player.Spellbook; qData = sBook.GetSpell(SpellSlot.Q); wData = sBook.GetSpell(SpellSlot.W); eData = sBook.GetSpell(SpellSlot.E); rData = sBook.GetSpell(SpellSlot.R); }
public static float getSpellCastTime(LeagueSharp.Common.Spell spell) { return(sBook.GetSpell(spell.Slot).SData.SpellCastTime); }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) /////LOI DOAN NAY { if (!spellbook.Owner.IsMe) { return; } var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { //Evade.isChanneling = true; //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D; lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } //block spell commmands if evade spell just used if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; //moved from processPacket /*if (args.Slot == SpellSlot.Recall) * { * lastStopPosition = myHero.ServerPosition.To2D(); * }*/ if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Any()) { foreach (KeyValuePair <String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot && evadeSpell.untargetable == false) { if (evadeSpell.evadeType == EvadeType.Blink) { var dir = (args.StartPosition.To2D() - myHero.ServerPosition.To2D()).Normalized(); var end = myHero.ServerPosition.To2D() + dir * myHero.ServerPosition.To2D().Distance(Game.CursorPos.To2D()); if (evadeSpell.fixedRange || end.Distance(myHero.ServerPosition.To2D()) > evadeSpell.range) { end = myHero.ServerPosition.To2D() + dir * evadeSpell.range; } var posInfo = EvadeHelper.CanHeroWalkToPos(end, evadeSpell.speed, ObjectCache.gamePing, 0); if (posInfo.posDangerCount < 1) { if (lastPosInfo != null) { lastPosInfo = posInfo; } if (lastPosInfo == null) { lastPosInfo = posInfo; } if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 250) { EvadeCommand.MoveTo(Game.CursorPos.To2D()); lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } return; } } if (evadeSpell.evadeType == EvadeType.Dash) { var dashPos = args.StartPosition.To2D(); if (args.Target != null) { dashPos = args.Target.Position.To2D(); } if (evadeSpell.fixedRange || dashPos.Distance(myHero.ServerPosition.To2D()) > evadeSpell.range) { var dir = (dashPos - myHero.ServerPosition.To2D()).Normalized(); dashPos = myHero.ServerPosition.To2D() + dir * evadeSpell.range; } var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, ObjectCache.gamePing, 0); if (posInfo.posDangerLevel > 0) { args.Process = false; } else { if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.To2D()); lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } return; } } lastPosInfo = PositionInfo.SetAllUndodgeable(); return; } } }
public static float getSpellCastTime(Spell spell) { return(sBook.GetSpell(spell.Slot).SData.SpellCastTime); }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) { return; } var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { //Evade.isChanneling = true; //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D; lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; //moved from processPacket /*if (args.Slot == SpellSlot.Recall) * { * lastStopPosition = myHero.ServerPosition.To2D(); * }*/ if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Count() > 0) { foreach (KeyValuePair <String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot) { if (evadeSpell.evadeType == EvadeType.Blink || evadeSpell.evadeType == EvadeType.Dash) { //Block spell cast if flashing/blinking into spells if (args.EndPosition.To2D().CheckDangerousPos(6, true)) //for blink + dash { args.Process = false; return; } if (evadeSpell.evadeType == EvadeType.Dash) { var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast <Slider>().CurrentValue; var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast <Slider>().CurrentValue; var dashPos = Game.CursorPos.To2D(); //real pos? if (evadeSpell.fixedRange) { var dir = (dashPos - myHero.ServerPosition.To2D()).Normalized(); dashPos = myHero.ServerPosition.To2D() + dir * evadeSpell.range; } //Draw.RenderObjects.Add(new Draw.RenderPosition(dashPos, 1000)); var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, extraDelayBuffer + ObjectCache.gamePing, extraDist); if (posInfo.posDangerLevel > 0) { args.Process = false; return; } } lastPosInfo = PositionInfo.SetAllUndodgeable(); //really? if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.To2D()); //block moveto lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } } return; } } }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) return; var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { //Evade.isChanneling = true; //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D; lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; //moved from processPacket if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Count() > 0) { foreach (KeyValuePair<String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot) { lastPosInfo = PositionInfo.SetAllUndodgeable(); if (evadeSpell.evadeType == EvadeType.Blink || evadeSpell.evadeType == EvadeType.Dash) { if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.To2D()); lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } } return; } } }
private static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args) { var Slot = args.Slot; if (sender.Owner.IsMe && UtilityManager.SpellSlots.Contains(Slot)) { var ChampionSpellManaCost = UtilityManager.ManaCostArray.FirstOrDefault(x => x.Key == OlympusAIO.objPlayer.CharacterName).Value; if (ChampionSpellManaCost == null) { return; } var Data = UtilityManager.PreserveManaData; var Spell = sender.GetSpell(Slot); if (MenuManager.PreserveManaMenu[Slot.ToString().ToLower()].GetValue <MenuBool>().Enabled) { var SpellData = Data.FirstOrDefault(x => x.Key == Slot).Value; var NewSpellData = ChampionSpellManaCost[Slot][Spell.Level - 1]; if (Data.ContainsKey(Slot) && SpellData != NewSpellData) { Data.Remove(Slot); Console.WriteLine($"Preserve Mana List: Removed {Slot}."); } if (!Data.ContainsKey(Slot) && !Spell.State.HasFlag(SpellState.NotLearned)) { Data.Add(Slot, NewSpellData); Console.WriteLine($"Preserve Mana List: Added {Slot}, Cost: {NewSpellData}."); } } else { if (Data.ContainsKey(Slot)) { Data.Remove(Slot); Console.WriteLine($"Preserve Mana List: Removed {Slot} (Disabled)."); } } var CheckSum = Data.Where(x => MenuManager.PreserveManaMenu[x.Key.ToString().ToLower()].GetValue <MenuBool>().Enabled).Sum(x => x.Value); if (CheckSum <= 0) { return; } if (ObjectManager.Get <GameObject>().Any(x => x.Type == GameObjectType.EffectEmitter && x.Name == "Perks_ManaFlowBand_Buff" && x.DistanceToPlayer() <= 75)) { return; } if (ObjectManager.Get <GameObject>().Any(x => x.Type == GameObjectType.EffectEmitter && x.Name == "Perks_LastResort_Buf" && x.DistanceToPlayer() <= 75)) { return; } var SpellCost = ChampionSpellManaCost[Slot][OlympusAIO.objPlayer.GetSpell(Slot).Level - 1]; if (!Data.Keys.Contains(Slot) && OlympusAIO.objPlayer.Mana - SpellCost < CheckSum) { args.Process = false; } } }
private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args) { if (sender == null || !sender.HasSpellCaster || !sender.Owner.IsMe) { return; } var target = args.Target as Obj_AI_Base; var castTime = sender.GetSpell(args.Slot).SData.CastFrame / 30f * 1000f + Game.Ping / 2f; // target offscreen if (target != null) { if (!target.IsHPBarRendered) {} //StartPathWorld(target.ServerPosition); } //StartPathWorld(args.StartPosition); }
public void CombineSpells(ElementSelectionSpell i_Element, FormSelectionSpell i_SpellToCombine) { m_Spellbook.GetSpell(i_Element, i_SpellToCombine)?.Cast(this); }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) return; var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } //block spell commmands if evade spell just used if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Any()) { foreach (KeyValuePair<String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot && evadeSpell.untargetable == false) { if (evadeSpell.evadeType == EvadeType.Blink) { var dir = (args.StartPosition.LSTo2D() - myHero.ServerPosition.LSTo2D()).LSNormalized(); var end = myHero.ServerPosition.LSTo2D() + dir * myHero.ServerPosition.LSTo2D().LSDistance(Game.CursorPos.LSTo2D()); if (evadeSpell.fixedRange || end.LSDistance(myHero.ServerPosition.LSTo2D()) > evadeSpell.range) { end = myHero.ServerPosition.LSTo2D() + dir * evadeSpell.range; } var posInfo = EvadeHelper.CanHeroWalkToPos(end, evadeSpell.speed, ObjectCache.gamePing, 0); if (posInfo.posDangerCount > 0) { args.Process = false; } else { lastPosInfo.position = end; lastDodgingEndTime = EvadeUtils.TickCount; if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.LSTo2D()); //block moveto lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } return; } } if (evadeSpell.evadeType == EvadeType.Dash) { var dashPos = args.StartPosition.LSTo2D(); if (args.Target != null) { dashPos = args.Target.Position.LSTo2D(); } if (evadeSpell.fixedRange || dashPos.LSDistance(myHero.ServerPosition.LSTo2D()) > evadeSpell.range) { var dir = (dashPos - myHero.ServerPosition.LSTo2D()).LSNormalized(); dashPos = myHero.ServerPosition.LSTo2D() + dir * evadeSpell.range; } var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, ObjectCache.gamePing, 0); if (posInfo.posDangerLevel > 0) { args.Process = false; } else { lastPosInfo.position = dashPos; lastDodgingEndTime = EvadeUtils.TickCount; if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.LSTo2D()); //block moveto lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } return; } } lastPosInfo = PositionInfo.SetAllUndodgeable(); return; } } }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) { return; } var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } //block spell commmands if evade spell just used if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Count() > 0) { foreach (KeyValuePair <String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot && evadeSpell.untargetable == false) { if (evadeSpell.evadeType == EvadeType.Dash) { if (evadeSpell.evadeType == EvadeType.Dash) { var dashPos = args.StartPosition.LSTo2D(); //real pos? if (args.Target != null) { dashPos = args.Target.Position.LSTo2D(); } if (evadeSpell.fixedRange || dashPos.LSDistance(myHero.ServerPosition.LSTo2D()) > evadeSpell.range) { var dir = (dashPos - myHero.ServerPosition.LSTo2D()).LSNormalized(); dashPos = myHero.ServerPosition.LSTo2D() + dir * evadeSpell.range; } var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, ObjectCache.gamePing, 0); if (posInfo.posDangerLevel > 0) { args.Process = false; return; } } lastPosInfo = PositionInfo.SetAllUndodgeable(); if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.LSTo2D()); lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } } return; } } }
public static SpellDataInst[] GetSummonerSpells(this Spellbook spellbook) { return(new[] { spellbook.GetSpell(SpellSlot.Summoner1), spellbook.GetSpell(SpellSlot.Summoner2) }); }
public void useSpellsOnMinions() { if (lastMinionSpellUse + 277 > DeathWalker.now) { return; } lastMinionSpellUse = DeathWalker.now; if (hero.MaxMana > 300 && hero.ManaPercent < 78) { return; } if (hero.MaxMana > 199 && hero.MaxMana < 201 && hero.ManaPercent < 95) { return; } foreach (var spell in spells) { if (spell.Value.Slot == SpellSlot.R || spell.Value.Instance.Cooldown > 10 || !spell.Value.IsReady() || spell.Value.ManaCost > hero.Mana || spell.Key.SpellTags == null || !spell.Key.SpellTags.Contains(SpellTags.Damage) || (isTransformChampion() && sBook.GetSpell(spell.Key.Slot).Name.ToLower() != spell.Key.SpellName.ToLower())) { continue; } //Farm spell if (spell.Value.IsSkillshot && !spell.Value.Collision && spell.Value.GetDamage(hero) > 5) { var farmMinions = MinionManager.GetMinions((spell.Value.Range != 0) ? spell.Value.Range : 300); var farmLocation = (spell.Value.Type == SkillshotType.SkillshotCircle)?spell.Value.GetCircularFarmLocation(farmMinions): spell.Value.GetLineFarmLocation(farmMinions); if (farmLocation.MinionsHit > 2) { spell.Value.Cast(farmLocation.Position); return; } //dont waste for single kills return; } //if line var minions = MinionManager.GetMinions((spell.Value.Range != 0) ? spell.Value.Range : 500); foreach (var minion in minions) { if (minion.Health > spell.Value.GetDamage(minion)) { continue; } var movementSpells = new List <SpellTags> { SpellTags.Dash, SpellTags.Blink, SpellTags.Teleport }; if (spell.Value.IsSkillshot) { if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(minion)) { Console.WriteLine("Cast farm location: " + spell.Key.Slot); spell.Value.Cast(minion.Position); return; } } else { float range = (spell.Value.Range != 0) ? spell.Value.Range : 500; if (spell.Key.CastType.Contains(CastType.Self)) { var bTarg = ARAMTargetSelector.getBestTarget(range, true); if (bTarg != null) { Console.WriteLine("Cast farm self: " + spell.Key.Slot); spell.Value.Cast(); return; } } else if (spell.Key.CastType.Contains(CastType.EnemyMinions)) { if (minion != null) { if (!(spell.Key.SpellTags != null && spell.Key.SpellTags.Any(movementSpells.Contains)) || safeGap(minion)) { Console.WriteLine("Cast farm target: " + spell.Key.Slot); spell.Value.CastOnUnit(minion); return; } } } } } } }
private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args) { if (!spellbook.Owner.IsMe) return; var sData = spellbook.GetSpell(args.Slot); string name; if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name)) { //Evade.isChanneling = true; //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D; lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount) { args.Process = false; } lastSpellCast = args.Slot; lastSpellCastTime = EvadeUtils.TickCount; //moved from processPacket /*if (args.Slot == SpellSlot.Recall) { lastStopPosition = myHero.ServerPosition.To2D(); }*/ if (Situation.ShouldDodge()) { if (isDodging && SpellDetector.spells.Count() > 0) { foreach (KeyValuePair<String, SpellData> entry in SpellDetector.windupSpells) { SpellData spellData = entry.Value; if (spellData.spellKey == args.Slot) //check if it's a spell that we should block { args.Process = false; return; } } } } foreach (var evadeSpell in EvadeSpell.evadeSpells) { if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot) { if (evadeSpell.evadeType == EvadeType.Blink || evadeSpell.evadeType == EvadeType.Dash) { //Block spell cast if flashing/blinking into spells if (args.EndPosition.To2D().CheckDangerousPos(6, true)) //for blink + dash { args.Process = false; return; } if (evadeSpell.evadeType == EvadeType.Dash) { var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue; var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue; var dashPos = Game.CursorPos.To2D(); //real pos? if (evadeSpell.fixedRange) { var dir = (dashPos - myHero.ServerPosition.To2D()).Normalized(); dashPos = myHero.ServerPosition.To2D() + dir*evadeSpell.range; } //Draw.RenderObjects.Add(new Draw.RenderPosition(dashPos, 1000)); var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, extraDelayBuffer + ObjectCache.gamePing, extraDist); if (posInfo.posDangerLevel > 0) { args.Process = false; return; } } lastPosInfo = PositionInfo.SetAllUndodgeable(); //really? if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500) { EvadeCommand.MoveTo(Game.CursorPos.To2D()); //block moveto lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100; } } return; } } }
private static void CastSpell(Spellbook sender, SpellbookCastSpellEventArgs args) { LastCastedSpell = sender.GetSpell(args.Slot).Name; LastCastedSpellTime = DateTime.Now; }