Beispiel #1
0
    private readonly Spell Torment = new Spell("Torment"); //No GCD

    #endregion

    public DemonHunterVengeance()
    {
        Main.InternalRange             = ObjectManager.Me.GetCombatReach;
        Main.InternalAggroRange        = Main.InternalRange;
        Main.InternalLightHealingSpell = null;
        MySettings = DemonHunterVengeanceSettings.GetSettings();
        Main.DumpCurrentSettings <DemonHunterVengeanceSettings>(MySettings);
        UInt128 lastTarget = 0;

        while (Main.InternalLoop)
        {
            try
            {
                if (!ObjectManager.Me.IsDeadMe)
                {
                    if (!ObjectManager.Me.IsMounted)
                    {
                        if (Fight.InFight && ObjectManager.Me.Target > 0)
                        {
                            if (ObjectManager.Me.Target != lastTarget)
                            {
                                lastTarget = ObjectManager.Me.Target;
                            }

                            if (CombatClass.InSpellRange(ObjectManager.Target, 0, 40))
                            {
                                Combat();
                            }
                            else
                            {
                                Patrolling();
                            }
                        }
                        else
                        {
                            Patrolling();
                        }
                    }
                }
                else
                {
                    Thread.Sleep(500);
                }
            }
            catch
            {
            }
            Thread.Sleep(100);
        }
    }
    public TEMPLATE_SPEC()
    {
        Main.InternalRange             = TEMPLATE_COMBAT_RANGE; // Max range of your combat spells (40f for most classes, ObjectManager.Me.GetCombatReach for melee)
        Main.InternalAggroRange        = TEMPLATE_PULL_RANGE;   // Range at which your RANGED class should engage enemies remove if your class is melee
        Main.InternalLightHealingSpell = null;                  /*new Spell("TEMPLATE_HEALING_SPELL");*/
        MySettings = TEMPLATE_SPECSettings.GetSettings();
        Main.DumpCurrentSettings <TEMPLATE_SPECSettings>(MySettings);
        UInt128 lastTarget = 0;

        while (Main.InternalLoop)
        {
            try
            {
                if (!ObjectManager.Me.IsDeadMe)
                {
                    if (!ObjectManager.Me.IsMounted)
                    {
                        if (Fight.InFight && ObjectManager.Me.Target > 0)
                        {
                            if (ObjectManager.Me.Target != lastTarget)
                            {
                                lastTarget = ObjectManager.Me.Target;
                            }

                            if (CombatClass.InSpellRange(ObjectManager.Target, 0, 40))
                            {
                                Combat();
                            }
                            else if (!ObjectManager.Me.IsCast)
                            {
                                Patrolling();
                            }
                        }
                        else if (!ObjectManager.Me.IsCast)
                        {
                            Patrolling();
                        }
                    }
                }
                else
                {
                    Thread.Sleep(500);
                }
            }
            catch
            {
            }
            Thread.Sleep(100);
        }
    }
Beispiel #3
0
    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();
        }
    }