diff --git a/docs/defaultEvents/anticheat/onPlayerUseCheat.md b/docs/defaultEvents/anticheat/onPlayerUseCheat.md new file mode 100644 index 0000000..5735c60 --- /dev/null +++ b/docs/defaultEvents/anticheat/onPlayerUseCheat.md @@ -0,0 +1,21 @@ +# `event` onPlayerUseCheat +!!! note + Detecting some type of forbidden tools may take, even a few minutes. Server need time to analyze player data. + +This event is triggered when player uses some of forbidden cheat tools. + +Original: [onPlayerUseCheat](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/anticheat/onPlayerUseCheat/) + +## Parameters +* `dict` **kwargs**: + * `int` **playerid**: the id of the player who used some type of trainer/cheat. + * `int` **type**: the type of used trainer/cheat. For more information see [AntiCheat constants](../../constants/anticheat.md) + +## Usage +```python +import g2o + +@g2o.event('onPlayerUseCheat') +def onCheat(**kwargs): + print(f'Player {kwargs['playerid']} used forbidden cheat tool type {kwargs['type']}.') +``` \ No newline at end of file diff --git a/docs/defaultEvents/npc/onNpcActionFinished.md b/docs/defaultEvents/npc/onNpcActionFinished.md new file mode 100644 index 0000000..38abf55 --- /dev/null +++ b/docs/defaultEvents/npc/onNpcActionFinished.md @@ -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 g2o + +@g2o.event('onNpcActionFinished') +def onActionFinished(**kwargs): + print(f'NPC {kwargs['npc_id']} finished action {kwargs['action_type']} with the result {kwargs['result']}.') +``` \ No newline at end of file diff --git a/docs/defaultEvents/npc/onNpcActionSent.md b/docs/defaultEvents/npc/onNpcActionSent.md new file mode 100644 index 0000000..e7e328f --- /dev/null +++ b/docs/defaultEvents/npc/onNpcActionSent.md @@ -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 g2o + +@g2o.event('onNpcActionSent') +def onActionSent(**kwargs): + print(f'NPC {kwargs['npc_id']} changed host from {kwargs['previous_id']} to {kwargs['current_id']}.') +``` \ No newline at end of file diff --git a/docs/defaultEvents/npc/onNpcChangeHostPlayer.md b/docs/defaultEvents/npc/onNpcChangeHostPlayer.md new file mode 100644 index 0000000..6e929e6 --- /dev/null +++ b/docs/defaultEvents/npc/onNpcChangeHostPlayer.md @@ -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 g2o + +@g2o.event('onNpcChangeHostPlayer') +def onChangeHostPlayer(**kwargs): + print(f'NPC {kwargs['npc_id']} sent {kwargs['action_type']} to all players.') +``` \ No newline at end of file diff --git a/docs/defaultEvents/npc/onNpcCreated.md b/docs/defaultEvents/npc/onNpcCreated.md new file mode 100644 index 0000000..9ecad00 --- /dev/null +++ b/docs/defaultEvents/npc/onNpcCreated.md @@ -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 g2o + +@g2o.event('onNpcCreated') +def onNpcCreate(**kwargs): + print(f'NPC {kwargs['npc_id']} has been created.') +``` \ No newline at end of file diff --git a/docs/defaultEvents/npc/onNpcDestroyed.md b/docs/defaultEvents/npc/onNpcDestroyed.md new file mode 100644 index 0000000..ba6c21d --- /dev/null +++ b/docs/defaultEvents/npc/onNpcDestroyed.md @@ -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 g2o + +@g2o.event('onNpcDestroyed') +def onNpcDestroy(**kwargs): + print(f'NPC {kwargs['npc_id']} has been destroyed.') +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index e618b0f..407004f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,6 +39,8 @@ nav: - Weapon mode: constants/weapon-mode.md - Weather: constants/weather.md - Events: + - Anticheat: + - onPlayerUseCheat: defaultEvents/anticheat/onPlayerUseCheat.md - General: - onInit: defaultEvents/general/onInit.md - onExit: defaultEvents/general/onExit.md @@ -48,6 +50,12 @@ nav: - onUnban: defaultEvents/general/onUnban.md - Network: - onPacket: defaultEvents/network/onPacket.md + - Npc: + - onNpcActionFinished: defaultEvents/npc/onNpcActionFinished.md + - onNpcActionSent: defaultEvents/npc/onNpcActionSent.md + - onNpcChangeHostPlayer: defaultEvents/npc/onNpcChangeHostPlayer.md + - onNpcCreated: defaultEvents/npc/onNpcCreated.md + - onNpcDestroyed: defaultEvents/npc/onNpcDestroyed.md - Player: - onPlayerChangeColor: defaultEvents/player/onPlayerChangeColor.md - onPlayerChangeFocus: defaultEvents/player/onPlayerChangeFocus.md