| @@ -0,0 +1,67 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Runtime.InteropServices; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.Controller { | ||
| class SendKey { | ||
| [DllImport("user32.dll", SetLastError = true)] | ||
| static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); | ||
| //[DllImport("user32.dll", SetLastError = true)] | ||
| //static extern bool PostMessage(IntPtr hWnd, uint Msg, string wParam, string lParam); | ||
| [DllImport("user32.dll", SetLastError = true)] | ||
| static extern IntPtr FindWindow(string lpClassName, string lpWindowName); | ||
| [DllImport("user32.dll", CharSet = CharSet.Auto)] | ||
| public static extern bool SetCursorPos(int X, int Y); | ||
| [DllImport("user32.dll")] | ||
| public static extern bool GetWindowRect(IntPtr hwnd, ref Rect rectangle); | ||
|
|
||
| public struct Rect { | ||
| public int Left { get; set; } | ||
| public int Top { get; set; } | ||
| public int Right { get; set; } | ||
| public int Bottom { get; set; } | ||
| } | ||
|
|
||
| private static readonly uint WM_KEYDOWN = 0x0100; | ||
| private static readonly uint WM_KEYUP = 0x0101; | ||
|
|
||
| public static void Send(ConstController.WindowsVirtualKey Key) { | ||
| IntPtr Handle = FindWindow(null, Program.PROCESS_WINDOW_TITLE); | ||
| PostMessage(Handle, WM_KEYDOWN, (int)Key, 0); | ||
| PostMessage(Handle, WM_KEYUP, (int)Key, 0); | ||
| } | ||
|
|
||
| public static void KeyDown(ConstController.WindowsVirtualKey Key, ref bool state) { | ||
| IntPtr Handle = FindWindow(null, Program.PROCESS_WINDOW_TITLE); | ||
| PostMessage(Handle, WM_KEYDOWN, (int)Key, 0); | ||
| state = true; | ||
| } | ||
| public static void KeyUp(ConstController.WindowsVirtualKey Key, ref bool state) { | ||
| IntPtr Handle = FindWindow(null, Program.PROCESS_WINDOW_TITLE); | ||
| PostMessage(Handle, WM_KEYUP, (int)Key, 0); | ||
| state = false; | ||
| } | ||
| public static void KeyDown(ConstController.WindowsVirtualKey Key, bool state, ref bool mystate) { | ||
| if (state || mystate) { | ||
| IntPtr Handle = FindWindow(null, Program.PROCESS_WINDOW_TITLE); | ||
| PostMessage(Handle, WM_KEYDOWN, (int)Key, 0); | ||
| } | ||
| mystate = true; | ||
| } | ||
| public static void KeyUp(ConstController.WindowsVirtualKey Key, bool state, ref bool mystate) { | ||
| if (state || mystate) { | ||
| IntPtr Handle = FindWindow(null, Program.PROCESS_WINDOW_TITLE); | ||
| PostMessage(Handle, WM_KEYUP, (int)Key, 0); | ||
| } | ||
| mystate = false; | ||
| } | ||
| public static Rect GetWoWPosition() { | ||
| Rect result = new Rect(); | ||
| GetWindowRect(FindWindow(null, Program.PROCESS_WINDOW_TITLE), ref result); | ||
| return result; | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,86 @@ | ||
| using Magic; | ||
| using Microsoft.Xna.Framework; | ||
| using Radar.Bellona.MemoryReading; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
|
|
||
| namespace Radar.Bellona { | ||
| class EveryoneGetinHere { | ||
| public static List<GameObject> NearbyGameObjects = new List<GameObject>(); | ||
| public static List<GameObject> newGameObjects = new List<GameObject>(); | ||
|
|
||
| public static void GetEveryObject(ref List<RadarPlayer> players, Vector2 playerpos, BlackMagic w) { | ||
| players.Clear(); | ||
| GameObject TempObject = new GameObject(Initializer.FirstObject); | ||
| int i = 0; | ||
| while ((uint)TempObject.BaseAddress != 0 && i < 300) { | ||
| i++; | ||
| TempObject.Unit = new WoWModels.WoWUnit(); | ||
| TempObject.Unit.RefreshForRadar(w, TempObject); | ||
| if (Vector3.Distance(TempObject.Unit.Position, new Vector3(playerpos, TempObject.Unit.Position.Z)) < 50) { | ||
| players.Add(new RadarPlayer(TempObject)); | ||
| } | ||
| try { | ||
| TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject))); | ||
| } | ||
| catch { | ||
| return; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| public static void RefreshNearbyGameObjects(Vector2 playerpos, BlackMagic w, int threshhold) { | ||
| GameObject TempObject = new GameObject(Initializer.FirstObject); | ||
| int i = 0; | ||
| NearbyGameObjects.Clear(); | ||
| while ((uint)TempObject.BaseAddress != 0) { | ||
| i++; | ||
| TempObject.Unit = new WoWModels.WoWUnit(); | ||
| TempObject.Unit.RefreshForRadar(w, TempObject); | ||
| //if (Vector3.Distance(TempObject.Unit.Position, new Vector3(playerpos, TempObject.Unit.Position.Z)) < threshhold) { | ||
| NearbyGameObjects.Add(TempObject); | ||
| //} | ||
| try { | ||
| TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject))); | ||
| } | ||
| catch { | ||
| break; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
| public static void RefreshNewGameObjects(Vector2 playerpos, BlackMagic w) { | ||
| GameObject TempObject = new GameObject(Initializer.FirstObject); | ||
| int i = 0; | ||
| newGameObjects.Clear(); | ||
| while ((uint)TempObject.BaseAddress != 0 && i < 500) { | ||
| i++; | ||
| TempObject.Unit = new WoWModels.WoWUnit(); | ||
| TempObject.Unit.RefreshForRadar(w, TempObject); | ||
| bool shit = false; | ||
| foreach(GameObject go in NearbyGameObjects) { | ||
| if (go.GUID == TempObject.GUID) { | ||
| shit = true; | ||
| } | ||
| } | ||
| if (!shit) { | ||
| newGameObjects.Add(TempObject); | ||
| } | ||
| try { | ||
| TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject))); | ||
| } | ||
| catch { | ||
| break; | ||
| } | ||
|
|
||
| } | ||
| foreach(GameObject ngo in newGameObjects) { | ||
| ngo.Unit.Position = new Vector3(w.ReadFloat((uint)newGameObjects[0].BaseAddress + 0x110), w.ReadFloat((uint)newGameObjects[0].BaseAddress + 0x114), 104); | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,117 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.MemoryReading { | ||
| class ConstOffsets { | ||
| internal enum ObjectManager : uint { | ||
| CurMgrPointer = 0x9BE7E0, | ||
| CurMgrOffset = 0x463C, | ||
| NextObject = 0x3C, | ||
| FirstObject = 0xC0, | ||
| LocalGUID = 0x30, | ||
| LocalDescriptorArray = 0xC, | ||
| LocalBuffBigArray = 0xE9C, | ||
| LocalBuffSmallArray = 0xE98, | ||
| LocalMovementArray = 0x100, | ||
| } | ||
| internal enum Movements : uint { | ||
| IsMoving8 = 0x38, | ||
| IsinCombatOffset1 = 0xF8, | ||
| IsinCombatOffset2 = 0xB4, | ||
| } | ||
| internal enum CastingInfo { | ||
| IsCasting = 0xA34, | ||
| ChanneledCasting = 0xA48, | ||
| BalancePower = 0x11DC, | ||
| BalanceState = 0xFA4, | ||
| } | ||
| internal enum Globals : uint { | ||
| Markers = 0xB33EF8, | ||
| SpellCooldDownPtr = 0xACD714, | ||
| PlayerName = 0x9BE820, | ||
| CurrentRealm = 0x9BE9AE, | ||
| #region GUID-s | ||
| PlayerGUID = 0x9BE818, | ||
| CurrentTargetGUID = 0xAD7448, | ||
| LastTargetGUID = 0xAD7450, | ||
| FocusTargetGUID = 0xAD7468, | ||
| MouseOverGUID = 0xAD7438, | ||
| PetGUID = 0xB43B60, | ||
| FollowGUID = 0x9D61D8, | ||
| Arena1GUID = 0xB36140, | ||
| Arena2GUID = Arena1GUID + 0x8, | ||
| Arena3GUID = Arena2GUID + 0x8, | ||
| Arena4GUID = Arena3GUID + 0x8, | ||
| Arena5GUID = Arena4GUID + 0x8, | ||
| PartyLeaderGUID = 0xB33370, | ||
| PartyMember1GUID = 0xB33350, | ||
| PartyMember2GUID = PartyMember1GUID + 0x8, | ||
| PartyMember3GUID = PartyMember2GUID + 0x8, | ||
| PartyMember4GUID = PartyMember3GUID + 0x8, | ||
| #endregion | ||
| #region ClientInfo | ||
| LootWindow = 0xB45230, | ||
| Timestamp = 0x9C0C7C, | ||
| BuildNumber = 0xAB4214, | ||
| GetMinimapZoneText = 0xAD7414, | ||
| GetZoneText = 0xAD741C, | ||
| GetSubZoneText = 0xAD7418, | ||
| GetZoneID = 0xAD74B0, | ||
| IsInGame = 0xAD7426, | ||
| ContinentID = 0x8A2710, | ||
| LastErrorMessage = 0xAD6828, | ||
| IsLoadingOrConnecting = 0xABB9AC, | ||
| GetCurrencyInfo = 0x914F48, | ||
| GetHomeBindAreaId = 0x9D4D7C, | ||
| #endregion | ||
| ComboPoints = 0xAD74F1, | ||
| Runes = 0xB36060, | ||
| PetSpellBookNumSpells = 0xB33CA4, | ||
| PetSpellBookNumSpellsPtr = 0xB33CA8, | ||
| SpellIsTargetting = 0xACD654, | ||
| SpellIsPending = 0xACD770, | ||
| ScriptGetLocale = 0x9732FC, | ||
| #region AddonInfo | ||
| GetNumInstalledAddons = 0x93A74C, | ||
| BaseAddons = 0x93A750, | ||
| #endregion | ||
| #region GuildInfo | ||
| TotalGuildMembers = 0xB35ECC, | ||
| GuildRosterInfoBase = 0xB35F64, | ||
| #endregion | ||
| #region Other | ||
| CursorType = 0x93D250, | ||
| MirrorTimer = 0xAD78D0, | ||
| #endregion | ||
| } | ||
| internal enum Descriptors : uint { | ||
| Class8 = 0x55, | ||
| Level = 0xB0, | ||
| Health = 0x58, | ||
| MaxHealth = 0x70, | ||
| Power = 0x5C, | ||
| HolyPower = 0x60, | ||
| SecondaryPower = 0x64, | ||
| MaxPower = 0x74, | ||
| TargetGUID = 0x40, | ||
| ShapeShift = 0x1C7, | ||
| Faction = 0xB4, | ||
| } | ||
| internal enum RaidMembers : uint { | ||
| TotalNumber=0xB3407C, | ||
| FirstRaidMemberAddress = 0xB33FD8, | ||
| NextRaidMemberAddres = 0x04, | ||
| } | ||
|
|
||
| internal enum Positions : uint { | ||
| X = 0x790, | ||
| Y = 0x794, | ||
| Z = 0x798, | ||
| Rotation = 0x7A0, | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,159 @@ | ||
| using Magic; | ||
| using Radar.Bellona.WoWModels; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.MemoryReading { | ||
| public class GameObject { | ||
| private UIntPtr baseAddress; | ||
| private UInt64 guid; | ||
| private UIntPtr descriptorArrayAddress; | ||
| private UIntPtr buffBigArrayAddress; | ||
| private UIntPtr buffSmallArrayAddress; | ||
| private UIntPtr movementArrayAddress; | ||
| private WoWUnit unit; | ||
| #region properties | ||
| public UIntPtr BaseAddress { | ||
| get { | ||
| return baseAddress; | ||
| } | ||
|
|
||
| set { | ||
| baseAddress = value; | ||
| } | ||
| } | ||
|
|
||
| public ulong GUID { | ||
| get { | ||
| return guid; | ||
| } | ||
|
|
||
| set { | ||
| guid = value; | ||
| } | ||
| } | ||
|
|
||
| public UIntPtr DescriptorArrayAddress { | ||
| get { | ||
| return descriptorArrayAddress; | ||
| } | ||
|
|
||
| set { | ||
| descriptorArrayAddress = value; | ||
| } | ||
| } | ||
|
|
||
| public UIntPtr BuffBigArrayAddress { | ||
| get { | ||
| return buffBigArrayAddress; | ||
| } | ||
|
|
||
| set { | ||
| buffBigArrayAddress = value; | ||
| } | ||
| } | ||
|
|
||
| public UIntPtr BuffSmallArrayAddress { | ||
| get { | ||
| return buffSmallArrayAddress; | ||
| } | ||
|
|
||
| set { | ||
| buffSmallArrayAddress = value; | ||
| } | ||
| } | ||
|
|
||
| internal WoWUnit Unit { | ||
| get { | ||
| return unit; | ||
| } | ||
|
|
||
| set { | ||
| unit = value; | ||
| } | ||
| } | ||
|
|
||
| public UIntPtr MovementArrayAddress { | ||
| get { | ||
| return movementArrayAddress; | ||
| } | ||
|
|
||
| set { | ||
| movementArrayAddress = value; | ||
| } | ||
| } | ||
| #endregion | ||
| #region constructors | ||
| public GameObject(GameObject other) { | ||
| this.BaseAddress = other.BaseAddress; | ||
| this.GUID = other.GUID; | ||
| this.DescriptorArrayAddress = other.DescriptorArrayAddress; | ||
| this.BuffBigArrayAddress = other.BuffBigArrayAddress; | ||
| this.BuffSmallArrayAddress = other.BuffSmallArrayAddress; | ||
| this.Unit = new WoWUnit(); | ||
| } | ||
| public GameObject(BlackMagic w, UIntPtr baddr) { | ||
| try { | ||
| this.BaseAddress = baddr; | ||
| this.GUID = w.ReadUInt64((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalGUID); | ||
| this.descriptorArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalDescriptorArray) + 0x10; | ||
| this.BuffBigArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalBuffBigArray) + 0x4; | ||
| this.BuffSmallArrayAddress = (UIntPtr)((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalBuffSmallArray); | ||
| this.MovementArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalMovementArray); | ||
| this.Unit = new WoWUnit(); | ||
| } | ||
| catch { | ||
| //Program.WowPrinter.Print(ConstStrings.GameObjectConstructorError); | ||
| this.Unit = new WoWUnit(); | ||
| } | ||
| } | ||
| public GameObject(BlackMagic w, UInt64 guid) { | ||
| try { | ||
| this.GUID = guid; | ||
| if (this.GUID != 0) { | ||
| GameObject TempObject = new GameObject(Initializer.FirstObject); | ||
| while ((uint)TempObject.BaseAddress != 0) { | ||
| if (TempObject.GUID == this.GUID) { | ||
| this.BaseAddress = TempObject.BaseAddress; | ||
| this.GUID = TempObject.GUID; | ||
| this.DescriptorArrayAddress = TempObject.DescriptorArrayAddress; | ||
| this.BuffBigArrayAddress = TempObject.BuffBigArrayAddress; | ||
| this.BuffSmallArrayAddress = TempObject.BuffSmallArrayAddress; | ||
| this.MovementArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalMovementArray); | ||
| this.RefreshUnit(w); | ||
| return; | ||
| } | ||
| else { | ||
| TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject))); | ||
| } | ||
| } | ||
| //Program.WowPrinter.Print(new Error(String.Format("Couldnt Find Gameobject with GUID 0x{0:X16}", guid))); | ||
| } | ||
| this.Unit = new WoWUnit(); | ||
|
|
||
| } | ||
| catch { | ||
| this.Unit = new WoWUnit(); | ||
| //Program.WowPrinter.Print(ConstStrings.GameObjectConstructorError); | ||
| } | ||
| } | ||
| #endregion | ||
| public void RefreshUnit(BlackMagic w) { | ||
| if (this.BaseAddress != (UIntPtr)0) { | ||
| this.Unit = new WoWUnit(w, this); | ||
| } | ||
| } | ||
| public static bool HPMin(ref GameObject minimum, GameObject next) { | ||
| if (next.GUID == 0 || minimum.unit.GetHealthPercent() < next.Unit.GetHealthPercent()) { | ||
| return false; | ||
| } | ||
| else{ | ||
| minimum = next; | ||
| return true; | ||
| } | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,36 @@ | ||
| using Magic; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.MemoryReading { | ||
| class Initializer { | ||
| public static GameObject FirstObject; | ||
|
|
||
| public static bool ConnectToGame(out BlackMagic w, string title) { | ||
| w = new BlackMagic(); | ||
| try { | ||
| if (!w.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle(title))) { | ||
| return false; | ||
| } | ||
| Console.WriteLine("Process found..."); | ||
| uint ObjMgrAddr = w.ReadUInt(w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.ObjectManager.CurMgrPointer) + (uint)ConstOffsets.ObjectManager.CurMgrOffset); | ||
| Console.WriteLine("Object Manager found... at x{0:X}",ObjMgrAddr); | ||
| FirstObject = new GameObject(w,(UIntPtr)w.ReadUInt(ObjMgrAddr + (uint)ConstOffsets.ObjectManager.FirstObject)); | ||
| Console.WriteLine("First Object found..."); | ||
| return true; | ||
|
|
||
| } | ||
| catch { | ||
| return false; | ||
| } | ||
| } | ||
| public static void RefreshObjectMangaer(BlackMagic w) { | ||
| uint ObjMgrAddr = w.ReadUInt(w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.ObjectManager.CurMgrPointer) + (uint)ConstOffsets.ObjectManager.CurMgrOffset); | ||
| FirstObject = new GameObject(w, (UIntPtr)w.ReadUInt(ObjMgrAddr + (uint)ConstOffsets.ObjectManager.FirstObject)); | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,121 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels { | ||
| [Flags] | ||
| public enum MarkerType { | ||
| none = 0, | ||
| star = 1, | ||
| circle = 2, | ||
| diamond = 3, | ||
| triagle = 4, | ||
| moon = 5, | ||
| square = 6, | ||
| cross = 7, | ||
| skull = 8, | ||
| } | ||
| public class MarkerGUIDs { | ||
| private ulong starGUID = 0; | ||
| private ulong circleGUID = 0; | ||
| private ulong diamondGUID = 0; | ||
| private ulong triagleGUID = 0; | ||
| private ulong moonGUID = 0; | ||
| private ulong squareGUID = 0; | ||
| private ulong crossGUID = 0; | ||
| private ulong skullGUID = 0; | ||
|
|
||
| public ulong StarGUID { | ||
| get { | ||
| return starGUID; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public ulong CircleGUID { | ||
| get { | ||
| return circleGUID; | ||
| } | ||
| } | ||
|
|
||
| public ulong DiamondGUID { | ||
| get { | ||
| return diamondGUID; | ||
| } | ||
| } | ||
|
|
||
| public ulong TriagleGUID { | ||
| get { | ||
| return triagleGUID; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public ulong MoonGUID { | ||
| get { | ||
| return moonGUID; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public ulong SquareGUID { | ||
| get { | ||
| return squareGUID; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public ulong CrossGUID { | ||
| get { | ||
| return crossGUID; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public ulong SkullGUID { | ||
| get { | ||
| return skullGUID; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public MarkerGUIDs(byte[] markerarray) { | ||
| if (markerarray.Length != 64) { | ||
| throw new ArgumentOutOfRangeException(); | ||
| } | ||
| starGUID = BitConverter.ToUInt64(markerarray, 0); | ||
| circleGUID = BitConverter.ToUInt64(markerarray, 8); | ||
| diamondGUID = BitConverter.ToUInt64(markerarray, 16); | ||
| triagleGUID = BitConverter.ToUInt64(markerarray, 24); | ||
| moonGUID = BitConverter.ToUInt64(markerarray, 32); | ||
| squareGUID = BitConverter.ToUInt64(markerarray, 40); | ||
| crossGUID = BitConverter.ToUInt64(markerarray, 48); | ||
| skullGUID = BitConverter.ToUInt64(markerarray, 56); | ||
| } | ||
| public ulong getGUIDByMarkerType(MarkerType mt) { | ||
| switch (mt) { | ||
| case MarkerType.star: | ||
| return this.StarGUID; | ||
| case MarkerType.circle: | ||
| return this.CircleGUID; | ||
| case MarkerType.diamond: | ||
| return this.DiamondGUID; | ||
| case MarkerType.triagle: | ||
| return this.TriagleGUID; | ||
| case MarkerType.moon: | ||
| return this.MoonGUID; | ||
| case MarkerType.square: | ||
| return this.SquareGUID; | ||
| case MarkerType.cross: | ||
| return this.CrossGUID; | ||
| case MarkerType.skull: | ||
| return this.SkullGUID; | ||
| default: | ||
| return 0; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,99 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels { | ||
| class MovementFlags { | ||
| private bool isMoving; | ||
| private bool isMovingForward; | ||
| private bool isMovingBackward; | ||
| private bool isMovingStraightLeft; | ||
| private bool isMovingStraightRight; | ||
| private bool isTurningLeft; | ||
| private bool isTurningRight; | ||
|
|
||
| public bool IsMoving { | ||
| get { | ||
| return isMoving; | ||
| } | ||
|
|
||
| set { | ||
| isMoving = value; | ||
| } | ||
| } | ||
|
|
||
| public bool IsMovingForward { | ||
| get { | ||
| return isMovingForward; | ||
| } | ||
|
|
||
| set { | ||
| isMovingForward = value; | ||
| } | ||
| } | ||
|
|
||
| public bool IsMovingBackward { | ||
| get { | ||
| return isMovingBackward; | ||
| } | ||
|
|
||
| set { | ||
| isMovingBackward = value; | ||
| } | ||
| } | ||
|
|
||
| public bool IsMovingStraightLeft { | ||
| get { | ||
| return isMovingStraightLeft; | ||
| } | ||
|
|
||
| set { | ||
| isMovingStraightLeft = value; | ||
| } | ||
| } | ||
|
|
||
| public bool IsMovingStraightRight { | ||
| get { | ||
| return isMovingStraightRight; | ||
| } | ||
|
|
||
| set { | ||
| isMovingStraightRight = value; | ||
| } | ||
| } | ||
|
|
||
| public bool IsTurningLeft { | ||
| get { | ||
| return isTurningLeft; | ||
| } | ||
|
|
||
| set { | ||
| isTurningLeft = value; | ||
| } | ||
| } | ||
|
|
||
| public bool IsTurningRight { | ||
| get { | ||
| return isTurningRight; | ||
| } | ||
|
|
||
| set { | ||
| isTurningRight = value; | ||
| } | ||
| } | ||
| public MovementFlags() { | ||
|
|
||
| } | ||
| public MovementFlags(byte flagByte) { | ||
| IsMoving = flagByte != 0; | ||
| IsMovingForward = (flagByte & 0x01) != 0; //2^0=1 | ||
| IsMovingBackward = (flagByte & 0x02) != 0; //2^1=2 | ||
| IsMovingStraightLeft = (flagByte & 0x04) != 0; //2^2=4 | ||
| IsMovingStraightRight = (flagByte & 0x08) != 0; //2^3=8 | ||
| IsTurningLeft = (flagByte & 0x10) != 0; //2^4=16 | ||
| IsTurningRight = (flagByte & 0x20) != 0; //2^4=32 | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,30 @@ | ||
| using Radar.Bellona.Controller; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| public class Curse : DoT { | ||
| private const uint cot = 1714; | ||
| private const uint cote = 1490; | ||
| private const uint cow = 702; | ||
| private const uint coe = 18223; | ||
| public Curse(uint i) : base(i) { | ||
|
|
||
| } | ||
| public Curse(uint i, ConstController.WindowsVirtualKey kb) : base(i, kb) { | ||
|
|
||
| } | ||
| public override bool ReCast(WoWGlobal wowinfo, WoWUnit unit) { | ||
| if (!unit.HasBuff(cot) && !unit.HasBuff(cote) && !unit.HasBuff(cow) && !unit.HasBuff(coe)) { | ||
| this.SendCast(); | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,66 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| [Flags] | ||
| public enum RuneType { | ||
| Blood = 0, | ||
| Unholy = 1, | ||
| Frost = 2, | ||
| } | ||
| public class DKSpellRuneCost { | ||
| private List<Rune> costs; | ||
|
|
||
| internal List<Rune> Costs { | ||
| get { | ||
| return costs; | ||
| } | ||
|
|
||
| set { | ||
| costs = value; | ||
| } | ||
| } | ||
|
|
||
| public DKSpellRuneCost(Rune r1) { | ||
| this.Costs = new List<Rune>(); | ||
| this.Costs.Add(r1); | ||
| } | ||
| public DKSpellRuneCost(Rune r1, Rune r2) { | ||
| this.Costs = new List<Rune>(); | ||
| this.Costs.Add(r1); | ||
| this.Costs.Add(r2); | ||
| } | ||
| } | ||
| public class Rune { | ||
| private RuneType type; | ||
| private uint cost; | ||
|
|
||
| public RuneType Type { | ||
| get { | ||
| return type; | ||
| } | ||
|
|
||
| set { | ||
| type = value; | ||
| } | ||
| } | ||
|
|
||
| public uint Cost { | ||
| get { | ||
| return cost; | ||
| } | ||
|
|
||
| set { | ||
| cost = value; | ||
| } | ||
| } | ||
|
|
||
| public Rune(RuneType t, uint c) { | ||
| this.Type = t; | ||
| this.Cost = c; | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,38 @@ | ||
| using Radar.Bellona.Controller; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| class DKRuneSpell : DoT { | ||
| private DKSpellRuneCost cost; | ||
|
|
||
| public DKRuneSpell(uint i, DKSpellRuneCost c) : base(i) { | ||
| this.cost = c; | ||
| } | ||
| public DKRuneSpell(uint i, ConstController.WindowsVirtualKey kb, DKSpellRuneCost c) : base(i, kb) { | ||
| this.cost = c; | ||
| } | ||
| public override bool ReCast(WoWGlobal wowinfo, WoWUnit unit) { | ||
| if (!unit.HasBuff(this.ID) && !wowinfo.SpellIsPending && wowinfo.HasRunesFor(cost)) { | ||
| this.SendCast(); | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| public bool CastIfHasRunesFor(WoWGlobal wowinfo) { | ||
| if (wowinfo.HasRunesFor(cost)) { | ||
| this.SendCast(); | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,11 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| class DKRunicPowerSpell { | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,26 @@ | ||
| using Radar.Bellona.Controller; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| public class DoT : Spell { | ||
| public DoT(uint i) : base(i) { | ||
|
|
||
| } | ||
| public DoT(uint i, ConstController.WindowsVirtualKey kb) : base(i, kb) { | ||
|
|
||
| } | ||
| public virtual bool ReCast(WoWGlobal wowinfo, WoWUnit unit) { | ||
| if (!unit.HasBuff(this.ID) /*&& !wowinfo.SpellIsPending*/) { | ||
| this.SendCast(); | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,42 @@ | ||
| using Radar.Bellona.Controller; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| public class Spell { | ||
| private uint id; | ||
| private ConstController.WindowsVirtualKey keybind; | ||
| //Bela | ||
| public uint ID { | ||
| get { | ||
| return id; | ||
| } | ||
|
|
||
| set { | ||
| id = value; | ||
| } | ||
| } | ||
| public Spell(uint i) { | ||
| this.ID = i; | ||
|
|
||
| } | ||
| public Spell(uint i, ConstController.WindowsVirtualKey kb) { | ||
| this.ID = i; | ||
| this.keybind = kb; | ||
| } | ||
| public void SendCast() { | ||
| SendKey.Send(this.keybind); | ||
| } | ||
|
|
||
| public bool CastIfHasBuff(WoWGlobal wowinfo, WoWUnit unit) { | ||
| if (unit.HasBuff(this.ID)) { | ||
| this.SendCast(); | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,18 @@ | ||
| using Radar.Bellona.Controller; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels.Spells { | ||
| class SpellWithCooldown : Spell{ | ||
| private System.Threading.Timer cooldownTimer; | ||
| private int cooldown; | ||
| private bool isitReady; | ||
| public SpellWithCooldown(uint i, ConstController.WindowsVirtualKey kb, int cooldown) : base(i, kb) { | ||
| this.cooldown = cooldown; | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,147 @@ | ||
| using Magic; | ||
| using Radar.Bellona.MemoryReading; | ||
| using Radar.Bellona.WoWModels.Spells; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels { | ||
|
|
||
| public class WoWGlobal { | ||
| private UInt64 playerGUID; | ||
| private UInt64 targetGUID; | ||
| private UInt64 focusGUID; | ||
| private byte comboPoints; | ||
| private byte runes; | ||
| private bool spellIsPending; | ||
| private MarkerGUIDs markers; | ||
| #region properties | ||
| public ulong PlayerGUID { | ||
| get { | ||
| return playerGUID; | ||
| } | ||
|
|
||
| set { | ||
| playerGUID = value; | ||
| } | ||
| } | ||
|
|
||
| public ulong TargetGUID { | ||
| get { | ||
| return targetGUID; | ||
| } | ||
|
|
||
| set { | ||
| targetGUID = value; | ||
| } | ||
| } | ||
|
|
||
| public ulong FocusGUID { | ||
| get { | ||
| return focusGUID; | ||
| } | ||
|
|
||
| set { | ||
| focusGUID = value; | ||
| } | ||
| } | ||
|
|
||
| public byte ComboPoints { | ||
| get { | ||
| return comboPoints; | ||
| } | ||
|
|
||
| set { | ||
| comboPoints = value; | ||
| } | ||
| } | ||
|
|
||
| public bool SpellIsPending { | ||
| get { | ||
| return spellIsPending; | ||
| } | ||
|
|
||
| set { | ||
| spellIsPending = value; | ||
| } | ||
| } | ||
|
|
||
| public MarkerGUIDs Markers { | ||
| get { | ||
| return markers; | ||
| } | ||
|
|
||
| set { | ||
| markers = value; | ||
| } | ||
| } | ||
| #endregion | ||
| public WoWGlobal(BlackMagic w) { | ||
| this.Refresh(w); | ||
| } | ||
| public void Refresh(BlackMagic w) { | ||
| try { | ||
| this.PlayerGUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PlayerGUID); | ||
| this.TargetGUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.CurrentTargetGUID); | ||
| this.FocusGUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.FocusTargetGUID); | ||
| this.ComboPoints = w.ReadByte((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.ComboPoints); | ||
| this.SpellIsPending = !(w.ReadByte((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.SpellIsPending) == 0); | ||
| this.runes = w.ReadByte((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.Runes); | ||
| this.Markers = new MarkerGUIDs(w.ReadBytes((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.Markers,64)); | ||
| } | ||
| catch { | ||
|
|
||
| } | ||
| } | ||
| public bool HasRunesFor(DKSpellRuneCost dkspc) { | ||
| foreach (Rune r in dkspc.Costs) { | ||
| if (!HasRune(r)) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| } | ||
| private bool HasRune(Rune r) { | ||
| switch (r.Type) { | ||
| case RuneType.Blood: | ||
| if (r.Cost <= GetBloodRunes()) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| case RuneType.Frost: | ||
| if (r.Cost <= GetFrostRunes()) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| case RuneType.Unholy: | ||
| if (r.Cost <= GetUnholyRunes()) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| return false; | ||
| } | ||
| public int GetBloodRunes() { | ||
| int temp = this.runes & 0x03; | ||
| return Convert.ToString(temp, 2).ToCharArray().Count(c => c == '1'); | ||
|
|
||
| } | ||
| public int GetFrostRunes() { | ||
| int temp = this.runes & 0x30; | ||
| return Convert.ToString(temp, 2).ToCharArray().Count(c => c == '1'); | ||
| } | ||
| public int GetUnholyRunes() { | ||
| int temp = this.runes & 0x0C; | ||
| return Convert.ToString(temp, 2).ToCharArray().Count(c => c == '1'); | ||
| } | ||
| } | ||
|
|
||
| } |
| @@ -0,0 +1,64 @@ | ||
| using Magic; | ||
| using Radar.Bellona.MemoryReading; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels { | ||
| [Flags] | ||
| public enum PartyMembers : uint { | ||
| Player = 0, | ||
| PartyMember1 = 1, | ||
| PartyMember2 = 2, | ||
| PartyMember3 = 3, | ||
| PartyMember4 = 4, | ||
| } | ||
| class WoWParty { | ||
| private List<UInt64> party= new List<UInt64>(); | ||
|
|
||
|
|
||
| public WoWParty(BlackMagic w) { | ||
| this.Refresh(w); | ||
| } | ||
|
|
||
| public List<ulong> Party { | ||
| get { | ||
| return party; | ||
| } | ||
|
|
||
| set { | ||
| party = value; | ||
| } | ||
| } | ||
| private void Refresh(BlackMagic w) { | ||
| UInt64 PartyMember1GUID = 0; | ||
| UInt64 PartyMember2GUID = 0; | ||
| UInt64 PartyMember3GUID = 0; | ||
| UInt64 PartyMember4GUID = 0; | ||
| try { | ||
| PartyMember1GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember1GUID); | ||
| PartyMember2GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember2GUID); | ||
| PartyMember3GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember3GUID); | ||
| PartyMember4GUID = w.ReadUInt64((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.Globals.PartyMember4GUID); | ||
| } | ||
| catch { | ||
| } | ||
| finally { | ||
| if (PartyMember1GUID != 0) { | ||
| Party.Add(PartyMember1GUID); | ||
| if (PartyMember2GUID != 0) { | ||
| Party.Add(PartyMember2GUID); | ||
| if (PartyMember3GUID != 0) { | ||
| Party.Add(PartyMember3GUID); | ||
| if (PartyMember4GUID != 0) { | ||
| Party.Add(PartyMember4GUID); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,59 @@ | ||
| using Magic; | ||
| using Radar.Bellona.MemoryReading; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Radar.Bellona.WoWModels { | ||
| [Flags] | ||
| public enum RaidMembers : uint { | ||
| RaidMember1 = 1, | ||
| RaidMember2 = 2, | ||
| RaidMember3 = 3, | ||
| RaidMember4 = 4, | ||
| RaidMember5 = 5, | ||
| RaidMember6 = 6, | ||
| RaidMember7 = 7, | ||
| RaidMember8 = 8, | ||
| RaidMember9 = 9, | ||
| RaidMember10 = 10, | ||
| } | ||
| class WoWRaid { | ||
| private uint raidmembercount; | ||
| private List<UInt64> raidMembers= new List<UInt64>(); | ||
| public WoWRaid(BlackMagic w) { | ||
| this.Refresh(w); | ||
| } | ||
|
|
||
| public uint Raidmembercount { | ||
| get { | ||
| return raidmembercount; | ||
| } | ||
|
|
||
| set { | ||
| raidmembercount = value; | ||
| } | ||
| } | ||
|
|
||
| public List<UInt64> RaidMembers { | ||
| get { | ||
| return raidMembers; | ||
| } | ||
|
|
||
| set { | ||
| raidMembers = value; | ||
| } | ||
| } | ||
|
|
||
| private void Refresh(BlackMagic w) { | ||
| Raidmembercount = w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.RaidMembers.TotalNumber); | ||
| RaidMembers.Clear(); | ||
| for (uint i = 0; i < Raidmembercount; i++) { | ||
| uint tempaddr=w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.RaidMembers.FirstRaidMemberAddress + i*(uint)ConstOffsets.RaidMembers.NextRaidMemberAddres); | ||
| RaidMembers.Add(w.ReadUInt64(tempaddr)); | ||
| } | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,21 @@ | ||
| using Microsoft.Xna.Framework; | ||
| using Radar.Bellona.MemoryReading; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
|
|
||
| namespace Radar { | ||
| public class RadarPlayer : RadarUnit { | ||
| private bool selected = false; | ||
| public RadarPlayer(Vector2 pos, Color color) : base (pos, color) { | ||
|
|
||
| } | ||
| public RadarPlayer(GameObject go) : base(new Vector2(go.Unit.Position.X,go.Unit.Position.Y), (float)go.Unit.Rotation, go.Unit.WowClass) { | ||
| selected = true; | ||
| } | ||
| public RadarPlayer(GameObject go, int rot) : base(new Vector2(go.Unit.Position.X, go.Unit.Position.Y), (float)rot, go.Unit.WowClass) { | ||
| selected = true; | ||
| } | ||
| } | ||
| } |
| @@ -4,19 +4,5 @@ | ||
| using System.Text; | ||
|
|
||
| namespace Radar { | ||
|
|
||
| } | ||