Exemplo n.º 1
0
    /*
     * CombatRotation()
     */
    public void CombatRotation()
    {
        if (lastTarget != ObjectManager.Target)
        {
            lastTarget = ObjectManager.Target;
            isCheap    = true;
        }

        if (OutlawSettings.CurrentSetting.EnableInterrupt)
        {
            WoWUnit toInterrupt = MyHelpers.InterruptableUnits();
            if (toInterrupt != null)
            {
                ObjectManager.Me.FocusGuid = toInterrupt.Guid;

                if (Kick.IsSpellUsable && Kick.KnownSpell)
                {
                    MovementManager.Face(toInterrupt.Position);
                    Kick.Launch(false, false, false, "focus");
                    Lua.LuaDoString("dRotationFrame.text:SetText(\"Kick " + MyHelpers.getTargetDistance() + " / " + MyHelpers.GetMeleeRangeWithTarget() + "\")");
                    return;
                }
                if (Gouge.IsSpellUsable && Gouge.KnownSpell)
                {
                    MovementManager.Face(toInterrupt.Position);
                    Gouge.Launch(false, false, false, "focus");
                    Lua.LuaDoString("dRotationFrame.text:SetText(\"Gouge " + MyHelpers.getTargetDistance() + " / " + MyHelpers.GetMeleeRangeWithTarget() + "\")");
                    return;
                }
                if (Blind.IsSpellUsable && Blind.KnownSpell)
                {
                    MovementManager.Face(toInterrupt.Position);
                    Blind.Launch(false, false, false, "focus");
                    Lua.LuaDoString("dRotationFrame.text:SetText(\"Blind " + MyHelpers.getTargetDistance() + " / " + MyHelpers.GetMeleeRangeWithTarget() + "\")");
                    return;
                }
            }
        }

        if (ObjectManager.Me.Health < ObjectManager.Me.MaxHealth * 0.7)
        {
            if (CrimsonVial.KnownSpell && CrimsonVial.IsSpellUsable)
            {
                CrimsonVial.Launch();
                Lua.LuaDoString(@"dRotationFrame.text:SetText(""Crimson Vial"")");
                return;
            }
            if (Feint.KnownSpell && Feint.IsSpellUsable)
            {
                Feint.Launch();
                Lua.LuaDoString(@"dRotationFrame.text:SetText(""Feint"")");
                return;
            }
        }

        if (ObjectManager.Me.Health < ObjectManager.Me.MaxHealth * 0.3)
        {
            if (Evasion.KnownSpell && Evasion.IsSpellUsable)
            {
                Evasion.Launch();
                Lua.LuaDoString(@"dRotationFrame.text:SetText(""Evasion"")");
                return;
            }

            if (EquippedItems.GetEquippedItems().Find(x => x.GetItemInfo.ItemName == ItemsManager.GetNameById(167378)) != null &&
                MyHelpers.getTargetDistance() <= MyHelpers.getMeleeRange() &&
                Lua.LuaDoString("result = \"\";  local cooldown = GetItemCooldown(167378) if (cooldown == 0 ) then     result = true else     result = false end ", "result") == "true")
            {
                ItemsManager.UseItem(167378);
                Lua.LuaDoString(@"dRotationFrame.text:SetText(""Emblem"")");
                return;
            }
        }

        if (ObjectManager.Me.IsStunned || ObjectManager.Me.Rooted || ObjectManager.Me.Confused)
        {
            if (GladiatorsMedallion.KnownSpell && GladiatorsMedallion.IsSpellUsable)
            {
                GladiatorsMedallion.Launch();
                Lua.LuaDoString(@"dRotationFrame.text:SetText(""Gladiators Medallion"")");
                return;
            }
        }


        if (MyHelpers.sealthed() &&
            ColdBlood.KnownSpell &&
            ColdBlood.IsSpellUsable &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            ColdBlood.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""ColdBlood"")");
            return;
        }

        if (Sealth.KnownSpell &&
            Sealth.IsSpellUsable
            )
        {
            Sealth.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""Sealth"")");
            return;
        }

        if (MyHelpers.sealthed() &&
            ShadowBlades.KnownSpell &&
            ShadowBlades.IsSpellUsable &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            ShadowBlades.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""ShadowBlades"")");
            return;
        }
        if (SymbolsofDeath.KnownSpell &&
            SymbolsofDeath.IsSpellUsable &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            SymbolsofDeath.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""SymbolsofDeath"")");
            return;
        }
        if (MyHelpers.sealthed() &&
            isCheap &&
            CheapShot.KnownSpell &&
            CheapShot.IsSpellUsable &&
            !ObjectManager.Target.HaveBuff("Cheap Shot") &&
            !ObjectManager.Target.HaveBuff("Kidney Shot") &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            CheapShot.Launch();
            Thread newThread = new Thread(runCheap);
            newThread.Start();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""CheapShot"")");
            return;
        }
        if (EquippedItems.GetEquippedItems().Find(x => x.GetItemInfo.ItemName == ItemsManager.GetNameById(167383)) != null &&
            MyHelpers.getTargetDistance() <= MyHelpers.getMeleeRange() &&
            Lua.LuaDoString("result = \"\";  local cooldown = GetItemCooldown(167383) if (cooldown == 0 ) then     result = true else     result = false end ", "result") == "true"
            )
        {
            ItemsManager.UseItem(167383);
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""maledict"")");
            return;
        }
        if (MarkedforDeath.KnownSpell &&
            MarkedforDeath.IsSpellUsable &&
            MyHelpers.getComboPoint() == 0 &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            MarkedforDeath.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""MarkedforDeath"")");
            return;
        }
        if (MyHelpers.sealthed() &&
            Nightblade.KnownSpell &&
            Nightblade.IsSpellUsable &&
            MyHelpers.getComboPoint() >= 4 &&
            !ObjectManager.Target.HaveBuff("Nightblade") &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            Nightblade.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""Nightblade"")");
            return;
        }

        if (MyHelpers.sealthed() &&
            Shadowstrike.KnownSpell &&
            Shadowstrike.IsSpellUsable &&
            MyHelpers.getComboPoint() < 4 &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            Shadowstrike.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""Shadowstrike"")");
            return;
        }
        if (ShadowStep.KnownSpell &&
            ShadowStep.IsSpellUsable &&
            MyHelpers.getTargetDistance() > MyHelpers.getMeleeRange() &&
            MyHelpers.getTargetDistance() < 25.0f
            )
        {
            ShadowStep.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""ShadowStep"")");
            return;
        }
        if (!MyHelpers.sealthed() &&
            ShadowDance.KnownSpell &&
            ShadowDance.IsSpellUsable &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            ShadowDance.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""ShadowDance"")");
            return;
        }
        if (!MyHelpers.sealthed() &&
            KidneyShot.KnownSpell &&
            KidneyShot.IsSpellUsable &&
            MyHelpers.getComboPoint() >= 4 &&
            !ObjectManager.Target.HaveBuff("Cheap Shot") &&
            !ObjectManager.Target.HaveBuff("Kidney Shot") &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            KidneyShot.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""ShadowDance"")");
            return;
        }

        if (Eviscerate.KnownSpell &&
            Eviscerate.IsSpellUsable &&
            MyHelpers.getComboPoint() >= 4 &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            Eviscerate.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""Eviscerate"")");
            return;
        }
        if (ConcentratedFlame.KnownSpell &&
            ConcentratedFlame.IsSpellUsable
            )
        {
            ConcentratedFlame.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""Concentrated Flame"")");
            return;
        }
        if (!MyHelpers.sealthed() &&
            Backstab.KnownSpell &&
            Backstab.IsSpellUsable &&
            MyHelpers.getComboPoint() < 4 &&
            MyHelpers.getTargetDistance() < MyHelpers.getMeleeRange()
            )
        {
            Backstab.Launch();
            Lua.LuaDoString(@"dRotationFrame.text:SetText(""ShadowDance"")");
            return;
        }
    }
Exemplo n.º 2
0
    /* Rotation() */
    public void Rotation()
    {
        Logging.Write(name + ": Started.");

        while (_isRunning)
        {
            try
            {
                if (Products.InPause)
                {
                    Lua.LuaDoString(@"dRotationFrame.text:SetText(""dRotation Paused!"")");
                }
                else if (!ObjectManager.Me.IsDeadMe && ObjectManager.Me.Target.IsNotZero() && ObjectManager.Target.IsAttackable && !MyHelpers.sealthed())
                {
                    CombatRotation();
                }
            }
            catch (Exception e)
            {
                Logging.WriteError(name + " ERROR: " + e);
            }

            Thread.Sleep(50); // Pause 10 ms to reduce the CPU usage.
        }
        Logging.Write(name + ": Stopped.");
    }