Skip to content

function getNpcLastActionId

This function gets last action identifier, that was enqued to the NPC action queue. Every action in queue has associated unique id, by which can be identified.
Original: getNpcLastActionId

Declaration

async def getNpcLastActionId(npc_id : int) -> int

Parameters

int npc_id: the identifier of npc.

Returns

int: The last finished action identifier, otherwise -1.

Source code in src/pyg2o/functions/npc.py
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
async def getNpcLastActionId(npc_id : int) -> int:
    """
    This function gets last action identifier, that was enqued to the NPC action queue. Every action in queue has associated unique id, by which can be identified.
    Original: [getNpcLastActionId](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcLastActionId/)

    ## Declaration
    ```python
    async def getNpcLastActionId(npc_id : int) -> int
    ```
    ## Parameters
    `int` **npc_id**: the identifier of npc.
    ## Returns
    `int`: The last finished action identifier, otherwise `-1`.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result