What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Simple] Blood DK lv 58 PvP + Lazyraider(No Movement)

HB0916H38

Member
Joined
May 15, 2011
Messages
95
Reaction score
0
Source code is available to all who wish to use it at no cost.
Anyone can access the actual source code, modify the code, study it and improve the software.

PHP:
using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Drawing;
using System.Globalization;
using System.Text;

using Styx;
using Styx.Combat.CombatRoutine;
using Styx.Helpers;
using Styx.Logic;
using Styx.Logic.BehaviorTree;
using Styx.Logic.Combat;
using Styx.Logic.Pathing;
using Styx.Logic.POI;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;

namespace DkBlood
{
    partial class DeathKnight: CombatRoutine
    {
        // Versao

        Version curVersion = new Version(1, 0);

        public static LocalPlayer Me { get { return ObjectManager.Me; } }

        public override string Name { get { return "[DROD]DkBlood v" + curVersion; } }
        public override WoWClass Class { get { return WoWClass.DeathKnight; } }

        public int lvl = Me.Level;

        public override void Initialize()
        {
            Logging.Write(Color.Lime, "[DROD]DkBlood Iniciando");
        }

        public override bool WantButton
        {
            get
            {
                return true;
            }
        }

        public override void OnButtonPress()
        {
        }

        public override void Pulse()
        {
            if (!Me.Mounted)
            {
                if (!Me.HasAura("Bone Shield") && SpellManager.CanCast("Bone Shield"))
                {
                    CastSpell("Bone Shield");
                }

                if ((!Me.HasAura("Horn of Winter") && !Me.HasAura("Battle Shout") && SpellManager.CanCast("Horn of Winter")))
                {
                    CastSpell("Horn of Winter");
                }
            }
        }

        public override void Combat()
        {
            if (Me.Mounted)
                return;

            using (new FrameLock())
            {
                /** Heal CD
                 */
                if (Me.HealthPercent < 60)
                {
                    CastSpell("Vampiric Blood");
                }
                if (Me.HealthPercent < 60 || (Me.HasAura("Will of the Necropolis") && Me.HealthPercent < 60))
                {
                    CastSpell("Rune Tap");
                }
                if (Me.CurrentTarget.Distance < 4 && !SpellManager.GlobalCooldown && Me.HealthPercent < 90)
                {
                    CastSpell("Death Strike");
                }

                /** Cooldowns
                 */
                if (Me.BloodRuneCount < 2)
                {
                    CastSpell("Blood Tap");
                }

                /** Meele Rotation
                 */
                if (Me.CurrentTarget.Distance <= 4)
                {
                    if (Me.CurrentRunicPower == Me.MaxRunicPower)
                    {
                        CastSpell("Death Coil");
                    }

                    if (SpellManager.CanCast("Death Strike"))
                    {
                        CastSpell("Death Strike");
                    }

                    if (SpellManager.CanCast("Heart Strike"))
                    {
                        CastSpell("Heart Strike");
                    }
                }

                /** Ranged Rotation
                 */
                if (Me.CurrentTarget.Distance > 4)
                {
                    if (Me.CurrentTarget.Distance < 30)
                    {
                        if (Me.CurrentRunicPower == Me.MaxRunicPower)
                        {
                            CastSpell("Death Coil");
                        }
                    }
                    if (Me.CurrentTarget.Distance < 20)
                    {
                        CastSpell("Chains of Ice");
                    }
                }

                /** Interrupt
                 */

                /** Disease
                 */
                if (!Me.CurrentTarget.HasAura("Frost Fever") && !Me.CurrentTarget.HasAura("Blood Plague"))
                {
                    if (Me.CurrentTarget.Distance < 20)
                    {
                        CastSpell("Icy Touch");
                    }
                }
                if (!Me.CurrentTarget.HasAura("Frost Fever"))
                {
                    if (Me.CurrentTarget.Distance < 20)
                    {
                        CastSpell("Icy Touch");
                    }
                }
                if (!Me.CurrentTarget.HasAura("Blood Plague"))
                {
                    if (Me.CurrentTarget.Distance < 4)
                    {
                        CastSpell("Plague Strike");
                    }
                }
            }
        }

        private void AutoAttack()
        {
            if (!Me.IsAutoAttacking)
            {
                Lua.DoString("StartAttack()");
            }
        }

        public override bool NeedRest
        {
            get
            {
                if (Me.Mounted)
                    return false;
                if (Me.Dead || Me.IsGhost || Me.Combat)
                    return false;

                return false;
            }
        }

        public override void Rest()
        {
        }


        //Credit to Wulf!
        public bool CastSpell(string spellName, WoWPlayer target)
        {
            using (new FrameLock())
            {
                if (SpellManager.CanCast(spellName, target) && !SpellManager.GlobalCooldown && !Me.IsCasting)
                {
                    if (target == Me)
                    {
                        return false;
                    }
                    else
                    {
                        SpellManager.Cast(spellName, target);
                        Logging.Write(Color.LightBlue, "[DROD]DkBlood [RP: " + StyxWoW.Me.CurrentRunicPower + "] Cast: " + spellName);
                        return true;
                    }
                }
                return false;
            }
        }

        public bool CastSpell(string spellName)
        {
            using (new FrameLock())
            {
                if (!StyxWoW.IsInGame || !StyxWoW.IsInWorld || Me.IsCasting || !SpellManager.HasSpell(spellName) || SpellManager.Spells[spellName].Cooldown)
                {
                    return false;
                }

                if (SpellManager.HasSpell(spellName) && SpellManager.CanCast(spellName) && !SpellManager.GlobalCooldown && !Me.IsCasting)
                {
                    SpellManager.Cast(spellName);
                    Logging.Write(Color.LightBlue, "[DROD]DkBlood [RP: " + StyxWoW.Me.CurrentRunicPower + "] Cast: " + spellName);
                    return true;
                }
                return false;
            }
        }
    }
}
 
Back
Top