SceneManagerService

This services allows you to get information about the entities that are in your map.

getPlayers

Returns a list with all the players in the map.

// Request
{
    "service": "SceneManagerService",
    "method": "getPlayers",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "players": [
            // player 1,
            // player 2,
            // [...]
        ]
    }
}

The players field is a list of objects with the structure described in the Entities chapter.

getMonsters

Returns a list of all the monsters in the map.

// Request
{
    "service": "SceneManagerService",
    "method": "getMonsters",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "monsters": [
            // monster 1,
            // monster 2,
            // [...]
        ]
    }
}

The monsters field is a list of objects with the structure described in the Entities chapter.

getItems

Returns a list of all the items in the map.

// Request
{
    "service": "SceneManagerService",
    "method": "getItems",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "items": [
            // item 1,
            // item 2,
            // [...]
        ]
    }
}

The items field is a list of objects with the structure described in the Entities chapter.

getNpcs

Returns a list of all the NPCs in the map.

// Request
{
    "service": "SceneManagerService",
    "method": "getNpcs",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "npcs": [
            // npc 1,
            // npc 2,
            // [...]
        ]
    }
}

The npcs field is a list of objects with the structure described in the Entities chapter.

findPlayer

Searchs for a player in the map. Returns the player object if found, otherwise returns an error.

// Request
{
    "service": "SceneManagerService",
    "method": "findPlayer",
    "params": {
        "id": 1234
    }
}

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

findMonster

Searchs for a monster in the map. Returns the monster object if found, otherwise returns an error.

// Request
{
    "service": "SceneManagerService",
    "method": "findMonster",
    "params": {
        "id": 6472
    }
}

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

findItem

Searchs for an item in the map. Returns the item object if found, otherwise returns an error.

// Request
{
    "service": "SceneManagerService",
    "method": "findItem",
    "params": {
        "id": 67271
    }
}

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

findNpc

Searchs for an NPC in the map. Returns the NPC object if found, otherwise returns an error.

// Request
{
    "service": "SceneManagerService",
    "method": "findNpc",
    "params": {
        "id": 2232
    }
}

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

getAllBosses

Returns a list with all the bosses in the map.

// Request
{
    "service": "SceneManagerService",
    "method": "getAllBosses",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "bosses": [
            // boss 1,
            // boss 2,
            // [...]
        ]
    }
}

The bosses field is a list of objects with the monster structure described in the Entities chapter.

getMapGrid

Returns the current map grid that tells you which cells are walkable and which ones are not.

// Request
{
    "service": "SceneManagerService",
    "method": "getMapGrid",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "width": 180,
        "height": 180,
        "grid": [
            [0, 0, 0, 1, 1, 2, ...],
            [1, 1, 0, 0, 0, 2, ...],
            // [...]
        ]
    }
}

The grid field is a 2D array. The values inside of it tells you if a cell is walkable (value of 0) or non walkable (values 1 and 2).

Last updated