Пример #1
0
 private void ChangeToStance(string stance, out int rage)
 {
     HookManager.CastSpell(stance);
     rage                = UpdateRage();
     NextStance          = DateTime.Now.AddSeconds(1);
     IsInBerserkerStance = stance == BerserkerStance;
 }
Пример #2
0
        private bool HandleDeadPartymembers()
        {
            if (!Spells.ContainsKey(resurrectionSpell))
            {
                Spells.Add(resurrectionSpell, CharacterManager.SpellBook.GetSpellByName(resurrectionSpell));
            }

            if (Spells[resurrectionSpell] != null &&
                !CooldownManager.IsSpellOnCooldown(resurrectionSpell) &&
                Spells[resurrectionSpell].Costs < ObjectManager.Player.Mana)
            {
                IEnumerable <WowPlayer> players      = ObjectManager.WowObjects.OfType <WowPlayer>();
                List <WowPlayer>        groupPlayers = players.Where(e => e.IsDead && e.Health == 0 && ObjectManager.PartymemberGuids.Contains(e.Guid)).ToList();

                if (groupPlayers.Count > 0)
                {
                    HookManager.TargetGuid(groupPlayers.First().Guid);
                    HookManager.CastSpell(resurrectionSpell);
                    CooldownManager.SetSpellCooldown(resurrectionSpell, (int)HookManager.GetSpellCooldown(resurrectionSpell));
                    return(true);
                }
            }

            return(false);
        }
Пример #3
0
        private bool HandleBuffing()
        {
            List <string> myBuffs = HookManager.GetBuffs(WowLuaUnit.Player);

            if (!ObjectManager.Player.IsInCombat)
            {
                HookManager.TargetGuid(ObjectManager.PlayerGuid);
            }

            if (!myBuffs.Any(e => e.Equals(shadowformSpell, StringComparison.OrdinalIgnoreCase)) &&
                CastSpellIfPossible(shadowformSpell, true))
            {
                return(true);
            }

            if (!myBuffs.Any(e => e.Equals(powerWordFortitudeSpell, StringComparison.OrdinalIgnoreCase)) &&
                CastSpellIfPossible(powerWordFortitudeSpell, true))
            {
                HookManager.CastSpell(powerWordFortitudeSpell);
                return(true);
            }

            if (!myBuffs.Any(e => e.Equals(vampiricEmbraceSpell, StringComparison.OrdinalIgnoreCase)) &&
                CastSpellIfPossible(vampiricEmbraceSpell, true))
            {
                return(true);
            }

            LastBuffCheck = DateTime.Now;
            return(false);
        }
Пример #4
0
        private void HandleAttacking(WowUnit target)
        {
            double playerRunePower     = ObjectManager.Player.Runeenergy;
            double distanceToTarget    = ObjectManager.Player.Position.GetDistance(target.Position);
            double targetHealthPercent = (target.Health / (double)target.MaxHealth) * 100;
            double playerHealthPercent = (ObjectManager.Player.Health / (double)ObjectManager.Player.MaxHealth) * 100.0;

            (string, int)targetCastingInfo = HookManager.GetUnitCastingInfo(WowLuaUnit.Target);
            //List<string> myBuffs = HookManager.GetBuffs(WowLuaUnit.Player.ToString());
            //myBuffs.Any(e => e.Equals("Chains of Ice"))

            if (HookManager.GetSpellCooldown("Death Grip") <= 0 && distanceToTarget <= 30)
            {
                HookManager.CastSpell("Death Grip");
            }
            if (target.IsFleeing && distanceToTarget <= 30)
            {
                HookManager.CastSpell("Chains of Ice");
            }

            if (HookManager.GetSpellCooldown("Army of the Dead") <= 0 &&
                IsOneOfAllRunesReady())
            {
                HookManager.CastSpell("Army of the Dead");
            }

            List <WowUnit> unitsNearPlayer = ObjectManager.WowObjects
                                             .OfType <WowUnit>()
                                             .Where(e => e.Position.GetDistance(ObjectManager.Player.Position) <= 10)
                                             .ToList();

            if (unitsNearPlayer.Count > 2 &&
                HookManager.GetSpellCooldown("Blood Boil") <= 0 &&
                HookManager.IsRuneReady(0) ||
                HookManager.IsRuneReady(1))
            {
                HookManager.CastSpell("Blood Boil");
            }

            List <WowUnit> unitsNearTarget = ObjectManager.WowObjects
                                             .OfType <WowUnit>()
                                             .Where(e => e.Position.GetDistance(target.Position) <= 30)
                                             .ToList();

            if (unitsNearTarget.Count > 2 &&
                HookManager.GetSpellCooldown("Death and Decay") <= 0 &&
                IsOneOfAllRunesReady())
            {
                HookManager.CastSpell("Death and Decay");
                HookManager.ClickOnTerrain(target.Position);
            }

            if (HookManager.GetSpellCooldown("Icy Touch") <= 0 &&
                HookManager.IsRuneReady(2) ||
                HookManager.IsRuneReady(3))
            {
                HookManager.CastSpell("Icy Touch");
            }
        }
Пример #5
0
        public void OutOfCombatExecute()
        {
            if (!HookManager.GetBuffs(WowLuaUnit.Player).Any(e => e.Contains("tealth")))
            {
                HookManager.CastSpell("Stealth");
                spells.ResetAfterTargetDeath();
            }

            if (!LastPlayerPosition.Equals(ObjectManager.Player.Position))
            {
                distanceTraveled   = ObjectManager.Player.Position.GetDistance(LastPlayerPosition);
                LastPlayerPosition = new Vector3(ObjectManager.Player.Position.X, ObjectManager.Player.Position.Y, ObjectManager.Player.Position.Z);
            }

            if (distanceTraveled < 0.001)
            {
                ulong   leaderGuid = ObjectManager.PartyleaderGuid;
                WowUnit target     = null;
                if (leaderGuid == ObjectManager.PlayerGuid && SearchNewTarget(ref target, true))
                {
                    if (!LastTargetPosition.Equals(target.Position))
                    {
                        hasTargetMoved     = true;
                        LastTargetPosition = new Vector3(target.Position.X, target.Position.Y, target.Position.Z);
                        distanceToTarget   = LastPlayerPosition.GetDistance(LastTargetPosition);
                    }
                    else
                    {
                        computeNewRoute = true;
                        hasTargetMoved  = false;
                    }

                    Dancing = false;
                    HandleMovement(target);
                    HandleAttacking(target);
                }
                else if (!Dancing || standing)
                {
                    standing = false;
                    HookManager.ClearTarget();
                    HookManager.SendChatMessage(standingEmotes[new Random().Next(standingEmotes.Length)]);
                    Dancing = true;
                }
            }
            else
            {
                if (!Dancing || !standing)
                {
                    standing = true;
                    HookManager.ClearTarget();
                    HookManager.SendChatMessage(runningEmotes[new Random().Next(runningEmotes.Length)]);
                    Dancing = true;
                }
            }
        }
Пример #6
0
 private void CastSpell(string spell, ref int rage, int rageCosts, double cooldown, bool gcd)
 {
     HookManager.CastSpell(spell);
     rage -= rageCosts;
     if (cooldown > 0)
     {
         NextActionTime[spell] = DateTime.Now.AddSeconds(cooldown);
     }
     if (gcd)
     {
         NextGCDSpell = DateTime.Now.AddSeconds(1.5);
     }
 }
Пример #7
0
        private bool CastSpellIfPossible(string spellName, bool needsMana = false)
        {
            if (!Spells.ContainsKey(spellName))
            {
                Spells.Add(spellName, CharacterManager.SpellBook.GetSpellByName(spellName));
            }

            if (Spells[spellName] != null &&
                !CooldownManager.IsSpellOnCooldown(spellName) &&
                (!needsMana || Spells[spellName].Costs < ObjectManager.Player.Mana))
            {
                HookManager.CastSpell(spellName);
                CooldownManager.SetSpellCooldown(spellName, (int)HookManager.GetSpellCooldown(spellName));
                return(true);
            }

            return(false);
        }
Пример #8
0
        private bool CastSpellIfPossible(string spellName, bool needsEnergy = false, bool needsCombopoints = false, int requiredCombopoints = 1)
        {
            if (!Spells.ContainsKey(spellName))
            {
                Spells.Add(spellName, CharacterManager.SpellBook.GetSpellByName(spellName));
            }

            if (Spells[spellName] != null &&
                !CooldownManager.IsSpellOnCooldown(spellName) &&
                (!needsEnergy || Spells[spellName].Costs < ObjectManager.Player.Energy) &&
                (!needsCombopoints || ObjectManager.Player.ComboPoints >= requiredCombopoints))
            {
                HookManager.CastSpell(spellName);
                CooldownManager.SetSpellCooldown(spellName, (int)HookManager.GetSpellCooldown(spellName));
                return(true);
            }

            return(false);
        }
Пример #9
0
        private bool CastSpellIfPossible(string spellName, bool needsRuneenergy = false, bool needsBloodrune = false, bool needsFrostrune = false, bool needsUnholyrune = false)
        {
            if (!Spells.ContainsKey(spellName))
            {
                Spells.Add(spellName, CharacterManager.SpellBook.GetSpellByName(spellName));
            }

            if (Spells[spellName] != null &&
                !CooldownManager.IsSpellOnCooldown(spellName) &&
                (!needsRuneenergy || Spells[spellName].Costs < ObjectManager.Player.Runeenergy) &&
                (!needsBloodrune || (HookManager.IsRuneReady(0) || HookManager.IsRuneReady(1))) &&
                (!needsFrostrune || (HookManager.IsRuneReady(2) || HookManager.IsRuneReady(3))) &&
                (!needsUnholyrune || (HookManager.IsRuneReady(4) || HookManager.IsRuneReady(5))))
            {
                HookManager.CastSpell(spellName);
                CooldownManager.SetSpellCooldown(spellName, (int)HookManager.GetSpellCooldown(spellName));
                return(true);
            }

            return(false);
        }
Пример #10
0
        private void HandleAttacking(WowUnit target)
        {
            bool          gcdWaiting          = IsGCD();
            bool          targetAimed         = true;
            double        playerMana          = ObjectManager.Player.Mana;
            double        targetHealthPercent = target.HealthPercentage;
            double        playerHealthPercent = ObjectManager.Player.HealthPercentage;
            List <string> buffs = HookManager.GetBuffs(WowLuaUnit.Player);

            // buffs
            if (!buffs.Any(e => e.Contains("evotion")))
            {
                HookManager.CastSpell("Devotion Aura");
            }

            if (!gcdWaiting && !buffs.Any(e => e.Contains("ury")))
            {
                HookManager.CastSpell("Righteous Fury");
                SetGCD(1.5);
                return;
            }

            if (!buffs.Any(e => e.Contains("ighteousness")))
            {
                HookManager.CastSpell("Seal of Righteousness");
            }

            if (!gcdWaiting && playerHealthPercent > 50 && DateTime.Now.Subtract(LastSacrifice).TotalSeconds > 120)
            {
                HookManager.CastSpell("Divine Sacrifice");
                LastSacrifice = DateTime.Now;
                SetGCD(1.5);
                return;
            }

            // distance attack
            if (!gcdWaiting && distanceToTarget > (10 + target.CombatReach) && distanceToTarget < (30 + target.CombatReach))
            {
                if (DateTime.Now.Subtract(LastAvenger).TotalSeconds > 30 && playerMana >= 1027)
                {
                    HookManager.CastSpell("Avenger's Shield");
                    LastAvenger = DateTime.Now;
                    HookManager.SendChatMessage("/s and i'm like.. bam!");
                    playerMana -= 1027;
                    SetGCD(1.5);
                    return;
                }
            }
            else
            {
                // close combat
                if (!gcdWaiting && distanceToTarget < target.CombatReach)
                {
                    if (multipleTargets && DateTime.Now.Subtract(LastConsecration).TotalSeconds > 8 && playerMana >= 869)
                    {
                        HookManager.CastSpell("Consecration");
                        LastConsecration = DateTime.Now;
                        HookManager.SendChatMessage("/s MOVE BITCH!!!!!11");
                        playerMana -= 869;
                        SetGCD(1.5);
                        return;
                    }

                    if (DateTime.Now.Subtract(LastHammer).TotalSeconds > 60 && playerMana >= 117)
                    {
                        HookManager.CastSpell("Hammer of Justice");
                        LastHammer = DateTime.Now;
                        HookManager.SendChatMessage("/s STOP! hammertime!");
                        playerMana -= 117;
                        SetGCD(1.5);
                        return;
                    }
                }
            }

            // support members
            int     lowHealth = 2147483647;
            WowUnit lowMember = null;

            foreach (ulong memberGuid in ObjectManager.PartymemberGuids)
            {
                WowUnit member = ObjectManager.WowObjects.OfType <WowUnit>().FirstOrDefault(t => t.Guid == memberGuid);
                if (member != null && member.Health < lowHealth)
                {
                    lowHealth = member.Health;
                    lowMember = member;
                }
            }

            if (lowMember != null)
            {
                if (!gcdWaiting && (lowMember.IsDazed || lowMember.IsConfused || lowMember.IsFleeing || lowMember.IsSilenced))
                {
                    if (playerMana >= 276)
                    {
                        HookManager.TargetGuid(lowMember.Guid);
                        targetAimed = false;
                        HookManager.CastSpell("Blessing of Sanctuary");
                        playerMana -= 276;
                        SetGCD(1.5);
                        return;
                    }

                    if (playerMana >= 236)
                    {
                        HookManager.TargetGuid(lowMember.Guid);
                        targetAimed = false;
                        HookManager.CastSpell("Hand of Freedom");
                        playerMana -= 236;
                        SetGCD(1.5);
                        return;
                    }
                }

                if (lowMember.HealthPercentage > 1)
                {
                    if (!gcdWaiting && DateTime.Now.Subtract(LastDivineShield).TotalSeconds > 240 && lowMember.HealthPercentage < 20 && playerMana >= 117)
                    {
                        HookManager.TargetGuid(lowMember.Guid);
                        targetAimed = false;
                        HookManager.CastSpell("Divine Shield");
                        LastDivineShield = DateTime.Now;
                        playerMana      -= 117;
                        SetGCD(1.5);
                        return;
                    }
                    else if (lowMember.HealthPercentage < 50 && DateTime.Now.Subtract(LastProtection).TotalSeconds > 120 && playerMana >= 117)
                    {
                        HookManager.TargetGuid(lowMember.Guid);
                        targetAimed = false;
                        HookManager.CastSpell("Divine Protection");
                        LastProtection = DateTime.Now;
                        playerMana    -= 117;
                    }
                }
            }

            // self-casts
            if (!gcdWaiting && DateTime.Now.Subtract(LastHolyShield).TotalSeconds > 8 && playerMana >= 395)
            {
                HookManager.ClearTarget();
                targetAimed = false;
                HookManager.CastSpell("Holy Shield");
                LastHolyShield = DateTime.Now;
                playerMana    -= 395;
                SetGCD(1.5);
                return;
            }

            if (!gcdWaiting && DateTime.Now.Subtract(LastWisdom).TotalSeconds > 600 && playerMana >= 197)
            {
                HookManager.ClearTarget();
                targetAimed = false;
                HookManager.CastSpell("Blessing of Wisdom");
                LastWisdom  = DateTime.Now;
                playerMana -= 197;
                SetGCD(1.5);
                return;
            }

            // back to attack
            if (!targetAimed)
            {
                HookManager.TargetGuid(target.Guid);
            }

            if (!ObjectManager.Player.IsAutoAttacking)
            {
                HookManager.StartAutoAttack();
            }
        }