internal static void Init() { Game.OnTick += delegate { if (Core.GameTickCount - Lastupdate > 100) { BallsList.AddRange(ObjectManager.Get <Obj_AI_Minion>().Where(o => o != null && !o.IsDead && o.IsValid && o.Health > 0 && o.BaseSkinName.Equals("SyndraSphere"))); BallsList.RemoveAll(b => b == null || b.IsDead || !b.IsValid); Lastupdate = Core.GameTickCount; } }; }
internal static float RDamage(Obj_AI_Base target) { if (target == null || !Syndra.R.IsLearned) { return(0); } var ap = Player.Instance.FlatMagicDamageMod; var index = Player.GetSpell(SpellSlot.R).Level - 1; var mindmg = new float[] { 270, 405, 540 }[index] +0.6f * ap; var maxdmg = new float[] { 630, 975, 1260 }[index] +1.4f * ap; var perballdmg = (new float[] { 90, 135, 180 }[index] +0.2f * ap) * BallsList.Count(); return(Player.Instance.CalculateDamageOnUnit(target, DamageType.Magical, Math.Max(mindmg, maxdmg) + perballdmg) - 15); }
public override void Draw() { if (DrawMenu.CheckBoxValue("dmg")) { foreach (var obj in EntityManager.Heroes.Enemies.Where(o => o.IsValidTarget())) { float x = obj.HPBarPosition.X; float y = obj.HPBarPosition.Y; dmg.Color = Color.White; if (ComboDamage(obj, true) >= obj.Health) { dmg.Color = Color.Red; } dmg.TextValue = (int)ComboDamage(obj, true) + " / " + (int)obj.Health; dmg.Position = new Vector2(x, y); dmg.Draw(); } } if (DrawMenu.CheckBoxValue("balls")) { foreach (var ball in BallsList.Where(b => b != null && E.IsInRange(b))) { Circle.Draw(SharpDX.Color.AliceBlue, ball.BoundingRadius + 25, ball); if (E.IsReady()) { var start = ball.ServerPosition.Extend(user.ServerPosition, 100).To3D(); var end = user.ServerPosition.Extend(ball.ServerPosition, Eball.Range).To3D(); new Geometry.Polygon.Rectangle(start, end, Eball.Width).Draw(Color.AliceBlue); } } } foreach (var spell in SpellList.Where(s => DrawMenu.CheckBoxValue(s.Slot))) { Circle.Draw(spell.IsReady() ? SharpDX.Color.Chartreuse : SharpDX.Color.OrangeRed, spell.Range, user); } }
internal static Obj_AI_Minion SelectBall(Obj_AI_Base target) { if (target == null) { return(null); } Obj_AI_Minion theball = null; var CastPosition = Syndra.Q.GetPrediction(target).CastPosition; foreach (var ball in BallsList.Where(b => b != null && Syndra.E.IsInRange(b))) { var source = Player.Instance.PredictPosition(); var start = ball.ServerPosition.Extend(source, 100).To3D(); var end = source.Extend(ball.ServerPosition, Syndra.Eball.Range).To3D(); var rect = new Geometry.Polygon.Rectangle(start, end, Syndra.Eball.Width); if (rect.IsInside(CastPosition)) { theball = ball; } } return(theball); }
protected override void OnReload(GameMode currentGameMode, bool maintainState) { BodyGUID = null; PenisGUID = null; BallsGUID = null; DisplayPenis = ChaControl.sex == 0; DisplayBalls = ChaControl.sex == 0 ? true : DefaultFemaleDisplayBalls.Value; var data = GetExtendedData(); if (data != null) { if (data.version == 1) { if (data.data.TryGetValue("DisplayBalls", out var loadedDisplayBalls)) { DisplayBalls = (bool)loadedDisplayBalls; } if (data.data.TryGetValue("UncensorGUID", out var loadedUncensorGUID) && loadedUncensorGUID != null) { string UncensorGUID = loadedUncensorGUID.ToString(); if (!UncensorGUID.IsNullOrWhiteSpace() && MigrationDictionary.TryGetValue(UncensorGUID, out MigrationData migrationData)) { BodyGUID = migrationData.BodyGUID; PenisGUID = migrationData.PenisGUID; BallsGUID = migrationData.BallsGUID; if (PenisGUID != null) { DisplayPenis = true; } } } } else { if (data.data.TryGetValue("BodyGUID", out var loadedUncensorGUID) && loadedUncensorGUID != null) { BodyGUID = loadedUncensorGUID.ToString(); } if (data.data.TryGetValue("PenisGUID", out var loadedPenisGUID) && loadedPenisGUID != null) { PenisGUID = loadedPenisGUID.ToString(); } if (data.data.TryGetValue("BallsGUID", out var loadedBallsGUID) && loadedBallsGUID != null) { BallsGUID = loadedBallsGUID.ToString(); } if (data.data.TryGetValue("DisplayPenis", out var loadedDisplayPenis)) { DisplayPenis = (bool)loadedDisplayPenis; } if (data.data.TryGetValue("DisplayBalls", out var loadedDisplayBalls)) { DisplayBalls = (bool)loadedDisplayBalls; } } } if (BodyGUID.IsNullOrWhiteSpace()) { BodyGUID = null; } if (PenisGUID.IsNullOrWhiteSpace()) { PenisGUID = null; } if (BallsGUID.IsNullOrWhiteSpace()) { BallsGUID = null; } if (MakerAPI.InsideAndLoaded) { if (MakerAPI.GetCharacterLoadFlags().Body) { if (MakerAPI.GetMakerBase().chaCtrl == ChaControl) { //Update the UI to match the loaded character if (BodyGUID == null || BodyList.IndexOf(BodyGUID) == -1) { //The loaded uncensor isn't on the list, possibly due to being forbidden BodyDropdown.SetValue(0, false); BodyGUID = null; } else { BodyDropdown.SetValue(BodyList.IndexOf(BodyGUID), false); } if (PenisGUID == null || PenisList.IndexOf(PenisGUID) == -1) { #if KK PenisDropdown.SetValue(DisplayPenis ? 0 : 1, false); #elif EC PenisDropdown.SetValue(0, false); #endif PenisGUID = null; } else { PenisDropdown.SetValue(PenisList.IndexOf(PenisGUID), false); } if (BallsGUID == null || BallsList.IndexOf(BallsGUID) == -1) { BallsDropdown.SetValue(DisplayBalls ? 0 : 1, false); BallsGUID = null; } else { BallsDropdown.SetValue(BallsList.IndexOf(BallsGUID), false); } } } else { //Set the uncensor stuff to whatever is set in the maker BodyGUID = BodyDropdown.Value == 0 ? null : BodyList[BodyDropdown.Value]; #if KK PenisGUID = PenisDropdown.Value == 0 || PenisDropdown.Value == 1 ? null : PenisList[PenisDropdown.Value]; DisplayPenis = PenisDropdown.Value == 1 ? false : true; #elif EC PenisGUID = PenisDropdown.Value == 0 ? null : PenisList[PenisDropdown.Value]; #endif BallsGUID = BallsDropdown.Value == 0 || BallsDropdown.Value == 1 ? null : BallsList[BallsDropdown.Value]; DisplayBalls = BallsDropdown.Value == 1 ? false : true; } } #if KK //Correct characters if genderbender is not permitted, except in Studio where it may be required for scene compatibility if (GenderBender.Value == false && !StudioAPI.InsideStudio) { DisplayPenis = ChaControl.sex == 0; DisplayBalls = ChaControl.sex == 0; } #endif //Update the uncensor on every load or reload UpdateUncensor(); }
protected override void OnReload(GameMode currentGameMode) { BodyGUID = null; PenisGUID = null; BallsGUID = null; DisplayPenis = ChaControl.sex == 0; DisplayBalls = ChaControl.sex == 0; var data = GetExtendedData(); if (data != null) { if (data.version == 1) { if (data.data.TryGetValue("DisplayBalls", out var loadedDisplayBalls)) { DisplayBalls = (bool)loadedDisplayBalls; } if (data.data.TryGetValue("UncensorGUID", out var loadedUncensorGUID) && loadedUncensorGUID != null) { string UncensorGUID = loadedUncensorGUID.ToString(); if (!UncensorGUID.IsNullOrWhiteSpace() && MigrationDictionary.TryGetValue(UncensorGUID, out MigrationData migrationData)) { BodyGUID = migrationData.BodyGUID; PenisGUID = migrationData.PenisGUID; BallsGUID = migrationData.BallsGUID; if (PenisGUID != null) { DisplayPenis = true; } } } } else { if (data.data.TryGetValue("BodyGUID", out var loadedUncensorGUID) && loadedUncensorGUID != null) { BodyGUID = loadedUncensorGUID.ToString(); } if (data.data.TryGetValue("PenisGUID", out var loadedPenisGUID) && loadedPenisGUID != null) { PenisGUID = loadedPenisGUID.ToString(); } if (data.data.TryGetValue("BallsGUID", out var loadedBallsGUID) && loadedBallsGUID != null) { BallsGUID = loadedBallsGUID.ToString(); } if (data.data.TryGetValue("DisplayPenis", out var loadedDisplayPenis)) { DisplayPenis = (bool)loadedDisplayPenis; } if (data.data.TryGetValue("DisplayBalls", out var loadedDisplayBalls)) { DisplayBalls = (bool)loadedDisplayBalls; } } } if (BodyGUID.IsNullOrWhiteSpace()) { BodyGUID = null; } if (PenisGUID.IsNullOrWhiteSpace()) { PenisGUID = null; } if (BallsGUID.IsNullOrWhiteSpace()) { BallsGUID = null; } if (MakerAPI.InsideAndLoaded) { DoDropdownEvents = false; if (MakerAPI.GetCharacterLoadFlags().Body) { if (MakerAPI.GetMakerBase().chaCtrl == ChaControl) { //Update the UI to match the loaded character if (BodyGUID == null || BodyList.IndexOf(BodyGUID) == -1) { //The loaded uncensor isn't on the list, possibly due to being forbidden BodyDropdown.Value = 0; BodyGUID = null; } else { BodyDropdown.Value = BodyList.IndexOf(BodyGUID); } if (PenisGUID == null || PenisList.IndexOf(PenisGUID) == -1) { PenisDropdown.Value = DisplayPenis ? 0 : 1; PenisGUID = null; } else { PenisDropdown.Value = PenisList.IndexOf(PenisGUID); } if (BallsGUID == null || BallsList.IndexOf(BallsGUID) == -1) { BallsDropdown.Value = DisplayBalls ? 0 : 1; BallsGUID = null; } else { BallsDropdown.Value = BallsList.IndexOf(BallsGUID); } } } else { //Set the uncensor stuff to whatever is set in the maker BodyGUID = BodyDropdown.Value == 0 ? null : BodyList[BodyDropdown.Value]; PenisGUID = PenisDropdown.Value == 0 || PenisDropdown.Value == 1 ? null : PenisList[PenisDropdown.Value]; BallsGUID = BallsDropdown.Value == 0 || BallsDropdown.Value == 1 ? null : BallsList[BallsDropdown.Value]; DisplayPenis = PenisDropdown.Value == 1 ? false : true; DisplayBalls = BallsDropdown.Value == 1 ? false : true; } DoDropdownEvents = true; } //Update the uncensor on every load or reload UpdateUncensor(); }
protected static void WCast(Vector3 target) { if (W.Handle.ToggleState == 1) { var pick = EntityManager.MinionsAndMonsters.CombinedAttackable.FirstOrDefault(m => m.IsValidTarget(W.Range) && m.Health > 5) ?? BallsList.FirstOrDefault(b => W.IsInRange(b)); if (pick != null) { W.Cast(pick); } } else { W.Cast(target); } }
public override void Harass() { var Qtarget = Q.GetTarget(); var Wtarget = W.GetTarget(); var Etarget = E.GetTarget(); if (SelectBall(Etarget) == null) { Etarget = EntityManager.Heroes.Enemies.OrderByDescending(TargetSelector.GetPriority).FirstOrDefault(t => (BallsList.Any() ? BallsList.Any(b => b.IsInRange(t, Eball.Range) && E.IsInRange(b)) : t.IsKillable(1200)) && t.IsKillable()); } if (Etarget != null && Q.IsReady() && E.IsReady() && HarassMenu.CheckBoxValue("QE") && HarassMenu.CompareSlider("Emana", user.ManaPercent)) { QE(Etarget); } if (Wtarget != null && W.IsReady() && Wtarget.IsKillable(W.Range) && HarassMenu.CheckBoxValue(SpellSlot.W) && HarassMenu.CompareSlider("Wmana", user.ManaPercent)) { WCast(Wtarget); return; } if (Qtarget != null && Q.IsReady() && Qtarget.IsKillable(Q.Range) && HarassMenu.CheckBoxValue(SpellSlot.Q) && HarassMenu.CompareSlider("Qmana", user.ManaPercent)) { Q.Cast(Qtarget, 30); return; } if (Etarget != null && E.IsReady() && HarassMenu.CheckBoxValue(SpellSlot.E) && HarassMenu.CompareSlider("Emana", user.ManaPercent)) { if (SelectBall(Etarget) != null && E.IsInRange(SelectBall(Etarget))) { Eball.Cast(SelectBall(Etarget)); return; } if (Etarget.IsKillable(E.Range) && user.HealthPercent <= 20) { E.Cast(Etarget, 25); } } }
public override void Combo() { var Qtarget = Q.GetTarget(); var Wtarget = W.GetTarget(); var Etarget = E.GetTarget(); var Rtarget = EntityManager.Heroes.Enemies.OrderByDescending(TargetSelector.GetPriority).FirstOrDefault(t => t.IsKillable(R.Range) && RDamage(t) >= t.TotalShieldHealth()); if (SelectBall(Etarget) == null) { Etarget = EntityManager.Heroes.Enemies.OrderByDescending(TargetSelector.GetPriority).FirstOrDefault(t => (BallsList.Any() ? BallsList.Any(b => b.IsInRange(t, Eball.Range) && E.IsInRange(b)) : t.IsKillable(1200)) && t.IsKillable()); } var FullCombotarget = EntityManager.Heroes.Enemies.OrderByDescending(TargetSelector.GetPriority).FirstOrDefault(e => ComboDamage(e, true) >= e.TotalShieldHealth() && e.IsKillable(R.Range)); if (W.Handle.ToggleState != 1 && Wtarget != null && W.IsReady() && Wtarget.IsKillable(W.Range)) { W.Cast(Wtarget); } if (FullCombotarget != null && FullCombotarget.IsKillable()) { if (Q.IsReady() && FullCombotarget.IsKillable(Q.Range) && ComboMenu.CheckBoxValue(SpellSlot.Q) && user.Mana >= Q.Mana() + W.Mana() + E.Mana() + R.Mana()) { Q.Cast(FullCombotarget, 45); } if (E.IsReady() && ComboMenu.CheckBoxValue(SpellSlot.E) && user.Mana >= W.Mana() + E.Mana() + R.Mana()) { if (SelectBall(FullCombotarget) != null && E.IsInRange(SelectBall(FullCombotarget))) { Eball.Cast(SelectBall(FullCombotarget)); return; } if (FullCombotarget.IsKillable(E.Range)) { E.Cast(FullCombotarget, 25); return; } } if (W.IsReady() && FullCombotarget.IsKillable(W.Range) && ComboMenu.CheckBoxValue(SpellSlot.W) && user.Mana >= W.Mana() + R.Mana()) { WCast(FullCombotarget); } if (R.IsReady() && FullCombotarget.IsKillable(R.Range) && ComboMenu.CheckBoxValue(SpellSlot.R) && !(Q.IsReady() && W.IsReady() && E.IsReady())) { R.Cast(FullCombotarget); } } if (E.IsReady() && Etarget != null && SelectBall(Etarget) != null && E.IsInRange(SelectBall(Etarget)) && ComboMenu.CheckBoxValue(SpellSlot.E)) { Eball.Cast(SelectBall(Etarget)); return; } if (Etarget != null && Q.IsReady() && E.IsReady() && ComboMenu.CheckBoxValue("QE")) { QE(Etarget); } if (Qtarget != null && Q.IsReady() && Qtarget.IsKillable(Q.Range) && ComboMenu.CheckBoxValue(SpellSlot.Q)) { Q.Cast(Qtarget, 30); } if (Etarget != null && E.IsReady() && ComboMenu.CheckBoxValue(SpellSlot.E)) { if (Etarget.IsKillable(E.Range) && user.HealthPercent <= 20) { E.Cast(Etarget, 25); return; } } if (Wtarget != null && W.IsReady() && Wtarget.IsKillable(W.Range) && ComboMenu.CheckBoxValue(SpellSlot.W)) { W.Cast(Wtarget); } if (R.IsReady() && Rtarget != null && ComboMenu.CheckBoxValue(SpellSlot.R)) { R.Cast(Rtarget); } }