Exemple #1
0
 internal WoWAura(WoWGUID ownerGUID, int spellID, byte stack, uint timeLeft)
 {
     OwnerGUID    = ownerGUID;
     SpellId      = spellID;
     Stack        = stack;
     TimeLeftInMs = timeLeft;
 }
Exemple #2
0
        private void SetMouseoverUnit(WoWGUID guid)
        {
            var mouseoverGUID = memory.Read <WoWGUID>(memory.ImageBase + WowBuildInfoX64.MouseoverGUID);

            if (mouseoverGUID != guid)
            {
                memory.Write(memory.ImageBase + WowBuildInfoX64.MouseoverGUID, guid);
            }
        }
Exemple #3
0
        internal WowPlayer(IntPtr pAddress, WoWGUID guid, WowProcess wow) : base(wow)
        {
            Address = pAddress;
            MGUID   = guid;
            WowPlayerInfo inf = memory.Read <WowPlayerInfo>(Address + WowBuildInfoX64.UnitInfoStart);

            TargetGUID = inf.TargetGUID;
            Health     = inf.Health;
            HealthMax  = inf.HealthMax;
            Power      = inf.Power;
            PowerMax   = inf.PowerMax;
            Alive      = Health > 1;
            Level      = inf.Level;
            InCombat   = ((inf.UnitFlags >> 19) & 1) == 1; // Script_UnitAffectingCombat
            Class      = inf.Class;
            IsMounted  = inf.MountDisplayID != 0;
            Race       = inf.Race;
            switch (Race)
            {
            case Race.Orc:
            case Race.Undead:
            case Race.Tauren:
            case Race.Troll:
            case Race.BloodElf:
            case Race.Goblin:
            case Race.PandarenHorde:
                Faction = Faction.Horde;
                break;

            case Race.Human:
            case Race.Dwarf:
            case Race.NightElf:
            case Race.Gnome:
            case Race.Draenei:
            case Race.Worgen:
            case Race.PandarenAlliance:
                Faction = Faction.Alliance;
                break;

            default:
                Faction = Faction.Unknown;
                break;
            }
        }
Exemple #4
0
        internal static WoWPlayerMe Pulse(
            WowProcess wow,
            List <WowObject> wowObjects = null,
            List <WowPlayer> wowUnits   = null,
            List <WowNpc> wowNpcs       = null,
            List <WoWItem> items        = null,
            List <WowObject> containers = null)
        {
            wowObjects?.Clear();
            wowUnits?.Clear();
            wowNpcs?.Clear();
            items?.Clear();
            containers?.Clear();
            WoWPlayerMe me         = null;
            WoWGUID     playerGUID = wow.Memory.Read <WoWGUID>(wow.Memory.ImageBase + WowBuildInfoX64.PlayerGUID);
            var         manager    = wow.Memory.Read <IntPtr>(wow.Memory.ImageBase + WowBuildInfoX64.ObjectManager);
            var         currObject = wow.Memory.Read <IntPtr>(manager + WowBuildInfoX64.ObjectManagerFirstObject);
            var         objType    = GetObjectType(wow.Memory, currObject);

            while (objType < (byte)ObjectType.Invalid)
            {
                switch (objType)
                {
                case (byte)ObjectType.Unit:
                    wowNpcs?.Add(new WowNpc(currObject, wow));
                    break;

                case (byte)ObjectType.Player:
                    wowUnits?.Add(new WowPlayer(currObject, wow.Memory.Read <WoWGUID>(currObject + WowBuildInfoX64.ObjectGUID), wow));
                    break;

                case (byte)ObjectType.ActivePlayer:
                    WoWGUID guid = wow.Memory.Read <WoWGUID>(currObject + WowBuildInfoX64.ObjectGUID);
                    if (guid == playerGUID)
                    {
                        me = new WoWPlayerMe(currObject, wow);
                    }
                    break;

                case (byte)ObjectType.GameObject:
                    wowObjects?.Add(new WowObject(currObject, wow));
                    break;

                case (byte)ObjectType.Container:
                    containers?.Add(new WowObject(currObject, wow));
                    break;

                case (byte)ObjectType.Item:
                case (byte)ObjectType.AzeriteEmpoweredItem:
                case (byte)ObjectType.AzeriteItem:
                    items?.Add(new WoWItem(currObject, wow));
                    break;
                }
                if (!TryGetNextObject(wow, currObject, out currObject))
                {
                    break;
                }
                objType = GetObjectType(wow.Memory, currObject);
            }
            return(me);
        }