/// <summary> /// Get any NPC's name by its BaseAdress /// </summary> /// <param name="objBase">BaseAdress of the npc to search the name for</param> /// <returns>name of the npc</returns> public string GetMobNameFromBase(uint objBase) { uint objName = BlackMagicInstance.ReadUInt(objBase + 0x964); objName = BlackMagicInstance.ReadUInt(objName + 0x05C); return(BlackMagicInstance.ReadASCIIString(objName, 24)); }
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 { } }
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 { } }
/// <summary> /// Get a player's name from its GUID /// </summary> /// <param name="guid">player's GUID</param> /// <returns>name of the player</returns> public string GetPlayerNameFromGuid(ulong guid) { uint playerMask, playerBase, shortGUID, testGUID, offset, current; playerMask = BlackMagicInstance.ReadUInt((Offsets.nameStore + Offsets.nameMask)); playerBase = BlackMagicInstance.ReadUInt((Offsets.nameStore + Offsets.nameBase)); // Shorten the GUID shortGUID = (uint)guid & 0xfffffff; offset = 12 * (playerMask & shortGUID); current = BlackMagicInstance.ReadUInt(playerBase + offset + 8); offset = BlackMagicInstance.ReadUInt(playerBase + offset); // Check for empty name if ((current & 0x1) == 0x1) { return(""); } testGUID = BlackMagicInstance.ReadUInt(current); while (testGUID != shortGUID) { current = BlackMagicInstance.ReadUInt(current + offset + 4); // Check for empty name if ((current & 0x1) == 0x1) { return(""); } testGUID = BlackMagicInstance.ReadUInt(current); } return(BlackMagicInstance.ReadASCIIString(current + Offsets.nameString, 12)); }