private static void GameObject_OnCreate(GameObject sender, EventArgs args) { var client = sender as MissileClient; if (client != null && client.SData.Name == "AhriOrbMissile") { QOrbMissile = client; } if (client != null && client.SData.Name == "AhriOrbReturn") { QReturnMissile = client; } if (sender.Name != "Rengar_LeapSound.troy") return; var gapcloserMenuInfo = Config.AntiGapcloserMenuValues.FirstOrDefault(x => x.Champion == "Rengar"); if (gapcloserMenuInfo == null || !gapcloserMenuInfo.Enabled) return; foreach (var rengar in EntityManager.Heroes.Enemies.Where(x => x.IsValidTarget(1000) && x.ChampionName == "Rengar").Where(rengar => rengar.Distance(Player.Instance.Position) < 1000)) { CachedAntiGapclosers.Add(new ProcessSpellCastCache { Sender = rengar, NetworkId = rengar.NetworkId, DangerLevel = gapcloserMenuInfo.DangerLevel, Tick = (int)Game.Time * 1000 }); } }
public static bool IsMissileClient(this GameObject gameObject, out MissileClient missileClient) { missileClient = null; if (gameObject.GetType() != typeof(MissileClient) || !((MissileClient)gameObject).IsValidMissile()) return false; missileClient = (MissileClient) gameObject; return true; }
public static void Obj_SpellMissile_OnCreate(GameObject sender, EventArgs args) { if (!(sender is MissileClient)) return; var missile = (MissileClient)sender; if (missile.SpellCaster != null && missile.SpellCaster.IsValid && missile.SpellCaster.IsMe && missile.SData.Name.Equals("VelkozQMissile", StringComparison.InvariantCultureIgnoreCase)) { QMissile = missile; } }
public static void GameObject_OnCreate(GameObject sender, EventArgs args) { var piuwpiuw = sender as MissileClient; if (piuwpiuw != null && piuwpiuw.IsValid) { if (piuwpiuw.SpellCaster.IsMe && piuwpiuw.SData.Name == "LissandraEMissile") { PiuwPiuwMissile = piuwpiuw; } } }
public static void setParticle(MissileClient part) { //Should add check if same spell :) foreach (var targ in ActiveTargeted) { if (targ.particle == null && targ.hadPart == false) { targ.particle = part; targ.hadPart = true; return; } } }
private void SpellMissile_OnCreateOld(GameObject sender, EventArgs args) { if (sender.IsEnemy || sender.Type != GameObjectType.MissileClient || !sender.IsValid<MissileClient>()) return; MissileClient missile = (MissileClient)sender; if (missile.SData.Name != null) { if (missile.SData.Name == MissileName || missile.SData.Name == MissileReturnName) { Missile = missile; } } }
private static void GameObject_OnCreate(GameObject sender, EventArgs args) { if (sender == null) return; MissileClient projectile = sender as MissileClient; if (projectile == null || projectile.SpellCaster == null || projectile.SData == null || projectile.SpellCaster.Type != GameObjectType.AIHeroClient) return; if (projectile.SpellCaster.IsMe && projectile.SData.Name == "VelkozQMissile") { activeQ = projectile; //Console.WriteLine("Q Missile Created"); } }
//Check if the skillshot is from an ally. if (skillshot.Caster.Team == ObjectManager.Player.Team) { return; } //Check if the skillshot is too far away. if (skillshot.Start.LSDistance(ObjectManager.Player.ServerPosition.LSTo2D()) > (skillshot.SpellData.Range + skillshot.SpellData.Radius + 1000) * 1.5) { return; } //Add the skillshot to the detected skillshot list. if (!alreadyAdded) { //Multiple skillshots like twisted fate _spells[Spells.Q]. if (skillshot.DetectionType == DetectionType.ProcessSpell) { if (skillshot.SpellData.MultipleNumber != -1)
private static void ObjMissileClientOnCreateDelayed(MissileClient missile, SpellData spellData) { var unit = missile.SpellCaster as Obj_AI_Hero; var missilePosition = missile.Position.ToVector2(); var unitPosition = missile.StartPosition.ToVector2(); var endPos = missile.EndPosition.ToVector2(); var direction = (endPos - unitPosition).Normalized(); if (unitPosition.Distance(endPos) > spellData.Range || spellData.FixedRange) { endPos = unitPosition + direction * spellData.Range; } if (spellData.ExtraRange != -1) { endPos += Math.Min(spellData.ExtraRange, spellData.Range - endPos.Distance(unitPosition)) * direction; } var castTime = Variables.TickCount - Game.Ping / 2 - (spellData.MissileDelayed ? 0 : spellData.Delay) - (int)(1000f * missilePosition.Distance(unitPosition) / spellData.MissileSpeed); TriggerOnDetectSkillshot(DetectionType.RecvPacket, spellData, castTime, unitPosition, endPos, unit); }
/// <summary> /// Initializes static members of the <see cref="Collision" /> class. /// Static Constructor /// </summary> static Collision() { GameObject.OnCreate += (sender, args) => { var missile = sender as MissileClient; var spellCaster = missile?.SpellCaster as AIHeroClient; if (spellCaster == null || spellCaster.ChampionName != "Yasuo" || spellCaster.Team == GameObjects.Player.Team) { return; } switch (missile.SData.Name) { case "YasuoWMovingWallMisL": yasuoWallLeft = missile; break; case "YasuoWMovingWallMisR": yasuoWallRight = missile; break; } }; GameObject.OnDelete += (sender, args) => { var missile = sender as MissileClient; if (missile == null) { return; } if (missile.Compare(yasuoWallLeft)) { yasuoWallLeft = null; } else if (missile.Compare(yasuoWallRight)) { yasuoWallRight = null; } }; }
private static void OnDeleteMissile(Skillshot skillshot, MissileClient missile) { if (skillshot.SpellData.SpellName != "VelkozQ" || DetectedSkillshots.Count(i => i.SpellData.SpellName == "VelkozQSplit") != 0) { return; } var spellData = SpellDatabase.GetByName("VelkozQSplit"); for (var i = -1; i <= 1; i = i + 2) { DetectedSkillshots.Add( new Skillshot( DetectionType.ProcessSpell, spellData, Variables.TickCount, missile.Position.ToVector2(), missile.Position.ToVector2() + i * skillshot.Direction.Perpendicular() * spellData.Range, skillshot.Unit)); } }
private static void GameObject_OnDelete(GameObject sender, EventArgs args) { if (sender == null) return; MissileClient projectile = sender as MissileClient; if (projectile == null || projectile.SpellCaster == null || projectile.SData == null || projectile.SpellCaster.Type != GameObjectType.AIHeroClient) return; if (projectile.SpellCaster.IsMe && projectile.SData.Name == "VelkozQMissile") { activeQ = null; startPos = Vector2.Zero; LeftPos = Vector2.Zero; RightPos = Vector2.Zero; QTarget = null; //Console.WriteLine("Q Missile Destroyed"); } }
private static void GameObject_OnDelete(GameObject sender, EventArgs args) { if (AhriQMissile != null && sender.NetworkId.Equals(AhriQMissile.NetworkId)) { AhriQMissile = null; } if (AhriQParticle != null && sender.NetworkId.Equals(AhriQParticle.NetworkId)) { AhriQParticle = null; } }
private static void GameObject_OnCreate(GameObject sender, EventArgs args) { var particle = sender as Obj_GeneralParticleEmitter; if (particle != null && particle.IsValid && (particle.Name.Contains("Ahri_Orb") || particle.Name.Contains("Ahri_Passive"))) { AhriQParticle = particle; return; } var missile = sender as MissileClient; if (missile == null || !missile.IsValid || !missile.SpellCaster.IsMe) { return; } if (missile.SData.Name.Equals("AhriOrbReturn") || missile.SData.Name.Equals("AhriOrbMissile")) { AhriQMissile = missile; } }
private static void GameObject_OnDelete(GameObject sender, EventArgs args) { var missile = sender as MissileClient; if (missile != null) { if (missile.IdEquals(WMissile)) { WMissile = null; } else if (missile.IdEquals(RMissile)) { RMissile = null; } } }
private static void GameObject_OnCreate(GameObject sender, EventArgs args) { var missile = sender as MissileClient; if (missile != null && missile.SpellCaster != null && missile.SpellCaster.IsMe) { if (missile.SData.Name.Equals("JinxWMissile")) { WMissile = missile; Core.DelayAction(delegate { WMissile = null; }, (int)(1000 * missile.SpellCaster.Distance(missile.EndPosition) / W.Speed) + 200); } if (missile.SData.Name.Equals("JinxR")) { RMissile = missile; } } }
private static void TriggerOnDetectSkillshot( DetectionType detectionType, SpellData spellData, int startT, Vector2 start, Vector2 end, Vector2 originalEnd, Obj_AI_Base unit, MissileClient missile = null) { OnDetectSkillshot?.Invoke(new Skillshot(detectionType, spellData, startT, start, end, unit, missile) { OriginalEnd = originalEnd }); }
private void SpellMissile_OnCreate(GameObject obj, EventArgs args) { /*if (sender.Name.ToLower().Contains("minion") || sender.Name.ToLower().Contains("turret") || sender.Type == GameObjectType.obj_GeneralParticleEmitter) { return; } if (sender.IsValid<MissileClient>()) { var tMissile = sender as MissileClient; if (tMissile.SpellCaster.Type != GameObjectType.obj_AI_Hero) { return; } } ConsolePrinter.Print(sender.Type + " : " + sender.Name);*/ var minion = obj as Obj_AI_Minion; if(minion != null){ ConsolePrinter.Print(minion.CharData.BaseSkinName); } if (obj.IsValid<MissileClient>()) { MissileClient autoattack = (MissileClient)obj; /*if (!autoattack.SpellCaster.IsMinion) { ConsolePrinter.Print("Missile Name " + autoattack.SData.Name); ConsolePrinter.Print("Missile Speed " + autoattack.SData.MissileSpeed); ConsolePrinter.Print("LineWidth " + autoattack.SData.LineWidth); ConsolePrinter.Print("Range " + autoattack.SData.CastRange); ConsolePrinter.Print("Accel " + autoattack.SData.MissileAccel); }*/ } //ConsolePrinter.Print(obj.Name + ": " + obj.Type); if (!obj.IsValid<MissileClient>()) return; if (testMenu.Item("ShowMissileInfo").GetValue<bool>() == false) { return; } MissileClient missile = (MissileClient)obj; if (!missile.SpellCaster.IsValid<Obj_AI_Hero>()) { //return; } var testMissileSpeedStartTime = EvadeUtils.TickCount; var testMissileSpeedStartPos = missile.Position.To2D(); DelayAction.Add(250, () => { if (missile != null && missile.IsValid && !missile.IsDead) { testMissileSpeedStartTime = EvadeUtils.TickCount; testMissileSpeedStartPos = missile.Position.To2D(); } }); testMissile = missile; testMissileStartTime = EvadeUtils.TickCount; ConsolePrinter.Print("Est.CastTime: " + (EvadeUtils.TickCount - lastHeroSpellCastTime)); ConsolePrinter.Print("Missile Name " + missile.SData.Name); ConsolePrinter.Print("Missile Speed " + missile.SData.MissileSpeed); ConsolePrinter.Print("Max Speed " + missile.SData.MissileMaxSpeed); ConsolePrinter.Print("LineWidth " + missile.SData.LineWidth); ConsolePrinter.Print("Range " + missile.SData.CastRange); //ConsolePrinter.Print("Angle " + missile.SData.CastConeAngle); /*ConsolePrinter.Print("Offset: " + missile.SData.ParticleStartOffset); ConsolePrinter.Print("Missile Speed " + missile.SData.MissileSpeed); ConsolePrinter.Print("LineWidth " + missile.SData.LineWidth); circleRenderPos = missile.SData.ParticleStartOffset.To2D();*/ //ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - lastSpellCastTime)); Draw.RenderObjects.Add( new Draw.RenderCircle(missile.StartPosition.To2D(), 500)); Draw.RenderObjects.Add( new Draw.RenderCircle(missile.EndPosition.To2D(), 500)); DelayAction.Add(750, () => { if (missile != null && missile.IsValid && !missile.IsDead) { var dist = missile.Position.To2D().Distance(testMissileSpeedStartPos); ConsolePrinter.Print("Est.Missile speed: " + dist / (EvadeUtils.TickCount - testMissileSpeedStartTime)); } }); SpellData spellData; if (missile.SpellCaster != null && missile.SpellCaster.Team != myHero.Team && missile.SData.Name != null && SpellDetector.onMissileSpells.TryGetValue(missile.SData.Name, out spellData) && missile.StartPosition != null && missile.EndPosition != null) { if (missile.StartPosition.Distance(myHero.Position) < spellData.range + 1000) { var hero = missile.SpellCaster; if (hero.IsVisible) { foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells) { Spell spell = entry.Value; if (spell.info.missileName == missile.SData.Name && spell.heroID == missile.SpellCaster.NetworkId) { if (spell.info.isThreeWay == false && spell.info.isSpecial == false) { //spell.spellObject = obj; ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - spell.startTime)); } } } } } } }
public static bool isMissileCommingAtMe(MissileClient missle) { Vector3 step = missle.StartPosition + Vector3.Normalize(missle.StartPosition - missle.EndPosition) * 10; return (!(Player.LSDistance(step) < Player.LSDistance(missle.StartPosition))); }
public Skillshot( DetectionType detectionType, SpellData spellData, int startT, Vector2 start, Vector2 end, Obj_AI_Base unit, MissileClient missile = null) { this.DetectionType = detectionType; this.SpellData = spellData; this.StartTick = startT; this.Start = start; this.End = end; this.Direction = (end - start).LSNormalized(); this.Unit = unit; this.Missile = missile; switch (spellData.Type) { case SkillShotType.SkillshotCircle: this.Circle = new Geometry.Circle(this.CollisionEnd, spellData.Radius); break; case SkillShotType.SkillshotLine: this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius); break; case SkillShotType.SkillshotMissileLine: this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius); break; case SkillShotType.SkillshotCone: this.Sector = new Geometry.Sector( start, this.CollisionEnd - start, spellData.Radius * (float)Math.PI / 180, spellData.Range); break; case SkillShotType.SkillshotRing: this.Ring = new Geometry.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius); break; case SkillShotType.SkillshotArc: this.Arc = new Geometry.Arc( start, end, Config.SkillShotsExtraRadius + (int)Program.Player.BoundingRadius); break; } this.UpdatePolygon(); }
private static void MissileClient_OnCreate(GameObject sender, EventArgs args) { if (IsWaitingMissile) { if (sender != null && sender is MissileClient) { var missile = sender as MissileClient; if (missile.SpellCaster.IsMe) { if (missile.SData.Name.ToLower().Contains("blindmonkqone")) { Missile = missile; Core.DelayAction(delegate { Missile = null; }, 1000 * (int)(2 * Extensions.Distance(Missile, Missile.EndPosition) / SpellManager.Q1.Speed)); } } } } }
static void ObjectHandling() { GameObject.OnCreate += (sender, args) => { if (sender.Name.Contains("ZiggsLightstrike_tar")) { var miss = sender as MissileClient; if (sender is MissileClient && sender.IsValid && miss.SpellCaster.IsMe) { ZiggsE = miss; } } }; GameObject.OnDelete += (sender, args) => { if (sender.Name.Contains("ZiggsLightstrike_tar")) { var miss = sender as MissileClient; if (sender is MissileClient && sender.IsValid && miss.SpellCaster.IsMe) { ZiggsE = null; } } }; }
/// <summary> /// Gets the spell hit time. /// </summary> /// <param name="missile">The missile.</param> /// <param name="pos">The position.</param> /// <returns></returns> private float GetSpellHitTime(MissileClient missile, Vector2 pos) { if (!missile.SData.TargettingType.ToString().Contains("Location") || missile.SData.TargettingType.ToString().Contains("Aoe")) { return missile.SData.TargettingType == SpellDataTargetType.LocationAoe ? Math.Max( 0, missile.SData.CastFrame / 30 * 1000 + missile.StartPosition.LSDistance(missile.EndPosition) / missile.SData.MissileSpeed * 1000 - Environment.TickCount - Game.Ping) : float.MaxValue; } if ( Spells.Find(x => x.MissileName.Equals(missile.Name, StringComparison.InvariantCultureIgnoreCase)) .MissileSpeed == int.MaxValue) { return Math.Max( 0, missile.SData.CastFrame / 30 * 1000 + missile.StartPosition.LSDistance(missile.EndPosition) / missile.SData.MissileSpeed * 1000 - Environment.TickCount - Game.Ping); } var spellPos = missile.Position.LSTo2D(); return 1000 * spellPos.LSDistance(pos) / missile.SData.MissileAccel; }
/// <summary> /// Determines whether the hero can evade the specified missile. /// </summary> /// <param name="missile">The missile.</param> /// <param name="hero">The hero.</param> /// <returns></returns> private bool CanEvadeMissile(MissileClient missile, Obj_AI_Base hero) { var heroPos = hero.ServerPosition.LSTo2D(); float evadeTime = 0; float spellHitTime = 0; if (missile.SData.TargettingType.ToString().Contains("Location") && !missile.SData.TargettingType.ToString().Contains("Aoe")) { var projection = heroPos.ProjectOn(missile.StartPosition.LSTo2D(), missile.EndPosition.LSTo2D()).SegmentPoint; evadeTime = 1000 * (missile.SData.LineWidth - heroPos.LSDistance(projection) + hero.BoundingRadius) / hero.MoveSpeed; spellHitTime = GetSpellHitTime(missile, projection); } else if (missile.SData.TargettingType == SpellDataTargetType.LocationAoe) { evadeTime = 1000 * (missile.SData.CastRadius - heroPos.LSDistance(missile.EndPosition)) / hero.MoveSpeed; spellHitTime = GetSpellHitTime(missile, heroPos); } return spellHitTime > evadeTime; }
private static void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args) { if (sender.IsValid<MissileClient>() && sender.IsAlly) { var missile = (MissileClient) sender; if (missile.SData.Name != null && missile.SData.Name == "VelkozQMissile") QMissile = missile; } }
private void Obj_SpellMissile_OnDelete(GameObject sender, EventArgs args) { if (sender.IsEnemy || sender.Type != GameObjectType.MissileClient || !sender.IsValid<MissileClient>()) return; var missile = (MissileClient) sender; if (missile.SData.Name != null) { if (missile.SData.Name.ToLower() == MissileReturnName.ToLower()) { Missile = null; } } }
private static void MissileClient_OnDelete(GameObject sender, EventArgs args) { if (MissileIsValid) { if (sender != null && sender is MissileClient) { var missile = sender as MissileClient; if (missile.SpellCaster.IsMe) { if (Missile.NetworkId == missile.NetworkId) { Smite_Target = null; Missile = null; } } } } }
public Zed() { Q = new LeagueSharp.SDK.Spell(SpellSlot.Q, 925).SetSkillshot(0.25f, 50, 1700, true, SkillshotType.SkillshotLine); Q2 = new LeagueSharp.SDK.Spell(Q.Slot, Q.Range).SetSkillshot(Q.Delay, Q.Width, Q.Speed, true, Q.Type); Q3 = new LeagueSharp.SDK.Spell(Q.Slot, Q.Range).SetSkillshot(Q.Delay, Q.Width, Q.Speed, true, Q.Type); W = new LeagueSharp.SDK.Spell(SpellSlot.W, 700).SetSkillshot(0, 0, 1750, false, SkillshotType.SkillshotLine); E = new LeagueSharp.SDK.Spell(SpellSlot.E, 290).SetTargetted(0.005f, float.MaxValue); R = new LeagueSharp.SDK.Spell(SpellSlot.R, 625); Q.DamageType = W.DamageType = E.DamageType = R.DamageType = DamageType.Physical; Q.MinHitChance = HitChance.VeryHigh; comboMenu = config.AddSubMenu("Combo", "Combo"); comboMenu.AddGroupLabel("Q/E: Always On"); comboMenu.Add("Ignite", new CheckBox("Use Ignite")); comboMenu.Add("Items", new CheckBox("Use Items")); comboMenu.AddGroupLabel("Swap Settings"); comboMenu.Add("SwapIfKill", new CheckBox("Swap W/R If Mark Can Kill Target", false)); comboMenu.Add("SwapIfHpU", new Slider("Swap W/R If Hp < (%)", 10)); comboMenu.Add("SwapGap", new ComboBox("Swap W/R To Gap Close", 1, "OFF", "Smart", "Always")); comboMenu.AddGroupLabel("W Settings"); comboMenu.Add("WNormal", new CheckBox("Use For Non-R Combo")); comboMenu.Add("WAdv", new ComboBox("Use For R Combo", 1, "OFF", "Line", "Triangle", "Mouse")); comboMenu.AddGroupLabel("R Settings"); comboMenu.Add("R", new KeyBind("Use R", false, KeyBind.BindTypes.PressToggle, 'X')); comboMenu.Add("RMode", new ComboBox("Mode", 0, "Always", "Wait Q/E")); comboMenu.Add("RStopRange", new Slider("Prevent Q/W/E If R Ready And Distance <=", (int)(R.Range + 200), (int)R.Range, (int)(R.Range + W.Range))); if (GameObjects.EnemyHeroes.Any()) { comboMenu.AddGroupLabel("Extra R Settings"); foreach (var enemy in ObjectManager.Get<AIHeroClient>().Where(o => o.IsEnemy)) { comboMenu.Add("RCast" + enemy.NetworkId, new CheckBox("Cast On " + enemy.ChampionName, false)); } } hybridMenu = config.AddSubMenu("Hybrid", "Hybrid"); hybridMenu.Add("Mode", new ComboBox("Mode", 1, "W-E-Q", "E-Q", "Q")); hybridMenu.Add("WEQ", new KeyBind("Only W If Hit E-Q", false, KeyBind.BindTypes.PressToggle, 'X')); hybridMenu.AddGroupLabel("Auto Q Settings (Champ)"); hybridMenu.Add("AutoQ", new KeyBind("KeyBind", false, KeyBind.BindTypes.PressToggle, 'T')); hybridMenu.Add("AutoQMpA", new Slider("If Mp >=", 100, 0, 200)); hybridMenu.AddGroupLabel("Auto E Settings (Champ/Shadow)"); hybridMenu.Add("AutoE", new CheckBox("Auto", false)); lhMenu = config.AddSubMenu("LastHit", "Last Hit"); lhMenu.Add("Q", new CheckBox("Use Q")); ksMenu = config.AddSubMenu("KillSteal", "Kill Steal"); ksMenu.Add("Q", new CheckBox("Use Q")); ksMenu.Add("E", new CheckBox("Use E")); if (GameObjects.EnemyHeroes.Any()) { Evade.Init(); } drawMenu = config.AddSubMenu("Draw", "Draw"); drawMenu.Add("Q", new CheckBox("Q Range", false)); drawMenu.Add("W", new CheckBox("W Range", false)); drawMenu.Add("E", new CheckBox("E Range", false)); drawMenu.Add("R", new CheckBox("R Range", false)); drawMenu.Add("RStop", new CheckBox("Prevent Q/W/E Range", false)); drawMenu.Add("UseR", new CheckBox("R In Combo Status")); drawMenu.Add("Target", new CheckBox("Target")); drawMenu.Add("DMark", new CheckBox("Death Mark")); drawMenu.Add("WPos", new CheckBox("W Shadow")); drawMenu.Add("RPos", new CheckBox("R Shadow")); miscMenu = config.AddSubMenu("Misc", "Misc"); miscMenu.Add("FleeW", new KeyBind("Use W To Flee", false, KeyBind.BindTypes.HoldActive, 'C')); Evade.Evading += Evading; Evade.TryEvading += TryEvading; Game.OnUpdate += OnUpdate; Drawing.OnDraw += OnDraw; Obj_AI_Base.OnProcessSpellCast += (sender, args) => { if (!sender.IsMe) { return; } if (args.Slot == SpellSlot.W && args.SData.Name == "ZedW") { rCasted = false; wCasted = true; } else if (args.Slot == SpellSlot.R && args.SData.Name == "ZedR") { wCasted = false; rCasted = true; } }; GameObject.OnCreate += (sender, args) => { if (sender.IsEnemy) { return; } var shadow = sender as Obj_AI_Minion; if (shadow == null || !shadow.IsAlly || shadow.CharData.BaseSkinName != "ZedUltMissile" || shadow.CharData.BaseSkinName != "ZedShadowDashMissile" || shadow.CharData.BaseSkinName != "zedshadow") { return; } if (wCasted) { wShadowT = Variables.TickCount; wShadow = shadow; wCasted = rCasted = false; } else if (rCasted) { rShadowT = Variables.TickCount; rShadow = shadow; wCasted = rCasted = false; } }; Obj_AI_Base.OnBuffGain += (sender, args) => { if (sender.IsEnemy || !args.Buff.Caster.IsMe) { return; } var shadow = sender as Obj_AI_Minion; if (shadow != null && shadow.IsAlly && shadow.BaseSkinName == "ZedShadow" && args.Buff.Caster.IsMe) { switch (args.Buff.Name) { case "zedwshadowbuff": if (!wShadow.Compare(shadow)) { wShadowT = Variables.TickCount; wShadow = shadow; } break; case "zedrshadowbuff": if (!rShadow.Compare(shadow)) { rShadowT = Variables.TickCount; rShadow = shadow; } break; } } }; Obj_AI_Base.OnPlayAnimation += (sender, args) => { if (sender.IsMe || sender.IsEnemy || args.Animation != "Death") { return; } if (sender.Compare(wShadow)) { wShadow = null; } else if (sender.Compare(rShadow)) { rShadow = null; } }; GameObject.OnCreate += (sender, args) => { var missile = sender as MissileClient; if (missile != null) { if (missile.SpellCaster.IsMe && missile.SData.Name == "ZedWMissile") { wMissile = missile; } return; } if (sender.Name != "Zed_Base_R_buf_tell.troy") { return; } var target = EntityManager.Heroes.Enemies.FirstOrDefault(i => i.LSIsValidTarget() && HaveR(i)); if (target != null && target.Distance(sender) < 150) { deathMark = sender; } }; GameObject.OnDelete += (sender, args) => { if (sender.Compare(wMissile)) { wMissile = null; } else if (sender.Compare(deathMark)) { deathMark = null; } }; }
public Diana() { Q = new SpellBase(SpellSlot.Q, SpellType.Circular, 825) { Width = 185, CastDelay = 250, Speed = 1640 }; W = new SpellBase(SpellSlot.W, SpellType.Self, 250); E = new SpellBase(SpellSlot.E, SpellType.Self, 450) { CastDelay = 250 }; R = new SpellBase(SpellSlot.R, SpellType.Targeted, 825) { Speed = 2500 }; Obj_AI_Base.OnProcessSpellCast += delegate (Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { if (sender.IsMe) { switch (args.Slot) { case SpellSlot.Q: Q.LastCastTime = Core.GameTickCount; QEndPosition = args.End; // +(args.End - sender.ServerPosition).Normalized() * Q.Width / 2; break; case SpellSlot.R: R.LastCastTime = Core.GameTickCount; break; } } }; GameObject.OnCreate += delegate (GameObject sender, EventArgs args) { var missile = sender as MissileClient; if (missile != null && missile.SpellCaster != null && missile.SpellCaster.IsMe) { if (missile.SData.Name.Equals(QMissileName)) { QMissile = missile; } } }; GameObject.OnDelete += delegate (GameObject sender, EventArgs args) { var missile = sender as MissileClient; if (missile != null && missile.SpellCaster != null && missile.SpellCaster.IsMe) { if (missile.SData.Name.Equals(QMissileName)) { QMissile = null; } } }; Gapcloser.OnGapcloser += delegate (AIHeroClient sender, Gapcloser.GapcloserEventArgs args) { if (sender.IsEnemy) { if (AutomaticMenu.CheckBox("Gapcloser")) { E.Cast(sender); } } }; Interrupter.OnInterruptableSpell += delegate (Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs args) { if (sender.IsEnemy) { if (AutomaticMenu.CheckBox("Interrupter")) { E.Cast(sender); } } }; Dash.OnDash += delegate (Obj_AI_Base sender, Dash.DashEventArgs args) { if (sender.IsEnemy) { if (AutomaticMenu.CheckBox("Gapcloser")) { E.Cast(sender); } } }; Q.AddConfigurableHitChancePercent(); MenuManager.AddSubMenu("Combo"); { ComboMenu.AddValue("Q", new CheckBox("Use Q")); ComboMenu.AddValue("W", new CheckBox("Use W")); ComboMenu.AddValue("QR", new CheckBox("Use QR on minion to gapclose")); ComboMenu.AddValue("Ignite", new CheckBox("Use Ignite if target is killable", false)); ComboMenu.AddStringList("E", "Use E", new[] { "Never", "Smartly", "Always" }, 1); ComboMenu.AddStringList("R", "Use R", new[] { "Never", "Smartly", "Always" }, 1); ComboMenu.AddValue("2ndR", new CheckBox("Use always second r", false)); } MenuManager.AddSubMenu("Harass"); { HarassMenu.AddValue("Q", new CheckBox("Use Q")); HarassMenu.AddValue("W", new CheckBox("Use W")); HarassMenu.AddValue("E", new CheckBox("Use E", false)); HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 25)); } MenuManager.AddSubMenu("Clear"); { ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear")); { ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit is greater than {0}", 4, 0, 10)); ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit is greater than {0}", 3, 0, 10)); ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50)); } ClearMenu.AddValue("LastHit", new GroupLabel("LastHit")); { ClearMenu.AddStringList("LastHit.Q", "Use Q", new[] { "Never", "Smartly", "Always" }, 1); ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50)); } ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear")); { ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q")); ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W")); ClearMenu.AddValue("JungleClear.R", new CheckBox("Use R")); ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20)); } } MenuManager.AddKillStealMenu(); { KillStealMenu.AddValue("Q", new CheckBox("Use Q")); KillStealMenu.AddValue("W", new CheckBox("Use W")); KillStealMenu.AddValue("R", new CheckBox("Use R")); } MenuManager.AddSubMenu("Automatic"); { AutomaticMenu.AddValue("Gapcloser", new CheckBox("Use E on hero gapclosing / dashing")); AutomaticMenu.AddValue("Interrupter", new CheckBox("Use E on channeling spells")); } MenuManager.AddDrawingsMenu(); { Q.AddDrawings(); W.AddDrawings(); E.AddDrawings(false); R.AddDrawings(); } }
public static bool missleWillHit(MissileClient missle) { if (missle.Target.IsMe || YasMath.interCir(missle.StartPosition.LSTo2D(), missle.EndPosition.LSTo2D(), Player.Position.LSTo2D(), missle.SData.LineWidth + Player.BoundingRadius)) { if (missle.StartPosition.LSDistance(Player.Position) < (missle.StartPosition.LSDistance(missle.EndPosition))) return true; } return false; }