コード例 #1
0
        private bool NeedToHealSomeone()
        {
            if (TargetManagerHeal.GetUnitToTarget(out IEnumerable <WowUnit> unitsToHeal))
            {
                WowUnit target = unitsToHeal.First();

                if (unitsToHeal.Count() > 3 &&
                    TryCastSpell(prayerOfHealingSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.Guid != WowInterface.ObjectManager.PlayerGuid &&
                    target.HealthPercentage < 70 &&
                    WowInterface.ObjectManager.Player.HealthPercentage < 70 &&
                    TryCastSpell(bindingHealSpell, target.Guid, true))
                {
                    return(true);
                }

                if (WowInterface.ObjectManager.Player.ManaPercentage < 50 &&
                    TryCastSpell(hymnOfHopeSpell, 0))
                {
                    return(true);
                }

                if (WowInterface.ObjectManager.Player.HealthPercentage < 20 &&
                    TryCastSpell(desperatePrayerSpell, 0))
                {
                    return(true);
                }

                if ((target.HealthPercentage < 98 && target.HealthPercentage > 80 &&
                     !target.HasBuffByName(weakenedSoulSpell) &&
                     !target.HasBuffByName(powerWordShieldSpell) &&
                     TryCastSpell(powerWordShieldSpell, target.Guid, true)) ||
                    (target.HealthPercentage < 90 && target.HealthPercentage > 80 &&
                     !target.HasBuffByName(renewSpell) &&
                     TryCastSpell(renewSpell, target.Guid, true)))
                {
                    return(true);
                }

                double healthDifference = target.MaxHealth - target.Health;
                List <KeyValuePair <int, string> > spellsToTry = SpellUsageHealDict.Where(e => e.Key <= healthDifference).ToList();

                foreach (KeyValuePair <int, string> keyValuePair in spellsToTry.OrderByDescending(e => e.Value))
                {
                    if (TryCastSpell(keyValuePair.Value, target.Guid, true))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #2
0
        private bool NeedToHealSomeone()
        {
            if (TargetManagerHeal.GetUnitToTarget(out IEnumerable <WowUnit> unitsToHeal))
            {
                WowUnit targetUnit = unitsToHeal.Count() > 1 ? unitsToHeal.First(e => !e.HasBuffByName(beaconOfLightSpell)) : unitsToHeal.First();

                if (targetUnit.HealthPercentage < 15.0 &&
                    TryCastSpell(layOnHandsSpell, 0))
                {
                    return(true);
                }

                if (unitsToHeal.Count(e => !e.HasBuffByName(beaconOfLightSpell)) > 1 &&
                    TryCastSpell(beaconOfLightSpell, targetUnit.Guid, true))
                {
                    return(true);
                }

                // TODO: bugged need to figure out why cooldown is always wrong
                // if (targetUnit.HealthPercentage < 50
                //     && CastSpellIfPossible(divineFavorSpell, targetUnit.Guid, true))
                // {
                //     LastHealAction = DateTime.Now;
                //     return true;
                // }

                if (WowInterface.ObjectManager.Player.ManaPercentage < 50 &&
                    WowInterface.ObjectManager.Player.ManaPercentage > 20 &&
                    TryCastSpell(divineIlluminationSpell, 0, true))
                {
                    return(true);
                }

                if (WowInterface.ObjectManager.Player.ManaPercentage < 60 &&
                    TryCastSpell(divinePleaSpell, 0, true))
                {
                    return(true);
                }

                double healthDifference = targetUnit.MaxHealth - targetUnit.Health;
                List <KeyValuePair <int, string> > spellsToTry = SpellUsageHealDict.Where(e => e.Key <= healthDifference).ToList();

                foreach (KeyValuePair <int, string> keyValuePair in spellsToTry.OrderByDescending(e => e.Value))
                {
                    if (TryCastSpell(keyValuePair.Value, targetUnit.Guid, true))
                    {
                        break;
                    }
                }

                return(true);
            }

            return(false);
        }
コード例 #3
0
ファイル: PriestHoly.cs プロジェクト: jaydeshow/AmeisenBotX
        private bool NeedToHealSomeone()
        {
            if (TargetManagerHeal.GetUnitToTarget(out IEnumerable <WowUnit> unitsToHeal))
            {
                WowUnit target = unitsToHeal.First();

                if (unitsToHeal.Count() > 3 &&
                    target.HealthPercentage > 80.0 &&
                    TryCastSpell(prayerOfHealingSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 25.0 &&
                    TryCastSpell(guardianSpiritSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.Guid != WowInterface.ObjectManager.PlayerGuid &&
                    target.HealthPercentage < 70.0 &&
                    WowInterface.ObjectManager.Player.HealthPercentage < 70.0 &&
                    TryCastSpell(bindingHealSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 90.0 &&
                    target.HealthPercentage > 75.0 &&
                    !target.HasBuffByName(renewSpell) &&
                    TryCastSpell(renewSpell, target.Guid, true))
                {
                    return(true);
                }

                double healthDifference = target.MaxHealth - target.Health;
                List <KeyValuePair <int, string> > spellsToTry = SpellUsageHealDict.Where(e => e.Key <= healthDifference).OrderByDescending(e => e.Key).ToList();

                foreach (KeyValuePair <int, string> keyValuePair in spellsToTry)
                {
                    if (TryCastSpell(keyValuePair.Value, target.Guid, true))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #4
0
        private bool NeedToHealSomeone()
        {
            if (TargetManagerHeal.GetUnitToTarget(out IEnumerable <WowUnit> unitsToHeal))
            {
                WowInterface.HookManager.WowTargetGuid(unitsToHeal.First().Guid);

                if (WowInterface.ObjectManager.Target != null)
                {
                    if (WowInterface.ObjectManager.Target.HealthPercentage < 25 &&
                        TryCastSpell(earthShieldSpell, 0, true))
                    {
                        return(true);
                    }

                    if (unitsToHeal.Count() > 4 &&
                        TryCastSpell(chainHealSpell, WowInterface.ObjectManager.TargetGuid, true))
                    {
                        return(true);
                    }

                    if (unitsToHeal.Count() > 6 &&
                        (TryCastSpell(naturesSwiftnessSpell, 0, true) ||
                         TryCastSpell(tidalForceSpell, WowInterface.ObjectManager.TargetGuid, true)))
                    {
                        return(true);
                    }

                    double healthDifference = WowInterface.ObjectManager.Target.MaxHealth - WowInterface.ObjectManager.Target.Health;
                    List <KeyValuePair <int, string> > spellsToTry = SpellUsageHealDict.Where(e => e.Key <= healthDifference).ToList();

                    foreach (KeyValuePair <int, string> keyValuePair in spellsToTry.OrderByDescending(e => e.Value))
                    {
                        if (TryCastSpell(keyValuePair.Value, WowInterface.ObjectManager.TargetGuid, true))
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
コード例 #5
0
        private bool NeedToHealSomeone()
        {
            if (TargetManagerHeal.GetUnitToTarget(out IEnumerable <WowUnit> unitsToHeal))
            {
                if (unitsToHeal.Count(e => e.HealthPercentage < 40.0) > 3 &&
                    TryCastSpell(tranquilitySpell, 0, true))
                {
                    return(true);
                }

                WowUnit target = unitsToHeal.First();

                if (target.HealthPercentage < 90.0 &&
                    target.HealthPercentage > 75.0 &&
                    unitsToHeal.Count(e => e.HealthPercentage < 90.0) > 1 &&
                    TryCastSpell(wildGrowthSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 20.0 &&
                    TryCastSpell(naturesSwiftnessSpell, target.Guid, true) &&
                    TryCastSpell(healingTouchSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 50.0 &&
                    (target.HasBuffByName(regrowthSpell) || target.HasBuffByName(rejuvenationSpell)) &&
                    SwiftmendEvent.Ready &&
                    TryCastSpell(swiftmendSpell, target.Guid, true) &&
                    SwiftmendEvent.Run())
                {
                    return(true);
                }

                if (target.HealthPercentage < 95.0 &&
                    target.HealthPercentage > 70.0 &&
                    !target.HasBuffByName(rejuvenationSpell) &&
                    TryCastSpell(rejuvenationSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 98.0 &&
                    target.HealthPercentage > 70.0 &&
                    !target.HasBuffByName(lifebloomSpell) &&
                    TryCastSpell(lifebloomSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 65.0 &&
                    TryCastSpell(nourishSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 65.0 &&
                    TryCastSpell(healingTouchSpell, target.Guid, true))
                {
                    return(true);
                }

                if (target.HealthPercentage < 65.0 &&
                    !target.HasBuffByName(regrowthSpell) &&
                    TryCastSpell(regrowthSpell, target.Guid, true))
                {
                    return(true);
                }
            }

            return(false);
        }