docs: Updated docs for 2.0.0 version
This commit is contained in:
21
docs/defaultEvents/npc/onNpcActionFinished.md
Normal file
21
docs/defaultEvents/npc/onNpcActionFinished.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# `event` onNpcActionFinished
|
||||
|
||||
This event is triggered when NPC action was finished.
|
||||
|
||||
Original: [onNpcActionFinished](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcActionFinished/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **npc_id**: the npc identifier.
|
||||
* `int` **action_type**: the action type.
|
||||
* `int` **action_id**: the unique action identifier.
|
||||
* `bool` **result**: the result of finished action.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import pyg2o as g2o
|
||||
|
||||
@g2o.event('onNpcActionFinished')
|
||||
async def onActionFinished(npc_id, action_type, action_id, result):
|
||||
print(f'NPC {npc_id} finished action {action_type} with the result {result}.')
|
||||
```
|
||||
20
docs/defaultEvents/npc/onNpcActionSent.md
Normal file
20
docs/defaultEvents/npc/onNpcActionSent.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# `event` onNpcActionSent
|
||||
|
||||
This event is triggered when NPC host is changed. Every remote NPC is hosted by one of spawned players in order to get valid position of NPC.
|
||||
|
||||
Original: [onNpcActionSent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcActionSent/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **npc_id**: the npc identifier.
|
||||
* `int` **current_id**: the action type.
|
||||
* `int` **previous_id**: the unique action identifier.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import pyg2o as g2o
|
||||
|
||||
@g2o.event('onNpcActionSent')
|
||||
async def onActionSent(npc_id, action_type, action_id):
|
||||
print(f'NPC {npc_id} sent action {action_id}.')
|
||||
```
|
||||
20
docs/defaultEvents/npc/onNpcChangeHostPlayer.md
Normal file
20
docs/defaultEvents/npc/onNpcChangeHostPlayer.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# `event` onNpcChangeHostPlayer
|
||||
|
||||
This event is triggered when server sends NPC action to streamed players.
|
||||
|
||||
Original: [onNpcChangeHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcChangeHostPlayer/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **npc_id**: the id of the remote npc.
|
||||
* `int` **current_id**: the id of the current host, can be -1 if there is no current host.
|
||||
* `int` **previous_id**: the id of the previous host, can be -1 if there was no previous host.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import pyg2o as g2o
|
||||
|
||||
@g2o.event('onNpcChangeHostPlayer')
|
||||
async def onChangeHostPlayer(npc_id, previous_id, current_id):
|
||||
print(f'NPC {npc_id} changed host to {current_id}')
|
||||
```
|
||||
18
docs/defaultEvents/npc/onNpcCreated.md
Normal file
18
docs/defaultEvents/npc/onNpcCreated.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onNpcCreated
|
||||
|
||||
This event is triggered when remote NPC is created.
|
||||
|
||||
Original: [onNpcCreated](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcCreated/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **npc_id**: the id of the newly created remote npc.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import pyg2o as g2o
|
||||
|
||||
@g2o.event('onNpcCreated')
|
||||
async def onNpcCreate(npc_id):
|
||||
print(f'NPC {npc_id} has been created.')
|
||||
```
|
||||
18
docs/defaultEvents/npc/onNpcDestroyed.md
Normal file
18
docs/defaultEvents/npc/onNpcDestroyed.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onNpcDestroyed
|
||||
|
||||
This event is triggered when remote NPC is created.
|
||||
|
||||
Original: [onNpcDestroyed](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcDestroyed/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **npc_id**: the id of the destroyed remote npc.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import pyg2o as g2o
|
||||
|
||||
@g2o.event('onNpcDestroyed')
|
||||
async def onNpcDestroy(npc_id):
|
||||
print(f'NPC {npc_id} has been destroyed.')
|
||||
```
|
||||
Reference in New Issue
Block a user