private void GameObject_OnDelete(GameObject sender, EventArgs args) { var emitter = sender as Obj_GeneralParticleEmitter; if (emitter != null && emitter.CheckTeam()) { SpellData spellData; if (SpellDetector.onProcessTraps.TryGetValue(emitter.Name.ToLower(), out spellData)) { foreach (var entry in SpellDetector.detectedSpells.Where(x => x.Value.info.trapTroyName.ToLower() == emitter.Name.ToLower())) { DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); entry.Value.spellObject = null; } } } var aiBase = sender as Obj_AI_Base; if (aiBase != null && aiBase.CheckTeam()) { SpellData spellData; if (SpellDetector.onProcessTraps.TryGetValue(aiBase.CharData.BaseSkinName.ToLower(), out spellData)) { foreach (var entry in SpellDetector.detectedSpells.Where(x => x.Value.info.trapBaseName.ToLower() == aiBase.CharData.BaseSkinName.ToLower())) { DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); entry.Value.spellObject = null; } } } }
private static void OnCreateObj_jayceshockblast(GameObject obj, EventArgs args, Obj_AI_Hero hero, SpellData spellData) { if (obj.Type == GameObjectType.obj_GeneralParticleEmitter && obj.Name.Contains("Jayce") && obj.Name.Contains("accel_gate_end") && obj.Name.Contains("RED")) { foreach (var tracker in ObjectTracker.ObjTracker) { var gateObj = tracker.Value; if (gateObj.Name == "AccelGate") { DelayAction.Add(0, () => ObjectTracker.ObjTracker.Remove(tracker.Key)); } } } if (obj.Type == GameObjectType.obj_GeneralParticleEmitter && obj.Name.Contains("Jayce") && obj.Name.Contains("accel_gate_start") && obj.Name.Contains("RED")) { //var particle = obj as Obj_GeneralParticleEmitter; /*var dir = obj.Orientation.To2D(); * var pos1 = obj.Position.To2D() - dir * 470; * var pos2 = obj.Position.To2D() + dir * 470; * * //Draw.RenderObjects.Add(new Draw.RenderLine(pos1, pos2, 3500)); * Draw.RenderObjects.Add(new Draw.RenderCircle(pos1, 3500));*/ var gateTracker = new ObjectTrackerInfo(obj, "AccelGate"); //gateTracker.Orientation = dir.To3D(); ObjectTracker.ObjTracker.Add(obj.NetworkId, gateTracker); foreach (var entry in SpellDetector.Spells) //check currently moving skillshot { var spell = entry.Value; if (spell.Info.SpellName == "JayceShockBlast") { var tHero = spell.HeroId; Vector2 int1, int2; var intersection = MathUtils.FindLineCircleIntersections(obj.Position.To2D(), 470, spell.StartPos, spell.EndPos, out int1, out int2); var projection = obj.Position.To2D().ProjectOn(spell.StartPos, spell.EndPos); //var intersection = spell.startPos.Intersection(spell.endPos, pos1, pos2); //var projection = intersection.Point.ProjectOn(spell.startPos, spell.endPos); //if (intersection.Intersects && projection.IsOnSegment) if (intersection > 0 && projection.IsOnSegment) { SpellDetector.CreateSpellData(hero, projection.SegmentPoint.To3D(), spell.EndPos.To3D(), spellData, spell.SpellObject); DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); break; } } } //SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0); } }
private void Render_OnPresent() { foreach (var spell in SpellDetector.DrawSpells.Values) { var spellPos = spell.CurrentSpellPosition; if (spell.HeroId != MyHero.NetworkId) { continue; } switch (spell.SpellType) { case SpellType.Line: if (Vector2.Distance(spellPos, MyHero.ServerPosition.To2D()) <= MyHero.BoundingRadius + spell.Radius && Environment.TickCount - spell.StartTime > spell.Info.SpellDelay && Vector2.Distance(spell.StartPos, MyHero.ServerPosition.To2D()) < spell.Info.Range) { RenderObjects.Add(new RenderCircle(spellPos, 1000, Color.Red, (int)spell.Radius, 10)); Aimtec.SDK.Util.DelayAction.Queue(100, () => SpellDetector.DeleteSpell(spell.SpellId), new CancellationToken(false)); // DelayAction.Add(1, () => SpellDetector.DeleteSpell(spell.SpellId)); } else { Render.Circle(new Vector3(spellPos.X, spellPos.Y, MyHero.Position.Z), (int)spell.Radius, 50, Color.White); } break; case SpellType.Circular: if (Environment.TickCount - spell.StartTime >= spell.EndTime - spell.StartTime) { if (!MyHero.ServerPosition.To2D().InSkillShot(spell, MyHero.BoundingRadius)) { continue; } RenderObjects.Add(new RenderCircle(spellPos, 1000, Color.Red, (int)spell.Radius)); Aimtec.SDK.Util.DelayAction.Queue(100, () => SpellDetector.DeleteSpell(spell.SpellId), new CancellationToken(false)); } break; case SpellType.Cone: // SPELL TESTER if (Environment.TickCount - spell.StartTime >= spell.EndTime - spell.StartTime) { if (MyHero.ServerPosition.To2D().InSkillShot(spell, MyHero.BoundingRadius)) { Aimtec.SDK.Util.DelayAction.Queue(100, () => SpellDetector.DeleteSpell(spell.SpellId), new CancellationToken(false)); } } break; } } }
private void Game_OnUpdate(EventArgs args) { foreach (var entry in SpellDetector.detectedSpells.Where(x => x.Value.info.spellName.Contains("_trap"))) { var spell = entry.Value; if (spell.spellObject == null) { continue; } if (spell.spellObject.IsDead || !spell.spellObject.IsVisible || !spell.spellObject.IsValid) { DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); entry.Value.spellObject = null; } } }
private void Game_OnWndProc(WndProcEventArgs e) { if (!ObjectCache.MenuCache.Cache["ClickRemove"].Enabled) { return; } if (e.Message != (uint)WindowsMessages.WM_LBUTTONDOWN) { return; } foreach (var entry in SpellDetector.DetectedSpells.Where(x => Game.CursorPos.To2D().InSkillShot(x.Value, 50 + x.Value.Info.Radius, false))) { var spell = entry.Value; if (spell.Info.Range > 9000 /*global*/ || spell.Info.SpellName.Contains("_trap")) { DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); } } }
private void Game_OnWndProc(WndEventArgs args) { if (!ObjectCache.menuCache.cache["ClickRemove"].GetValue <bool>()) { return; } if (args.Msg != (uint)WindowsMessages.WM_LBUTTONDOWN) { return; } foreach (var entry in SpellDetector.detectedSpells.Where(x => Game.CursorPos.To2D().InSkillShot(x.Value, 50 + x.Value.info.radius, false))) { var spell = entry.Value; if (spell.info.range > 9000 /*global*/ || spell.info.spellType == SpellType.Circular) { DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); Game.PrintChat("<b>ezEvade</b>: " + spell.info.charName + " (" + spell.info.spellKey + ") removed!"); } } }
private static void OnCreateObj_jayceshockblast(GameObject obj, EventArgs args, AIHeroClient hero, SpellData spellData) { return; if (obj.IsEnemy && obj.Type == GameObjectType.obj_GeneralParticleEmitter && obj.Name.Contains("Jayce") && obj.Name.Contains("accel_gate_start")) { var dir = ObjectTracker.GetLastHiuOrientation(); var pos1 = obj.Position.To2D() - dir * 470; var pos2 = obj.Position.To2D() + dir * 470; var gateTracker = new ObjectTrackerInfo(obj, "AccelGate"); gateTracker.direction = dir.To3D(); ObjectTracker.objTracker.Add(obj.NetworkId, gateTracker); foreach (var entry in SpellDetector.spells) { var spell = entry.Value; if (spell.info.spellName == "jayceshockblast") { var tHero = spell.heroID; var intersection = spell.startPos.Intersection(spell.endPos, pos1, pos2); var projection = intersection.Point.ProjectOn(spell.startPos, spell.endPos); if (intersection.Intersects && projection.IsOnSegment) { SpellDetector.CreateSpellData(hero, intersection.Point.To3D(), spell.endPos.To3D(), spellData, spell.spellObject); DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key)); } } } //SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0); } }
private void Game_OnWndProc(WndEventArgs args) { if (!ObjectCache.menuCache.cache["ClickRemove"].Cast <CheckBox>().CurrentValue) { return; } if (args.Msg != (uint)WindowMessages.LeftButtonDown) { return; } foreach (var entry in SpellDetector.detectedSpells.Where(x => Game.CursorPos.To2D().InSkillShot(x.Value, 50 + x.Value.info.radius, false))) { var spell = entry.Value; if (spell.info.range > 9000 /*global*/ || spell.info.spellName.Contains("_trap")) { Core.DelayAction(() => SpellDetector.DeleteSpell(entry.Key), 1); //Game.PrintChat("<b>ezEvade</b>: " + spell.info.charName + " (" + spell.info.spellKey + ") removed!"); } } }