Ejemplo n.º 1
0
        public PetManager(WowInterface wowInterface, TimeSpan healPetCooldown, Func <bool> castMendPetFunction, Func <bool> castCallPetFunction, Func <bool> castRevivePetFunction)
        {
            WowInterface    = wowInterface;
            HealPetCooldown = healPetCooldown;
            CastMendPet     = castMendPetFunction;
            CastCallPet     = castCallPetFunction;
            CastRevivePet   = castRevivePetFunction;

            CallPetEvent = new(TimeSpan.FromSeconds(8));
        }
Ejemplo n.º 2
0
 public UseUnitQuestObjective(WowInterface wowInterface, int objectDisplayId, bool questgiversOnly, UseUnitQuestObjectiveCondition condition)
 {
     WowInterface     = wowInterface;
     ObjectDisplayIds = new List <int>()
     {
         objectDisplayId
     };
     Condition       = condition;
     QuestgiversOnly = questgiversOnly;
 }
Ejemplo n.º 3
0
        public ShamanRestoration(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(waterShieldSpell, () => TryCastSpell(waterShieldSpell, 0, true)));

            SpellUsageHealDict = new Dictionary <int, string>()
            {
                { 0, riptideSpell },
                { 5000, healingWaveSpell },
            };
        }
Ejemplo n.º 4
0
        public TwilightPortalTactic(WowInterface wowInterface)
        {
            WowInterface     = wowInterface;
            PortalClickEvent = new(TimeSpan.FromSeconds(1));

            Configureables = new()
            {
                { "isOffTank", false },
            };
        }
Ejemplo n.º 5
0
        public JobEngine(WowInterface wowInterface)
        {
            AmeisenLogger.Instance.Log("JobEngine", $"Initializing", LogLevel.Verbose);

            WowInterface = wowInterface;

            MailboxItemQueue = new Queue <string>();

            Reset();
        }
Ejemplo n.º 6
0
        public RogueAssassination(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(sliceAndDiceSpell, () => TryCastSpellRogue(sliceAndDiceSpell, 0, true, true, 1)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(coldBloodSpell, () => TryCastSpellRogue(coldBloodSpell, 0, true)));

            InterruptManager.InterruptSpells = new()
            {
                { 0, (x) => TryCastSpellRogue(kickSpell, x.Guid, true) }
            };
        }
Ejemplo n.º 7
0
        public TwilightPortalTactic(WowInterface wowInterface)
        {
            WowInterface     = wowInterface;
            PortalClickEvent = new TimegatedEvent(TimeSpan.FromSeconds(1));

            Configureables = new Dictionary <string, dynamic>()
            {
                { "isOffTank", false },
            };
        }
        public TalkToUnitQuestObjective(WowInterface wowInterface, List <int> displayIds, List <int> gossipIds, bool questgiversOnly, TalkToUnitQuestObjectiveCondition condition)
        {
            WowInterface    = wowInterface;
            DisplayIds      = displayIds;
            GossipIds       = gossipIds;
            Condition       = condition;
            QuestgiversOnly = questgiversOnly;

            TalkEvent = new TimegatedEvent(TimeSpan.FromMilliseconds(500));
        }
Ejemplo n.º 9
0
        public CollectQuestObjective(WowInterface wowInterface, int itemId, int itemAmount, int objectDisplayId, List <AreaNode> area)
        {
            WowInterface     = wowInterface;
            ItemId           = itemId;
            WantedItemAmount = itemAmount;
            ObjectDisplayId  = objectDisplayId;
            Area             = area;

            RightClickEvent = new TimegatedEvent(TimeSpan.FromSeconds(1));
        }
Ejemplo n.º 10
0
        public DungeonEngine(WowInterface wowInterface, AmeisenBotStateMachine stateMachine)
        {
            WowInterface = wowInterface;
            StateMachine = stateMachine;

            CurrentNodes   = new Queue <DungeonNode>();
            CompletedNodes = new List <DungeonNode>();

            Reset();
        }
Ejemplo n.º 11
0
        public override unsafe void Update(WowInterface wowInterface)
        {
            base.Update(wowInterface);

            if (wowInterface.XMemory.ReadStruct(DescriptorAddress + RawWowObject.EndOffset, out RawWowCorpse objPtr))
            {
                DisplayId = objPtr.DisplayId;
                Owner     = objPtr.Owner;
                Party     = objPtr.Party;
            }
        }
Ejemplo n.º 12
0
        public DungeonEngine(WowInterface wowInterface)
        {
            WowInterface = wowInterface;

            CurrentNodes     = new Queue <DungeonNode>();
            ExitDungeonEvent = new TimegatedEvent(TimeSpan.FromMilliseconds(1000));

            RootSelector = new Selector <DungeonBlackboard>
                           (
                "HasFinishedDungeon",
                (b) => Progress == 100.0,
                new Leaf <DungeonBlackboard>("LeaveDungeon", (b) => ExitDungeon()),
                new Selector <DungeonBlackboard>
                (
                    "IDied",
                    (b) => IDied,
                    new Sequence <DungeonBlackboard>
                    (
                        new Leaf <DungeonBlackboard>("RecoverDeathPosition", (b) => MoveToPosition(DeathPosition)),
                        new Leaf <DungeonBlackboard>("SetIDiedToFalse", (b) =>
            {
                IDied = false;
                return(BehaviorTreeStatus.Success);
            })
                    ),
                    new Selector <DungeonBlackboard>
                    (
                        "AmITheLeader",
                        (b) => WowInterface.ObjectManager.PartyleaderGuid == WowInterface.ObjectManager.PlayerGuid || !WowInterface.ObjectManager.PartymemberGuids.Any(),
                        new Selector <DungeonBlackboard>
                        (
                            "AreAllPlayersPresent",
                            (b) => AreAllPlayersPresent(48.0),
                            new Leaf <DungeonBlackboard>("FollowNodePath", (b) => FollowNodePath()),
                            new Leaf <DungeonBlackboard>("WaitForPlayersToArrive", (b) => { return(BehaviorTreeStatus.Success); })
                        ),
                        new Selector <DungeonBlackboard>
                        (
                            "IsDungeonLeaderInRange",
                            (b) => WowInterface.ObjectManager.Partyleader != null,
                            new Leaf <DungeonBlackboard>("FollowLeader", (b) => MoveToPosition(WowInterface.ObjectManager.Partyleader.Position, 0f, MovementAction.Following)),
                            new Leaf <DungeonBlackboard>("WaitForLeaderToArrive", (b) => { return(BehaviorTreeStatus.Success); })
                        )
                    )
                )
                           );

            BehaviorTree = new AmeisenBotBehaviorTree <DungeonBlackboard>
                           (
                "DungeonBehaviorTree",
                RootSelector,
                DungeonBlackboard
                           );
        }
Ejemplo n.º 13
0
        public EventHook(WowInterface wowInterface)
        {
            WowInterface = wowInterface;

            Setup();

            JsonSerializerSettings = new()
            {
                Error = (sender, errorArgs) => errorArgs.ErrorContext.Handled = true
            };
        }
Ejemplo n.º 14
0
        public CharacterManager(AmeisenBotConfig config, WowInterface wowInterface)
        {
            WowInterface = wowInterface;
            Config       = config;

            Inventory      = new CharacterInventory(WowInterface);
            Equipment      = new CharacterEquipment(WowInterface);
            SpellBook      = new SpellBook(WowInterface);
            ItemComparator = new ItemLevelComparator();
            Skills         = new List <string>();
        }
Ejemplo n.º 15
0
        public WarriorProtection(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(commandingShoutSpell, () => TryCastSpell(commandingShoutSpell, 0, true)));

            TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(demoralizingShoutSpell, () => TryCastSpell(demoralizingShoutSpell, WowInterface.TargetGuid, true)));

            InterruptManager.InterruptSpells = new()
            {
                { 0, (x) => (TryCastSpellWarrior(shieldBashSpell, defensiveStanceSpell, x.Guid, true)) },
                { 1, (x) => TryCastSpell(concussionBlowSpell, x.Guid, true) }
            };
        public UseObjectQuestObjective(WowInterface wowInterface, int objectDisplayId, UseObjectQuestObjectiveCondition condition)
        {
            WowInterface     = wowInterface;
            ObjectDisplayIds = new List <int>()
            {
                objectDisplayId
            };
            Condition = condition;

            UseEvent = new TimegatedEvent(TimeSpan.FromSeconds(1));
        }
Ejemplo n.º 17
0
 public void Interact(WowInterface wowInterface, WowGameobject gameobject, float minRange = 3.0f)
 {
     if (IsInRange(gameobject, minRange))
     {
         wowInterface.HookManager.WowObjectRightClick(gameobject);
     }
     else
     {
         wowInterface.MovementEngine.SetMovementAction(MovementAction.Move, gameobject.Position);
     }
 }
Ejemplo n.º 18
0
        public SpellBook(WowInterface wowInterface)
        {
            WowInterface = wowInterface;

            Spells = new List <Spell>();

            JsonSerializerSettings = new JsonSerializerSettings()
            {
                Error = (sender, errorArgs) => errorArgs.ErrorContext.Handled = true
            };
        }
Ejemplo n.º 19
0
        public ShamanEnhancement(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(lightningShieldSpell, () => WowInterface.Player.ManaPercentage > 60.0 && TryCastSpell(lightningShieldSpell, 0, true)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(waterShieldSpell, () => WowInterface.Player.ManaPercentage < 20.0 && TryCastSpell(waterShieldSpell, 0, true)));

            TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(flameShockSpell, () => TryCastSpell(flameShockSpell, WowInterface.TargetGuid, true)));

            InterruptManager.InterruptSpells = new()
            {
                { 0, (x) => TryCastSpell(windShearSpell, x.Guid, true) },
                { 1, (x) => TryCastSpell(hexSpell, x.Guid, true) }
            };
Ejemplo n.º 20
0
        public WarriorArms(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(battleShoutSpell, () => TryCastSpell(battleShoutSpell, 0, true)));

            TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(hamstringSpell, () => WowInterface.Target?.Type == WowObjectType.Player && TryCastSpell(hamstringSpell, WowInterface.TargetGuid, true)));
            TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(rendSpell, () => WowInterface.Target?.Type == WowObjectType.Player && WowInterface.Player.Rage > 75 && TryCastSpell(rendSpell, WowInterface.TargetGuid, true)));

            InterruptManager.InterruptSpells = new()
            {
                { 0, (x) => TryCastSpellWarrior(intimidatingShoutSpell, berserkerStanceSpell, x.Guid, true) },
                { 1, (x) => TryCastSpellWarrior(intimidatingShoutSpell, battleStanceSpell, x.Guid, true) }
            };
Ejemplo n.º 21
0
        public TalkToUnitQuestObjective(WowInterface wowInterface, int displayId, List <int> gossipIds, TalkToUnitQuestObjectiveCondition condition)
        {
            WowInterface = wowInterface;
            DisplayIds   = new List <int>()
            {
                displayId
            };
            GossipIds = gossipIds;
            Condition = condition;

            TalkEvent = new(TimeSpan.FromMilliseconds(500));
        }
Ejemplo n.º 22
0
        public DungeonEngine(WowInterface wowInterface, AmeisenBotStateMachine stateMachine)
        {
            WowInterface = wowInterface;
            StateMachine = stateMachine;

            CurrentNodes   = new ConcurrentQueue <DungeonNode>();
            CompletedNodes = new List <DungeonNode>();

            ExitDungeonEvent = new TimegatedEvent(TimeSpan.FromMilliseconds(1000));

            Reset();
        }
Ejemplo n.º 23
0
        public static bool Run(WowInterface wowInterface, WowUnit selectedUnit)
        {
            if (wowInterface == null || selectedUnit == null)
            {
                return(false);
            }

            if (wowInterface.ObjectManager.TargetGuid != selectedUnit.Guid)
            {
                wowInterface.HookManager.WowTargetGuid(selectedUnit.Guid);
                return(false);
            }

            if (wowInterface.HookManager.WowIsClickToMoveActive())
            {
                wowInterface.MovementEngine.StopMovement();
            }

            if (!BotMath.IsFacing(wowInterface.ObjectManager.Player.Position, wowInterface.ObjectManager.Player.Rotation, selectedUnit.Position))
            {
                wowInterface.HookManager.WowFacePosition(wowInterface.ObjectManager.Player, selectedUnit.Position);
            }

            if (!wowInterface.HookManager.LuaUiIsVisible("GossipFrame", "MerchantFrame"))
            {
                wowInterface.HookManager.WowUnitRightClick(selectedUnit);
                return(false);
            }

            if (selectedUnit.IsGossip)
            {
                if (wowInterface.HookManager.LuaUiIsVisible("GossipFrame"))
                {
                    string[] gossipTypes = wowInterface.HookManager.LuaGetGossipTypes();

                    for (int i = 0; i < gossipTypes.Length; ++i)
                    {
                        if (gossipTypes[i].Equals("vendor", StringComparison.OrdinalIgnoreCase) ||
                            gossipTypes[i].Equals("repair", StringComparison.OrdinalIgnoreCase))
                        {
                            wowInterface.HookManager.LuaSelectGossipOption(i + 1);
                        }
                    }
                }

                if (!wowInterface.HookManager.LuaUiIsVisible("MerchantFrame"))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 24
0
        public CharacterManager(AmeisenBotConfig config, WowInterface wowInterface)
        {
            WowInterface = wowInterface;
            Config       = config;

            Inventory      = new CharacterInventory(WowInterface);
            Equipment      = new CharacterEquipment(WowInterface);
            SpellBook      = new SpellBook(WowInterface);
            TalentManager  = new TalentManager(WowInterface);
            ItemComparator = new ItemLevelComparator();
            Skills         = new Dictionary <string, (int, int)>();
        }
Ejemplo n.º 25
0
        public ShamanRestoration(WowInterface wowInterface) : base(wowInterface)
        {
            MyAuraManager.BuffsToKeepActive = new Dictionary <string, CastFunction>()
            {
                { waterShieldSpell, () => CastSpellIfPossible(waterShieldSpell, 0, true) }
            };

            SpellUsageHealDict = new Dictionary <int, string>()
            {
                { 0, riptideSpell },
                { 5000, healingWaveSpell },
            };
        }
Ejemplo n.º 26
0
        public JobEngine(WowInterface wowInterface, AmeisenBotConfig config)
        {
            AmeisenLogger.I.Log("JobEngine", $"Initializing", LogLevel.Verbose);

            WowInterface = wowInterface;
            Config       = config;

            MiningEvent    = new TimegatedEvent(TimeSpan.FromSeconds(1));
            BlacklistEvent = new TimegatedEvent(TimeSpan.FromSeconds(1));
            MailSentEvent  = new TimegatedEvent(TimeSpan.FromSeconds(3));

            NodeBlacklist = new List <ulong>();
        }
Ejemplo n.º 27
0
        public DeathknightUnholy(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(unholyPresenceSpell, () => TryCastSpellDk(unholyPresenceSpell, 0)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(hornOfWinterSpell, () => TryCastSpellDk(hornOfWinterSpell, 0, true)));

            TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(frostFeverSpell, () => TryCastSpellDk(icyTouchSpell, WowInterface.TargetGuid, false, false, false, true)));
            TargetAuraManager.Jobs.Add(new KeepActiveAuraJob(bloodPlagueSpell, () => TryCastSpellDk(plagueStrikeSpell, WowInterface.TargetGuid, false, false, false, true)));

            InterruptManager.InterruptSpells = new()
            {
                { 0, (x) => TryCastSpellDk(mindFreezeSpell, x.Guid, true) },
                { 1, (x) => TryCastSpellDk(strangulateSpell, x.Guid, false, true) }
            };
Ejemplo n.º 28
0
        public SmartMovementEngine(WowInterface wowInterface, MovementSettings movementSettings)
        {
            WowInterface     = wowInterface;
            MovementSettings = movementSettings;

            Rnd         = new Random();
            CurrentPath = new Queue <Vector3>();

            State    = MovementEngineState.None;
            TryCount = 0;

            PlayerVehicle = new BasicVehicle(wowInterface, movementSettings.MaxSteering, movementSettings.MaxVelocity, movementSettings.MaxAcceleration);
        }
Ejemplo n.º 29
0
        public MageFrost(WowInterface wowInterface, AmeisenBotFsm stateMachine) : base(wowInterface, stateMachine)
        {
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(arcaneIntellectSpell, () => TryCastSpell(arcaneIntellectSpell, 0, true)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(frostArmorSpell, () => TryCastSpell(frostArmorSpell, 0, true)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(iceArmorSpell, () => TryCastSpell(iceArmorSpell, 0, true)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(manaShieldSpell, () => TryCastSpell(manaShieldSpell, 0, true)));
            MyAuraManager.Jobs.Add(new KeepActiveAuraJob(iceBarrierSpell, () => TryCastSpell(iceBarrierSpell, 0, true)));

            InterruptManager.InterruptSpells = new()
            {
                { 0, (x) => TryCastSpell(counterspellSpell, x.Guid, true) }
            };
        }
Ejemplo n.º 30
0
        public KillAndLootQuestObjective(WowInterface wowInterface, List <int> npcIds, int collectOrKillAmount, int questItemId, List <List <Vector3> > areas)
        {
            WowInterface        = wowInterface;
            NpcIds              = npcIds;
            CollectOrKillAmount = collectOrKillAmount;
            QuestItemId         = questItemId;
            SearchAreas         = new SearchAreaEnsamble(areas);

            if (!CollectQuestItem)
            {
                wowInterface.Db.GetCombatLogSubject().Register(this);
            }
        }