Originally Posted by Interest07
Just in case you don't have the action structs...
Follow:
Code:
public void follow(int playerId)
{
int actionStruct = values.actionStructPointer;
int actionList = MemFunctions.MemReadInt(pr_processHandle, actionStruct + 0x30);
int followAction = MemFunctions.MemReadInt(pr_processHandle, actionList + 0x1C);
MemFunctions.MemWriteInt(pr_processHandle, followAction + 0x8, 0); //Set error = 0
MemFunctions.MemWriteInt(pr_processHandle, followAction + 0x20, playerId); //Set playerId to follow
//MemFunctions.MemWriteInt(pr_processHandle, followAction + 0x48, 0); //Set stopped following = 0
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0xC, followAction); //Set new action at position 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x18, 1); //Set next action position to 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x14, followAction); //Set new action type follow as next action
}
Interaction struct (regular attack, pickup item, initiate dialogue with npc, use skill or harvest resource):
Code:
private void interactWith(int objectId, int interactionType, int skillPointer)
{
int actionStruct = values.actionStructPointer;
int actionList = MemFunctions.MemReadInt(pr_processHandle, actionStruct + 0x30);
int interactWithAction = MemFunctions.MemReadInt(pr_processHandle, actionList + 0x8);
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x8, 0); //action finished = 0
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x14, 1); //Action start = 1
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x24, 0); // Action not start = 0
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x20, objectId); // Set object id to interact with
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x38, interactionType); // Set the type of interaction, 0 = regAtk, 1 = pick item, 2 = talk to NPC,3 = useSkill, 4 = gatherResources
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x34, 0); // Set error = 0
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x50, skillPointer); // Set skillPointer
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0xC, interactWithAction); // Set new actionType
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x18, 1); // Set next action position to 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x14, interactWithAction); // Set new actionType
}
Move struct:
Code:
public void moveTo(float X, float Y, float Z, float height)
{
int actionStruct = values.actionStructPointer;
int actionList = MemFunctions.MemReadInt(pr_processHandle, actionStruct + 0x30);
int moveAction = MemFunctions.MemReadInt(pr_processHandle, actionList + 0x4);
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x8, 0); //action finished = 0
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x14, 1); //Action start = 1
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x20, X); // Set X coord
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x24, Y); // Set Y coord
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x28, Z); // Set Z coord
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x68, height); // Set height
if (height >= 0.0)
{
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x64, 26625); //Set 1st var for flying up
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x6C, 256); // Set 2nd var for flying up
}
else
{
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x64, 26624); //Set 1st var for not flying up
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x6C, 65536); // Set 2nd var for not flying up
}
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x2C, 0); // Set moveType
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0xC, moveAction); // Set new moveAction
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x18, 1); // Set next action position to 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x14, moveAction); // Set new moveAction
}
|