private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs) { if (spellData.SpellName == "GravesQLineSpell") { var newData = (SpellData)spellData.Clone(); newData.IsPerpendicular = true; newData.SecondaryRadius = 255f; newData.UpdatePosition = false; newData.ExtraEndTime = 1300; var end = args.End; var start = args.Start; if (end.Distance(start) > newData.Range) { end = args.Start + (args.End - args.Start).Normalized() * newData.Range; } if (end.Distance(start) < newData.Range) { end = args.Start + (args.End - args.Start).Normalized() * newData.Range; } var w = EvadeHelper.GetNearWallPoint(start, end); if (w != default(Vector3)) { end = w; } //SpellDetector.CreateSpellData(hero, hero.ServerPosition, end, spellData); SpellDetector.CreateSpellData(hero, hero.ServerPosition, end, newData); } }
private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs) { if (spellData.SpellName != "ZileanQ") { return; } var end = args.End; if (args.Start.Distance(end) > spellData.Range) { end = args.Start + (args.End - args.Start).Normalized() * spellData.Range; } foreach (var bomb in Bombs.Where(b => b.IsValid && !b.IsDead && b.IsVisible)) { var newData = (SpellData)spellData.Clone(); newData.Radius = 350; if (!(end.Distance(bomb.Position) <= newData.Radius)) { continue; } SpellDetector.CreateSpellData(hero, hero.ServerPosition, bomb.Position, newData, null, 0, true, SpellType.Circular, false, newData.Radius); SpellDetector.CreateSpellData(hero, hero.ServerPosition, end, newData, null, 0, true, SpellType.Circular, false, newData.Radius); specialSpellArgs.NoProcess = true; } foreach (var bombPosition in QSpots.Values) { var newData = (SpellData)spellData.Clone(); newData.Radius = 350; if (!(end.Distance(bombPosition) <= newData.Radius) || QSpots.Count <= 1) { continue; } SpellDetector.CreateSpellData(hero, hero.ServerPosition, bombPosition, newData, null, 0, true, SpellType.Circular, false, newData.Radius); SpellDetector.CreateSpellData(hero, hero.ServerPosition, end, newData, null, 0, true, SpellType.Circular, false, newData.Radius); specialSpellArgs.NoProcess = true; } QSpots[Game.ClockTime] = end; }
private void ProcessSpell_TwitchSprayandPrayAttack(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs) { if (spellData.SpellName == "TwitchSprayandPrayAttack") { if (args.Target != null) { var start = hero.ServerPosition; var end = hero.ServerPosition + (args.Target.Position - hero.ServerPosition) * spellData.Range; var data = (SpellData)spellData.Clone(); data.SpellDelay = hero.AttackCastDelay * 1000; SpellDetector.CreateSpellData(hero, start, end, data); } } }
private void ProcessSPellFizzMarinerDoom(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs) { if (spellData.SpellName == "FizzR") { var start = args.Start; var endPos = args.End; if (start.Distance(endPos) > spellData.Range) { endPos = start + (endPos - start).Normalized() * spellData.Range; } var dist = start.Distance(endPos); var radius = dist > 910 ? 400 : (dist >= 455 ? 300 : 200); var data = (SpellData)spellData.Clone(); data.SecondaryRadius = radius; specialSpellArgs.SpellData = data; } }
private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs) { if (spellData.SpellName.ToLower() == "syndrae") { var estart = args.Start; var eend = args.Start + (args.End - args.Start).Normalized() * 800; foreach (var sphere in _spheres.Where(s => s.IsValid && !s.IsDead)) { // check if e whill hit the sphere var proj = sphere.Position.To2D().ProjectOn(estart.To2D(), eend.To2D()); if (proj.IsOnSegment && sphere.Position.To2D().Distance(proj.SegmentPoint) <= sphere.BoundingRadius + 155) { var start = sphere.Position; var end = hero.ServerPosition + (sphere.Position - hero.ServerPosition).Normalized() * spellData.Range; var data = (SpellData)spellData.Clone(); data.SpellDelay = sphere.Distance(hero.ServerPosition) / spellData.ProjectileSpeed * 1000; SpellDetector.CreateSpellData(hero, start, end, data, sphere); } } foreach (var entry in _qSpots) { var spherePosition = entry.Value; // check if e whill hit the sphere var proj = spherePosition.To2D().ProjectOn(estart.To2D(), eend.To2D()); if (proj.IsOnSegment && spherePosition.To2D().Distance(proj.SegmentPoint) <= 155) { var start = spherePosition; var end = hero.ServerPosition + (spherePosition - hero.ServerPosition).Normalized() * spellData.Range; var data = (SpellData)spellData.Clone(); data.SpellDelay = spherePosition.Distance(hero.ServerPosition) / spellData.ProjectileSpeed * 1000; SpellDetector.CreateSpellData(hero, start, end, data); } } specialSpellArgs.NoProcess = true; } if (spellData.SpellName.ToLower() == "syndraq") { var end = args.End; if (args.Start.Distance(end) > spellData.Range) { end = args.Start + (args.End - args.Start).Normalized() * spellData.Range; } _qSpots[Game.ClockTime] = end; } if (spellData.SpellName.ToLower() == "syndrawcast") { var end = args.End; if (args.Start.Distance(end) > spellData.Range) { end = args.Start + (args.End - args.Start).Normalized() * spellData.Range; } _qSpots[Game.ClockTime] = end; } }