public static void GetAllUnits(out List<WoWUnit> allunits, WoWConnection wc) { allunits = new List<WoWUnit>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.Player || TempObject.UnitType == WoWUnitType.NPC) { Vector3 myUnitPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress+MemoryOffsets.ObjectManagerLocalDescriptorArray)+ 0x10 +MemoryOffsets.DescriptorArrayClass8); float myUnitRot = wc.Connection.ReadFloat((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); if (myUnitRot > Math.PI) { myUnitRot = -(2 * (float)(Math.PI) - myUnitRot); } allunits.Add(new WoWUnit(TempObject, myUnitPos, myUnitRot, myClass)); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } }
public WoWSpell(WoWObject wo, Vector3 pos, uint sID) : base(wo) { this.position = pos; this.spellID = sID; this.RSpell = new RadarSpell(new Vector2( -RadarObject.RadarZoom * (pos.Y - Game1.mainPlayer.Position.Y), -RadarObject.RadarZoom * (pos.X - Game1.mainPlayer.Position.X)), 0f); }
public WoWUnit(WoWObject wo, Vector3 pos,float rot, WoWClass uClass) : base(wo) { this.position = pos; this.unitClass = uClass; this.RUnit = new RadarUnit(new Vector2( -RadarObject.RadarZoom * (pos.Y - Game1.mainPlayer.Position.Y), -RadarObject.RadarZoom * (pos.X - Game1.mainPlayer.Position.X)), -(rot+(float)Math.PI/2), ColorHelper.GetColorFromWoWClass(uClass)); }
public WoWPlayer(WoWObject wo, Vector3 pos, float rot, WoWClass uClass, byte moveflag) : base(wo) { this.Position = pos; this.Rotation = rot; this.unitClass = uClass; this.MovingInfo = new MovementFlags(moveflag); this.RPlayer = new RadarPlayer(new Vector2( -RadarObject.RadarZoom * (pos.Y - Game1.mainPlayer.Position.Y), -RadarObject.RadarZoom * (pos.X - Game1.mainPlayer.Position.X)), -(rot + (float)Math.PI / 2), ColorHelper.GetColorFromWoWClass(uClass)); }
public static void GetAllSpells(out List<WoWSpell> allspells, WoWConnection wc) { allspells = new List<WoWSpell>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } }
public static void GetAllSpells(out List <WoWSpell> allspells, WoWConnection wc) { allspells = new List <WoWSpell>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } }
public static void GetAllObjects(ref List<WoWUnit> allunits, ref List<WoWSpell> allspells, ref List<WoWPlayer> allplayers, WoWConnection wc) { allunits = new List<WoWUnit>(); allspells = new List<WoWSpell>(); List<WoWPlayer> tempplayers = new List<WoWPlayer>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.NPC) { Vector3 myUnitPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + 0x10 + MemoryOffsets.DescriptorArrayClass8); float myUnitRot = wc.Connection.ReadFloat((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); if (myUnitRot > Math.PI) { myUnitRot = -(2 * (float)(Math.PI) - myUnitRot); } allunits.Add(new WoWUnit(TempObject, myUnitPos, myUnitRot, myClass)); } else if (TempObject.UnitType == WoWUnitType.Player) { Vector3 myPlayerPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + 0x10 + MemoryOffsets.DescriptorArrayClass8); float myPlayerRot = wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); uint myMovementArrayAddress = wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalMovementArray); byte movebyte = wc.Connection.ReadByte(myMovementArrayAddress + MemoryOffsets.MovementArrayIsMoving8); if (myPlayerRot > Math.PI) { myPlayerRot = -(2 * (float)(Math.PI) - myPlayerRot); } tempplayers.Add(new WoWPlayer(TempObject, myPlayerPos, myPlayerRot, myClass, movebyte)); } else if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } foreach (WoWPlayer y in tempplayers) { try { allplayers.First(x => x.guid == y.guid).SetPositions(y); } catch (InvalidOperationException) { allplayers.Add(y); } } }
public WoWObject(WoWObject other) { this.BaseAddress = other.BaseAddress; this.Guid = other.Guid; this.UnitType = other.UnitType; }
public static void GetAllObjects(ref List <WoWUnit> allunits, ref List <WoWSpell> allspells, ref List <WoWPlayer> allplayers, WoWConnection wc) { allunits = new List <WoWUnit>(); allspells = new List <WoWSpell>(); List <WoWPlayer> tempplayers = new List <WoWPlayer>(); WoWObject TempObject = new WoWObject(wc.FirstObjectAddress, wc); while ((uint)TempObject.BaseAddress != 0 && TempObject.Guid != 0) { if (TempObject.UnitType == WoWUnitType.NPC || TempObject.UnitType == WoWUnitType.PermanentPet) { Vector3 myUnitPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + MemoryOffsets.DescriptorArrayClass8); float myUnitRot = wc.Connection.ReadFloat((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); if (myUnitRot > Math.PI) { myUnitRot = -(2 * (float)(Math.PI) - myUnitRot); } allunits.Add(new WoWUnit(TempObject, myUnitPos, myUnitRot, myClass)); } else if (TempObject.UnitType == WoWUnitType.Player) { Vector3 myPlayerPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitPosZ)); WoWClass myClass = WoWClass.None; try { myClass = (WoWClass)wc.Connection.ReadByte(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalDescriptorArray) + MemoryOffsets.DescriptorArrayClass8); } catch { } float myPlayerRot = wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerUnitRotation); uint myMovementArrayAddress = wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerLocalMovementArray); byte movebyte = 0;// wc.Connection.ReadByte(myMovementArrayAddress + MemoryOffsets.MovementArrayIsMoving8); if (myPlayerRot > Math.PI) { myPlayerRot = -(2 * (float)(Math.PI) - myPlayerRot); } tempplayers.Add(new WoWPlayer(TempObject, myPlayerPos, myPlayerRot, myClass, movebyte)); } else if (TempObject.UnitType == WoWUnitType.Spell) { Vector3 mySpellPos = new Vector3( wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosX), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosY), wc.Connection.ReadFloat(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellPosZ)); allspells.Add(new WoWSpell(TempObject, mySpellPos, wc.Connection.ReadUInt(TempObject.BaseAddress + MemoryOffsets.ObjectManagerSpellID))); } try { TempObject = new WoWObject(wc.Connection.ReadUInt((uint)TempObject.BaseAddress + MemoryOffsets.ObjectManagerNextObjectAddress), wc); } catch { break; } } foreach (WoWPlayer y in tempplayers) { try { allplayers.First(x => x.guid == y.guid).SetPositions(y); } catch (InvalidOperationException) { allplayers.Add(y); } } }
public WoWObject(WoWObject other) { this.BaseAddress = other.BaseAddress; this.Guid = other.Guid; this.UnitType = other.UnitType; }