Hey guys...
I'm totally confused,maybe someone could give me a hint about it.
Here's my codes
Code:
public enum CTMType : uint
{
FaceTarget = 0x1,
FaceDestination = 0x2,
Stop_ThrowsException = 0x3,
MoveTo = 0x4,
InteractNPC = 0x5,
Loot = 0x6,
InteractObject = 0x7,
FaceOther = 0x8,
Skin = 0x9,
Attack = 0x10,
AttackPosition = 0xA,
AttackGuid = 0xB,
ConstantFace = 0xC,
None = 0xD,
Idle = 0x13
}
public enum CTMStruct : uint
{
ctmBase = 0x9D4A08,
ctmTurnScale = ctmBase + 0x4,
ctmStopDistance = ctmBase + 0xC,
ctmAngle = ctmBase + 0x14,
ctmAction = ctmBase + 0x1C,
ctmGuid = ctmBase + 0x20,
DestinationX = ctmBase + 0x8C,
DestinationY = ctmBase + 0x90,
DestinationZ = ctmBase + 0x94,
ctmActivatePointer = 0xAD5E6C,
ctmActivateOffset = 0x30
}
And
Code:
public void ClickToMove(float x, float y, float z,float distance, ulong targetGuid, Offsets.CTMType type)
{
IntPtr Action = IntPtr.Add(Manager.WoWBaseAddress, (int)Offsets.CTMStruct.ctmAction);
IntPtr Distance = IntPtr.Add(Manager.WoWBaseAddress, (int)Offsets.CTMStruct.ctmStopDistance);
IntPtr X = IntPtr.Add(Manager.WoWBaseAddress, (int)Offsets.CTMStruct.DestinationX);
IntPtr Y = IntPtr.Add(Manager.WoWBaseAddress, (int)Offsets.CTMStruct.DestinationY);
IntPtr Z = IntPtr.Add(Manager.WoWBaseAddress, (int)Offsets.CTMStruct.DestinationZ);
IntPtr GUID = IntPtr.Add(Manager.WoWBaseAddress, (int)Offsets.CTMStruct.ctmGuid);
if (distance != 0)
{
Manager.Write<float>(Distance, distance);
}
if (x != 0)
{
Manager.Write<float>(X, x);
}
if (y != 0)
{
Manager.Write<float>(Y, y);
}
if (z != 0)
{
Manager.Write<float>(Z, z);
}
if (targetGuid != 0)
{
Manager.Write<ulong>(GUID, targetGuid);
}
Manager.Write<int>(Action, (int)type);
}
with the codes above when i call
Code:
ClickToMove(0, 0, 0, 0, OM.Me.TargetGUID, Offsets.CTMType.InteractNPC);
it works just fine!
but when i use CTM like this
Code:
private void bGOInteract_Click(object sender, EventArgs e)
{
int i = lbGameObjects.SelectedIndex;
if (i == -1)
return;
GameObject obj = OM.GameObjects[i];
OM.Me.ClickToMove(0, 0, 0, 3, obj.GUID, Offsets.CTMType.InteractObject);
}
my character just walk to the mine i chosen and stood within the distance i used here(3f).
the question here is how can i get my character do the mining job?