PlayerObjManagerService

This services allows you to interact with your own character. This services allows you to read information about your character aswell as performing actions such as attacking and walking.

getPlayerObjManager

Returns an object containing information about the player.

// Request
{
    "service": "PlayerObjManagerService",
    "method": "getPlayerObjManager",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "position": {
            "x": 5,
            "y": 8
        },
        "dest_position": {
            "x": 15,
            "y": 20
        },
        "state": 1,
        "player": { 
            // [...]
        },
        "id": 5492,
        "is_resting": false
    }
}

The player field is an object with the structure described in the Entities chapter.

walk

Walks with your character to the specified coordinates.

// Request
{
    "service": "PlayerObjManagerService",
    "method": "walk",
    "params": {
        "x": 5,
        "y": 8
    }
}

// Response
{
    "status": "ok",
    "result": {}
}

resetPlayerState

This method allows you to reset the player state as if you are clicking in the ground. This is what makes the little arrow in the target's head go from red (attacking) to yellow (not attacking).

// Request
{
    "service": "PlayerObjManagerService",
    "method": "resetPlayerState",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {}
}

attack

This method allows you to use skills. If you want to cast a skill that doesn't need a target you can pass an entity_type and entity_id values of 0.

// Request
{
    "service": "PlayerObjManagerService",
    "method": "attack",
    "params": {
        "entity_type": 2,
        "entity_id": 2610,
        "skill_id": 3
    }
}

// Response
{
    "status": "ok",
    "result": {}
}

pickup

Walks and pick up the specified item in the ground.

// Request
{
    "service": "PlayerObjManagerService",
    "method": "pickup",
    "params": {
        "item_id": 32152
    }
}

// Response
{
    "status": "ok",
    "result": {}
}

collect

Walks and collects the specified npc. This is used for stuff like fragant grass, ice flowers, lettuce, etc.

// Request
{
    "service": "PlayerObjManagerService",
    "method": "collect",
    "params": {
        "npc_id": 52719
    }
}

// Response
{
    "status": "ok",
    "result": {}
}

target

Targets and entity to show the target widget in game. It is not strictly needed for attacking but it is recommended to use it when attacking a new entity as you would do while playing with your hands.

// Request
{
    "service": "PlayerObjManagerService",
    "method": "target",
    "params": {
        "entity_type": 2,
        "entity_id": 2610
    }
}

// Response
{
    "status": "ok",
    "result": {}
}

Last updated