コード例 #1
0
        /************************************************************************************/
        public bool CastAmbidextrousCasting()
        {
            /// Ambidextrous Casting behaves as a combat art and will turn on auto attack if used.
            if (!m_bAutoAttack)
            {
                return(false);
            }

            CachedAbility AmbidextrousCastingAbility = GetAbility(m_uiAmbidexterousCastingAbilityID, true);

            if (AmbidextrousCastingAbility != null)
            {
                if (AmbidextrousCastingAbility.TotalCastTimeSpan > CastTimeRemaining)
                {
                    return(false);
                }

                /// Because we're not tracking the cast timer, this can be a bit spammy.
                if (CastSimultaneousAbility(m_uiAmbidexterousCastingAbilityID))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        /************************************************************************************/
        /// <summary>
        /// Casts Fusion. This spell deserves special consideration because it is a directional PBAE.
        /// </summary>
        /// <returns></returns>
        protected bool CastFusion()
        {
            if (m_bUseBlueAEs && m_OffensiveTargetActor != null)
            {
                CachedAbility FusionAbility = GetAbility(m_uiFusionAbilityID, true);
                if (FusionAbility != null && m_OffensiveTargetActor.Distance <= FusionAbility.m_fEffectRadius)
                {
                    /// Freehand Sorcery for Fusion.
                    if (CastAbilityOnSelf(m_uiFreehandSorceryAbilityID))
                    {
                        return(true);
                    }

                    if (CastAbility(m_uiFusionAbilityID))
                    {
                        /// Fusion is directional.
                        m_OffensiveTargetActor.DoFace();
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #3
0
        /************************************************************************************/
        protected override bool DoNextAction()
        {
            if (base.DoNextAction() || MeActor.IsDead)
            {
                return(true);
            }

            if (IsCasting)
            {
                return(true);
            }

            if (UseRegenItem())
            {
                return(true);
            }
            if (DisarmChests())
            {
                return(true);
            }
            if (CastJestersCap())
            {
                return(true);
            }

            if (m_bCheckBuffsNow && MeActor.IsStealthed && !MeActor.InCombatMode)
            {
                /// I'm sick and tired of Shroud lingering on after combat.
                if (CancelMaintained(m_uiShroudAbilityID, true))
                {
                    return(true);
                }
            }
            else if (m_bCheckBuffsNow && !MeActor.IsStealthed)
            {
                /// Time is of the essence when rebuffing after a wipe!
                if (!MeActor.InCombatMode && CheckToggleBuff(m_uiGroupRunSpeedBuffAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupCastingSkillBuffAbilityID, m_bBuffCastingSkill))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupSpellProcBuffAbilityID, m_bBuffSpellProc))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupManaRegenBuffAbilityID, m_bBuffManaRegen))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupDefenseBuffAbilityID, m_bBuffDefense))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupHasteBuffAbilityID, m_bBuffHaste))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupDehateBuffAbilityID, m_bBuffDehate))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupSTRSTABuffAbilityID, m_bBuffSTRSTA))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupReflectBuffAbilityID, m_bBuffReflect))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupHealthRegenBuffAbilityID, m_bBuffHealthRegen))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiRaidArcaneBuffAbilityID, m_bBuffArcaneResistance))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiRaidElementalBuffAbilityID, m_bBuffElementalResistance))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiSelfAGIINTBuffAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiResonanceAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiHarmonizationAbilityID, true))
                {
                    return(true);
                }
                if (CheckSingleTargetBuff(m_uiUpbeatTempoAbilityID, m_astrUpbeatTempoTargets))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiAllegroAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiDontKillTheMessengerAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiDexterousSonataAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiFortissimoAbilityID, true))
                {
                    return(true);
                }
                if (CheckToggleBuff(m_uiGroupRunSpeedBuffAbilityID, true))
                {
                    return(true);
                }
                if (CheckRacialBuffs())
                {
                    return(true);
                }
                StopCheckingBuffs();
            }

            /// Decide if the offensive target is still legitimate. If so, attempt to target it.
            GetOffensiveTargetActor();
            if (m_OffensiveTargetActor != null)
            {
                /// Find the distance to the mob.  Especially important for PBAE usage.
                bool bTempBuffsAdvised = (m_OffensiveTargetActor.IsEpic && m_OffensiveTargetActor.Health > 25) || (m_OffensiveTargetActor.IsHeroic && m_OffensiveTargetActor.Health > 90) || (m_OffensiveTargetActor.Health > 95);
                int  iEncounterSize    = m_OffensiveTargetActor.EncounterSize;

                if (CastNextMez(m_uiSingleMezAbilityID))
                {
                    return(true);
                }

                if (!EngageOffensiveTarget())
                {
                    return(false);
                }

                /// We put the stealth check so early on because it is so easily wasted by the wrong thing.
                /// Troubadors only have one stealth attack.
                if (MeActor.IsStealthed && CastAbility(m_uiSingleINTDebuffAbilityID))
                {
                    return(true);
                }

                if (m_bIHaveAggro)
                {
                    if (CastAbility(m_uiEvasiveManeuversAbilityID))
                    {
                        return(true);
                    }

                    if (CastAbility(m_uiSingleDeaggroAbilityID))
                    {
                        return(true);
                    }

                    if (UseDeaggroItems())
                    {
                        return(true);
                    }
                }

                if (CastHOStarter())
                {
                    return(true);
                }

                if (bTempBuffsAdvised)
                {
                    if (!IsBeneficialEffectPresent(m_uiMaestroAbilityID) && CastAbility(m_uiMaestroAbilityID))
                    {
                        /// Right now we're just making a dumb assumption that the player has the VP mythical because that's the easy thing to do.
                        SpamSafeRaidSay(m_strMaestroCallout);
                        return(true);
                    }
                }

                /// Instant cast interrupt/knockback.
                if (m_bUseGreenAEs && IsBeneficialEffectPresent(m_uiMaestroAbilityID))
                {
                    if (CastAbility(m_uiGreenInstantKnockdownAbilityID))
                    {
                        return(true);
                    }
                }

                /// AE interrupt nuke.
                if (IsBeneficialEffectPresent(m_uiMaestroAbilityID))
                {
                    if (CastGreenOffensiveAbility(m_uiGreenInterruptNukeAbilityID, 2))
                    {
                        return(true);
                    }
                }

                /// Offensive skill booster. Do this before combat arts; unlike spells, CA's can be lost on a miss.
                if (CastAbility(m_uiRhythmBladeAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiSingleMentalSnareDebuffAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiGreenResistDebuffAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiGreenSkillDebuffAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiGreenWISDebuffAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiGreenSTRAGIDebuffAbilityID))
                {
                    return(true);
                }

                if (CastLoreAndLegendAbility())
                {
                    return(true);
                }

                if (CastAbility(m_uiSingleDefenseDebuffAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiHalfElfMitigationDebuffAbilityID))
                {
                    return(true);
                }

                if (CastAbilityFromFlankingOrBehind(m_uiSingleResistDebuffAbilityID))
                {
                    return(true);
                }

                /// We now cast stealth to allow the use of our INT debuff, Night Strike.
                /// On the very next DoNextAction(), we'll see ourselves stealthed and execute the debuff.
                /// It takes some luck though. We cast stealth but the server doesn't tell us we're stealthed yet,
                /// so we use other spells and break the stealth on accident.
                if (!IsAbilityMaintained(m_uiSingleINTDebuffAbilityID))
                {
                    CachedAbility DebuffAbility = GetAbility(m_uiSingleINTDebuffAbilityID, true);
                    if (DebuffAbility != null && DebuffAbility.m_fTimeUntilReady == 0.0)                     /// IsReady will always be false if not stealthed.
                    {
                        if (CastAbility(m_uiBumpAbilityID))
                        {
                            return(true);
                        }

                        if (m_bAllowShroudForNightStrike && CastAbility(m_uiShroudAbilityID))
                        {
                            return(true);
                        }
                    }
                }

                /*********************************
                *  From here on out, it's dps spells.
                *
                *  Evasive Maneuvers = 4077.2
                *  Ceremonial Blade = 3245.7
                *  Reverberating Shrill = 2016.1
                *  Turnstrike = 1708
                *  Draining Incursion = 1448.9
                *  Tap Essence = 1310.2
                *  Thunderous Overture = 907.3
                *********************************/

                if (CastGreenOffensiveAbility(m_uiGreenInterruptNukeAbilityID, 3))
                {
                    return(true);
                }

                if (CastAbility(m_uiEvasiveManeuversAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiSingleMentalAttackPairAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiSingleLongRangeNukeAbilityID))
                {
                    return(true);
                }

                /// AE avoid, though we use it as generic DPS.
                if (CastAbility(m_uiTurnstrikeAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiSinglePowerDrainAttackAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiSinglePowerSiphonNukeAbilityID))
                {
                    return(true);
                }

                if (CastAbility(m_uiSingleShortRangeNukeAbilityID))
                {
                    return(true);
                }

                /// Not sure where in cast order this goes yet.
                if (Me.RangedAutoAttackOn && CastAbility(m_uiSingleRangedAttackAbilityID))
                {
                    return(true);
                }

                if (CastGreenOffensiveAbility(m_uiGreenInterruptNukeAbilityID, 2))
                {
                    return(true);
                }

                if (UseOffensiveItems())
                {
                    return(true);
                }

                /// Nuke of last resort.
                if (CastGreenOffensiveAbility(m_uiGreenInterruptNukeAbilityID, 1))
                {
                    return(true);
                }
            }

            return(false);
        }