Example #1
0
        public void WowDynobjectSizeTest()
        {
            // >> WowObject : WowDynobject
            int rawWowObjectSize    = Marshal.SizeOf(typeof(RawWowObject));
            int rawWowDynobjectSize = Marshal.SizeOf(typeof(RawWowDynobject));

            _ = new WowDynobject(IntPtr.Zero, WowObjectType.Dynobject);

            Assert.AreEqual(RawWowObject.EndOffset + RawWowDynobject.EndOffset, rawWowObjectSize + rawWowDynobjectSize);
        }
Example #2
0
        private WowDynobject ReadWowDynobject(IntPtr activeObject, WowObjectType wowObjectType)
        {
            if (WowInterface.XMemory.Read(IntPtr.Add(activeObject, WowInterface.OffsetList.WowObjectDescriptor.ToInt32()), out IntPtr descriptorAddress) &&
                WowInterface.XMemory.ReadStruct(IntPtr.Add(activeObject, WowInterface.OffsetList.WowObjectPosition.ToInt32()), out Vector3 position))
            {
                WowDynobject dynObject = new WowDynobject(activeObject, wowObjectType)
                {
                    DescriptorAddress = descriptorAddress,
                    Position          = position
                };

                return(dynObject.UpdateRawWowDynobject(WowInterface.XMemory));
            }

            return(null);
        }
Example #3
0
        public override void Execute()
        {
            WowDynobject aoeSpellObject = WowInterface.ObjectManager.WowObjects.OfType <WowDynobject>()
                                          .FirstOrDefault(e => !Blacklisted.Contains(e.SpellId) &&
                                                          e.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < e.Radius + 5.0 &&
                                                          WowInterface.HookManager.WowGetUnitReaction(WowInterface.ObjectManager.Player, WowInterface.ObjectManager.GetWowObjectByGuid <WowUnit>(e.Caster)) != WowUnitReaction.Friendly);

            if (aoeSpellObject == null)
            {
                StateMachine.SetState(StateMachine.LastState);
                return;
            }

            Vector3 targetPosition = FindPositionOutsideOfAoeSpell(aoeSpellObject.Position, aoeSpellObject.Radius);

            WowInterface.MovementEngine.SetMovementAction(MovementAction.Moving, targetPosition);
        }
Example #4
0
        public override void Execute()
        {
            if (WowInterface.ObjectManager != null &&
                WowInterface.ObjectManager.Player != null)
            {
                // TODO: exclude friendly spells like Circle of Healing
                WowDynobject aoeSpellObject = WowInterface.ObjectManager.WowObjects.OfType <WowDynobject>()
                                              .FirstOrDefault(e => FriendlySpells.Contains(e.SpellId) && e.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < e.Radius + 1);

                if (aoeSpellObject == null)
                {
                    StateMachine.SetState(StateMachine.LastState);
                    return;
                }

                Vector3 targetPosition = FindPositionOutsideOfAoeSpell(aoeSpellObject.Position, aoeSpellObject.Radius);

                WowInterface.MovementEngine.SetState(MovementEngineState.Moving, targetPosition);
                WowInterface.MovementEngine.Execute();
            }
        }
Example #5
0
        public override void Execute()
        {
            if (ObjectManager != null &&
                ObjectManager.Player != null)
            {
                // TODO: exclude friendly spells like Circle of Healing
                WowDynobject aoeSpellObject = ObjectManager.WowObjects.OfType <WowDynobject>()
                                              .FirstOrDefault(e => e.Position.GetDistance2D(ObjectManager.Player.Position) < e.Radius + 1);

                if (aoeSpellObject == null)
                {
                    AmeisenBotStateMachine.SetState(AmeisenBotState.Idle);
                    return;
                }

                Vector3 targetPosition = FindPositionOutsideOfAoeSpell(aoeSpellObject.Position, aoeSpellObject.Radius);

                MovementEngine.SetState(MovementEngineState.Moving, targetPosition);
                MovementEngine.Execute();
            }
        }