Exemple #1
0
        public override void Update()
        {
            base.Update();

            try
            {
                if (PlayerBase == 0)
                {
                    PlayerBase = BlackMagicInstance.ReadUInt(Offsets.playerBase);
                    PlayerBase = BlackMagicInstance.ReadUInt(PlayerBase + 0x34);
                    PlayerBase = BlackMagicInstance.ReadUInt(PlayerBase + 0x24);
                }

                Race  = (WowRace)BlackMagicInstance.ReadByte(Offsets.playerRace);
                Class = (WowClass)BlackMagicInstance.ReadByte(Offsets.playerClass);

                Name   = BlackMagicInstance.ReadASCIIString(Offsets.playerName, 12);
                Exp    = BlackMagicInstance.ReadInt(PlayerBase + 0x3794);
                MaxExp = BlackMagicInstance.ReadInt(PlayerBase + 0x3798);

                // Somehow this is really sketchy, need to replace this...
                //uint castingState = BlackMagicInstance.ReadUInt((uint)BlackMagicInstance.MainModule.BaseAddress + Offsets.localPlayerCharacterState);
                //castingState = BlackMagicInstance.ReadUInt(castingState + Offsets.localPlayerCharacterStateOffset1);
                //castingState = BlackMagicInstance.ReadUInt(castingState + Offsets.localPlayerCharacterStateOffset2);
                //CurrentState = (UnitState)BlackMagicInstance.ReadInt(castingState + Offsets.localPlayerCharacterStateOffset3);

                TargetGuid = BlackMagicInstance.ReadUInt64(Descriptor + 0x48);
                PetGuid    = BlackMagicInstance.ReadUInt64(Offsets.petGuid);

                PartymemberGuids = new List <ulong>();
                //PartyleaderGuid = BlackMagicInstance.ReadUInt64(Offsets.partyLeader);
                PartyleaderGuid = BlackMagicInstance.ReadUInt64(Offsets.raidLeader);

                PartymemberGuids.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer1));
                PartymemberGuids.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer2));
                PartymemberGuids.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer3));
                PartymemberGuids.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer4));

                // try to add raidmembers
                for (uint p = 0; p < 40; p++)
                {
                    try
                    {
                        uint  address = Offsets.raidGroupStart + (p * Offsets.raidPlayerOffset);
                        ulong guid    = BlackMagicInstance.ReadUInt64(address);
                        if (!PartymemberGuids.Contains(guid))
                        {
                            PartymemberGuids.Add(guid);
                        }
                    }
                    catch { }
                }
            }
            catch { }
        }
Exemple #2
0
        public override void Update()
        {
            base.Update();

            try
            {
                if (PlayerBase == 0)
                {
                    PlayerBase = BlackMagicInstance.ReadUInt(Offsets.playerBase);
                    PlayerBase = BlackMagicInstance.ReadUInt(PlayerBase + 0x34);
                    PlayerBase = BlackMagicInstance.ReadUInt(PlayerBase + 0x24);
                }

                Race  = (WowRace)BlackMagicInstance.ReadByte(Offsets.playerRace);
                Class = (WowClass)BlackMagicInstance.ReadByte(Offsets.playerClass);

                Name   = BlackMagicInstance.ReadASCIIString(Offsets.playerName, 12);
                Exp    = BlackMagicInstance.ReadInt(PlayerBase + 0x3794);
                MaxExp = BlackMagicInstance.ReadInt(PlayerBase + 0x3798);

                // Somehow this is really sketchy, need to replace this...
                //uint castingState = BlackMagicInstance.ReadUInt((uint)BlackMagicInstance.MainModule.BaseAddress + Offsets.localPlayerCharacterState);
                //castingState = BlackMagicInstance.ReadUInt(castingState + Offsets.localPlayerCharacterStateOffset1);
                //castingState = BlackMagicInstance.ReadUInt(castingState + Offsets.localPlayerCharacterStateOffset2);
                //CurrentState = (UnitState)BlackMagicInstance.ReadInt(castingState + Offsets.localPlayerCharacterStateOffset3);

                TargetGuid = BlackMagicInstance.ReadUInt64(Descriptor + 0x48);

                PartymemberGuids = new List <ulong>();
                PartyleaderGUID  = BlackMagicInstance.ReadUInt64(Offsets.partyLeader);

                if (PartyleaderGUID != 0)
                {
                    PartymemberGuids?.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer1));
                    PartymemberGuids?.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer2));
                    PartymemberGuids?.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer3));
                    PartymemberGuids?.Add(BlackMagicInstance.ReadUInt64(Offsets.partyPlayer4));
                }
            }
            catch { }
        }
Exemple #3
0
        public override void Update()
        {
            base.Update();

            if (Name == null)
            {
                try { Name = GetMobNameFromBase(BaseAddress); } catch { }
            }

            try
            {
                pos.X    = BlackMagicInstance.ReadFloat(BaseAddress + 0x798);
                pos.Y    = BlackMagicInstance.ReadFloat(BaseAddress + 0x79C);
                pos.Z    = BlackMagicInstance.ReadFloat(BaseAddress + 0x7A0);
                Rotation = BlackMagicInstance.ReadFloat(BaseAddress + 0x7A8);

                TargetGuid = BlackMagicInstance.ReadUInt64(Descriptor + 0x48);

                CurrentlyCastingId    = BlackMagicInstance.ReadInt(BaseAddress + 0xA6C);
                CurrentlyChannelingId = BlackMagicInstance.ReadInt(BaseAddress + 0xA80);
            }
            catch { }

            // too cpu heavy

            /*try
             * {
             *  distance = Utils.GetDistance(pos, AmeisenManager.GetInstance().Me().pos);
             * }
             * catch { }*/

            try
            {
                Level     = BlackMagicInstance.ReadInt(Descriptor + 0xD8);
                Health    = BlackMagicInstance.ReadInt(Descriptor + 0x60);
                MaxHealth = BlackMagicInstance.ReadInt(Descriptor + 0x80);
            }
            catch { }

            try
            {
                Mana    = BlackMagicInstance.ReadInt(Descriptor + 0x64);
                MaxMana = BlackMagicInstance.ReadInt(Descriptor + 0x84);
            }
            catch { }

            try
            {
                Rage    = BlackMagicInstance.ReadInt(Descriptor + 0x68) / 10;
                MaxRage = 100;
            }
            catch { }

            try
            {
                Energy    = BlackMagicInstance.ReadInt(BaseAddress + 0xFC0);
                MaxEnergy = 100;
            }
            catch { }

            try
            {
                RuneEnergy    = BlackMagicInstance.ReadInt(BaseAddress + 0x19D4) / 10;
                MaxRuneEnergy = 100;
            }
            catch { }

            //CombatReach = BlackMagicInstance.ReadInt(BaseUnitFields + (0x42 * 4));
            //ChannelSpell = BlackMagicInstance.ReadInt(BaseUnitFields + (0x16 * 4));
            //SummonedBy = BlackMagicInstance.ReadInt(BaseUnitFields + (0xE * 4));
            //FactionTemplate = BlackMagicInstance.ReadInt(BaseUnitFields + (0x37 * 4));

            try { UFlags = (BitVector32)BlackMagicInstance.ReadObject(Descriptor + 0xEC, typeof(BitVector32)); } catch { }

            try { UFlags2 = (BitVector32)BlackMagicInstance.ReadObject(Descriptor + 0xF0, typeof(BitVector32)); } catch { }

            try { DynamicUFlags = (BitVector32)BlackMagicInstance.ReadObject(Descriptor + 0x240, typeof(BitVector32)); } catch { }

            try { IsDead = BlackMagicInstance.ReadByte(Descriptor + 0x12B) == 1; } catch { }
        }