public static async Task <bool> Execute() { if (await Chocobo.HandleChocobo()) { return(true); } Group.UpdateAllies(Utilities.Routines.Scholar.GroupExtension); if (Core.Me.IsCasting) { return(true); } Globals.HealTarget = Group.CastableAlliesWithin30.OrderBy(x => x.CurrentHealthPercent).FirstOrDefault(); await Casting.CheckForSuccessfulCast(); Globals.InParty = PartyManager.IsInParty || Globals.InGcInstance; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2); if (Core.Me.IsMounted) { return(false); } if (CustomOpenerLogic.InOpener) { return(false); } if (await Buff.SummonPet()) { return(true); } return(await Buff.Aetherflow()); }
protected override void JungleClear() { if (!ResourceManager.Check("jungle-clear")) { return; } var useW = Menu.Item(Menu.Name + ".jungle-clear.w").GetValue <bool>() && W.IsReady(); var useE = Menu.Item(Menu.Name + ".jungle-clear.e").GetValue <bool>() && E.IsReady(); var useR = Menu.Item(Menu.Name + ".jungle-clear.r").GetValue <bool>() && R.IsReady() && Menu.Item(Menu.Name + ".miscellaneous.r-max").GetValue <Slider>().Value > GetRBuffCount(); if (useW) { Casting.FarmSelfAoe( W, MinionManager.GetMinions(W.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth), 1, Player.AttackRange + Player.BoundingRadius * 1.25f + 20 * W.Level); } if (ShouldUseSpells()) { if (useE) { Casting.Farm( E, MinionManager.GetMinions( E.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth), 1); } if (useR) { Casting.Farm( R, MinionManager.GetMinions( R.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth), 1); } } }
public static async Task <bool> Execute() { if (await Chocobo.HandleChocobo()) { return(true); } Group.UpdateAllies(Utilities.Routines.Astrologian.GroupExtension); if (Core.Me.IsCasting) { return(true); } Globals.HealTarget = Group.CastableAlliesWithin30.OrderBy(x => x.CurrentHealthPercent).FirstOrDefault(); await Casting.CheckForSuccessfulCast(); Globals.InParty = PartyManager.IsInParty || Globals.InGcInstance; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2); if (Core.Me.IsMounted) { return(false); } if (Globals.OnPvpMap) { return(false); } if (Duty.State() == Duty.States.Ended) { return(false); } return(await Buff.Sect()); }
public static async Task <bool> Heal() { if (Core.Me.IsMounted) { return(true); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; if (await GambitLogic.Gambit()) { return(true); } if (await Logic.Summoner.Heal.Raise()) { return(true); } //Force Toggles: if (await Logic.Summoner.Heal.ForceRaise()) { return(true); } if (await Logic.Summoner.Heal.ForceHardRaise()) { return(true); } //Force Toggles End. return(await Logic.Summoner.Heal.Physick()); }
public static async Task <bool> Heal() { if (Core.Me.IsMounted) { return(true); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); if (await GambitLogic.Gambit()) { return(true); } // if (await Buff.TransposeMovement()) return true; return(false); }
public static async Task <bool> PreCombatBuff() { await Casting.CheckForSuccessfulCast(); if (await Buff.FistsOf()) { return(true); } if (await Buff.Meditate()) { return(true); } if (MonkSettings.Instance.UsePositionalToasts && Utilities.Routines.Monk.UseToast == 9) { Logger.Write($@"[Magitek] Initiated Toast for MNK"); Thread T = new Thread(() => PositionalToast.PositionalLogic()); Utilities.Routines.Monk.UseToast = 0; PositionalToast.SendToast("Toast Overlay Initiated", 5); T.Start(); } return(false); }
private void button13_Click(object sender, EventArgs e) { Casting casting = new Casting(); casting.Executar(); }
public static Casting CreateCasting(int castingID) { Casting casting = new Casting(); casting.CastingID = castingID; return casting; }
public static async Task <bool> PreCombatBuff() { await Casting.CheckForSuccessfulCast(); return(await Buff.Defiance()); }
public void SendSMSGSpellGo(Casting cast, Mobile Caster,Object target,ArrayList all, ArrayList executed) { int offset = 4; uint flags = 0; if ( cast.type == 0 ) flags = 0; else if ( ( cast.type & 0x800 ) != 0 ) flags = 0x0101; else if( ( cast.type & 0x2 ) != 0 || ( cast.type & 0x8000 ) != 0 ) flags = 0x100; else if( ( cast.type & 0x10 ) != 0 || ( cast.type & 0x1000 ) != 0 ) flags = 0x1010; else if( ( cast.type & 0x20 ) != 0 || ( cast.type & 0x40 ) != 0 ) { offset = 4; Converter.ToBytes( (UInt64)0, tempBuff, ref offset ); Converter.ToBytes( Guid, tempBuff, ref offset ); Converter.ToBytes( cast.id, tempBuff, ref offset ); Converter.ToBytes( (byte)0, tempBuff, ref offset ); Converter.ToBytes( (short)0x0201, tempBuff, ref offset ); Converter.ToBytes( (UInt64)0x32, tempBuff, ref offset ); Converter.ToBytes( (byte)0, tempBuff, ref offset ); Converter.ToBytes( (UInt64)1, tempBuff, ref offset ); Converter.ToBytes( cast.type, tempBuff, ref offset ); Converter.ToBytes( ((SpellXYZtarget)primarySpellTarget).X, tempBuff, ref offset ); Converter.ToBytes( ((SpellXYZtarget)primarySpellTarget).Y, tempBuff, ref offset ); Converter.ToBytes( ((SpellXYZtarget)primarySpellTarget).Z, tempBuff, ref offset ); ToAllPlayerNear( OpCodes.SMSG_SPELL_GO, tempBuff, offset ); return; } Converter.ToBytes( (ulong)Caster.Guid, tempBuff, ref offset ); Converter.ToBytes( (ulong)Caster.Guid, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.id, tempBuff, ref offset ); Converter.ToBytes( (ushort)flags, tempBuff, ref offset ); if(executed != null) { Converter.ToBytes( (byte)executed.Count, tempBuff, ref offset ); foreach(Mobile mob in executed) { Converter.ToBytes( (ulong)mob.Guid, tempBuff, ref offset ); } } else { Converter.ToBytes( (byte)1, tempBuff, ref offset ); Converter.ToBytes( (ulong)target.Guid, tempBuff, ref offset ); } if(all != null && executed !=null) { Converter.ToBytes( (byte)all.Count - executed.Count , tempBuff, ref offset ); foreach(Mobile mob in all) { if(!executed.Contains(mob)) Converter.ToBytes( (ulong)mob.Guid, tempBuff, ref offset ); } } else { Converter.ToBytes( (byte)0, tempBuff, ref offset ); } Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); Converter.ToBytes( (ulong)target.Guid, tempBuff, ref offset ); ToAllPlayerNear( OpCodes.SMSG_SPELL_GO, tempBuff, offset ); //Console.WriteLine("SMSG_SPELL_GO"); //HexViewer.View( tempBuff, 0, offset ); }
public static async Task <bool> Execute() { Group.UpdateAllies(); if (Core.Me.IsCasting) { return(true); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Globals.InParty = PartyManager.IsInParty; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2) || Core.Me.InCombat; Utilities.Routines.Bard.RefreshVars(); if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 20); } } if (Weaving.GetCurrentWeavingCounter() < 2 && Spells.HeavyShot.Cooldown.TotalMilliseconds > 650 + BaseSettings.Instance.UserLatencyOffset) { // Utility if (await Utility.RepellingShot()) { return(true); } if (await Utility.WardensPaean()) { return(true); } if (await Utility.NaturesMinne()) { return(true); } if (await Utility.Troubadour()) { return(true); } if (await PhysicalDps.ArmsLength(BardSettings.Instance)) { return(true); } if (await PhysicalDps.SecondWind(BardSettings.Instance)) { return(true); } if (await Utility.HeadGraze()) { return(true); } // Damage if (await SingleTarget.LastPossiblePitchPerfectDuringWM()) { return(true); } if (await Songs.LetMeSingYouTheSongOfMyPeople()) { return(true); } if (await Cooldowns.BattleVoice()) { return(true); } if (await Cooldowns.RagingStrikes()) { return(true); } if (await Cooldowns.Barrage()) { return(true); } if (await SingleTarget.PitchPerfect()) { return(true); } if (await Aoe.RainOfDeathDuringMagesBallard()) { return(true); } if (await SingleTarget.BloodletterInMagesBallard()) { return(true); } if (await SingleTarget.EmpyrealArrow()) { return(true); } if (await Aoe.ShadowBite()) { return(true); } if (await SingleTarget.Sidewinder()) { return(true); } if (await Aoe.RainOfDeath()) { return(true); } if (await SingleTarget.Bloodletter()) { return(true); } } if (await SingleTarget.StraightShotAfterBarrage()) { return(true); } if (await DamageOverTime.IronJawsOnCurrentTarget()) { return(true); } if (await DamageOverTime.SnapShotIronJawsOnCurrentTarget()) { return(true); } if (await DamageOverTime.WindbiteOnCurrentTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnCurrentTarget()) { return(true); } if (await Aoe.ApexArrow()) { return(true); } if (await DamageOverTime.IronJawsOnOffTarget()) { return(true); } if (await DamageOverTime.WindbiteOnOffTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnOffTarget()) { return(true); } if (await Aoe.QuickNock()) { return(true); } if (await SingleTarget.StraightShot()) { return(true); } return(await SingleTarget.HeavyShot()); }
public static async Task <bool> Combat() { if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 20); } } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); if (Core.Me.CurrentManaPercent <= ScholarSettings.Instance.MinimumManaPercent) { return(false); } if (await Buff.SummonPet()) { return(true); } if (Utilities.Combat.Enemies.Count > ScholarSettings.Instance.StopDamageWhenMoreThanEnemies) { return(true); } if (Globals.InParty) { if (!ScholarSettings.Instance.DoDamage) { return(true); } if (Core.Me.CurrentManaPercent < ScholarSettings.Instance.MinimumManaPercent) { return(true); } } if (await Aoe.ArtOfWar()) { return(true); } if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await SingleTarget.Bio()) { return(true); } if (await SingleTarget.BioMultipleTargets()) { return(true); } if (await SingleTarget.Ruin2()) { return(true); } if (await SingleTarget.EnergyDrain2()) { return(true); } return(await SingleTarget.Broil()); }
public void Remove(Casting casting) { context.Castings.Remove(casting); context.SaveChanges(); }
public static async Task <bool> Execute() { if (await Chocobo.HandleChocobo()) { return(true); } Group.UpdateAllies(Utilities.Routines.Astrologian.GroupExtension); Globals.HealTarget = Group.CastableAlliesWithin30.OrderBy(x => x.CurrentHealthPercent).FirstOrDefault(); if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; Globals.InParty = PartyManager.IsInParty || Globals.InGcInstance; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2) || Core.Me.InCombat; Globals.OnPvpMap = Core.Me.OnPvpMap(); if (Duty.State() == Duty.States.Ended) { return(false); } if (await GambitLogic.Gambit()) { return(true); } if (Globals.OnPvpMap) { if (await Pvp.EssentialDignity()) { return(true); //Heal } if (await Pvp.Purify()) { return(true); //Dispel/Heal } if (await Pvp.Muse()) { return(true); //Self-Buff } if (await Pvp.Lightspeed()) { return(true); //CombatBuff } if (await Pvp.Synastry()) { return(true); //Heal } if (await Pvp.Deorbit()) { return(true); //Heal } if (await Pvp.EmpyreanRain()) { return(true); //Heal } if (await Pvp.Recuperate()) { return(true); //Self-Heal } if (await Pvp.Benefic2()) { return(true); //Heal } if (await Pvp.Benefic()) { return(true); //Heal } if (await Pvp.Concentrate()) { return(true); //CombatBuff/Heal } if (await Pvp.Safeguard()) { return(true); //CombatBuff/Shield } if (await Card.Play()) { return(true); } return(await Card.Draw()); } if (Globals.PartyInCombat && Globals.InParty) { if (await TankBusters.Execute()) { return(true); } } if (await Logic.Astrologian.Heal.Ascend()) { return(true); } // Scalebound Extreme Rathalos if (Core.Me.HasAura(1495)) { if (await Dispel.Execute()) { return(true); } return(false); } if (await Logic.Astrologian.Heal.EssentialDignity()) { return(true); } if (await Dispel.Execute()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (await Buff.Lightspeed()) { return(true); } if (await Buff.Synastry()) { return(true); } if (await Buff.CelestialOpposition()) { return(true); } if (DutyManager.InInstance || Core.Me.InCombat) { if (Globals.InParty) { if (await Logic.Astrologian.Heal.EssentialDignity()) { return(true); } if (await Logic.Astrologian.Heal.AspectedHelios()) { return(true); } if (await Logic.Astrologian.Heal.CollectiveUnconscious()) { return(true); } if (await Logic.Astrologian.Heal.Helios()) { return(true); } if (await Logic.Astrologian.Heal.LadyOfCrowns()) { return(true); } if (await Logic.Astrologian.Heal.Benefic2()) { return(true); } } if (await Logic.Astrologian.Heal.Benefic()) { return(true); } if (await Logic.Astrologian.Heal.AspectedBenefic()) { return(true); } if (await Logic.Astrologian.Heal.EarthlyStar()) { return(true); } } if (await Logic.Astrologian.Heal.LadyOfCrowns()) { return(true); } if (await Logic.Astrologian.Heal.Benefic()) { return(true); } if (await Card.Play()) { return(true); } return(await Card.Draw()); }
protected override void Combo() { var useQ = Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady() && ManaManager.Check("combo-q"); var useE = Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(); if (useQ) { Casting.SkillShot(Q, Q.GetHitChance("combo")); } if (useE) { var target = TargetSelector.GetTarget(E); if (target != null && Rend.HasBuff(target)) { if (target.Distance(Player) > Orbwalking.GetRealAutoAttackRange(target)) { if ( GameObjects.EnemyMinions.Any( m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m)) && Rend.IsKillable(m, true))) { E.Cast(); } else { var minion = GetDashObjects( GameObjects.EnemyMinions.Where( m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m))) .Select(e => e as Obj_AI_Base) .ToList()) .Find( m => m.Health > Player.GetAutoAttackDamage(m) && m.Health < Player.GetAutoAttackDamage(m) + Rend.GetDamage(m, 1)); if (minion != null) { Orbwalker.ForceTarget(minion); } } } else if (E.IsInRange(target)) { if (Rend.IsKillable(target, false)) { E.Cast(); } else { var buff = Rend.GetBuff(target); if (buff != null && buff.Count >= Menu.Item(Menu.Name + ".combo.e-min").GetValue <Slider>().Value) { if (target.Distance(Player) > E.Range * 0.8 && !target.IsFacing(Player)) { E.Cast(); } } } } } } if (Menu.Item(Menu.Name + ".combo.minions").GetValue <bool>() && !GameObjects.EnemyHeroes.Any( e => e.IsValidTarget() && e.Distance(Player) < Orbwalking.GetRealAutoAttackRange(e) * 1.1f) && !Player.IsWindingUp && !Player.IsDashing()) { var obj = GetDashObjects().FirstOrDefault(); if (obj != null) { Orbwalker.ForceTarget(obj); } } else { Orbwalker.ForceTarget(null); } }
public async Task <ActionResult> Edit(StyleViewModel svm) { CheckForNameAndNumberUniqueness(svm); int i; // Check special cases in Model CheckModelState(svm); // TraceModelStateErrors(svm.Style.StyleName); // Save the Style and all edited components; add the new ones and remove the deleted ones if (ModelState.IsValid) { bool bUseLaborTable = svm.Style.JewelryType.bUseLaborTable; svm.Style.JewelryType = null; // hack to avoid maismatch of JewelryTypeId error!!! if (db.Entry(svm.Style).State != EntityState.Added) { db.Entry(svm.Style).State = EntityState.Modified; } // Iterate thru the components // Castings if (svm.Castings != null) { i = -1; foreach (CastingComponent c in svm.Castings) { i++; Casting casting; StyleCasting sc; try { ValidCasting(c); } catch (OjMissingCastingException e) { ModelState.AddModelError("Castings[" + i + "].Name", e.Message); continue; } switch (c.State) { case SVMStateEnum.Added: casting = new Casting(c); // add a new link casting.Id = -i; db.Castings.Add(casting); sc = new StyleCasting() { CastingId = casting.Id, StyleId = svm.Style.Id, }; db.StyleCastings.Add(sc); break; case SVMStateEnum.Deleted: sc = db.StyleCastings.Where(x => x.StyleId == svm.Style.Id && x.CastingId == c.Id) .SingleOrDefault(); casting = db.Castings.Find(c.Id); db.Castings.Remove(casting); db.StyleCastings.Remove(sc); break; case SVMStateEnum.Dirty: case SVMStateEnum.Fixed: casting = db.Castings.Find(c.Id); casting.Set(c); /* * // Update the Syle-Casting Link * sc = db.StyleCastings.Where(x => x.StyleId == svm.Style.Id && x.CastingId == c.Id).SingleOrDefault(); */ break; case SVMStateEnum.Unadded: break; default: break; } } } // Stones if (svm.Stones != null) { i = -1; foreach (StoneComponent sc in svm.Stones) { i++; //Stone stone; StyleStone ss; int stoneId = 0; try { stoneId = ValidStone(svm.CompanyId, sc); sc.Id = stoneId; } catch (OjInvalidStoneComboException e) { ModelState.AddModelError("Stones[" + i + "].Name", e.Message); continue; } catch (OjMissingStoneException) { if (sc.Name == null) { ModelState.AddModelError("Stones[" + i + "].Name", "You must enter a stone!! "); } if (sc.ShId == null) { ModelState.AddModelError("Stones[" + i + "].ShId", "You must enter a shape!! "); } if (sc.SzId == null) { ModelState.AddModelError("Stones[" + i + "].SzId", "You must enter a size!! "); } continue; } switch (sc.State) { case SVMStateEnum.Added: //stone = new Stone(sc); //db.Stones.Add(stone); ss = new StyleStone() { StyleId = svm.Style.Id, StoneId = stoneId, Qty = (int)sc.Qty }; db.StyleStones.Add(ss); break; case SVMStateEnum.Deleted: ss = db.StyleStones.Where(x => x.Id == sc.linkId).SingleOrDefault(); //db.Stones.Remove(ss.Stone); db.StyleStones.Remove(ss); break; case SVMStateEnum.Dirty: case SVMStateEnum.Fixed: //stone = db.Stones.Find(sc.Id); //stone.Set(sc); ss = db.StyleStones.Where(x => x.Id == sc.linkId).SingleOrDefault(); //ss = db.StyleStones.Where(x => x.StyleId == svm.Style.Id && x.Id == sc.Id).SingleOrDefault(); ss.Qty = (int)sc.Qty; ss.StoneId = stoneId; break; case SVMStateEnum.Unadded: default: break; } } } // Findings if (svm.Findings != null) { i = -1; foreach (FindingsComponent c in svm.Findings) { i++; StyleFinding fc; try { ValidFinding(c, i); } catch (OjMissingFindingException e) { ModelState.AddModelError("Findings[" + i + "].Id", e.Message); continue; } switch (c.State) { case SVMStateEnum.Added: /* * component = new Component(c); * db.Components.Add(component); */ fc = new StyleFinding() { StyleId = svm.Style.Id, FindingId = c.Id ?? 0, Qty = c.Qty }; db.StyleFindings.Add(fc); break; case SVMStateEnum.Deleted: fc = db.StyleFindings.Where(x => x.Id == c.linkId).SingleOrDefault(); //db.Findings.Remove(fc.Finding); db.StyleFindings.Remove(fc); break; case SVMStateEnum.Dirty: case SVMStateEnum.Fixed: /* * component = db.Components.Find(c.Id); * component.Set(c); */ //finding.Set(c); // Dont change the finding, just the link!!! fc = db.StyleFindings.Where(x => x.Id == c.linkId).SingleOrDefault(); fc.FindingId = c.Id ?? 0; fc.Qty = c.Qty; break; case SVMStateEnum.Unadded: // No updates default: break; } } } // Labors if (svm.Labors != null && bUseLaborTable == false) { i = -1; foreach (LaborComponent lc in svm.Labors) { i++; Labor labor; StyleLabor sl; try { ValidLabor(lc); } catch (OjMissingLaborException e) { ModelState.AddModelError("Labors[" + i + "].Name", e.Message); continue; } switch (lc.State) { case LMState.Added: AddLabor(lc, svm, i); break; case LMState.Deleted: sl = db.StyleLabors.Where(x => x.StyleId == svm.Style.Id && x.LaborId == lc.Id).Single(); RemoveLabor(sl); break; case LMState.Fixed: case LMState.Dirty: if (lc.Id <= 0) { AddLabor(lc, svm, i); } else { labor = db.Labors.Find(lc.Id); labor.Set(lc); } /* * sl = db.StyleLabors.Where(x => x.StyleId == svm.Style.Id && x.LaborId == c.Id).Single(); */ break; case LMState.Unadded: // No updates default: break; } } } // Labor Table if (svm.LaborItems != null && bUseLaborTable == true) { i = -1; foreach (LaborItemComponent lic in svm.LaborItems) { i++; StyleLaborTableItem sl; try { ValidLaborItem(lic); } catch (OjMissingLaborException e) { ModelState.AddModelError("LaborsItems[" + i + "].Name", e.Message); continue; } switch (lic.State) { case LMState.Added: AddLaborItem(lic, svm, i); break; case LMState.Deleted: sl = db.StyleLaborItems.Where(x => x.Id == lic.linkId).SingleOrDefault(); RemoveLaborItem(sl); break; case LMState.Dirty: case LMState.Fixed: if (lic.Id <= 0) { AddLaborItem(lic, svm, i); } else { //laborItem = db.LaborTable.Find(lic.laborItemId); sl = db.StyleLaborItems.Where(x => x.Id == lic.linkId).SingleOrDefault(); sl.Qty = lic.Qty.GetValueOrDefault(); sl.LaborTableId = lic.laborItemId.GetValueOrDefault(); //laborItem.Set(lic); } /* * sl = db.StyleLabors.Where(x => x.StyleId == svm.Style.Id && x.LaborId == c.Id).Single(); */ break; case LMState.Unadded: // No updates default: break; } db.Entry(lic._laborItem).State = EntityState.Detached; } } // Misc if (svm.Miscs != null) { Misc misc; StyleMisc sm; i = -1; foreach (MiscComponent c in svm.Miscs) { i++; try { ValidMisc(c); } catch (OjMissingMiscException e) { ModelState.AddModelError("Miscs[" + i + "].Name", e.Message); continue; } switch (c.State) { case SVMStateEnum.Added: AddMisc(c, svm, i); break; case SVMStateEnum.Deleted: sm = db.StyleMiscs.Where(x => x.StyleId == svm.Style.Id && x.MiscId == c.Id).Single(); RemoveMisc(sm); break; case SVMStateEnum.Dirty: case SVMStateEnum.Fixed: if (c.Id <= 0) { AddMisc(c, svm, i); } else { misc = db.Miscs.Find(c.Id); misc.Set(c); } /* * sm = db.StyleMiscs.Where(x => x.StyleId == svm.Style.Id && x.MiscId == c.Id).Single(); */ break; case SVMStateEnum.Unadded: // No updates default: break; } } if (svm.SVMState == SVMStateEnum.Added) { db.Styles.Add(svm.Style); } } // false } if (ModelState.IsValid) { if (true) // if the modelstate only has validation errors on "Clean" components, then allow the DB update { // Save changes, go to Home try { db.SaveChanges(); // need the styleId for the image name } catch (Exception e) { Trace.TraceError($"Error saving style {svm.Style.StyleName}, msg: {e.Message}"); } Trace.TraceInformation("Operation: {0}, svmId:{1}", svm.SVMOp.ToString(), svm.Style.Id); await SaveImageInStorage(db, svm); db.Entry(svm.Style); db.SaveChanges(); if (svm.SVMOp == SVMOperation.Create) { // Redurect to Edit return(RedirectToAction("Edit", new { id = svm.Style.Id })); } if (svm.SVMOp != SVMOperation.Print) { // Redurect to Edit return(RedirectToAction("Index", new { CollectionId = svm.Style.CollectionId })); } else { return(Print(svm.Style.Id)); } } } Collection co = db.Collections.Find(svm.Style.CollectionId); svm.CompanyId = co.CompanyId; svm.Style.JewelryType = db.JewelryTypes.Find(svm.Style.JewelryTypeId); //svm.Style. string markup = db.FindCompany(svm.CompanyId).markup; if (markup == null) { markup = "[]"; } svm.markups = JsonConvert.DeserializeObject <List <Markup> >(markup); svm.PopulateDropDownData(db); svm.PopulateDropDowns(db); if (svm.SVMOp == SVMOperation.Create) { svm.LookupComponents(db); } else { svm.RepopulateComponents(db); // iterate thru the data and repopulate the links } ViewBag.CollectionId = new SelectList(db.Collections.Where(x => x.CompanyId == co.CompanyId), "Id", "Name", svm.Style.CollectionId); //ViewBag.JewelryTypeId = new SelectList(db.JewelryTypes.Where(x => x.CompanyId == co.CompanyId), "Id", "Name", svm.Style.JewelryTypeId); ViewBag.MetalWtUnitId = new SelectList(db.MetalWeightUnits.OrderBy(mwu => mwu.Unit), "Id", "Unit", svm.Style.MetalWtUnitId); // iterate thru modelstate errors, display on page return(View(svm)); }
protected override void OnPostUpdate() { if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit && Menu.Item(Menu.Name + ".lasthit.q").GetValue <bool>() && Q.IsReady()) { var m = MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly) .FirstOrDefault(e => Q.IsKillable(e)); if (m != null) { Casting.TargetSkill(m, Q); } } if (UltimateManager.Assisted() && R.IsReady()) { if (Menu.Item(Menu.Name + ".ultimate.assisted.move-cursor").GetValue <bool>()) { Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius); } var target = TargetSelector.GetTarget(R); if (target != null && !RLogic( target, Menu.Item(Menu.Name + ".ultimate.assisted.min").GetValue <Slider>().Value, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(), Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady())) { if (Menu.Item(Menu.Name + ".ultimate.assisted.single").GetValue <bool>()) { RLogicSingle( Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(), Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady()); } } } if (UltimateManager.Auto() && R.IsReady()) { var target = TargetSelector.GetTarget(R); if (target != null && !RLogic( target, Menu.Item(Menu.Name + ".ultimate.auto.min").GetValue <Slider>().Value, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(), Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), UltimateModeType.Auto)) { if (Menu.Item(Menu.Name + ".ultimate.auto.single").GetValue <bool>()) { RLogicSingle( Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(), Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady()); } } } if (Menu.Item(Menu.Name + ".miscellaneous.e-auto").GetValue <bool>() && E.IsReady() && HealthManager.Check("auto-e") && !Player.IsRecalling() && !Player.InFountain()) { var buff = GetEBuff(); if (buff == null || (buff.EndTime - Game.Time) <= Game.Ping / 2000f + 0.5f) { E.Cast(); } } }
protected virtual void Visit(XmlSchemaAnnotated annotated) { XmlSchemaAnyAttribute anyAttribute; XmlSchemaAttribute attribute; XmlSchemaAttributeGroup attributeGroup; XmlSchemaAttributeGroupRef attributeGroupRef; XmlSchemaContent content; XmlSchemaContentModel contentModel; XmlSchemaFacet facet; XmlSchemaGroup group; XmlSchemaIdentityConstraint constraint; XmlSchemaNotation notation; XmlSchemaParticle particle; XmlSchemaSimpleTypeContent schemaSimpleTypeContent; XmlSchemaType type; XmlSchemaXPath xPath; if (Casting.TryCast(annotated, out anyAttribute)) { Visit(anyAttribute); } else if (Casting.TryCast(annotated, out attribute)) { Visit(attribute); } else if (Casting.TryCast(annotated, out attributeGroup)) { Visit(attributeGroup); } else if (Casting.TryCast(annotated, out attributeGroupRef)) { Visit(attributeGroupRef); } else if (Casting.TryCast(annotated, out content)) { Visit(content); } else if (Casting.TryCast(annotated, out contentModel)) { Visit(contentModel); } else if (Casting.TryCast(annotated, out facet)) { Visit(facet); } else if (Casting.TryCast(annotated, out group)) { Visit(group); } else if (Casting.TryCast(annotated, out constraint)) { Visit(constraint); } else if (Casting.TryCast(annotated, out notation)) { Visit(notation); } else if (Casting.TryCast(annotated, out particle)) { Visit(particle); } else if (Casting.TryCast(annotated, out schemaSimpleTypeContent)) { Visit(schemaSimpleTypeContent); } else if (Casting.TryCast(annotated, out type)) { Visit(type); } else if (Casting.TryCast(annotated, out xPath)) { Visit(xPath); } else { throw ExceptionBuilder.UnexpectedSchemaObjectType(annotated); } }
public void SendSMSGSpellStart(Casting cast, Mobile Caster,object target) { int offset = 4; Converter.ToBytes( (ulong)Caster.Guid, tempBuff, ref offset ); Converter.ToBytes( (ulong)Caster.Guid, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.id, tempBuff, ref offset ); Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.castingtime, tempBuff, ref offset ); Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); if( (cast.type & 0x8000) != 0 || (cast.type & 0x0800) != 0 || (cast.type & 0x0002) != 0 ) { Converter.ToBytes( (ulong)(target as Object).Guid, tempBuff, ref offset ); } else if( (cast.type & 0x1000) != 0|| (cast.type & 0x0010) != 0 ) { Converter.ToBytes( (ulong)(target as Item).Guid, tempBuff, ref offset ); } else if( (cast.type & 0x0020) != 0 ) { Converter.ToBytes( (float)this.X, tempBuff, ref offset ); Converter.ToBytes( (float)this.Y, tempBuff, ref offset ); Converter.ToBytes( (float)this.Z, tempBuff, ref offset ); } else if( (cast.type & 0x0040) != 0 ) { Converter.ToBytes( (float)((SpellXYZtarget)target).X, tempBuff, ref offset ); Converter.ToBytes( (float)((SpellXYZtarget)target).Y, tempBuff, ref offset ); Converter.ToBytes( (float)((SpellXYZtarget)target).Z, tempBuff, ref offset ); } else if( (cast.type & 0x2000) != 0 ) { } else if( (cast.type & 0x20) != 0 ) { if (this is Character) { Item ammo = World.CreateItemInPoolById( (this as Character).AmmoType ); if (ammo != null) { Converter.ToBytes( (uint)ammo.Model, tempBuff, ref offset ); Converter.ToBytes( (uint)ammo.InventoryType, tempBuff, ref offset ); } } } ToAllPlayerNear( OpCodes.SMSG_SPELL_START, tempBuff, offset ); //Console.WriteLine("SMSG_SPELL_START"); //HexViewer.View( tempBuff, 0, offset ); }
private void Awake() { instance = this; }
public void Add(Casting casting) { context.Castings.Add(casting); context.SaveChanges(); }
public static async Task <bool> PreCombatBuff() { await Casting.CheckForSuccessfulCast(); return(false); }
public static async Task <bool> Combat() { if (Core.Me.IsCasting) { return(true); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Utilities.Routines.Reaper.RefreshVars(); if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { if (await Utility.Soulsow()) { return(true); } return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 3 + Core.Me.CurrentTarget.CombatReach); } } if (await Buff.FightLogic_ArcaneCrest()) { return(true); } if (await Buff.FightLogic_Feint()) { return(true); } if (Core.Me.HasAura(Auras.Enshrouded)) //Enshroud Mode { if (ReaperRoutine.GlobalCooldown.CanWeave(1)) { if (await Enshroud.AoE.LemuresScythe()) { return(true); } if (await Enshroud.SingleTarget.LemuresSlice()) { return(true); } } if (await Enshroud.AoE.Communio()) { return(true); } if (await Enshroud.AoE.GrimReaping()) { return(true); } if (await Enshroud.SingleTarget.VoidReaping()) { return(true); } if (await Enshroud.SingleTarget.CrossReaping()) { return(true); } if (await Enshroud.SingleTarget.LemuresSliceOfFWeave()) { return(true); } } else { if (ReaperRoutine.GlobalCooldown.CanWeave()) { if (await PhysicalDps.Interrupt(ReaperSettings.Instance)) { return(true); } if (await PhysicalDps.SecondWind(ReaperSettings.Instance)) { return(true); } if (await PhysicalDps.Bloodbath(ReaperSettings.Instance)) { return(true); } if (await Cooldown.ArcaneCircle()) { return(true); } if (await Cooldown.Enshroud()) { return(true); } if (await Cooldown.Gluttony()) { return(true); } if (await AoE.GrimSwathe()) { return(true); } if (await SingleTarget.BloodStalk()) { return(true); } if (await Utility.TrueNorth()) { return(true); } } if (await Utility.Soulsow()) { return(true); } if (await AoE.WhorlofDeath()) { return(true); } if (await SingleTarget.ShadowOfDeath()) { return(true); } if (await AoE.HarvestMoon()) { return(true); } if (await AoE.PlentifulHarvest()) { return(true); } if (await AoE.Guillotine()) { return(true); } if (await SingleTarget.GibbetAndGallows()) { return(true); } if (await AoE.SoulScythe()) { return(true); } if (await SingleTarget.SoulSlice()) { return(true); } if (await AoE.NightmareScythe()) { return(true); } if (await SingleTarget.InfernalSlice()) { return(true); } if (await SingleTarget.WaxingSlice()) { return(true); } if (await AoE.WhorlofDeathIdle()) { return(true); } if (await AoE.SpinningScythe()) { return(true); } if (await SingleTarget.ShadowOfDeathIdle()) { return(true); } if (await SingleTarget.Slice()) { return(true); } if (await SingleTarget.HarvestMoon()) { return(true); } return(await SingleTarget.EnhancedHarpe()); } return(false); }
public DebuffProxy(GetUnitDelegate del) : base(del) { casting = new Casting(this); }
public static async Task <bool> Heal() { if (Core.Me.IsMounted) { return(true); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; if (await GambitLogic.Gambit()) { return(true); } if (CustomOpenerLogic.InOpener) { return(false); } if (await Logic.Scholar.Heal.Resurrection()) { return(true); } // Scalebound Extreme Rathalos if (Core.Me.HasAura(1495)) { return(await Dispel.Execute()); } #region Pre-Healing Stuff if (Globals.PartyInCombat && Globals.InParty) { // if (await TankBusters.Execute()) return true; } if (await Logic.Scholar.Heal.ForceWhispDawn()) { return(true); } if (await Logic.Scholar.Heal.ForceAdlo()) { return(true); } if (await Logic.Scholar.Heal.ForceIndom()) { return(true); } if (await Logic.Scholar.Heal.ForceExcog()) { return(true); } if (await Buff.Aetherflow()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (await Dispel.Execute()) { return(true); } if (Globals.InParty) { if (await Buff.DeploymentTactics()) { return(true); } if (await Buff.Aetherpact()) { return(true); } if (await Buff.BreakAetherpact()) { return(true); } } if (await Buff.ChainStrategem()) { return(true); } #endregion if (await Logic.Scholar.Heal.Excogitation()) { return(true); } if (await Logic.Scholar.Heal.Lustrate()) { return(true); } if (Core.Me.Pet != null && Core.Me.InCombat) { if (await Logic.Scholar.Heal.FeyBlessing()) { return(true); } if (await Logic.Scholar.Heal.WhisperingDawn()) { return(true); } if (await Logic.Scholar.Heal.FeyIllumination()) { return(true); } if (await Logic.Scholar.Heal.SummonSeraph()) { return(true); } if (await Logic.Scholar.Heal.Consolation()) { return(true); } } if (Globals.InParty) { if (await Logic.Scholar.Heal.Indomitability()) { return(true); } if (await Logic.Scholar.Heal.Succor()) { return(true); } if (await Logic.Scholar.Heal.SacredSoil()) { return(true); } } if (await Logic.Scholar.Heal.EmergencyTacticsAdlo()) { return(true); } if (await Logic.Scholar.Heal.Adloquium()) { return(true); } if (await Logic.Scholar.Heal.Physick()) { return(true); } if (await Buff.SummonPet()) { return(true); } if (Utilities.Combat.Enemies.Count > ScholarSettings.Instance.StopDamageWhenMoreThanEnemies) { return(true); } if (Globals.InParty) { if (!ScholarSettings.Instance.DoDamage) { return(true); } if (Core.Me.CurrentManaPercent < ScholarSettings.Instance.MinimumManaPercent) { return(true); } } return(await Combat()); }
private static string GetSchemaObjectName(Context context, XmlSchemaObject schemaObject) { XmlSchema schema; XmlSchemaAttribute attribute; XmlSchemaElement element; XmlSchemaGroup group; XmlSchemaAttributeGroup attributeGroup; XmlSchemaSimpleType simpleType; XmlSchemaComplexType complexType; XmlSchemaGroupBase groupBase; XmlSchemaGroupRef groupRef; XmlSchemaContent content; if (Casting.TryCast(schemaObject, out attribute)) { var parents = context.SchemaSetManager.GetObjectParents(attribute); IList <ListItem> listItems = ListItemBuilder.Build(context, parents); if (listItems != null && listItems.Count == 1) { ListItem parentItem = listItems[0]; return(parentItem.Topic.LinkTitle); } //var simpleTypeStructureRoot = // context.SchemaSetManager.GetSimpleTypeStructure( // attribute.AttributeSchemaType); //if (simpleTypeStructureRoot != null) //{ // if (simpleTypeStructureRoot.Children.Count == 1) // { // var node = simpleTypeStructureRoot.Children[0]; // var isSingleRow = SimpleTypeStructureNode.GetIsSingleRow(node); // if (isSingleRow && node.NodeType == SimpleTypeStructureNodeType.NamedType) // { // XmlSchemaType schemaType = (XmlSchemaType)node.Node; // return GetTypeName(context.TopicManager, schemaType); // } // } //} return(attribute.AttributeSchemaType.Name); } if (Casting.TryCast(schemaObject, out element)) { var parents = context.SchemaSetManager.GetObjectParents(element); IList <ListItem> listItems = ListItemBuilder.Build(context, parents); if (listItems != null && listItems.Count == 1) { ListItem parentItem = listItems[0]; return(parentItem.Topic.LinkTitle); } //var simpleTypeStructureRoot = // context.SchemaSetManager.GetSimpleTypeStructure( // element.ElementSchemaType); //if (simpleTypeStructureRoot != null) //{ // if (simpleTypeStructureRoot.Children.Count == 1) // { // var node = simpleTypeStructureRoot.Children[0]; // var isSingleRow = SimpleTypeStructureNode.GetIsSingleRow(node); // if (isSingleRow && node.NodeType == SimpleTypeStructureNodeType.NamedType) // { // XmlSchemaType schemaType = (XmlSchemaType)node.Node; // return GetTypeName(context.TopicManager, schemaType); // } // } //} return(element.ElementSchemaType.Name); } if (Casting.TryCast(schemaObject, out schema)) { return(String.Empty); } if (Casting.TryCast(schemaObject, out group)) { return(group.QualifiedName.Name); } if (Casting.TryCast(schemaObject, out attributeGroup)) { return(attributeGroup.QualifiedName.Name); } if (Casting.TryCast(schemaObject, out simpleType)) { return(simpleType.QualifiedName.Name); } if (Casting.TryCast(schemaObject, out complexType)) { return(complexType.QualifiedName.Name); } if (Casting.TryCast(schemaObject, out groupBase)) { return(GetSchemaObjectName(context, groupBase.Parent)); } if (Casting.TryCast(schemaObject, out groupRef)) { group = context.SchemaSetManager.SchemaSet.ResolveGroup(groupRef); if (group != null) { return(group.QualifiedName.Name); } } if (Casting.TryCast(schemaObject, out content)) { XmlSchemaSimpleContentExtension simpleContentExtension; XmlSchemaSimpleContentRestriction simpleContentRestriction; XmlSchemaComplexContentExtension complexContentExtension; XmlSchemaComplexContentRestriction complexContentRestriction; if (Casting.TryCast(content, out simpleContentExtension)) { return(simpleContentExtension.BaseTypeName.Name); } else if (Casting.TryCast(content, out simpleContentRestriction)) { return(simpleContentRestriction.BaseTypeName.Name); } else if (Casting.TryCast(content, out complexContentExtension)) { return(complexContentExtension.BaseTypeName.Name); } else if (Casting.TryCast(content, out complexContentRestriction)) { return(complexContentRestriction.BaseTypeName.Name); } } //if (schemaObject.Parent != null) //{ // return GetSchemaObjectName(context, schemaObject.Parent); //} throw ExceptionBuilder.UnexpectedSchemaObjectType(schemaObject); }
public static async Task <bool> Heal() { if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; if (await GambitLogic.Gambit()) { return(true); } if (Globals.PartyInCombat && Globals.InParty) { if (await TankBusters.Execute()) { return(true); } } //force cast logics if (await Logic.WhiteMage.Heal.ForceRegen()) { return(true); } if (await Logic.WhiteMage.Heal.ForceBenediction()) { return(true); } if (await Logic.WhiteMage.Heal.ForceMedica()) { return(true); } if (await Logic.WhiteMage.Heal.ForceMedicaII()) { return(true); } if (await Logic.WhiteMage.Heal.ForceAfflatusSolace()) { return(true); } if (await Logic.WhiteMage.Heal.ForceAfflatusRapture()) { return(true); } if (await Logic.WhiteMage.Heal.ForceCureII()) { return(true); } if (await Logic.WhiteMage.Heal.ForceCureIII()) { return(true); } if (await Logic.WhiteMage.Heal.ForceTetra()) { return(true); } if (await SingleTarget.ForceAfflatusMisery()) { return(true); } if (await Logic.WhiteMage.Heal.Raise()) { return(true); } // Scalebound Extreme Rathalos if (Core.Me.HasAura(1495)) { if (await Dispel.Execute()) { return(true); } return(false); } if (Casting.LastSpell == Spells.PlenaryIndulgence) { if (await Logic.WhiteMage.Heal.AfflatusRapture()) { return(true); } if (await Logic.WhiteMage.Heal.Cure3()) { return(true); } if (await Logic.WhiteMage.Heal.Medica2()) { return(true); } return(await Spells.Medica.Cast(Core.Me)); } if (await Logic.WhiteMage.Heal.Benediction()) { return(true); } if (await Dispel.Execute()) { return(true); } if (await Buff.Temperance()) { return(true); } if (await Buff.ThinAir(false)) { return(true); } if (await Buff.DivineBenison()) { return(true); } if (await Logic.WhiteMage.Heal.PlenaryIndulgence()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (await Buff.AssizeForMana()) { return(true); } if (await Buff.PresenceOfMind()) { return(true); } if (await Logic.WhiteMage.Heal.Tetragrammaton()) { return(true); } if (await Logic.WhiteMage.Heal.AfflatusSolace()) { return(true); } if (await Logic.WhiteMage.Heal.Cure3()) { return(true); } if (Globals.InParty) { if (await Logic.WhiteMage.Heal.AssizeHeal()) { return(true); } if (await Logic.WhiteMage.Heal.Benediction()) { return(true); } if (await Logic.WhiteMage.Heal.Tetragrammaton()) { return(true); } if (await Logic.WhiteMage.Heal.AfflatusRapture()) { return(true); } if (await Logic.WhiteMage.Heal.Medica()) { return(true); } if (await Logic.WhiteMage.Heal.Medica2()) { return(true); } if (await Logic.WhiteMage.Heal.Cure3()) { return(true); } if (await Logic.WhiteMage.Heal.Asylum()) { return(true); } } if (await Logic.WhiteMage.Heal.Cure2()) { return(true); } if (await Logic.WhiteMage.Heal.Cure()) { return(true); } if (await SingleTarget.FluidAura()) { return(true); } return(await Logic.WhiteMage.Heal.Regen()); }
public virtual bool SpellExecutionStart(Casting cast,object target,bool fromObject) { this.primarySpellTarget = target; if(this.spellTarget == null && target is Object ) this.spellTarget = target as Object; if (!fromObject) { if(!cast.baseability.CheckSpellCaster(this)) return false; if(!(primarySpellTarget is SpellXYZtarget) || !(primarySpellTarget is Item)) if(!cast.baseability.CheckSpellTarget(this,primarySpellTarget as Object)) return false; } if(cast.id == 75) { if(this.combatTimer != null) this.combatTimer.Stop(); if(this.combatTimer != null) Console.WriteLine("stop1" + this.combatTimer.Delay); if(this is Character) { if((this as Character).SecondCombatTimer != null) (this as Character).SecondCombatTimer.Stop(); if((this as Character).SecondCombatTimer != null) Console.WriteLine("stop1"); if((this as Character).FirstCombatTimer != null) (this as Character).FirstCombatTimer.Stop(); if((this as Character).FirstCombatTimer != null) Console.WriteLine("stop2" ); } #region AutoShot if (target is Mobile) { SpellTemplate st = (SpellTemplate)cast.baseability; SingleTargetSpellEffect stse =( SingleTargetSpellEffect)SpellTemplate.SpellEffects[cast.id]; stse(st,this,target as Mobile); } #endregion } else if(SpellTemplate.SpellEffects[cast.id] != null) { #region attack speed spells with projectile if((SpellTemplate.SpellEffects[cast.id] is SingleTargetSpellEffectAttackSpeedRanged) || (SpellTemplate.SpellEffects[cast.id] is SingleTargetSpellEffectAttackSpeedRangedMultiple)) { if(this.combatTimer != null) this.combatTimer.Stop(); if(this.combatTimer != null) Console.WriteLine("stop1" + this.combatTimer.Delay); if(this is Character) { if((this as Character).SecondCombatTimer != null) (this as Character).SecondCombatTimer.Stop(); if((this as Character).SecondCombatTimer != null) Console.WriteLine("stop1"); if((this as Character).FirstCombatTimer != null) (this as Character).FirstCombatTimer.Stop(); if((this as Character).FirstCombatTimer != null) Console.WriteLine("stop2" ); } { Mobile mob = (Mobile)target; if(mob != null) { this.OnSpellTemplateResults(cast.baseability,mob); Item weapon = this.RangedWeapon; Item ammo = this.RangedAmmo; if (weapon == null) { this.SpellFaillure(SpellFailedReason.YourWeaponHandIsEmpty); return false; } if((weapon.InventoryType == InventoryTypes.Thrown)) ammo = weapon; bool skip = false; foreach(object obj in this.AdditionnalStates) { if(obj is RangedUseTimer) { RangedUseTimer rut = (RangedUseTimer)obj; if(rut.cast.id == this.cast.id) { Console.WriteLine("UHHUHHUHHHUHHU"); #region Cast Result send this.SpellFaillure(SpellFailedReason.AbilityIsntReadyYet); #endregion skip = true; } } } if(!skip) { if(cast.castingtime > 0) { RangedUseTimer rut1 = new RangedUseTimer(this.cast,this,(int)(this.RangedAttackSpeed*1000) + cast.castingtime); } else { RangedUseTimer rut1 = new RangedUseTimer(this.cast,this,(int)(this.RangedAttackSpeed*1000)); } int offset = 4; Converter.ToBytes( this.Guid, this.tempBuff, ref offset ); Converter.ToBytes( this.Guid, this.tempBuff, ref offset ); Converter.ToBytes( cast.id, this.tempBuff, ref offset ); Converter.ToBytes( (short)0x22, this.tempBuff, ref offset ); Converter.ToBytes( (uint)0x000001c7, this.tempBuff, ref offset ); Converter.ToBytes( (ushort)0x2, this.tempBuff, ref offset ); Converter.ToBytes( mob.Guid, this.tempBuff, ref offset ); if(ammo != null) { Console.WriteLine("ommo ok"); Converter.ToBytes( (uint)ammo.Model, this.tempBuff, ref offset ); Converter.ToBytes( (uint)ammo.InventoryType, this.tempBuff, ref offset ); } this.ToAllPlayerNear( OpCodes.SMSG_SPELL_START, this.tempBuff, offset ); spellCastTimer = new SpellCastTimer( new SpellStartRun( this.SpellStart ), (int)500 ); } } } } #endregion #region NextAttackEffectDelegate + multiple one else if(SpellTemplate.SpellEffects[cast.id] is NextAttackEffectDelegate ) { if (target is Mobile) { Mobile mob = (Mobile)target; if(mob != null) { this.OnSpellTemplateResults(cast.baseability,mob); NextAttackEffect nae = new NextAttackEffect(cast.baseability,(NextAttackEffectDelegate)SpellTemplate.SpellEffects[cast.id]); this.nextAttackEffects.Add(nae); int offset = 4; Converter.ToBytes( (ulong)Guid, tempBuff, ref offset ); Converter.ToBytes( (ulong)Guid, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.id, tempBuff, ref offset ); Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.castingtime, tempBuff, ref offset ); Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); Converter.ToBytes( (ulong)mob.Guid, tempBuff, ref offset ); ToAllPlayerNear( OpCodes.SMSG_SPELL_START, tempBuff, offset ); } else this.SpellFaillure(SpellFailedReason.InvalidTarget); } else this.SpellFaillure(SpellFailedReason.InvalidTarget); } else if(SpellTemplate.SpellEffects[cast.id] is NextAttackEffectDelegateMultiple ) { if (target is Mobile) { Mobile mob = (Mobile)target; if(mob != null) { this.OnSpellTemplateResults(cast.baseability,mob); NextAttackEffect nae = new NextAttackEffect(cast.baseability,(NextAttackEffectDelegateMultiple)SpellTemplate.SpellEffects[cast.id]); this.nextAttackEffects.Add(nae); int offset = 4; Converter.ToBytes( (ulong)Guid, tempBuff, ref offset ); Converter.ToBytes( (ulong)Guid, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.id, tempBuff, ref offset ); Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); Converter.ToBytes( (uint)cast.castingtime, tempBuff, ref offset ); Converter.ToBytes( (ushort)cast.type, tempBuff, ref offset ); Converter.ToBytes( (ulong)mob.Guid, tempBuff, ref offset ); ToAllPlayerNear( OpCodes.SMSG_SPELL_START, tempBuff, offset ); } else this.SpellFaillure(SpellFailedReason.InvalidTarget); } else this.SpellFaillure(SpellFailedReason.InvalidTarget); } #endregion #region base else { if(this.combatTimer != null) this.combatTimer.Stop(); if(this.combatTimer != null) Console.WriteLine("stop1" + this.combatTimer.Delay); if(this is Character) { if((this as Character).SecondCombatTimer != null) (this as Character).SecondCombatTimer.Stop(); if((this as Character).SecondCombatTimer != null) Console.WriteLine("stop1"); if((this as Character).FirstCombatTimer != null) (this as Character).FirstCombatTimer.Stop(); if((this as Character).FirstCombatTimer != null) Console.WriteLine("stop2" ); } this.SendSMSGSpellStart(cast,this,this.primarySpellTarget); if(cast.castingtime <=0) { SpellStart(); } else { spellCastTimer = new SpellCastTimer( new SpellStartRun( this.SpellStart ), (int)cast.castingtime ); } } #endregion } return true; }
public static async Task <bool> Combat() { if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 20 + Core.Me.CurrentTarget.CombatReach); } } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); BardRoutine.RefreshVars(); if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (BardRoutine.GlobalCooldown.CanWeave()) { // Utility if (await Utility.RepellingShot()) { return(true); } if (await Utility.WardensPaean()) { return(true); } if (await Utility.NaturesMinne()) { return(true); } if (await Utility.Troubadour()) { return(true); } if (await PhysicalDps.ArmsLength(BardSettings.Instance)) { return(true); } if (await PhysicalDps.SecondWind(BardSettings.Instance)) { return(true); } if (await PhysicalDps.Interrupt(BardSettings.Instance)) { return(true); } // Damage if (await SingleTarget.LastPossiblePitchPerfectDuringWM()) { return(true); } if (await Songs.LetMeSingYouTheSongOfMyPeople()) { return(true); } if (await Cooldowns.RagingStrikes()) { return(true); } if (await Cooldowns.BattleVoice()) { return(true); } if (await Cooldowns.RadiantFinale()) { return(true); } if (await Cooldowns.Barrage()) { return(true); } if (await SingleTarget.PitchPerfect()) { return(true); } if (await Aoe.RainOfDeathDuringMagesBallard()) { return(true); } if (await SingleTarget.BloodletterInMagesBallard()) { return(true); } if (await SingleTarget.EmpyrealArrow()) { return(true); } if (await SingleTarget.Sidewinder()) { return(true); } if (await Aoe.RainOfDeath()) { return(true); } if (await SingleTarget.Bloodletter()) { return(true); } } if (await DamageOverTime.IronJawsOnCurrentTarget()) { return(true); } if (await DamageOverTime.SnapShotIronJawsOnCurrentTarget()) { return(true); } if (await SingleTarget.StraightShotAfterBarrage()) { return(true); } if (await DamageOverTime.WindbiteOnCurrentTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnCurrentTarget()) { return(true); } if (await Aoe.BlastArrow()) { return(true); } if (await Aoe.ApexArrow()) { return(true); } if (await Aoe.ShadowBite()) { return(true); } if (await DamageOverTime.IronJawsOnOffTarget()) { return(true); } if (await DamageOverTime.WindbiteOnOffTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnOffTarget()) { return(true); } if (await Aoe.LadonsBite()) { return(true); } if (await SingleTarget.StraightShot()) { return(true); } return(await SingleTarget.HeavyShot()); }
public static async Task<bool> Heal() { if (WorldManager.InSanctuary) return false; if (Core.Me.IsMounted) return false; if (await Casting.TrackSpellCast()) return true; await Casting.CheckForSuccessfulCast(); if (await Buff.SummonPet()) return true; Casting.DoHealthChecks = false; if (await GambitLogic.Gambit()) return true; if (CustomOpenerLogic.InOpener) return false; if (await HealFightLogic.Aoe()) return true; if (await HealFightLogic.Tankbuster()) return true; if (await Logic.Scholar.Heal.Resurrection()) return true; // Scalebound Extreme Rathalos if (Core.Me.HasAura(1495)) { return await Dispel.Execute(); } #region Pre-Healing Stuff if (await Logic.Scholar.Heal.ForceWhispDawn()) return true; if (await Logic.Scholar.Heal.ForceAdlo()) return true; if (await Logic.Scholar.Heal.ForceIndom()) return true; if (await Logic.Scholar.Heal.ForceExcog()) return true; if (await Dispel.Execute()) return true; if (await Buff.Aetherflow()) return true; if (await Buff.LucidDreaming()) return true; if (Globals.InParty) { if (await Buff.DeploymentTactics()) return true; if (await Buff.Aetherpact()) return true; if (await Buff.BreakAetherpact()) return true; } if (await Buff.ChainStrategem()) return true; #endregion if (await Logic.Scholar.Heal.Excogitation()) return true; if (await Logic.Scholar.Heal.Lustrate()) return true; if (Core.Me.Pet != null && Core.Me.InCombat) { if (await Logic.Scholar.Buff.SummonSeraph()) return true; if (await Logic.Scholar.Heal.Consolation()) return true; if (await Logic.Scholar.Heal.FeyIllumination()) return true; if (await Logic.Scholar.Heal.WhisperingDawn()) return true; if (await Logic.Scholar.Heal.FeyBlessing()) return true; } if (Globals.InParty) { if (await Logic.Scholar.Heal.Indomitability()) return true; if (await Logic.Scholar.Heal.EmergencyTacticsSuccor()) return true; if (await Logic.Scholar.Heal.Succor()) return true; if (await Logic.Scholar.Heal.SacredSoil()) return true; } if (await Buff.Expedient()) return true; if (await Buff.Protraction()) return true; if (await Logic.Scholar.Heal.EmergencyTacticsAdloquium()) return true; if (await Logic.Scholar.Heal.Adloquium()) return true; if (await Logic.Scholar.Heal.Physick()) return true; return await HealAlliance(); }
public static async Task <bool> Execute() { Group.UpdateAllies(Utilities.Routines.WhiteMage.GroupExtension); Globals.HealTarget = Group.CastableAlliesWithin30.OrderBy(x => x.CurrentHealthPercent).FirstOrDefault(); if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; Globals.InParty = PartyManager.IsInParty || Globals.InGcInstance; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2) || Core.Me.InCombat; Globals.OnPvpMap = Core.Me.OnPvpMap(); if (Core.Me.OnPvpMap()) { await PvpRotation(); return(true); } if (Duty.State() == Duty.States.Ended) { return(false); } if (await GambitLogic.Gambit()) { return(true); } if (await Chocobo.HandleChocobo()) { return(true); } if (Globals.PartyInCombat && Globals.InParty) { if (await TankBusters.Execute()) { return(true); } } if (await Logic.WhiteMage.Heal.Raise()) { return(true); } // Scalebound Extreme Rathalos if (Core.Me.HasAura(1495)) { if (await Dispel.Execute()) { return(true); } return(false); } if (Casting.LastSpell == Spells.PlenaryIndulgence) { if (await Logic.WhiteMage.Heal.Cure3()) { return(true); } if (await Logic.WhiteMage.Heal.Medica2()) { return(true); } return(await Spells.Medica.Cast(Core.Me)); } if (await Logic.WhiteMage.Heal.Benediction()) { return(true); } if (await Dispel.Execute()) { return(true); } if (await Buff.Temperance()) { return(true); } if (await Buff.ThinAir(false)) { return(true); } if (await Buff.DivineBenison()) { return(true); } if (await Logic.WhiteMage.Heal.PlenaryIndulgence()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (await Buff.AssizeForMana()) { return(true); } if (await Buff.PresenceOfMind()) { return(true); } if (await Logic.WhiteMage.Heal.Tetragrammaton()) { return(true); } if (await Logic.WhiteMage.Heal.AfflatusSolace()) { return(true); } if (await Logic.WhiteMage.Heal.Cure3()) { return(true); } if (Globals.InParty) { if (await Logic.WhiteMage.Heal.AssizeHeal()) { return(true); } if (await Logic.WhiteMage.Heal.Benediction()) { return(true); } if (await Logic.WhiteMage.Heal.Tetragrammaton()) { return(true); } if (await Logic.WhiteMage.Heal.AfflatusRapture()) { return(true); } if (await Logic.WhiteMage.Heal.Medica()) { return(true); } if (await Logic.WhiteMage.Heal.Medica2()) { return(true); } if (await Logic.WhiteMage.Heal.Cure3()) { return(true); } if (await Logic.WhiteMage.Heal.Asylum()) { return(true); } } if (await Logic.WhiteMage.Heal.Cure2()) { return(true); } if (await Logic.WhiteMage.Heal.Cure()) { return(true); } if (await SingleTarget.FluidAura()) { return(true); } return(await Logic.WhiteMage.Heal.Regen()); }
protected override void OnPostUpdate() { if (Ultimate.IsActive(UltimateModeType.Flash) && R.IsReady() && SummonerManager.Flash.IsReady()) { if (Ultimate.ShouldMove(UltimateModeType.Flash)) { Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius); } var targets = Targets.Where( t => t.Distance(Player) < (R.Range + R.Width + SummonerManager.Flash.Range) * 1.5f && !t.IsDashing() && (t.IsFacing(Player) ? t.Distance(Player) : R.GetPrediction(t).UnitPosition.Distance(Player.Position)) > R.Range); var backwards = Menu.Item(Menu.Name + ".ultimate.backwards").GetValue <bool>(); foreach (var target in targets) { var flashPos = Player.Position.Extend(target.Position, SummonerManager.Flash.Range); var maxHits = GetMaxRHits(HitChance.High, flashPos); if (maxHits.Item1.Count > 0) { var castPos = backwards ? Player.Position.Extend(maxHits.Item2, -(Player.Position.Distance(maxHits.Item2) * 2)) : Player.Position.Extend(maxHits.Item2, Player.Position.Distance(maxHits.Item2)); if (Ultimate.Check(UltimateModeType.Flash, maxHits.Item1)) { if (R.Cast(castPos)) { Utility.DelayAction.Add(300 + Game.Ping / 2, () => SummonerManager.Flash.Cast(flashPos)); } } else if (Ultimate.ShouldSingle(UltimateModeType.Flash)) { if ( maxHits.Item1.Where(hit => Ultimate.CheckSingle(UltimateModeType.Flash, hit)) .Any(hit => R.Cast(castPos))) { Utility.DelayAction.Add(300 + Game.Ping / 2, () => SummonerManager.Flash.Cast(flashPos)); } } } } } if (Ultimate.IsActive(UltimateModeType.Assisted) && R.IsReady()) { if (Ultimate.ShouldMove(UltimateModeType.Assisted)) { Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius); } if (!RLogic(UltimateModeType.Assisted, R.GetHitChance("combo"))) { RLogicSingle(UltimateModeType.Assisted, R.GetHitChance("combo"), false); } } if (Ultimate.IsActive(UltimateModeType.Auto) && R.IsReady()) { if (!RLogic(UltimateModeType.Auto, R.GetHitChance("combo"))) { RLogicSingle(UltimateModeType.Auto, R.GetHitChance("combo")); } } if (HeroListManager.Enabled("w-immobile") && W.IsReady()) { var target = Targets.FirstOrDefault( t => HeroListManager.Check("w-immobile", t) && BestTargetOnlyManager.Check("w-immobile", W, t) && Utils.IsImmobile(t)); if (target != null) { Casting.SkillShot(target, W, HitChance.High); } } }
public static async Task <bool> Heal() { if (WorldManager.InSanctuary) { return(false); } if (Core.Me.IsMounted) { return(false); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; if (await GambitLogic.Gambit()) { return(true); } if (await Logic.Astrologian.Heal.Ascend()) { return(true); } if (await Logic.Astrologian.Heal.EssentialDignity()) { return(true); } if (await Dispel.Execute()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (await Buff.Lightspeed()) { return(true); } if (await Buff.Synastry()) { return(true); } if (await Buff.NeutralSect()) { return(true); } if (Globals.InActiveDuty || Core.Me.InCombat) { if (Globals.InParty) { if (await Logic.Astrologian.Heal.EssentialDignity()) { return(true); } if (await Logic.Astrologian.Heal.CelestialIntersection()) { return(true); } if (await Logic.Astrologian.Heal.CelestialOpposition()) { return(true); } if (await Logic.Astrologian.Heal.Horoscope()) { return(true); } if (await Logic.Astrologian.Heal.HoroscopePop()) { return(true); } if (await Logic.Astrologian.Heal.AspectedHelios()) { return(true); } if (await Logic.Astrologian.Heal.CollectiveUnconscious()) { return(true); } if (await Logic.Astrologian.Heal.Helios()) { return(true); } if (await Logic.Astrologian.Heal.Benefic2()) { return(true); } } if (await Logic.Astrologian.Heal.Benefic2()) { return(true); } if (await Logic.Astrologian.Heal.AspectedBenefic()) { return(true); } if (await Logic.Astrologian.Heal.EarthlyStar()) { return(true); } } if (await Logic.Astrologian.Heal.Benefic()) { return(true); } return(await Combat()); }
protected override void LaneClear() { if (!ResourceManager.Check("lane-clear")) { return; } var useQ = Menu.Item(Menu.Name + ".lane-clear.q").GetValue <bool>() && Q.IsReady(); var useW = Menu.Item(Menu.Name + ".lane-clear.w").GetValue <bool>() && W.IsReady(); var useE = Menu.Item(Menu.Name + ".lane-clear.e").GetValue <bool>() && E.IsReady() && DelayManager.Check("e-delay", _lastECast); if (useE) { var minion = MinionManager.GetMinions(Player.ServerPosition, E.Range) .FirstOrDefault( e => GetPoisonBuffEndTime(e) > E.ArrivalTime(e) && (e.Health > E.GetDamage(e) * 2 || e.Health < E.GetDamage(e) - 5)); if (minion != null) { _lastEEndTime = Game.Time + E.ArrivalTime(minion) + 0.1f; _lastECast = Environment.TickCount; Casting.TargetSkill(minion, E); } } if (useQ || useW) { var minions = MinionManager.GetMinions(Player.ServerPosition, Q.Range + Q.Width) .Where(e => GetPoisonBuffEndTime(e) < Q.Delay * 1.1) .ToList(); if (minions.Any()) { if (useQ) { var prediction = Q.GetCircularFarmLocation(minions, Q.Width + 30); if (prediction.MinionsHit > 1 && Game.Time > _lastPoisonClearDelay || _lastPoisonClearPosition.Distance(prediction.Position) > W.Width * 1.1f) { var mP = minions.Count( p => p.Distance(prediction.Position) < Q.Width + 30 && GetPoisonBuffEndTime(p) >= 0.5f); if (prediction.MinionsHit - mP > 1) { _lastPoisonClearDelay = Game.Time + Q.Delay + 1; _lastPoisonClearPosition = prediction.Position; Q.Cast(prediction.Position); } } } if (useW) { var prediction = W.GetCircularFarmLocation(minions, W.Width + 50); if (prediction.MinionsHit > 2 && (Game.Time > _lastPoisonClearDelay || _lastPoisonClearPosition.Distance(prediction.Position) > Q.Width * 1.1f)) { var mP = minions.Count( p => p.Distance(prediction.Position) < W.Width + 50 && GetPoisonBuffEndTime(p) >= 0.5f); if (prediction.MinionsHit - mP > 1) { _lastPoisonClearDelay = Game.Time + W.Delay + 2; _lastPoisonClearPosition = prediction.Position; W.Cast(prediction.Position); } } } } } }
public static async Task <bool> Heal() { if (WorldManager.InSanctuary) { return(false); } if (Core.Me.IsMounted) { return(false); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; if (await GambitLogic.Gambit()) { return(true); } if (await Logic.Sage.Heal.Egeiro()) { return(true); } if (await Dispel.Execute()) { return(true); } if (await Logic.Sage.Heal.ForceZoePneuma()) { return(true); } if (await Logic.Sage.Heal.ForceEukrasianPrognosis()) { return(true); } if (await Logic.Sage.Heal.ForceHaima()) { return(true); } if (await Logic.Sage.Heal.ForcePanhaima()) { return(true); } if (await Logic.Sage.Heal.ForcePepsisEukrasianPrognosis()) { return(true); } if (await Logic.Sage.HealFightLogic.Aoe()) { return(true); } if (await Logic.Sage.HealFightLogic.Tankbuster()) { return(true); } if (SageRoutine.CanWeave()) { if (await Buff.LucidDreaming()) { return(true); } if (await Buff.Rhizomata()) { return(true); } if (await Buff.Krasis()) { return(true); } } if (Globals.InActiveDuty || Core.Me.InCombat) { if (SageRoutine.CanWeave()) { if (await Logic.Sage.Heal.Pepsis()) { return(true); } if (await Logic.Sage.Heal.Panhaima()) { return(true); } if (await Logic.Sage.Heal.Holos()) { return(true); } if (await Logic.Sage.Heal.Physis()) { return(true); } if (await Logic.Sage.Heal.Ixochole()) { return(true); } if (await Logic.Sage.Heal.Kerachole()) { return(true); } if (await Logic.Sage.Heal.Haima()) { return(true); } if (await Logic.Sage.Heal.Taurochole()) { return(true); } if (await Logic.Sage.Heal.Druochole()) { return(true); } } if (await Logic.Sage.Heal.ZoePneuma()) { return(true); } if (await Logic.Sage.Heal.PepsisEukrasianPrognosis()) { return(true); } if (await Logic.Sage.Heal.Pneuma()) { return(true); } if (await Logic.Sage.Heal.EukrasianPrognosis()) { return(true); } if (await Logic.Sage.Heal.Prognosis()) { return(true); } if (await Logic.Sage.Heal.EukrasianDiagnosis()) { return(true); } if (await Logic.Sage.Heal.Diagnosis()) { return(true); } if (await Logic.Sage.Shield.ShieldsUpRedAlert()) { return(true); } } return(await HealAlliance()); }
public void AddToCasting(Casting casting) { base.AddObject("Casting", casting); }