public static void Harass() { var eTarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQHarass").GetValue <bool>(); var useW = Config.Item("UseWHarass").GetValue <bool>(); var useE = Config.Item("UseEHarass").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); if (mustDebug) { Game.PrintChat("Harass Target -> " + eTarget.SkinName); } if (E.IsReady() && useE) { var eTargetCastE = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical); if (eTargetCastE.HasBuffOfType(BuffType.Poison)) { // keep priority target } else { var query = DevHelper.GetEnemyList().Where(x => x.IsValidTarget(E.Range) && x.HasBuffOfType(BuffType.Poison)); if (query.Any()) { eTargetCastE = query.First(); } } if (eTargetCastE != null) { var buffEndTime = GetPoisonBuffEndTime(eTargetCastE); if (buffEndTime > (Game.Time + E.Delay) || Player.GetSpellDamage(eTargetCastE, SpellSlot.E) > eTargetCastE.Health * 0.9) { CastE(eTarget); if (Player.GetSpellDamage(eTargetCastE, SpellSlot.E) > eTargetCastE.Health * 0.9) { return; } } } } if (eTarget.IsValidTarget(Q.Range) && Q.IsReady() && useQ) { if (Q.Cast(eTarget, packetCast, true) == Spell.CastStates.SuccessfullyCasted) { dtLastQCast = Environment.TickCount; } } if (W.IsReady() && useW) { W.CastIfHitchanceEquals(eTarget, HitChance.High, packetCast); } if (useW) { useW = (!eTarget.HasBuffOfType(BuffType.Poison) || (!eTarget.IsValidTarget(Q.Range) && eTarget.IsValidTarget(W.Range + (W.Width / 2)))); } if (W.IsReady() && useW && Environment.TickCount > dtLastQCast + Q.Delay * 1000) { W.CastIfHitchanceEquals(eTarget, eTarget.IsMoving ? HitChance.High : HitChance.Medium, packetCast); } }
public static void BurstCombo() { var eTarget = SimpleTs.GetTarget(R.Range, SimpleTs.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>(); var useIgnite = Config.Item("UseIgnite").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var UseRMinEnemies = Config.Item("UseRMinEnemies").GetValue <Slider>().Value; double totalComboDamage = 0; if (R.IsReady()) { totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.R); } totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.Q); totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.Q); totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.W); if (itemManager.IsReadyDFG()) { totalComboDamage = totalComboDamage * 1.2; } if (itemManager.IsReadyDFG()) { totalComboDamage += Player.GetItemDamage(eTarget, Damage.DamageItems.Dfg); } totalComboDamage += summonerSpellManager.IsReadyIgnite() ? Player.GetSummonerSpellDamage(eTarget, Damage.SummonerSpell.Ignite) : 0; double totalManaCost = 0; if (R.IsReady()) { totalManaCost += Player.Spellbook.GetSpell(SpellSlot.R).ManaCost; } totalManaCost += Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost; if (mustDebug) { Game.PrintChat("BurstCombo Damage {0}/{1} {2}", Convert.ToInt32(totalComboDamage), Convert.ToInt32(eTarget.Health), eTarget.Health < totalComboDamage ? "BustKill" : "Harras"); Game.PrintChat("BurstCombo Mana {0}/{1} {2}", Convert.ToInt32(totalManaCost), Convert.ToInt32(eTarget.Mana), Player.Mana >= totalManaCost ? "Mana OK" : "No Mana"); } // R Combo if (eTarget.Health < totalComboDamage && Player.Mana >= totalManaCost) { if (totalComboDamage * 0.3 < eTarget.Health) // Anti OverKill { if (mustDebug) { Game.PrintChat("BurstCombo R -> " + eTarget.BaseSkinName); } if (itemManager.IsReadyDFG()) { itemManager.CastDFG(eTarget); } if (R.IsReady() && useR) { var pred = R.GetPrediction(eTarget, true); R.Cast(pred.CastPosition, packetCast); } dtBurstComboStart = DateTime.Now; } dtBurstComboStart = DateTime.Now; } // R if Hit X Enemies if (R.IsReady() && useR) { if (DevHelper.CountEnemyInPositionRange(eTarget.ServerPosition, 250) >= UseRMinEnemies) { if (itemManager.IsReadyDFG()) { itemManager.CastDFG(eTarget); } var pred = R.GetPrediction(eTarget, true); R.Cast(pred.CastPosition, packetCast); dtBurstComboStart = DateTime.Now; } } // Ignite if (dtBurstComboStart.AddSeconds(4) > DateTime.Now && summonerSpellManager.IsReadyIgnite()) { if (mustDebug) { Game.PrintChat("Ignite -> " + eTarget.BaseSkinName); } summonerSpellManager.CastIgnite(eTarget);; } }
public static void Combo() { var eTarget = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>(); var useIgnite = Config.Item("UseIgnite").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var RMinHit = Config.Item("RMinHit").GetValue <Slider>().Value; var RMinHitFacing = Config.Item("RMinHitFacing").GetValue <Slider>().Value; var UseRSaveYourself = Config.Item("UseRSaveYourself").GetValue <bool>(); var UseRSaveYourselfMinHealth = Config.Item("UseRSaveYourselfMinHealth").GetValue <Slider>().Value; if (eTarget.IsValidTarget(R.Range) && R.IsReady() && UseRSaveYourself) { if (Player.GetHealthPerc() < UseRSaveYourselfMinHealth && eTarget.IsFacing(Player) && !eTarget.IsInvulnerable) { R.Cast(eTarget, packetCast, true); if (dtLastSaveYourself + 3000 < Environment.TickCount) { Game.PrintChat("Save Yourself!"); dtLastSaveYourself = Environment.TickCount; } } } if (eTarget.IsValidTarget(R.Range) && R.IsReady() && useR) { var castPred = R.GetPrediction(eTarget, true, R.Range); var enemiesHit = DevHelper.GetEnemyList().Where(x => R.WillHit(x, castPred.CastPosition) && !x.IsInvulnerable).ToList(); var enemiesFacing = enemiesHit.Where(x => x.IsFacing(Player)).ToList(); if (mustDebug) { Game.PrintChat("Hit:{0} Facing:{1}", enemiesHit.Count(), enemiesFacing.Count()); } if (enemiesHit.Count() >= RMinHit && enemiesFacing.Count() >= RMinHitFacing) { R.Cast(castPred.CastPosition, packetCast); } } if (E.IsReady() && useE) { var eTargetCastE = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical); if (eTargetCastE.HasBuffOfType(BuffType.Poison)) { // keep priority target } else { var query = DevHelper.GetEnemyList().Where(x => x.IsValidTarget(E.Range) && x.HasBuffOfType(BuffType.Poison)); if (query.Any()) { eTargetCastE = query.First(); } } if (eTargetCastE != null) { var buffEndTime = GetPoisonBuffEndTime(eTargetCastE); if (buffEndTime > (Game.Time + E.Delay) || Player.GetSpellDamage(eTargetCastE, SpellSlot.E) > eTargetCastE.Health * 0.9) { CastE(eTarget); if (Player.GetSpellDamage(eTargetCastE, SpellSlot.E) > eTargetCastE.Health * 0.9) { return; } } } } if (eTarget.IsValidTarget(Q.Range) && Q.IsReady() && useQ) { if (Q.Cast(eTarget, packetCast, true) == Spell.CastStates.SuccessfullyCasted) { dtLastQCast = Environment.TickCount; } } if (W.IsReady() && useW) { W.CastIfHitchanceEquals(eTarget, HitChance.High, packetCast); } if (useW) { useW = (!eTarget.HasBuffOfType(BuffType.Poison) || (!eTarget.IsValidTarget(Q.Range) && eTarget.IsValidTarget(W.Range + (W.Width / 2)))); } if (W.IsReady() && useW && Environment.TickCount > dtLastQCast + Q.Delay * 1000) { W.CastIfHitchanceEquals(eTarget, eTarget.IsMoving ? HitChance.High : HitChance.Medium, packetCast); } double igniteDamage = summonerSpellManager.GetIgniteDamage(eTarget) + (Player.GetSpellDamage(eTarget, SpellSlot.E) * 2); if (eTarget.Health < igniteDamage && E.Level > 0 && eTarget.IsValidTarget(600) && eTarget.HasBuffOfType(BuffType.Poison)) { summonerSpellManager.CastIgnite(eTarget); } }
public static void BurstCombo() { var eTarget = SimpleTs.GetTarget(R.Range, SimpleTs.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>(); var useIgnite = Config.Item("UseIgnite").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var UseRMinEnemies = Config.Item("UseRMinEnemies").GetValue <Slider>().Value; double totalComboDamage = 0; totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.Q); totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.W); totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.E); totalComboDamage += Player.GetSpellDamage(eTarget, SpellSlot.R); totalComboDamage += igniteManager.IsReady() ? Player.GetSummonerSpellDamage(eTarget, Damage.SummonerSpell.Ignite) : 0; double totalManaCost = 0; totalManaCost += Player.Spellbook.GetSpell(SpellSlot.R).ManaCost; totalManaCost += Player.Spellbook.GetSpell(SpellSlot.W).ManaCost; if (mustDebug) { Game.PrintChat("BurstCombo Damage {0}/{1} {2}", Convert.ToInt32(totalComboDamage), Convert.ToInt32(eTarget.Health), eTarget.Health < totalComboDamage ? "BustKill" : "Harras"); Game.PrintChat("BurstCombo Mana {0}/{1} {2}", Convert.ToInt32(totalManaCost), Convert.ToInt32(eTarget.Mana), Player.Mana >= totalManaCost ? "Mana OK" : "No Mana"); } // Passive UP +1 enemy Combo var query = DevHelper.GetEnemyList() .Where(x => x.IsValidTarget(R.Range) && HasPassiveBuff(x) && Player.GetSpellDamage(x, SpellSlot.R) > x.Health).OrderBy(x => x.Health); if (query.Count() > 0 && R.IsReady()) { R.CastOnUnit(query.First(), packetCast); } // Combo Damage if (R.IsReady() && useR && eTarget.IsValidTarget(R.Range)) { if (eTarget.Health < totalComboDamage * 0.9 && Player.Mana >= totalManaCost) { if (totalComboDamage * 0.3 < eTarget.Health) // Anti OverKill { if (mustDebug) { Game.PrintChat("BurstCombo R"); } R.CastOnUnit(eTarget, packetCast); } else { if (mustDebug) { Game.PrintChat("BurstCombo OverKill"); } } dtBurstComboStart = DateTime.Now; } } if (R.IsReady() && useR && eTarget.IsValidTarget(R.Range)) { var enemiesInRange = DevHelper.GetEnemyList().Where(x => x.Distance(eTarget) < 400); if (enemiesInRange.Count() >= UseRMinEnemies) { R.CastOnUnit(eTarget, packetCast); } } if (dtBurstComboStart.AddSeconds(5) > DateTime.Now && igniteManager.IsReady()) { if (mustDebug) { Game.PrintChat("Ignite"); } igniteManager.Cast(eTarget); } }
public static void FlashCombo() { var UseFlashCombo = Config.Item("FlashComboKey").GetValue <KeyBind>().Active; var FlashComboMinEnemies = Config.Item("FlashComboMinEnemies").GetValue <Slider>().Value; var FlashAntiSuicide = Config.Item("FlashAntiSuicide").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); if (!UseFlashCombo) { return; } int qtPassiveStacks = GetPassiveStacks(); if (((qtPassiveStacks == 3 && E.IsReady()) || qtPassiveStacks == 4) && summonerSpellManager.IsReadyFlash() && R.IsReady()) { var allEnemies = DevHelper.GetEnemyList() .Where(x => Player.Distance(x) > R.Range && Player.Distance(x) < R.Range + 500); var enemies = DevHelper.GetEnemyList() .Where(x => Player.Distance(x) > R.Range && Player.Distance(x) < R.Range + 400 && GetBurstComboDamage(x) * 0.9 > x.Health) .OrderBy(x => x.Health); bool isSuicide = FlashAntiSuicide ? allEnemies.Count() - enemies.Count() > 2 : false; if (enemies.Count() > 0 && !isSuicide) { var enemy = enemies.First(); if (DevHelper.CountEnemyInPositionRange(enemy.ServerPosition, 250) >= FlashComboMinEnemies) { var predict = R.GetPrediction(enemy, true).CastPosition; if (qtPassiveStacks == 3) { if (packetCast) { Packet.C2S.Cast.Encoded(new Packet.C2S.Cast.Struct(Player.NetworkId, SpellSlot.E)).Send(); } else { E.Cast(); } } summonerSpellManager.CastFlash(predict); if (itemManager.IsReadyDFG()) { itemManager.CastDFG(enemy); } if (R.IsReady()) { R.Cast(predict, packetCast); } if (W.IsReady()) { W.Cast(predict, packetCast); } if (E.IsReady()) { E.Cast(); } } } } }
public static void Combo() { var eTarget = SimpleTs.GetTarget(W.Range, SimpleTs.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>(); var useIgnite = Config.Item("UseIgnite").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var RMinHit = Config.Item("RMinHit").GetValue <Slider>().Value; var RMinHitFacing = Config.Item("RMinHitFacing").GetValue <Slider>().Value; var UseRSaveYourself = Config.Item("UseRSaveYourself").GetValue <bool>(); var UseRSaveYourselfMinHealth = Config.Item("UseRSaveYourselfMinHealth").GetValue <Slider>().Value; if (eTarget.IsValidTarget(R.Range) && R.IsReady() && UseRSaveYourself) { if (Player.GetHealthPerc() < UseRSaveYourselfMinHealth && eTarget.IsFacing(Player)) { R.Cast(eTarget.ServerPosition, packetCast); if (dtLastSaveYourself.AddSeconds(3) < DateTime.Now) { Game.PrintChat("Save Yourself!"); dtLastSaveYourself = DateTime.Now; } } } if (eTarget.IsValidTarget(R.Range) && R.IsReady() && useR) { var castPred = R.GetPrediction(eTarget, true, R.Range); var enemiesHit = DevHelper.GetEnemyList().Where(x => R.WillHit(x, castPred.CastPosition)).ToList(); var enemiesFacing = enemiesHit.Where(x => x.IsFacing(Player)).ToList(); if (mustDebug) { Game.PrintChat("Hit:{0} Facing:{1}", enemiesHit.Count(), enemiesFacing.Count()); } if (enemiesHit.Count() >= RMinHit && enemiesFacing.Count() >= RMinHitFacing) { R.Cast(castPred.CastPosition, packetCast); } } if (eTarget.IsValidTarget(E.Range) && E.IsReady() && useE) { var buffEndTime = GetPoisonBuffEndTime(eTarget); if ((eTarget.HasBuffOfType(BuffType.Poison) && buffEndTime > (Game.Time + E.Delay)) || Player.GetSpellDamage(eTarget, SpellSlot.E) > eTarget.Health) { CastE(eTarget); } } if (eTarget.IsValidTarget(Q.Range) && Q.IsReady() && useQ) { if (Q.CastIfHitchanceEquals(eTarget, eTarget.IsMoving ? HitChance.High : HitChance.Medium, packetCast)) { dtLastQCast = DateTime.Now; } } if (W.IsReady() && useW) { var predic = W.GetPrediction(eTarget, true); if (predic.Hitchance >= HitChance.Medium && predic.AoeTargetsHitCount > 1) { W.Cast(predic.CastPosition, packetCast); } } if (useW) { useW = (!eTarget.HasBuffOfType(BuffType.Poison) || (!eTarget.IsValidTarget(Q.Range) && eTarget.IsValidTarget(W.Range + (W.Width / 2)))); } if (W.IsReady() && useW && DateTime.Now > dtLastQCast.AddMilliseconds(Q.Delay * 1000)) { W.CastIfHitchanceEquals(eTarget, eTarget.IsMoving ? HitChance.High : HitChance.Medium, packetCast); } double igniteDamage = summonerSpellManager.GetIgniteDamage(eTarget) + (Player.GetSpellDamage(eTarget, SpellSlot.E) * 2); if (eTarget.Health < igniteDamage && E.Level > 0 && eTarget.IsValidTarget(600) && eTarget.HasBuffOfType(BuffType.Poison)) { summonerSpellManager.CastIgnite(eTarget); } }
public void criarPastaPacote() { DevHelper.print("Criando pasta do pacote", "N"); Directory.CreateDirectory(caminho); criarPastasInternas(); }
public static void BurstCombo() { var eTarget = SimpleTs.GetTarget(Q.Range, SimpleTs.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>() || Config.Item("UseRComboToggle").GetValue <KeyBind>().Active; var packetCast = Config.Item("PacketCast").GetValue <bool>(); // Cast R if will hit 1+ enemies if (useR && R.IsReady() && DevHelper.CountEnemyInPositionRange(eTarget.ServerPosition, 300) > 1) { if (packetCast) { Packet.C2S.Cast.Encoded(new Packet.C2S.Cast.Struct(Player.NetworkId, SpellSlot.R)).Send(); } else { R.Cast(); } if (mustDebug) { Game.PrintChat("BurstCombo -> R hit 1+"); } } // Cast R for Killable Combo var spellCombo = new[] { SpellSlot.Q, SpellSlot.R, SpellSlot.E, SpellSlot.Q, SpellSlot.W, SpellSlot.Q }; if (useR && R.IsReady() && Player.IsKillable(eTarget, spellCombo)) { if (packetCast) { Packet.C2S.Cast.Encoded(new Packet.C2S.Cast.Struct(Player.NetworkId, SpellSlot.R)).Send(); } else { R.Cast(); } if (mustDebug) { Game.PrintChat("BurstCombo -> R Combo"); } } // Cast on W if (useR && R.IsReady() && eTarget.HasBuff("Rune Prison")) { dtLastRunePrision = DateTime.Now; if (packetCast) { Packet.C2S.Cast.Encoded(new Packet.C2S.Cast.Struct(Player.NetworkId, SpellSlot.R)).Send(); } else { R.Cast(); } if (mustDebug) { Game.PrintChat("BurstCombo -> R Rune Prision"); } } }
public static void FlashCombo() { var UseFlashCombo = Config.Item("FlashComboKey").GetValue <KeyBind>().Active; var FlashComboMinEnemies = Config.Item("FlashComboMinEnemies").GetValue <Slider>().Value; var FlashAntiSuicide = Config.Item("FlashAntiSuicide").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); //var eTarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical); //Orbwalking.Orbwalk(eTarget, Game.CursorPos); if (!UseFlashCombo) { return; } // messageManager.AddMessage(0, "FlashComboKey ON", System.Drawing.Color.Yellow); int qtPassiveStacks = GetPassiveStacks(); if (((qtPassiveStacks == 3 && E.IsReady()) || qtPassiveStacks == 4) && summonerSpellManager.IsReadyFlash() && R.IsReady()) { var allEnemies = DevHelper.GetEnemyList() .Where(x => Player.Distance(x) > R.Range && Player.Distance(x) < R.Range + 500); var enemies = DevHelper.GetEnemyList() .Where(x => Player.Distance(x) > R.Range && Player.Distance(x) < R.Range + 400 && GetBurstComboDamage(x) * 0.9 > x.Health) .OrderBy(x => x.Health); bool isSuicide = FlashAntiSuicide ? allEnemies.Count() - enemies.Count() > 2 : false; if (enemies.Any() && !isSuicide) { var enemy = enemies.First(); if (DevHelper.CountEnemyInPositionRange(enemy.ServerPosition, 250) >= FlashComboMinEnemies) { var predict = R.GetPrediction(enemy, true).CastPosition; if (qtPassiveStacks == 3) { E.Cast(packetCast); } summonerSpellManager.CastFlash(predict); if (itemManager.IsItemReady(ItemName.DeathfireGrasp)) { itemManager.UseItem(ItemName.DeathfireGrasp, enemy); } if (R.IsReady()) { R.Cast(predict, packetCast); } if (W.IsReady()) { W.Cast(predict, packetCast); } if (E.IsReady()) { E.Cast(); } } } } }
public static void HelpAlly() { var HelpAlly = Config.Item("HelpAlly").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var UseEHelpAlly = Config.Item("UseEHelpAlly").GetValue <bool>(); var AllyMinHealth = Config.Item("AllyMinHealth").GetValue <Slider>().Value; if (HelpAlly) { var AllyList = DevHelper.GetAllyList().Where(x => Player.Distance(x.ServerPosition) < E.Range && x.GetHealthPerc() < AllyMinHealth && DevHelper.CountEnemyInPositionRange(x.ServerPosition, x.AttackRange) > 0).OrderBy(x => x.Health); if (AllyList.Any()) { var ally = AllyList.First(); if (R.IsReady()) { R.Cast(); } if (UseEHelpAlly && E.IsReady()) { E.CastOnUnit(ally, packetCast); } } } }
private void OpenList(DataManager.DataType dataType, GetEntry entryOp, CreateEntry createOp) { lock (GameBase.lockObj) { DataListFormViewModel choices = new DataListFormViewModel(); choices.Name = dataType.ToString(); string[] entries = DataManager.Instance.DataIndices[dataType].GetLocalStringArray(true); choices.SetEntries(entries); choices.SelectedOKEvent += () => { if (choices.SearchList.InternalIndex > -1) { lock (GameBase.lockObj) { int entryNum = choices.SearchList.InternalIndex; IEntryData data = entryOp(entryNum); Views.DataEditForm editor = new Views.DataEditForm(); editor.Title = DataEditor.GetWindowTitle(String.Format("{0} #{1:D3}", dataType.ToString(), entryNum), data.Name.ToLocal(), data, data.GetType()); DataEditor.LoadDataControls(data, editor.ControlPanel); editor.SelectedOKEvent += () => { lock (GameBase.lockObj) { object obj = data; DataEditor.SaveDataControls(ref obj, editor.ControlPanel); DataManager.Instance.ContentChanged(dataType, entryNum, (IEntryData)obj); string newName = DataManager.Instance.DataIndices[dataType].Entries[entryNum].GetLocalString(true); choices.ModifyEntry(entryNum, newName); editor.Close(); } }; editor.SelectedCancelEvent += () => { editor.Close(); }; editor.Show(); } } }; choices.SelectedAddEvent += () => { lock (GameBase.lockObj) { int entryNum = DataManager.Instance.DataIndices[dataType].Entries.Count; IEntryData data = createOp(); Views.DataEditForm editor = new Views.DataEditForm(); editor.Title = DataEditor.GetWindowTitle(String.Format("{0} #{1:D3}", dataType.ToString(), entryNum), data.Name.ToLocal(), data, data.GetType()); data.ToString(); DataEditor.LoadDataControls(data, editor.ControlPanel); editor.SelectedOKEvent += () => { lock (GameBase.lockObj) { object obj = data; DataEditor.SaveDataControls(ref obj, editor.ControlPanel); data = (IEntryData)obj; DataManager.Instance.ContentChanged(dataType, entryNum, (IEntryData)obj); string newName = DataManager.Instance.DataIndices[dataType].Entries[entryNum].GetLocalString(true); choices.AddEntry(newName); editor.Close(); } }; editor.SelectedCancelEvent += () => { editor.Close(); }; editor.Show(); } }; choices.SelectedReindexEvent += () => { lock (GameBase.lockObj) { DevHelper.RunIndexing(dataType); DevHelper.RunExtraIndexing(dataType); DataManager.Instance.LoadIndex(dataType); DataManager.Instance.LoadUniversalData(); DataManager.Instance.ClearCache(dataType); DiagManager.Instance.DevEditor.ReloadData(dataType); string[] entries = DataManager.Instance.DataIndices[dataType].GetLocalStringArray(true); choices.SetEntries(entries); } }; Views.DataListForm dataListForm = new Views.DataListForm { DataContext = choices, }; dataListForm.Show(); } }
public static void Combo() { var eTarget = SimpleTs.GetTarget(W.Range, SimpleTs.DamageType.Magical); if (eTarget == null) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>(); var useIgnite = Config.Item("UseIgnite").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var RMinHit = Config.Item("RMinHit").GetValue <Slider>().Value; var RMinHitFacing = Config.Item("RMinHitFacing").GetValue <Slider>().Value; if (eTarget.IsValidTarget(R.Range) && R.IsReady() && useR) { var castPred = R.GetPrediction(eTarget, true, R.Range); var enemiesHit = DevHelper.GetEnemyList().Where(x => R.WillHit(x, castPred.CastPosition)).ToList(); var enemiesFacing = enemiesHit.Where(x => x.IsFacing()).ToList(); if (mustDebug) { Game.PrintChat("Hit:{0} Facing:{1}", enemiesHit.Count(), enemiesFacing.Count()); } if (enemiesHit.Count() >= RMinHit && enemiesFacing.Count() >= RMinHitFacing) { R.Cast(castPred.CastPosition, packetCast); } } if (eTarget.IsValidTarget(E.Range) && E.IsReady() && useE) { if (eTarget.HasBuffOfType(BuffType.Poison) || Player.GetSpellDamage(eTarget, SpellSlot.E) > eTarget.Health) { E.CastOnUnit(eTarget, packetCast); } } if (eTarget.IsValidTarget(Q.Range) && Q.IsReady() && useQ) { Q.CastIfHitchanceEquals(eTarget, eTarget.IsMoving ? HitChance.High : HitChance.Medium, packetCast); } if (Config.Item("UseWCombo").GetValue <bool>()) { useW = (!eTarget.HasBuffOfType(BuffType.Poison) || (!eTarget.IsValidTarget(Q.Range) && eTarget.IsValidTarget(W.Range))); } if (eTarget.IsValidTarget(W.Range) && W.IsReady() && useW) { W.CastIfHitchanceEquals(eTarget, eTarget.IsMoving ? HitChance.High : HitChance.Medium, packetCast); } if (IgniteManager.HasIgnite && IgniteManager.IsReady() && IgniteManager.CanKill(eTarget)) { IgniteManager.Cast(eTarget); } }
public static int CountEnemyInPositionRange(Vector3 position, float range) { return(DevHelper.GetEnemyList().Count(x => x.ServerPosition.Distance(position) <= range)); }
static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { var UseWAgainstAA = Config.Item("UseWAgainstAA").GetValue <bool>(); var UseWAfterAttack = Config.Item("UseWAfterAttack").GetValue <bool>(); var UseEAfterAttack = Config.Item("UseEAfterAttack").GetValue <bool>(); if (UseWAgainstAA && sender.IsEnemy && !sender.IsMinion && args.Target.IsMe && W.IsReady() && DevHelper.IsAutoAttack(args.SData.Name)) { W.Cast(UsePackets()); } if (UseWAfterAttack && sender.IsMe && W.IsReady() && DevHelper.IsAutoAttack(args.SData.Name)) { W.Cast(UsePackets()); } if (UseEAfterAttack && sender.IsMe && E.IsReady() && DevHelper.IsAutoAttack(args.SData.Name)) { E.Cast(UsePackets()); } }
public static void HelpAlly() { var UseWHelpAlly = Config.Item("UseWHelpAlly").GetValue <bool>(); var UseEHelpAlly = Config.Item("UseEHelpAlly").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); if (UseWHelpAlly || UseEHelpAlly) { var AllyList = DevHelper.GetAllyList().Where(x => Player.Distance(x.ServerPosition) < W.Range && x.GetHealthPerc() < 50 && DevHelper.CountEnemyInPositionRange(x.ServerPosition, 600) > 0).OrderBy(x => x.Health); if (AllyList.Any()) { var ally = AllyList.First(); if (UseWHelpAlly && W.IsReady()) { W.CastOnUnit(ally, packetCast); } if (UseEHelpAlly && E.IsReady()) { E.CastOnUnit(ally, packetCast); } } } }
internal static Color Parse(string value) { Color clr = new Color(); int length = value.Length; if (value.StartsWith("#")) { if (length == 7) { clr.colorType = ColorType.scRGB; uint val = UInt32.Parse(value.Substring(1), NumberStyles.HexNumber); clr.A = 0xFF; clr.R = (byte)((val >> 16) & 0xFF); clr.G = (byte)((val >> 8) & 0xFF); clr.B = (byte)(val & 0xFF); } else if (length == 9) { clr.colorType = ColorType.scRGBwithAlpha; uint val = UInt32.Parse(value.Substring(1), NumberStyles.HexNumber); clr.A = (byte)((val >> 24) & 0xFF); clr.R = (byte)((val >> 16) & 0xFF); clr.G = (byte)((val >> 8) & 0xFF); clr.B = (byte)(val & 0xFF); } } else { // TODO if (value.StartsWith("{StaticResource")) { DevHelper.NotImplemented("Color StaticResource: " + value); // HACK: just continue return(Color.FromArgb(255, 0, 128, 0)); } else if (value.StartsWith("sc#")) { string[] xx = value.Substring(3).Split(','); if (xx.Length == 3) { clr.ScR = float.Parse(xx[0], CultureInfo.InvariantCulture); clr.ScG = float.Parse(xx[1], CultureInfo.InvariantCulture); clr.ScB = float.Parse(xx[2], CultureInfo.InvariantCulture); } else if (xx.Length == 4) { clr.ScA = float.Parse(xx[0], CultureInfo.InvariantCulture); clr.ScR = float.Parse(xx[1], CultureInfo.InvariantCulture); clr.ScG = float.Parse(xx[2], CultureInfo.InvariantCulture); clr.ScB = float.Parse(xx[3], CultureInfo.InvariantCulture); } else { throw new NotImplementedException("Color type format."); } } else if (value.StartsWith("ContextColor")) { DevHelper.NotImplemented("Color profile: " + value); // HACK: just continue return(Color.FromArgb(255, 0, 128, 0)); } else { throw new NotImplementedException("Color type."); } } return(clr); }
public static void CastEQ() { var eTarget = TargetSelector.GetTarget(Q.Range * 2, TargetSelector.DamageType.Magical); if (eTarget == null) { return; } if (!Q.IsReady() || !E.IsReady()) { return; } var useQ = Config.Item("UseQCombo").GetValue <bool>(); var useW = Config.Item("UseWCombo").GetValue <bool>(); var useE = Config.Item("UseECombo").GetValue <bool>(); var useR = Config.Item("UseRCombo").GetValue <bool>(); var packetCast = Config.Item("PacketCast").GetValue <bool>(); var enemyList = DevHelper.GetEnemyList() .Where(x => eTarget.NetworkId != x.NetworkId && Player.Distance(x) < E.Range && x.Distance(eTarget) < Q.Range).ToList(); if (enemyList.Any()) { var unit = enemyList.First(); E.CastOnUnit(unit, packetCast); // Wait for ProcessGainBuff if (mustDebug) { Game.PrintChat("CastEQ -> E Enemy"); } } var allyList = DevHelper.GetAllyList() .Where(x => !x.IsMe && Player.Distance(x) < E.Range && x.Distance(eTarget) < Q.Range).ToList(); if (allyList.Any()) { var unit = allyList.First(); E.CastOnUnit(unit, packetCast); // Wait for ProcessGainBuff if (mustDebug) { Game.PrintChat("CastEQ -> E Ally"); } } var minionList = MinionManager.GetMinions(Player.Position, E.Range, MinionTypes.All, MinionTeam.All, MinionOrderTypes.Health) .Where(x => DevHelper.GetRealDistance(x, eTarget) < Q.Range).OrderByDescending(x => x.Health).ToList(); if (minionList.Any()) { var unit = minionList.First(); E.CastOnUnit(unit, packetCast); // Wait for ProcessGainBuff if (mustDebug) { Game.PrintChat("CastEQ -> E Minion"); } } }
public static int SolverRun(string puzzle, int min, int sec, string solver, string pool, double minR, double maxR, SolverRun solverRun) { var args = new FluentString(" ") .Append(puzzle).Sep() .Append($"--solver {solver}").Sep() .Append($"--pool {pool}").Sep() .If(min > 0, $"--min {min}").Sep() .If(sec > 0, $"--sec {sec}").Sep() .If(minR > 0, $"--min-rating {minR}").Sep() .If(maxR < 2000, $"--min-rating {maxR}"); System.Console.WriteLine($"Arguments: {args}"); var exitRequested = false; SolverCommand?executing = null; // Setup: Report and cancellation var benchId = DateTime.Now.ToString("s").Replace(':', '-'); var outFile = $"./benchmark--{benchId}.txt"; var outTele = $"./telemetry--{benchId}.csv"; var outFolder = "./results/"; if (!Directory.Exists(outFolder)) { Directory.CreateDirectory(outFolder); } var info = new FileInfo(Path.Combine(outFolder, outFile)); var tele = new FileInfo(Path.Combine(outFolder, outTele)); using var report = File.CreateText(info.FullName); using var repTele = File.CreateText(tele.FullName); System.Console.CancelKeyPress += (o, e) => { report.Flush(); System.Console.WriteLine("Ctrl+C detected; cancel requested"); if (executing != null) { executing.ExitConditions.ExitRequested = true; } exitRequested = true; }; ISokobanSolutionRepository?solutionRepo = File.Exists("./solutions.json") && !DevHelper.IsDebug() ? new JsonSokobanSolutionRepository("./solutions.json") : null; ISolverRunTracking?runTracking = null; var results = new List <(Strategy, List <SolverResultSummary>)>(); var perm = GetPermutations(solver, pool).ToList(); var countStrat = 0; foreach (var strat in perm) { countStrat++; System.Console.WriteLine($"(Strategy {countStrat}/{perm.Count}) {strat}"); var ioc = new SolverContainerByType(new Dictionary <Type, Func <Type, object> >() { { typeof(ISolverPool), _ => PoolFactory(strat.Pool) }, { typeof(ISolverQueue), _ => new SolverQueueConcurrent() }, { typeof(ISolverRunTracking), _ => runTracking }, { typeof(ISokobanSolutionRepository), _ => solutionRepo }, }); var solverCommand = new SolverCommand { ServiceProvider = ioc, ExitConditions = new ExitConditions() { Duration = TimeSpan.FromMinutes(min).Add(TimeSpan.FromSeconds(sec)), MemAvail = DevHelper.GiB_1, // Stops the machine hanging / swapping to death StopOnSolution = true, }, AggProgress = new ConsoleProgressNotifier(repTele), CheckAbort = x => exitRequested, }; var runner = new BatchSolveComponent( report, System.Console.Out, solutionRepo, runTracking, 5, false); var solverInstance = SolverFactory(strat.Solver, ioc); var summary = runner.Run(solverRun, solverCommand, solverInstance, false); results.Add((strat, summary)); } // Header var extras = new Dictionary <string, string>() { { "Args", args }, { "Report", info.FullName } }; DevHelper.WriteFullDevelopmentContext(report, extras); DevHelper.WriteFullDevelopmentContext(System.Console.Out, extras); // Body var reportRow = GenerateReport(results).ToList(); MapToReporting.Create <SummaryLine>() .AddColumn("Solver", x => x.Strategy.Solver) .AddColumn("Pool", x => x.Strategy.Pool) .AddColumn("Puzzle", x => x.Result.Puzzle.Ident) .AddColumn("State", x => x.Result.Exited) .AddColumn("Solutions", x => (x.Result.Solutions?.Count ?? 0) == 0 ? null : (int?)x.Result.Solutions.Count) .AddColumn("Statistics", x => x.Result.Exited == ExitConditions.Conditions.Error ? x.Result.Exited.ToString() : x.Result.Statistics?.ToString(false, true) ) .RenderTo(reportRow, new MapToReportingRendererText(), report) .RenderTo(reportRow, new MapToReportingRendererText(), System.Console.Out); return(results.Any(x => x.Item2.Any(y => y.Exited == ExitConditions.Conditions.Error)) ? -1 : 0); // All exceptions }
public static void UltimateHandler() { var UseRAlly = Config.Item("UseRAlly").GetValue <bool>(); var UseRAllyMinHealth = Config.Item("UseRAllyMinHealth").GetValue <Slider>().Value; var packetCast = Config.Item("PacketCast").GetValue <bool>(); if (UseRAlly && R.IsReady()) { if (Player.GetHealthPerc() < UseRAllyMinHealth && DevHelper.CountEnemyInPositionRange(Player.ServerPosition, 500) > 0) { R.CastOnUnit(Player, packetCast); return; } var AllyList = DevHelper.GetAllyList().Where(x => Player.Distance(x.ServerPosition) < R.Range && x.GetHealthPerc() < UseRAllyMinHealth && DevHelper.CountEnemyInPositionRange(x.ServerPosition, 500) > 0); if (AllyList.Any()) { var ally = AllyList.First(); R.CastOnUnit(ally, packetCast); } } }
public Pacote(Pendencia pendencia_in, string caminho_in) { DevHelper.print("Verificando existência do pacote...", "N"); pendencia = pendencia_in; caminho = caminho_in + '/' + "VXXXXXX_ID" + pendencia.pendenciaId + " - " + DevHelper.limparString(pendencia.titulo); if (!Directory.Exists(caminho)) //se o pacote não existe { criarPastaPacote(); } }