Example #1
0
        public void CastSpell(Spell spell)
        {
            SpellChain.Add(spell);
            ManaSpent  += spell.Cost;
            PlayerMana -= spell.Cost;

            if (spell.Duration > 0)
            {
                Log($"Player casts {spell.Name}.");
                ActiveSpells.Add(spell, spell.Duration);
            }
            else
            {
                ApplyEffects(spell);
                if (!Debug)
                {
                    return;
                }
                switch (spell.Name)
                {
                case "Magic Missile":
                    Log($"Player casts Magic Missile, dealing {spell.Damage} damage.");
                    break;

                case "Drain":
                    Log(
                        $"Player casts {spell.Name}, dealing {spell.Damage} damage, and healing {spell.Heal} hit points");
                    break;
                }
            }
        }
        public WarlockDestruction(AmeisenBotStateMachine stateMachine) : base(stateMachine)
        {
            PetManager = new PetManager
                         (
                WowInterface,
                TimeSpan.FromSeconds(1),
                null,
                () => WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) && TryCastSpell(summonImpSpell, 0, true),
                () => WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) && TryCastSpell(summonImpSpell, 0, true)
                         );

            MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>();

            WowInterface.CharacterManager.SpellBook.OnSpellBookUpdate += () =>
            {
                if (SpellChain.Get(WowInterface.CharacterManager.SpellBook.IsSpellKnown, out string armorToUse, felArmorSpell, demonArmorSpell, demonSkinSpell))
                {
                    MyAuraManager.BuffsToKeepActive.Add(armorToUse, () => TryCastSpell(armorToUse, 0, true));
                }
            };

            TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>()
            {
                { corruptionSpell, () => !WowInterface.ObjectManager.Target.HasBuffByName(seedOfCorruptionSpell) && TryCastSpell(corruptionSpell, WowInterface.ObjectManager.TargetGuid, true) },
                { curseOfTheElementsSpell, () => TryCastSpell(curseOfTheElementsSpell, WowInterface.ObjectManager.TargetGuid, true) },
                { immolateSpell, () => TryCastSpell(immolateSpell, WowInterface.ObjectManager.TargetGuid, true) }
            };
        }
        public HunterMarksmanship(AmeisenBotStateMachine stateMachine) : base(stateMachine)
        {
            PetManager = new PetManager
                         (
                WowInterface,
                TimeSpan.FromSeconds(15),
                () => TryCastSpell(mendPetSpell, 0, true),
                () => TryCastSpell(callPetSpell, 0),
                () => TryCastSpell(revivePetSpell, 0)
                         );

            MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>()
            {
                { aspectOfTheViperSpell, () => WowInterface.ObjectManager.Player.ManaPercentage < 20.0 && TryCastSpell(aspectOfTheViperSpell, 0, true) }
            };

            WowInterface.CharacterManager.SpellBook.OnSpellBookUpdate += () =>
            {
                if (SpellChain.Run(WowInterface.CharacterManager.SpellBook.IsSpellKnown, out string aspectToUse, aspectOfTheDragonhawkSpell, aspectOfTheHawkSpell))
                {
                    MyAuraManager.BuffsToKeepActive.Add(aspectToUse, () => WowInterface.ObjectManager.Player.ManaPercentage > 50.0 && TryCastSpell(aspectToUse, 0, true));
                }
            };

            TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>()
            {
                { huntersMarkSpell, () => TryCastSpell(huntersMarkSpell, WowInterface.ObjectManager.TargetGuid, true) },
                { serpentStingSpell, () => TryCastSpell(serpentStingSpell, WowInterface.ObjectManager.TargetGuid, true) }
            };

            TargetInterruptManager.InterruptSpells = new SortedList <int, CastInterruptFunction>()
            {
                { 0, (x) => TryCastSpell(silencingShotSpell, x.Guid, true) }
            };
        }
Example #4
0
        public WarlockAffliction(AmeisenBotStateMachine stateMachine) : base(stateMachine)
        {
            PetManager = new PetManager
                         (
                WowInterface,
                TimeSpan.FromSeconds(1),
                null,
                () => (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonFelhunterSpell) &&
                       WowInterface.CharacterManager.Inventory.HasItemByName("Soul Shard") &&
                       TryCastSpell(summonFelhunterSpell, 0)) ||
                (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) &&
                 TryCastSpell(summonImpSpell, 0)),
                () => (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonFelhunterSpell) &&
                       WowInterface.CharacterManager.Inventory.HasItemByName("Soul Shard") &&
                       TryCastSpell(summonFelhunterSpell, 0)) ||
                (WowInterface.CharacterManager.SpellBook.IsSpellKnown(summonImpSpell) &&
                 TryCastSpell(summonImpSpell, 0))
                         );

            MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>();

            WowInterface.CharacterManager.SpellBook.OnSpellBookUpdate += () =>
            {
                if (SpellChain.Get(WowInterface.CharacterManager.SpellBook.IsSpellKnown, out string armorToUse, felArmorSpell, demonArmorSpell, demonSkinSpell))
                {
                    MyAuraManager.BuffsToKeepActive.Add(armorToUse, () => TryCastSpell(armorToUse, 0, true));
                }
            };

            TargetAuraManager.DebuffsToKeepActive = new Dictionary <string, CastFunction>()
            {
                { corruptionSpell, () => !WowInterface.ObjectManager.Target.HasBuffByName(seedOfCorruptionSpell) && TryCastSpell(corruptionSpell, WowInterface.ObjectManager.TargetGuid, true) },
                { curseOfAgonySpell, () => TryCastSpell(curseOfAgonySpell, WowInterface.ObjectManager.TargetGuid, true) },
                { unstableAfflictionSpell, () => TryCastSpell(unstableAfflictionSpell, WowInterface.ObjectManager.TargetGuid, true) },
                { hauntSpell, () => TryCastSpell(hauntSpell, WowInterface.ObjectManager.TargetGuid, true) }
            };
        }