Every time I tried to cast AOE spells at my position, I got an (out of range) error
Here is my code (c#)
Code:
ClickTerrain(ObjectManager.LocalPlayer.XPosition, ObjectManager.LocalPlayer.YPosition, ObjectManager.LocalPlayer.ZPosition);
Code:
public static void ClickTerrain(float X, float Y, float Z)
{
BlackMagic wow = new BlackMagic();
wow.OpenProcessAndThread(SProcess.GetProcessFromProcessName("Wow"));
uint Address = wow.AllocateMemory(20);
wow.WriteBytes(Address, BitConverter.GetBytes(0));
wow.WriteBytes(Address + 4, BitConverter.GetBytes(0));
wow.WriteBytes(Address + 8, BitConverter.GetBytes(X));
wow.WriteBytes(Address + 12, BitConverter.GetBytes(Y));
wow.WriteBytes(Address + 0x10, BitConverter.GetBytes(Z));
wow.Asm.Clear();
string[] asm = new string[] {
"nop",
"nop",
"mov eax, " + Address,
"push eax",
"call " + ((((uint)wow.MainModule.BaseAddress) + 0x4393c0)),
"add esp, 4",
"retn"
};
foreach (string str in asm)
{
wow.Asm.AddLine(str);
}
wow.Asm.InjectAndExecute(Address);
wow.FreeMemory(Address);
wow.Close();
}
I got the player position in this way : Wow.ReadFloat(PlayerBase +0x800);
And I'm sure i got the right position such as (1835.851 -4438.183 108.5703)
I guess the ClickTerrain code is right, but I don't know how did the (out of range) error message come
EDIT: SOLVED