コード例 #1
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void Defensive()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Mitigate Damage
            if (Blur.IsSpellUsable && ObjectManager.Me.HealthPercent < MySettings.UseBlurBelowPercentage)
            {
                Blur.Cast();
            }
            if (Darkness.IsSpellUsable && ObjectManager.Me.HealthPercent < MySettings.UseDarknessBelowPercentage)
            {
                Darkness.Cast();
            }
            if (Netherwalk.IsSpellUsable && ObjectManager.Me.HealthPercent < MySettings.UseNetherwalkBelowPercentage)
            {
                Netherwalk.Cast();
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #2
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void Heal()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Gift of the Naaru
            if (ObjectManager.Me.HealthPercent < MySettings.UseGiftoftheNaaruBelowPercentage && GiftoftheNaaru.IsSpellUsable)
            {
                GiftoftheNaaru.Cast();
                return;
            }
            //Soul Cleave
            if (MySettings.UseSoulCleave && ObjectManager.Me.HealthPercent < MySettings.UseSoulCleaveBelowPercentage && SoulCleave.IsSpellUsable)
            {
                SoulCleave.Cast();
                return;
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #3
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void BurstBuffs()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Burst Buffs
            if (MySettings.UseTrinketOne && !ItemsManager.IsItemOnCooldown(_firstTrinket.Entry) && ItemsManager.IsItemUsable(_firstTrinket.Entry))
            {
                ItemsManager.UseItem(_firstTrinket.Name);
                Logging.WriteFight("Use First Trinket Slot");
            }
            if (MySettings.UseTrinketTwo && !ItemsManager.IsItemOnCooldown(_secondTrinket.Entry) && ItemsManager.IsItemUsable(_secondTrinket.Entry))
            {
                ItemsManager.UseItem(_secondTrinket.Name);
                Logging.WriteFight("Use Second Trinket Slot");
            }
            if (MySettings.UseMetamorphosis && Metamorphosis.IsSpellUsable && Metamorphosis.IsHostileDistanceGood)
            {
                Metamorphosis.CastAtPosition(ObjectManager.Target.Position);
            }
            if (MySettings.UseChaosBlades && ChaosBlades.IsSpellUsable)
            {
                ChaosBlades.Cast();
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #4
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void AggroManagement()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Torment
            //Cast Growl when you are in a party and the target of your target is a low health player
            if (MySettings.UseTormentBelowToTPercentage > 0 && Torment.IsSpellUsable &&
                Torment.IsHostileDistanceGood)
            {
                WoWObject obj = ObjectManager.GetObjectByGuid(ObjectManager.Target.Target);
                if (obj.IsValid && obj.Type == WoWObjectType.Player &&
                    new WoWPlayer(obj.GetBaseAddress).HealthPercent < MySettings.UseTormentBelowToTPercentage)
                {
                    Torment.Cast();
                    return;
                }
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #5
0
ファイル: Tnb_Vehicle.cs プロジェクト: zneel/TheNoobBot
    private void Combat()
    {
        //Log
        if (!CombatMode)
        {
            Logging.WriteFight("Combat:");
            CombatMode = true;
        }

        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            GCDCycle();
        }
        catch (Exception e)
        {
            Logging.WriteDebug(e.Message);
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #6
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void BurstBuffs()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Burst Buffs
            if (MySettings.UseTrinketOne && !ItemsManager.IsItemOnCooldown(_firstTrinket.Entry) && ItemsManager.IsItemUsable(_firstTrinket.Entry))
            {
                ItemsManager.UseItem(_firstTrinket.Name);
                Logging.WriteFight("Use First Trinket Slot");
            }
            if (MySettings.UseTrinketTwo && !ItemsManager.IsItemOnCooldown(_secondTrinket.Entry) && ItemsManager.IsItemUsable(_secondTrinket.Entry))
            {
                ItemsManager.UseItem(_secondTrinket.Name);
                Logging.WriteFight("Use Second Trinket Slot");
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #7
0
    // For Self-Healing Spells (always return after Casting)
    private bool Healing()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Gift of the Naaru
            if (ObjectManager.Me.HealthPercent < MySettings.UseGiftoftheNaaruBelowPercentage && GiftoftheNaaru.IsSpellUsable)
            {
                GiftoftheNaaru.CastOnSelf();
                return(true);
            }
            //TEMPLATE_HEALING_SPELL
            if (ObjectManager.Me.HealthPercent < MySettings.UseTEMPLATEHEALINGSPELLBelowPercentage && TEMPLATEHEALINGSPELL.IsSpellUsable)
            {
                TEMPLATEHEALINGSPELL.CastOnSelf();
                return(true);
            }
            return(false);
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #8
0
    // For Defensive Buffs and Livesavers (always return after Casting)
    private bool Defensive()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            if (StunTimer.IsReady && (DefensiveTimer.IsReady || ObjectManager.Me.HealthPercent < 20))
            {
                //Stun
                if (ObjectManager.Target.IsStunnable)
                {
                    if (ObjectManager.Me.HealthPercent < MySettings.UseWarStompBelowPercentage && WarStomp.IsSpellUsable)
                    {
                        WarStomp.Cast();
                        StunTimer = new Timer(1000 * 2.5);
                        return(true);
                    }
                    //TEMPLATE_STUN_SPELL
                    if (ObjectManager.Me.HealthPercent < MySettings.UseTEMPLATESTUNSPELLBelowPercentage && TEMPLATESTUNSPELL.IsSpellUsable)
                    {
                        TEMPLATESTUNSPELL.Cast();
                        StunTimer = new Timer(1000 * TEMPLATE_STUN_TIME);// Time until the enemy will leave the Stun
                        return(true);
                    }
                }
                //Mitigate Damage
                if (ObjectManager.Me.HealthPercent < MySettings.UseStoneformBelowPercentage && Stoneform.IsSpellUsable)
                {
                    Stoneform.Cast();
                    DefensiveTimer = new Timer(1000 * 8);
                    return(true);
                }
                //TEMPLATE_DEFENSIVE_SPELL
                if (ObjectManager.Me.HealthPercent < MySettings.UseTEMPLATEDEFENSIVESPELLBelowPercentage && TEMPLATEDEFENSIVESPELL.IsSpellUsable)
                {
                    TEMPLATEDEFENSIVESPELL.Cast();
                    DefensiveTimer = new Timer(1000 * TEMPLATE_DEFENSIVE_BUFF_TIME);// Time until the Buff ends
                    return(true);
                }
            }
            //Mitigate Damage in Emergency Situations
            //TEMPLATE_EMERGENCY_DEFENSIVE_SPELL
            if (ObjectManager.Me.HealthPercent < MySettings.UseTEMPLATEEMERGENCYDEFENSIVESPELLBelowPercentage && TEMPLATEEMERGENCYDEFENSIVESPELL.IsSpellUsable)
            {
                TEMPLATEEMERGENCYDEFENSIVESPELL.Cast();
                return(true);
            }
            return(false);
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #9
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void Defensive()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //Defensive Cooldowns
            if (DefensiveTimer.IsReady || ObjectManager.Me.HealthPercent < 25)
            {
                //Mitigate Damage
                if (DemonSpikes.IsSpellUsable && !DemonSpikes.HaveBuff && (DemonSpikes.GetSpellCharges == 2 ||
                                                                           ObjectManager.Me.HealthPercent < MySettings.UseDemonSpikesBelowPercentage))
                {
                    DemonSpikes.Cast();
                    DefensiveTimer = new Timer(1000 * 6);
                    return;
                }
                if ((ObjectManager.Me.HealthPercent < MySettings.UseFieryBrandBelowPercentage ||
                     (ObjectManager.Target.IsCast && !ObjectManager.Target.CanInterruptCurrentCast &&
                      ObjectManager.Target.CastEndsInMs < 1500)) && FieryBrand.IsSpellUsable)
                {
                    FieryBrand.Cast();
                    DefensiveTimer = new Timer(1000 * 8);
                    return;
                }
            }
            if (ObjectManager.Me.HealthPercent < MySettings.UseMetamorphosisBelowPercentage &&
                Metamorphosis.IsSpellUsable && Metamorphosis.IsHostileDistanceGood)
            {
                Metamorphosis.CastAtPosition(ObjectManager.Target.Position);
                return;
            }
            //Mitigate Magic Damage for Rage
            if (ObjectManager.Me.HealthPercent < MySettings.UseEmpowerWardsBelowPercentage &&
                EmpowerWards.IsSpellUsable && !EmpowerWards.HaveBuff)
            {
                EmpowerWards.Cast();
                DefensiveTimer = new Timer(1000 * 6);
                return;
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #10
0
    // For the Ability Priority Logic
    private void Rotation()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            // Independant of Target Count
            if (MySettings.UseTEMPLATEOFFENSIVESPELL && TEMPLATEOFFENSIVESPELL.IsSpellUsable && TEMPLATEOFFENSIVESPELL.IsHostileDistanceGood &&
                ObjectManager.Me.CLASS_RESOURCE > MySettings.UseTEMPLATEOFFENSIVESPELLAbovePercentage &&              // Resource Check
                TEMPLATEBUFF.HaveBuff &&                                                                              // Buff Check
                TEMPLATEDOT.TargetHaveBuff &&                                                                         // Buff Check
                (ObjectManager.Me.GetUnitInSpellRange(5f) > 1 || ObjectManager.Target.GetUnitInSpellRange(5f) > 1) && // Unit Count Check
                TEMPLATEOFFENSIVESPELLTimer.IsReady)                                                                  // Timer Check
            {
                TEMPLATEOFFENSIVESPELL.Cast();
                TEMPLATEOFFENSIVESPELLTimer = new Timer(1000 * 10); // for timings that don't depend on a buff
                return;
            }
            if (MySettings.UseTEMPLATEARTIFACTSPELL && TEMPLATEARTIFACTSPELL.IsSpellUsable && TEMPLATEARTIFACTSPELL.IsHostileDistanceGood)
            {
                TEMPLATEARTIFACTSPELL.Cast();
                return;
            }

            //Single Target
            if (ObjectManager.Target.GetUnitInSpellRange(5f) == 1)
            {
            }
            //Multiple Targets
            else
            {
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #11
0
    // For Spots (always return after Casting)
    private bool AggroManagement()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            //TEMPLATE_AGGRO_SPELL
            if (MySettings.UseTEMPLATEAGGROSPELL && TEMPLATEAGGROSPELL.IsSpellUsable && TEMPLATEAGGROSPELL.IsHostileDistanceGood &&
                ObjectManager.Target.Target != ObjectManager.Me.Guid)
            {
                TEMPLATEAGGROSPELL.Cast();
                return(true);
            }
            return(false);
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #12
0
    // For Offensive Buffs (only return if a Cast triggered Global Cooldown)
    private bool Offensive()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            if (MySettings.UseTrinketOne && !ItemsManager.IsItemOnCooldown(_firstTrinket.Entry) && ItemsManager.IsItemUsable(_firstTrinket.Entry))
            {
                ItemsManager.UseItem(_firstTrinket.Name);
                Logging.WriteFight("Use First Trinket Slot");
            }
            if (MySettings.UseTrinketTwo && !ItemsManager.IsItemOnCooldown(_secondTrinket.Entry) && ItemsManager.IsItemUsable(_secondTrinket.Entry))
            {
                ItemsManager.UseItem(_secondTrinket.Name);
                Logging.WriteFight("Use Second Trinket Slot");
            }
            if (MySettings.UseBerserking && Berserking.IsSpellUsable)
            {
                Berserking.Cast();
            }
            if (MySettings.UseBloodFury && BloodFury.IsSpellUsable)
            {
                BloodFury.Cast();
            }
            //TEMPLATE_OFFENSIVE_BUFF_SPELL
            if (MySettings.UseTEMPLATEOFFENSIVEBUFFSPELL && TEMPLATEOFFENSIVEBUFFSPELL.IsSpellUsable && !TEMPLATEOFFENSIVEBUFFSPELL.HaveBuff)
            {
                TEMPLATEOFFENSIVEBUFFSPELL.Cast();
                return(true); // only return if Global Cooldown is triggered
            }
            return(false);
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #13
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void GCDCycle()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            if (MySettings.UseFelRush && FelRush.IsSpellUsable && CombatClass.InSpellRange(ObjectManager.Target, 0, 20 /*FelRush Range*/) &&
                //Keep Recharging
                (FelRush.GetSpellCharges == 2 ||
                 //Generate Fury
                 (FelMastery.HaveBuff && (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 30) ||
                 //Trigger Momentum
                 (Momentum.HaveBuff && !MomentumBuff.HaveBuff)))
            {
                FelRush.Cast();
                return;
            }
            if (MySettings.UseVengefulRetreat && VengefulRetreat.IsSpellUsable && CombatClass.InSpellRange(ObjectManager.Target, 0, 20 /*Vengeful Retreat Range*/) &&
                //Generate Fury
                ((Prepared.HaveBuff && (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 20) ||
                 //Trigger Momentum
                 (Momentum.HaveBuff && !MomentumBuff.HaveBuff)))
            {
                VengefulRetreat.Cast();
                return;
            }
            //Single Target
            if (ObjectManager.GetUnitInSpellRange(5f) == 1)
            {
                if (MySettings.UseNemesis && Nemesis.IsSpellUsable && Nemesis.IsHostileDistanceGood)
                {
                    Nemesis.Cast();
                    return;
                }
                if (Demonic.HaveBuff && MySettings.UseEyeBeam && EyeBeam.IsSpellUsable && EyeBeam.IsHostileDistanceGood)
                {
                    EyeBeam.Cast();
                    return;
                }
                if (MySettings.UseFelEruption && FelEruption.IsSpellUsable && FelEruption.IsHostileDistanceGood)
                {
                    FelEruption.Cast();
                    return;
                }
                if (MySettings.UseFuryoftheIllidari && FuryoftheIllidari.IsSpellUsable && FuryoftheIllidari.IsHostileDistanceGood &&
                    //Only with Momentum
                    (!Momentum.HaveBuff || MomentumBuff.HaveBuff))
                {
                    FuryoftheIllidari.Cast();
                    return;
                }
                if (FirstBlood.HaveBuff && (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    if (MySettings.UseBladeDance && BladeDance.IsSpellUsable && BladeDance.IsHostileDistanceGood)
                    {
                        BladeDance.Cast();
                        return;
                    }
                    if (MySettings.UseDeathSweep && DeathSweep.IsSpellUsable && DeathSweep.IsHostileDistanceGood)
                    {
                        DeathSweep.Cast();
                        return;
                    }
                }
                if (MySettings.UseFelblade && Felblade.IsSpellUsable && Felblade.IsHostileDistanceGood &&
                    //Generate Fury
                    (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 30)
                {
                    Felblade.Cast();
                    return;
                }
                if (Bloodlet.HaveBuff && MySettings.UseThrowGlaive && ThrowGlaive.IsSpellUsable && ThrowGlaive.IsHostileDistanceGood &&
                    //Only with Momentum
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    ThrowGlaive.Cast();
                    return;
                }
                if (MySettings.UseFelBarrage && FelBarrage.IsSpellUsable && FelBarrage.IsHostileDistanceGood &&
                    //Keep Recharging
                    FelBarrage.GetSpellCharges == 5 &&
                    //Only with Momentum
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    FelBarrage.Cast();
                    return;
                }
                if (MySettings.UseAnnihilation && Annihilation.IsSpellUsable && Annihilation.IsHostileDistanceGood &&
                    //Generate Fury
                    (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 30)
                {
                    Annihilation.Cast();
                    return;
                }
                if (AnguishoftheDeceiver.HaveBuff && MySettings.UseEyeBeam && EyeBeam.IsSpellUsable && EyeBeam.IsHostileDistanceGood)
                {
                    EyeBeam.Cast();
                    return;
                }
                if (MySettings.UseChaosStrike && ChaosStrike.IsSpellUsable && ChaosStrike.IsHostileDistanceGood &&
                    //Generate Fury
                    (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 30)
                {
                    ChaosStrike.Cast();
                    return;
                }
                if (MySettings.UseFelBarrage && FelBarrage.IsSpellUsable && FelBarrage.IsHostileDistanceGood &&
                    //Keep Recharging
                    FelBarrage.GetSpellCharges >= 4 &&
                    //Only with Momentum
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    FelBarrage.Cast();
                    return;
                }
                if (!DemonBlades.HaveBuff && MySettings.UseDemonsBite && DemonsBite.IsSpellUsable && DemonsBite.IsHostileDistanceGood)
                {
                    DemonsBite.Cast();
                    return;
                }
                if (MySettings.UseFelRush && FelRush.IsSpellUsable && CombatClass.InSpellRange(ObjectManager.Target, 6, 20 /*FelRush Range*/))
                {
                    FelRush.Cast();
                    return;
                }
                if (MySettings.UseThrowGlaive && ThrowGlaive.IsSpellUsable && (!CombatClass.InMeleeRange(ObjectManager.Target) ||
                                                                               DemonBlades.HaveBuff))
                {
                    ThrowGlaive.Cast();
                    return;
                }
            }
            //Multiple Target
            else
            {
                if (MySettings.UseFuryoftheIllidari && FuryoftheIllidari.IsSpellUsable && FuryoftheIllidari.IsHostileDistanceGood &&
                    //Only with Momentum
                    (!Momentum.HaveBuff || MomentumBuff.HaveBuff))
                {
                    FuryoftheIllidari.Cast();
                    return;
                }
                if (MySettings.UseFelBarrage && FelBarrage.IsSpellUsable && FelBarrage.IsHostileDistanceGood &&
                    //Keep Recharging
                    FelBarrage.GetSpellCharges >= 4 &&
                    //Only with Momentum
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    FelBarrage.Cast();
                    return;
                }
                if (MySettings.UseEyeBeam && EyeBeam.IsSpellUsable && EyeBeam.IsHostileDistanceGood &&
                    //Only with Momentum
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    EyeBeam.Cast();
                    return;
                }
                if (FirstBlood.HaveBuff && ObjectManager.GetUnitInSpellRange(5f) > 2 &&
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    if (MySettings.UseBladeDance && BladeDance.IsSpellUsable && BladeDance.IsHostileDistanceGood)
                    {
                        BladeDance.Cast();
                        return;
                    }
                    if (MySettings.UseDeathSweep && DeathSweep.IsSpellUsable && DeathSweep.IsHostileDistanceGood)
                    {
                        DeathSweep.Cast();
                        return;
                    }
                }
                if (Bloodlet.HaveBuff && MySettings.UseThrowGlaive && ThrowGlaive.IsSpellUsable && ThrowGlaive.IsHostileDistanceGood &&
                    //Only with Momentum
                    (!MomentumBuff.HaveBuff || MomentumBuff.HaveBuff))
                {
                    ThrowGlaive.Cast();
                    return;
                }
                if (MySettings.UseChaosStrike && ChaosStrike.IsSpellUsable &&
                    ChaosCleave.HaveBuff && ObjectManager.GetUnitInSpellRange(ChaosStrike.MaxRangeHostile) <= 3)
                {
                    ChaosStrike.Cast();
                    return;
                }
                if (MySettings.UseThrowGlaive && ThrowGlaive.IsSpellUsable && ThrowGlaive.IsHostileDistanceGood)
                {
                    ThrowGlaive.Cast();
                    return;
                }
                if (MySettings.UseChaosStrike && ChaosStrike.IsSpellUsable && ChaosStrike.IsHostileDistanceGood &&
                    //Generate Fury
                    (!DemonBlades.HaveBuff || (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 40) &&
                    (ObjectManager.Me.MaxFury - ObjectManager.Me.Fury) < 30)
                {
                    ChaosStrike.Cast();
                    return;
                }
                if (!DemonBlades.HaveBuff && MySettings.UseDemonsBite && DemonsBite.IsSpellUsable && DemonsBite.IsHostileDistanceGood)
                {
                    DemonsBite.Cast();
                    return;
                }
                if (MySettings.UseInfernalStrike && InfernalStrike.IsSpellUsable && InfernalStrike.IsHostileDistanceGood)
                {
                    InfernalStrike.CastAtPosition(ObjectManager.Target.Position);
                    return;
                }
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }
コード例 #14
0
ファイル: Tnb_DemonHunter.cs プロジェクト: zneel/TheNoobBot
    private void GCDCycle()
    {
        Usefuls.SleepGlobalCooldown();

        try
        {
            Memory.WowMemory.GameFrameLock(); // !!! WARNING - DONT SLEEP WHILE LOCKED - DO FINALLY(GameFrameUnLock()) !!!

            if (MySettings.UseSoulCarver && SoulCarver.IsSpellUsable && SoulCarver.IsHostileDistanceGood)
            {
                SoulCarver.Cast();
                return;
            }
            if (MySettings.UseFelDevastation && FelDevastation.IsSpellUsable && FelDevastation.IsHostileDistanceGood)
            {
                FelDevastation.Cast();
                return;
            }
            if (MySettings.UseSoulCleave && SoulCleave.IsSpellUsable && SoulCleave.IsHostileDistanceGood &&
                //Spend Pain
                ObjectManager.Me.Pain >= 80)
            {
                SoulCleave.Cast();
                return;
            }
            if (MySettings.UseImmolationAura && ImmolationAura.IsSpellUsable && ImmolationAura.IsHostileDistanceGood)
            {
                ImmolationAura.Cast();
                return;
            }

            //Single Target
            if (ObjectManager.GetUnitInSpellRange(5f) == 1)
            {
                if (MySettings.UseFelblade && Felblade.IsSpellUsable && Felblade.IsHostileDistanceGood)
                {
                    Felblade.Cast();
                    return;
                }
                if (MySettings.UseFelEruption && FelEruption.IsSpellUsable && FelEruption.IsHostileDistanceGood)
                {
                    FelEruption.Cast();
                    return;
                }
                if (MySettings.UseSpiritBomb && SpiritBomb.IsSpellUsable && SoulFragments.BuffStack >= 1 &&
                    SpiritBomb.IsHostileDistanceGood && !Frailty.TargetHaveBuff)
                {
                    SpiritBomb.Cast();
                    return;
                }
                if (MySettings.UseShear && Shear.IsSpellUsable && Shear.IsHostileDistanceGood &&
                    BladeTurningBuff.HaveBuff)
                {
                    Shear.Cast();
                    return;
                }
                if (MySettings.UseFracture && Fracture.IsSpellUsable && Fracture.IsHostileDistanceGood &&
                    //Spend Pain
                    ObjectManager.Me.Pain >= 60 && ObjectManager.Me.Health > 50)
                {
                    Fracture.Cast();
                    return;
                }
                if (SigilofFlameTimer.IsReady)
                {
                    if (MySettings.UseSigilofFlame && SigilofFlame.IsSpellUsable &&
                        SigilofFlame.IsHostileDistanceGood)
                    {
                        SigilofFlame.Cast();
                        SigilofFlameTimer = new Timer(1000 * 8);
                        return;
                    }
                    if (MySettings.UseInfernalStrike && InfernalStrike.IsSpellUsable &&
                        InfernalStrike.IsHostileDistanceGood && FlameCrash.HaveBuff)
                    {
                        InfernalStrike.Cast();
                        SigilofFlameTimer = new Timer(1000 * 8);
                        return;
                    }
                }
                if (MySettings.UseShear && Shear.IsSpellUsable && Shear.IsHostileDistanceGood)
                {
                    Shear.Cast();
                    return;
                }
            }
            //Multiple Target
            else
            {
                if (MySettings.UseSpiritBomb && SpiritBomb.IsSpellUsable && SoulFragments.BuffStack >= 1 &&
                    SpiritBomb.IsHostileDistanceGood && !Frailty.TargetHaveBuff)
                {
                    SpiritBomb.Cast();
                    return;
                }
                if (MySettings.UseFelblade && Felblade.IsSpellUsable && Felblade.IsHostileDistanceGood)
                {
                    Felblade.Cast();
                    return;
                }
                if (MySettings.UseShear && Shear.IsSpellUsable && Shear.IsHostileDistanceGood &&
                    BladeTurningBuff.HaveBuff)
                {
                    Shear.Cast();
                    return;
                }
                if (SigilofFlameTimer.IsReady)
                {
                    if (MySettings.UseSigilofFlame && SigilofFlame.IsSpellUsable && SigilofFlame.IsHostileDistanceGood)
                    {
                        SigilofFlame.CastAtPosition(ObjectManager.Target.Position);
                        SigilofFlameTimer = new Timer(1000 * 8);
                        return;
                    }
                    if (FlameCrash.HaveBuff && MySettings.UseInfernalStrike && InfernalStrike.IsSpellUsable && InfernalStrike.IsHostileDistanceGood)
                    {
                        InfernalStrike.CastAtPosition(ObjectManager.Target.Position);
                        SigilofFlameTimer = new Timer(1000 * 8);
                        return;
                    }
                }
                if (MySettings.UseFelEruption && FelEruption.IsSpellUsable && FelEruption.IsHostileDistanceGood)
                {
                    FelEruption.Cast();
                    return;
                }
                if (MySettings.UseShear && Shear.IsSpellUsable && Shear.IsHostileDistanceGood)
                {
                    Shear.Cast();
                    return;
                }
                if (MySettings.UseInfernalStrike && InfernalStrike.IsSpellUsable && InfernalStrike.IsHostileDistanceGood)
                {
                    InfernalStrike.CastAtPosition(ObjectManager.Target.Position);
                    if (FlameCrash.HaveBuff)
                    {
                        SigilofFlameTimer = new Timer(1000 * 8);
                    }
                    return;
                }
            }
        }
        finally
        {
            Memory.WowMemory.GameFrameUnLock();
        }
    }