public static Composite CreatePurgeEnemyBehavior(string spellName) { if (SingularSettings.Instance.PurgeTargets == CheckTargets.None || SingularSettings.Instance.PurgeBuffs == PurgeAuraFilter.None) { return(new ActionAlwaysFail()); } return(Spell.Cast(spellName, mov => false, on => { if (!SingularRoutine.IsAllowed(Styx.CommonBot.Routines.CapabilityFlags.DefensiveDispel)) { return null; } WoWUnit unit = GetPurgeEnemyTarget(spellName); if (unit != null) { Logger.WriteDebug("PurgeEnemy[{0}]: found {1} has triggering aura, cancast={2}", spellName, unit.SafeName(), Spell.CanCastHack(spellName, unit)); } return unit; }, ret => SingularSettings.Instance.PurgeTargets != CheckTargets.None )); }
public void UpdateCapabilitiesFlags() { if (!this.Visible) { return; } SendMessage(lblPoi.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFInterrupt.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFTaunt.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFMultiMobPull.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFDefDispel.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFOffDispel.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFKiting.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFSpecialAttacks.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFPetUse.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFPetSummon.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFTargeting.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFAOE.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFGapCloser.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFFacing.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFMoveBehind.Handle, WM_SETREDRAW, false, (IntPtr)0); SendMessage(chkCFMovement.Handle, WM_SETREDRAW, false, (IntPtr)0); chkCFInterrupt.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Interrupting); chkCFTaunt.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Taunting); chkCFMultiMobPull.Checked = SingularRoutine.IsAllowed(CapabilityFlags.MultiMobPull); chkCFDefDispel.Checked = SingularRoutine.IsAllowed(CapabilityFlags.DefensiveDispel); chkCFOffDispel.Checked = SingularRoutine.IsAllowed(CapabilityFlags.OffensiveDispel); chkCFKiting.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Kiting); chkCFSpecialAttacks.Checked = SingularRoutine.IsAllowed(CapabilityFlags.SpecialAttacks); chkCFPetUse.Checked = SingularRoutine.IsAllowed(CapabilityFlags.PetUse); chkCFPetSummon.Checked = SingularRoutine.IsAllowed(CapabilityFlags.PetSummoning); chkCFTargeting.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Targeting); chkCFAOE.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Aoe); chkCFGapCloser.Checked = SingularRoutine.IsAllowed(CapabilityFlags.GapCloser); chkCFFacing.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Facing); chkCFMoveBehind.Checked = SingularRoutine.IsAllowed(CapabilityFlags.MoveBehind); chkCFMovement.Checked = SingularRoutine.IsAllowed(CapabilityFlags.Movement); SendMessage(lblPoi.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFInterrupt.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFTaunt.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFMultiMobPull.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFDefDispel.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFOffDispel.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFKiting.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFSpecialAttacks.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFPetUse.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFPetSummon.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFTargeting.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFAOE.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFGapCloser.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFFacing.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFMoveBehind.Handle, WM_SETREDRAW, true, (IntPtr)0); SendMessage(chkCFMovement.Handle, WM_SETREDRAW, true, (IntPtr)0); }
public static Composite CreateDispelBehavior() { if (SingularSettings.Instance.DispelDebuffs == RelativePriority.None) { return(new ActionAlwaysFail()); } PrioritySelector prio = new PrioritySelector(); switch (StyxWoW.Me.Class) { case WoWClass.Paladin: prio.AddChild(Spell.Cast("Cleanse", on => _unitDispel)); break; case WoWClass.Monk: prio.AddChild(Spell.Cast("Detox", on => _unitDispel)); break; case WoWClass.Priest: if (TalentManager.CurrentSpec == WoWSpec.PriestHoly || TalentManager.CurrentSpec == WoWSpec.PriestDiscipline) { prio.AddChild(Spell.Cast("Purify", on => _unitDispel)); } break; case WoWClass.Druid: if (TalentManager.CurrentSpec == WoWSpec.DruidRestoration) { prio.AddChild(Spell.Cast("Nature's Cure", on => _unitDispel)); } else { prio.AddChild(Spell.Cast("Remove Corruption", on => _unitDispel)); } break; case WoWClass.Shaman: if (TalentManager.CurrentSpec == WoWSpec.ShamanRestoration) { prio.AddChild(Spell.Cast("Purify Spirit", on => _unitDispel)); } else { prio.AddChild(Spell.Cast("Cleanse Spirit", on => _unitDispel)); } break; case WoWClass.Mage: prio.AddChild(Spell.Cast("Remove Curse", on => _unitDispel)); break; } return(new Decorator( req => SingularRoutine.IsAllowed(Styx.CommonBot.Routines.CapabilityFlags.DefensiveDispel), new Sequence( new Action(r => _unitDispel = HealerManager.Instance.TargetList.FirstOrDefault(u => u.IsAlive && CanDispel(u))), prio ) )); }
public static bool CanDispel(WoWUnit unit, DispelCapabilities chk) { return(SingularRoutine.IsAllowed(CapabilityFlags.DefensiveDispel) && (chk & GetDispellableTypesOnUnit(unit)) != 0); }