Large diffs are not rendered by default.

@@ -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));
}
}
}
}

Large diffs are not rendered by default.

@@ -55,10 +55,19 @@ public ExtendedSpriteBatch(GraphicsDevice graphicsDevice)
public void DrawUnit(RadarUnit nUnit, Texture2D nTexture) {
this.Draw(nTexture, nUnit.Position, null, nUnit.DrawColor, (float)(nUnit.Rotation-Math.PI / 2), new Vector2(nTexture.Width / 2, nTexture.Height / 2), 0.08f, SpriteEffects.None, 0f);
}
public void DrawPlayer(RadarPlayer nUnit, Texture2D nTexture, Vector2 nPlayerPos) {

this.Draw(nTexture, new Vector2(-2*(nUnit.Position.Y - nPlayerPos.Y) + this.GraphicsDevice.Viewport.Width / 2, -2*(nUnit.Position.X - nPlayerPos.X) + this.GraphicsDevice.Viewport.Height / 2), null, nUnit.DrawColor, (float)(-nUnit.Rotation - Math.PI / 2), new Vector2(nTexture.Width / 2, nTexture.Height / 2), 0.08f, SpriteEffects.None, 0f);
}
public void DrawUnits(List<RadarUnit> nUnitlist, Texture2D nTexture) {
foreach (RadarUnit u in nUnitlist) {
this.DrawUnit(u, nTexture);
}
}
public void DrawPlayers(List<RadarPlayer> nUnitlist, Texture2D nTexture, Vector2 nPlayerPos) {
foreach (RadarPlayer u in nUnitlist) {
this.DrawPlayer(u, nTexture, nPlayerPos);
}
}
}
}
@@ -8,6 +8,9 @@
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Radar.Bellona.WoWModels;
using Magic;
using Radar.Bellona.MemoryReading;

namespace Radar {
/// <summary>
@@ -17,14 +20,21 @@ public class Game1 : Microsoft.Xna.Framework.Game {
GraphicsDeviceManager graphics;
ExtendedSpriteBatch spriteBatch;
public Texture2D UnitTexture;
private Rectangle TitleSafe;
public Texture2D SpellTexture;
private MouseState mouse = new MouseState();
private Vector2 pos = new Vector2();
private Vector2 startPoint = new Vector2();
private Rectangle selectionBox = new Rectangle();
private List<RadarUnit> unitsToDraw = new List<RadarUnit>();
private List<RadarPlayer> unitsToDraw = new List<RadarPlayer>();
private List<RadarPlayer> spellsToDraw = new List<RadarPlayer>();

private BlackMagic wow;
private Vector2 PlayerPos;
private static WoWGlobal clientInfo;
private bool selecting;
private bool drawthisshit;
private TimeSpan bela = TimeSpan.Zero;
private TimeSpan gyula = TimeSpan.Zero;

public Game1() {
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
@@ -38,9 +48,19 @@ public class Game1 : Microsoft.Xna.Framework.Game {
/// </summary>
protected override void Initialize() {
// TODO: Add your initialization logic here
unitsToDraw.Add(new RadarUnit(new Vector2(200, 300), WoWClass.Mage));
unitsToDraw.Add(new RadarUnit(new Vector2(500, 300), WoWClass.Rogue));
if (!Initializer.ConnectToGame(out wow, Program.PROCESS_WINDOW_TITLE)) {
throw new Exception("No compatible Client");
}
clientInfo = new WoWGlobal(wow);
base.Initialize();
Vector3 beluka = new GameObject(wow, clientInfo.PlayerGUID).Unit.Position;
PlayerPos = new Vector2(beluka.X, beluka.Y);

Bellona.EveryoneGetinHere.RefreshNearbyGameObjects(PlayerPos, wow, 500);

Bellona.EveryoneGetinHere.RefreshNewGameObjects(PlayerPos, wow);

System.Diagnostics.Debug.WriteLine("LOL");
}

/// <summary>
@@ -51,6 +71,7 @@ public class Game1 : Microsoft.Xna.Framework.Game {
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new ExtendedSpriteBatch(GraphicsDevice);
UnitTexture = Content.Load<Texture2D>("arrow");
SpellTexture = Content.Load<Texture2D>("run");
//TitleSafe = GetTitleSafeArea(.8f);
//pos.X = GraphicsDevice.Viewport.Width / 2;
//pos.Y = GraphicsDevice.Viewport.Height / 2;
@@ -72,8 +93,35 @@ public class Game1 : Microsoft.Xna.Framework.Game {
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime) {
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) {
this.Exit();
}
SelectionBoxRefresh();
if ((gameTime.TotalGameTime - this.gyula) > TimeSpan.FromMilliseconds(750)) {
this.gyula = gameTime.TotalGameTime;
//Bellona.EveryoneGetinHere.RefreshNearbyGameObjects(PlayerPos, wow, 50);
Bellona.EveryoneGetinHere.RefreshNewGameObjects(PlayerPos, wow);
}
if ((gameTime.TotalGameTime - this.bela) > TimeSpan.FromMilliseconds(125)) {
this.bela = gameTime.TotalGameTime;
WoWRaid wr = new WoWRaid(wow);
Vector3 beluka = new GameObject(wow, clientInfo.PlayerGUID).Unit.Position;
PlayerPos = new Vector2(beluka.X, beluka.Y);
Console.WriteLine(Bellona.EveryoneGetinHere.NearbyGameObjects.Count + " " + Bellona.EveryoneGetinHere.newGameObjects.Count);
unitsToDraw.Clear();
foreach (GameObject go in Bellona.EveryoneGetinHere.NearbyGameObjects) {
go.Unit.RefreshForRadar(wow, go);
unitsToDraw.Add(new RadarPlayer(go));
}
spellsToDraw.Clear();
foreach (GameObject go in Bellona.EveryoneGetinHere.newGameObjects) {
spellsToDraw.Add(new RadarPlayer(go,0));
}
}
base.Update(gameTime);
}

private void SelectionBoxRefresh() {
mouse = Mouse.GetState();
if (mouse.LeftButton == ButtonState.Pressed) {
if (selecting) {
@@ -97,9 +145,6 @@ public class Game1 : Microsoft.Xna.Framework.Game {
drawthisshit = false;
selecting = false;
}
// TODO: Add your update logic here

base.Update(gameTime);
}

/// <summary>
@@ -114,7 +159,8 @@ public class Game1 : Microsoft.Xna.Framework.Game {
if (drawthisshit) {
spriteBatch.DrawRectangle(selectionBox, Color.Red);
}
spriteBatch.DrawUnits(unitsToDraw, UnitTexture);
spriteBatch.DrawPlayers(unitsToDraw, UnitTexture, PlayerPos);
spriteBatch.DrawPlayers(spellsToDraw, SpellTexture, PlayerPos);
spriteBatch.End();
base.Draw(gameTime);
}

This file was deleted.

@@ -4,6 +4,7 @@ namespace Radar {
#if WINDOWS || XBOX
static class Program
{
public static string PROCESS_WINDOW_TITLE = "World of Warcraft";
/// <summary>
/// The main entry point for the application.
/// </summary>
@@ -60,6 +60,12 @@
<XnaCompressContent>true</XnaCompressContent>
</PropertyGroup>
<ItemGroup>
<Reference Include="BlackMagic">
<HintPath>..\..\..\..\Refs\BlackMagic.dll</HintPath>
</Reference>
<Reference Include="fasmdll_managed">
<HintPath>..\..\..\..\Refs\fasmdll_managed.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
@@ -72,12 +78,31 @@
<Reference Include="System.Net" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bellona\Controller\ConstController.cs" />
<Compile Include="Bellona\Controller\SendKey.cs" />
<Compile Include="Bellona\EveryoneGetinHere.cs" />
<Compile Include="Bellona\MemoryReading\ConstOffsets.cs" />
<Compile Include="Bellona\MemoryReading\GameObject.cs" />
<Compile Include="Bellona\MemoryReading\Initializer.cs" />
<Compile Include="Bellona\WoWModels\MarkerGUIDs.cs" />
<Compile Include="Bellona\WoWModels\MovementFlags.cs" />
<Compile Include="Bellona\WoWModels\Spells\Curse.cs" />
<Compile Include="Bellona\WoWModels\Spells\DKModels.cs" />
<Compile Include="Bellona\WoWModels\Spells\DKRuneSpell.cs" />
<Compile Include="Bellona\WoWModels\Spells\DKRunicPowerSpell.cs" />
<Compile Include="Bellona\WoWModels\Spells\DoT.cs" />
<Compile Include="Bellona\WoWModels\Spells\Spell.cs" />
<Compile Include="Bellona\WoWModels\Spells\SpellWithCooldown.cs" />
<Compile Include="Bellona\WoWModels\WoWGlobal.cs" />
<Compile Include="Bellona\WoWModels\WoWParty.cs" />
<Compile Include="Bellona\WoWModels\WoWRaid.cs" />
<Compile Include="Bellona\WoWModels\WoWUnit.cs" />
<Compile Include="ExtendedSpriteBatch.cs" />
<Compile Include="Player.cs" />
<Compile Include="RadarModels\RadarPlayer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Program.cs" />
<Compile Include="Game1.cs" />
<Compile Include="Unit.cs" />
<Compile Include="RadarModels\RadarUnit.cs" />
<Compile Include="WowModels.cs" />
</ItemGroup>
<ItemGroup>
@@ -109,6 +134,9 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<!--
@@ -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,13 +4,15 @@
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Radar.Bellona.WoWModels;

namespace Radar {
public class RadarUnit {
private Color drawColor;
private Vector2 position;
private float rotation;
private uint baseaddr;

#region properties
public Color DrawColor {
get {
return drawColor;
@@ -40,6 +42,7 @@ public class RadarUnit {
rotation = value;
}
}
#endregion

public RadarUnit(Vector2 pos, Color color) {
this.DrawColor = color;
@@ -51,15 +54,16 @@ public class RadarUnit {
this.Position = pos;
this.Rotation = 0f;
}
public RadarUnit(ulong guid) {

public RadarUnit(Vector2 pos, float rot, WoWClass wclass) {
this.DrawColor = RadarUnit.GetColorFromWoWClass(wclass);
this.Position = pos;
this.Rotation = rot;
}


public static Color GetColorFromWoWClass(WoWClass wclass) {
switch (wclass) {
case WoWClass.None:
return Color.Black;
return Color.White;
case WoWClass.DeathKnight:
return new Color(0.77f, 0.12f, 0.23f);
case WoWClass.Druid:
@@ -4,19 +4,5 @@
using System.Text;

namespace Radar {
public enum WoWClass : uint {
None = 0,
Warrior = 1,
Paladin = 2,
Hunter = 3,
Rogue = 4,
Priest = 5,
DeathKnight = 6,
Shaman = 7,
Mage = 8,
Warlock = 9,
Druid = 11,
}
class WowModels {
}

}