InventoryManagerService

This service allows you to get information about your inventory aswell as using items.

Inventory slot object

As response to some of the requests you will get objects with the following structure:

{
    "inv_tab": 0,
    "index": 4,
    "vnum": 452,
    "quantity": 999,
    "name": "Angel's feather"
}

The inv_tab specifies in which inventory tab the slot is in.

  • EQUIP: 0

  • MAIN: 1

  • ETC: 2

The index is the position inside the tab. It starts from 0.

getGold

Returns the gold you have in the inventory.

// Request
{
    "service": "InventoryManagerService",
    "method": "getGold",
    "params": {}
}

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

getEquipTab

Returns a list of the inventory slots from your EQUIP tab.

// Request
{
    "service": "InventoryManagerService",
    "method": "getEquipTab",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "inv_slots": [
            // inv slot 1,
            // inv slot 2,
            // [...]
        ]
    }
}

getMainTab

Returns a list of the inventory slots from your MAIN tab.

// Request
{
    "service": "InventoryManagerService",
    "method": "getMainTab",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "inv_slots": [
            // inv slot 1,
            // inv slot 2,
            // [...]
        ]
    }
}

getEtcTab

Returns a list of the inventory slots from your ETC tab.

// Request
{
    "service": "InventoryManagerService",
    "method": "getEtcTab",
    "params": {}
}

// Response
{
    "status": "ok",
    "result": {
        "inv_slots": [
            // inv slot 1,
            // inv slot 2,
            // [...]
        ]
    }
}

getInventorySlot

Returns an inventory slot from the specified tab and index.

// Request
{
    "service": "InventoryManagerService"
    "method": "getInventorySlot",
    "params": {
        "inv_tab": 0,
        "slot_index": 8
    }
}

// Response
{
    "status": "ok",
    "result": {
        // Inventory slot information
    }
}

findItem

Searchs for the item with the given vnum. Returns the inventory slot if found, otherwise returns an error.

// Request
{
    "service": "InventoryManagerService",
    "method": "findItem",
    "params": {
        "vnum": 6521
    }
}

// Response
{
    "status": "ok",
    "result": {
        // Inventory slot information
    }
}

useItem

Uses an item from the inventory with the given vnum. If the item is not found it returns an error.

// Request
{
    "service": "InventoryManagerService",
    "method": "useItem",
    "params": {
        "vnum": 1231
    }
}

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

useItemOnTarget

Uses an item from the inventory with the given vnum on the specified target. If the item is not found or the target is not found it returns an error.

// Request
{
    "service": "InventoryManagerService",
    "method": "useItemOnTarget",
    "params": {
        "vnum": 4421,
        "entity_type": 3,
        "entity_id": 52112
    }
}

Last updated