Greetings!
Excuse my poor English, I'm Ukrainian
First of all I’d like to mention my reading thoroughly all the topics which did not result in solving my problem. That’s why I’m asking.
While studding topics concerning CTM I’ve figured out the following manner of CTM action:
- coords of destination point should be placed to CTM_Base + X_Offset/Y_Offset or GUID of mob/NPC/object to interact should be placed to CTM_Base + GUID_Offset
- fill the CTM_Base + Action_Type_Offset with the action type to proceed.
This works perfectly with running. I put destination coords to appropriate place, put 4 into CTM_Base + Action_Type_Offset and character hops to desired point. But unfortunately this does not work for any other action type.
For instance if I put mob’s GUID to attack into CTM_Base + GUID_Offset GUID, then I put 0xB to CTM_Base + Action_Type_Offset, but the character do not react in any way. Neither with looting nor skinning.
Scanning memory starting from CTM_Base I’ve noted the value in CTM_Base + 0x24 to change on manual target clicking. Putting the same value to memory makes the character to behave desired way perfectly.
As a result the following code do not work:
WriteUInt(CTM_Base + 0x20, TargetGUID);
WriteInt(CTM_Base + 0x1C, 0xB);
But the following code appears to work:
WriteUInt(CTM_Base + 0x20, TargetGUID);
WriteUInt(CTM_Base + 0x24, SomeNumber);
WriteInt(CTM_Base + 0x1C, 0xB);
This is my personal observation. The problem is that the value of SomeNumber is different for various target types – it may turn to XXX +/- 15 for mobs, for example, YYY +/- 15 for veins and so on. I.e. it varies in some range for every target type.
After all my question is if my method is correct, how could I get the value of SomeNumber for certain target, or if it seems a nonsense – how should I use CTM to make my character to do something other then running?