refactor: Refactorized whole project structure
This commit is contained in:
25
python/docs/defaultEvents/player/onPlayerChangeColor.md
Normal file
25
python/docs/defaultEvents/player/onPlayerChangeColor.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# `event` onPlayerChangeColor
|
||||
This event is triggered when player nickname color was changed for all players.
|
||||
|
||||
Original: [onPlayerChangeColor](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeColor/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player whose nickname color was changed.
|
||||
* `int` **r**: the amount of red in the nickname color `(0 - 255)`.
|
||||
* `int` **g**: the amount of green in the nickname color `(0 - 255)`.
|
||||
* `int` **b**: the amount of blue in the nickname color `(0 - 255)`.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeColor')
|
||||
def onChangeColor(**kwargs):
|
||||
# Slicing out playerid and converting from {r: num, g: num, b: num}
|
||||
# to (num, num, num)
|
||||
rgbColor = tuple(list(kwargs.values())[1:])
|
||||
# Formating rgb into hex color
|
||||
hexColor = '#%02x%02x%02x' % rgbColor
|
||||
print(f'Player {kwargs['playerid']} changed his color to {hexColor}')
|
||||
```
|
||||
23
python/docs/defaultEvents/player/onPlayerChangeFocus.md
Normal file
23
python/docs/defaultEvents/player/onPlayerChangeFocus.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# `event` onPlayerChangeFocus
|
||||
This event is triggered when player targets another player.
|
||||
|
||||
Original: [onPlayerChangeFocus](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeFocus/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player which changes the focus.
|
||||
* `int` **oldFocusId**: the old playerid targeted by the player. Can be `-1` if player wasn't targeting other player.
|
||||
* `int` **newFocusId**: the new playerid targeted by the player. Can be `-1` if player doesn't target anyone.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeFocus')
|
||||
def onChangeFocus(**kwargs):
|
||||
focusId = kwargs['newFocusId']
|
||||
if focusId != -1:
|
||||
print(f'Player {kwargs['playerid']} is looking at {focusId}')
|
||||
else
|
||||
print(f'Player {kwargs['playerid']} is looking at... who?')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerChangeHealth.md
Normal file
19
python/docs/defaultEvents/player/onPlayerChangeHealth.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerChangeHealth
|
||||
This event is triggered when player health changes.
|
||||
|
||||
Original: [onPlayerChangeHealth](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeHealth/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player whose health points gets changed.
|
||||
* `int` **oldHP**: the previous health points of the player.
|
||||
* `int` **newHP**: the new health points of the player.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeHealth')
|
||||
def onChangeHealth(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} changed health: {kwargs['oldHP']} -> {kwargs['newHP']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerChangeMana.md
Normal file
19
python/docs/defaultEvents/player/onPlayerChangeMana.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerChangeMana
|
||||
This event is triggered when player mana changes.
|
||||
|
||||
Original: [onPlayerChangeMana](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeMana/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player mana points gets changed.
|
||||
* `int` **oldMP**: the previous mana points of the player.
|
||||
* `int` **newMP**: the new mana points of the player.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeMana')
|
||||
def onChangeMana(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} changed mana: {kwargs['oldMP']} -> {kwargs['newMP']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerChangeMaxHealth.md
Normal file
19
python/docs/defaultEvents/player/onPlayerChangeMaxHealth.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerChangeMaxHealth
|
||||
This event is triggered when player maximum health changes.
|
||||
|
||||
Original: [onPlayerChangeMaxHealth](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeMaxHealth/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player whose maxium health points gets changed.
|
||||
* `int` **oldMaxHP**: the previous maximum health points of the player.
|
||||
* `int` **newMaxHP**: the new maximum health points of the player.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeMaxHealth')
|
||||
def onChangeMaxHealth(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} changed maximum health: {kwargs['oldMaxHP']} -> {kwargs['newMaxHP']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerChangeMaxMana.md
Normal file
19
python/docs/defaultEvents/player/onPlayerChangeMaxMana.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerChangeMaxMana
|
||||
This event is triggered when player maximum mana changes.
|
||||
|
||||
Original: [onPlayerChangeMaxMana](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeMaxMana/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player maximum mana points gets changed.
|
||||
* `int` **oldMaxMP**: the previous maximum mana points of the player.
|
||||
* `int` **newMaxMP**: the new maximum mana points of the player.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeMaxMana')
|
||||
def onChangeMaxMana(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} changed maximum mana: {kwargs['oldMaxMP']} -> {kwargs['newMaxMP']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerChangeWeaponMode.md
Normal file
19
python/docs/defaultEvents/player/onPlayerChangeWeaponMode.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerChangeWeaponMode
|
||||
This event is triggered when player changes the weapon mode.
|
||||
|
||||
Original: [onPlayerChangeWeaponMode](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeWeaponMode/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player which changes the weapon mode.
|
||||
* `int` **oldWeaponMode**: the old weapon mode which was used by the player. For more information see [Weapon mode](../../constants/weapon-mode.md).
|
||||
* `int` **newWeaponMode**: the new weapon mode in which player is currently using. For more information see [Weapon mode](../../constants/weapon-mode.md).
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeWeaponMode')
|
||||
def onChangeWM(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} changed wm: {kwargs['oldWeaponMode']} -> {kwargs['newWeaponMode']}')
|
||||
```
|
||||
20
python/docs/defaultEvents/player/onPlayerChangeWorld.md
Normal file
20
python/docs/defaultEvents/player/onPlayerChangeWorld.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# `event` onPlayerChangeWorld
|
||||
> [!TIP] This event can be cancelled
|
||||
This event is triggered when player tries to change his currently played world (ZEN).
|
||||
|
||||
Original: [onPlayerChangeWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeWorld/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who tries to change the played world.
|
||||
* `str` **world**: a filename name of the world.
|
||||
* `str` **waypoint**: a name of the waypoint that the player will be teleported to.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerChangeWorld')
|
||||
def onChangeWorld(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} teleported to {kwargs['world']} at {kwargs['waypoint']}')
|
||||
```
|
||||
24
python/docs/defaultEvents/player/onPlayerCommand.md
Normal file
24
python/docs/defaultEvents/player/onPlayerCommand.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# `event` onPlayerCommand
|
||||
This event is triggered when a player uses command on the chat.
|
||||
Command always begins with forward slash `/`.
|
||||
|
||||
Original: [onPlayerCommand](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerCommand/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who typed the command.
|
||||
* `str` **command**: used command name on the chat.
|
||||
* `str` **params**: command parameters divided by space.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerCommand')
|
||||
def onCommand(**kwargs):
|
||||
# Spliting and formating params
|
||||
params = [eval(x) if not x.isalpha() else x for kwargs['params'].split()]
|
||||
|
||||
if kwargs['command'] == 'add' and len(params) == 2:
|
||||
print('Sum is: ', params[0] + params[1]) # /add 5 10 -> output: Sum is 15
|
||||
```
|
||||
21
python/docs/defaultEvents/player/onPlayerDamage.md
Normal file
21
python/docs/defaultEvents/player/onPlayerDamage.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# `event` onPlayerDamage
|
||||
> [!TIP] This event can be cancelled
|
||||
This event is triggered when player receives damage.
|
||||
|
||||
Original: [onPlayerDamage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerDamage/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who died.
|
||||
* `int` **killerid**: the id of the killer. If killerid is set to `-1`, it means that there was no killer. In this particular case damage source can be fall from a tall object or scripts.
|
||||
* `DamageDescription` **description**: a structure containing damage information. For more information see [DamageDescription](../../classes/game/DamageDescription.md)
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerDamage')
|
||||
def onDamage(**kwargs):
|
||||
desc = kwargs['description']
|
||||
print(f'Ouch! Player {kwargs['playerid']} just received {desc.damage} damage.')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerDead.md
Normal file
18
python/docs/defaultEvents/player/onPlayerDead.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerDead
|
||||
This event is triggered when one player kills another player.
|
||||
|
||||
Original: [onPlayerDead](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerDead/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who died.
|
||||
* `int` **killerid**: the id of the player who killed other player. If killerid is set to `-1`, it means that there was no killer.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerDead')
|
||||
def onDead(**kwargs):
|
||||
print(kwargs['playerid'], 'killed by', kwargs['killerid'])
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerDisconnect.md
Normal file
18
python/docs/defaultEvents/player/onPlayerDisconnect.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerDisconnect
|
||||
This event is triggered when a player gets disconnected with the server.
|
||||
|
||||
Original: [onPlayerDisconnect](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerDisconnect/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: he id of the player who disconnected from the server.
|
||||
* `int` **reason**: the reason why player got disconnected. For more information see [Network](../../constants/network.md).
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerDisconnect')
|
||||
def onDC(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} has left from the server')
|
||||
```
|
||||
20
python/docs/defaultEvents/player/onPlayerDropItem.md
Normal file
20
python/docs/defaultEvents/player/onPlayerDropItem.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# `event` onPlayerDropItem
|
||||
> [!TIP] This event can be cancelled
|
||||
This event is triggered when player drops an item from his inventory to the ground.
|
||||
|
||||
Original: [onPlayerDropItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerDropItem/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who tries to drop the item on the ground.
|
||||
* `ItemGround` **itemGround**: the ground item object which represents the dropped item by the player.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerDropItem')
|
||||
def onDropItem(**kwargs):
|
||||
item = itemm['itemGround']
|
||||
print(f'Player {kwargs['playerid']} dropped {item.instance} x{item.amount}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEnterWorld.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEnterWorld.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEnterWorld
|
||||
This event is triggered when player entered the world (**ZEN**) and was successfully spawned in it.
|
||||
|
||||
Original: [onPlayerEnterWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEnterWorld/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who entered the world.
|
||||
* `str` **world**: an filename name of the world.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEnterWorld')
|
||||
def onEnterWorld(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} entered world {kwargs['world']}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEquipAmulet.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEquipAmulet.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipAmulet
|
||||
This event is triggered when player equips or unequips amulet. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipAmulet](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipAmulet/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips a amulet.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipAmulet')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEquipArmor.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEquipArmor.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipAmulet
|
||||
This event is triggered when player equips or unequips armor. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipArmor](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipArmor/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips an armor.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipArmor')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEquipBelt.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEquipBelt.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipBelt
|
||||
This event is triggered when player equips or unequips belt. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipBelt](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipBelt/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips a belt.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipBelt')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerEquipHandItem.md
Normal file
19
python/docs/defaultEvents/player/onPlayerEquipHandItem.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerEquipHandItem
|
||||
This event is triggered when game adds item to player hand, e.g: when player opens or consumes any item. When item is removed from hand, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipHandItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipHandItem/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who gets an item to his hand.
|
||||
* `int` **hand**: the id of the hand in which player holds item. For more information see [Hand](../../constants/hand.md).
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipHandItem')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} has {kwargs['instance']}, used hand with id {kwargs['hand']}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEquipHelmet.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEquipHelmet.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipHelmet
|
||||
This event is triggered when player equips or unequips helmet. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipHelmet](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipHelmet/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips a helmet.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipHelmet')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipMeleeWeapon
|
||||
This event is triggered when player equips or unequips melee weapon. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipMeleeWeapon](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipMeleeWeapon/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips an melee weapon.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipMeleeWeapon')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipRangedWeapon
|
||||
This event is triggered when player equips or unequips ranged weapon. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipRangedWeapon](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipRangedWeapon/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips an ranged weapon.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipRangedWeapon')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerEquipRing.md
Normal file
19
python/docs/defaultEvents/player/onPlayerEquipRing.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerEquipRing
|
||||
This event is triggered when player equips or unequips ring. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipRing](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipRing/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips a ring.
|
||||
* `int` **hand**: the hand id that the player is putting the ring on. For more information see [Hand](../../constants/hand.md).
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipRing')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} has {kwargs['instance']}, used hand with id {kwargs['hand']}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerEquipShield.md
Normal file
18
python/docs/defaultEvents/player/onPlayerEquipShield.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerEquipShield
|
||||
This event is triggered when player equips or unequips shield. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipShield](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipShield/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips a shield.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerEquipShield')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}')
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerEquipSpell.md
Normal file
19
python/docs/defaultEvents/player/onPlayerEquipSpell.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerEquipSpell
|
||||
This event is triggered when player equips or unequips scroll or rune. When item is unequiped, empty `str` is returned instead.
|
||||
|
||||
Original: [onPlayerEquipSpell](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerEquipSpell/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who equips a spell.
|
||||
* `int` **slotId**: the slot id that the player puts the spell on in range `<0, 6>`.
|
||||
* `str` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerSpell')
|
||||
def onEquip(**kwargs):
|
||||
print(f'Player {kwargs['playerid']} equipped spell {kwargs['instance']} at slot {kwargs['slotId']}')
|
||||
```
|
||||
17
python/docs/defaultEvents/player/onPlayerJoin.md
Normal file
17
python/docs/defaultEvents/player/onPlayerJoin.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# `event` onPlayerJoin
|
||||
This event is triggered when a player successfully joined the server.
|
||||
|
||||
Original: [onPlayerJoin](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerJoin/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who joined the server.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerJoin')
|
||||
def onJoin(**kwargs):
|
||||
print(kwargs['playerid'], 'joined to the server.')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerMessage.md
Normal file
18
python/docs/defaultEvents/player/onPlayerMessage.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerMessage
|
||||
This event is triggered when a player types the message on the chat.
|
||||
|
||||
Original: [onPlayerMessage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerMessage/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who typed the message.
|
||||
* `str` **message**: the message typed by the player.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerMessage')
|
||||
def onMessage(**kwargs):
|
||||
print(kwargs['playerid'], 'says', kwargs['message'])
|
||||
```
|
||||
19
python/docs/defaultEvents/player/onPlayerMobInteract.md
Normal file
19
python/docs/defaultEvents/player/onPlayerMobInteract.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# `event` onPlayerMobInteract
|
||||
This event is triggered when player interacts with any kind of mob object in the world. In Gothic, mobs are special vobs on the map, that hero can interact with. For example bed, door, chest etc.
|
||||
|
||||
Original: [onPlayerMobInteract](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerMobInteract/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: represents previous state of mob. If value is `1`, then mob was used, in any other case value is `0`.
|
||||
* `int` **from**: represents current state of mob. If value is `1`, then mob is used, in any other case value is `0`.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerMobInteract')
|
||||
def onMobInteract(**kwargs):
|
||||
if kwargs['to'] == 1:
|
||||
print(kwargs['playerid'], 'started interaction with the MOB')
|
||||
```
|
||||
17
python/docs/defaultEvents/player/onPlayerRespawn.md
Normal file
17
python/docs/defaultEvents/player/onPlayerRespawn.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# `event` onPlayerRespawn
|
||||
This event is triggered when a player respawns after death.
|
||||
|
||||
Original: [onPlayerRespawn](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerRespawn/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who respawned after death.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerRespawn')
|
||||
def onRespawn(**kwargs):
|
||||
print(kwargs['playerid'], 'respawned.')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerShoot.md
Normal file
18
python/docs/defaultEvents/player/onPlayerShoot.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerShoot
|
||||
This event is triggered when player shoot using ranged weapon.
|
||||
|
||||
Original: [onPlayerShoot](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerShoot/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who just shot.
|
||||
* `str | null` **munition**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerShoot')
|
||||
def onShoot(**kwargs):
|
||||
print(kwargs['playerid'], 'made a shot.')
|
||||
```
|
||||
23
python/docs/defaultEvents/player/onPlayerSpellCast.md
Normal file
23
python/docs/defaultEvents/player/onPlayerSpellCast.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# `event` onPlayerSpellCast
|
||||
> [!TIP] This event can be cancelled
|
||||
!!! note
|
||||
Right now transformation and summon spells are not supported, despite this event will be triggered for them. Cancelling this event willl prevent this action to be synced to other players.
|
||||
|
||||
This event is triggered when player is casting some spell.
|
||||
|
||||
Original: [onPlayerSpellCast](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerSpellCast/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who casts the spell.
|
||||
* `str | null` **instance**: the item instance from Daedalus scripts.
|
||||
* `int` **spellLevel**: the level of charged spell.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerSpellCast')
|
||||
def onSpellCast(**kwargs):
|
||||
print(kwargs['player'], 'casted a spell', kwargs['instance'])
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerSpellSetup.md
Normal file
18
python/docs/defaultEvents/player/onPlayerSpellSetup.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerSpellSetup
|
||||
This event is triggered when player prepares the spell.
|
||||
|
||||
Original: [onPlayerSpellSetup](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerSpellSetup/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who prepares the spell.
|
||||
* `str | null` **instance**: the item instance from Daedalus scripts.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerSpellSetup')
|
||||
def onSpellSetup(**kwargs):
|
||||
print(kwargs['player'], 'setuped a spell', kwargs['instance'])
|
||||
```
|
||||
23
python/docs/defaultEvents/player/onPlayerTakeItem.md
Normal file
23
python/docs/defaultEvents/player/onPlayerTakeItem.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# `event` onPlayerTakeItem
|
||||
> [!TIP] This event can be cancelled
|
||||
!!! note
|
||||
Even if this event is triggered it doesn't mean, that player will get item to his inventory. It only means, that the player tried to get the item from the ground. Server is the last decide if the item can be taken from the ground. Canceling this event will prevent the item to be taken from the ground.
|
||||
|
||||
This event is triggered when player takes an item from the ground.
|
||||
|
||||
Original: [onPlayerTakeItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerTakeItem/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who tries to take the ground item.
|
||||
* `ItemGround` **itemGround**: the ground item object which player tried to to take.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerTakeItem')
|
||||
def onTakeItem(**kwargs):
|
||||
item = itemm['itemGround']
|
||||
print(f'Player {kwargs['playerid']} took {item.instance} x{item.amount}')
|
||||
```
|
||||
18
python/docs/defaultEvents/player/onPlayerTeleport.md
Normal file
18
python/docs/defaultEvents/player/onPlayerTeleport.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `event` onPlayerTeleport
|
||||
This event is triggered when player gets teleported by the game to the specified vob.
|
||||
|
||||
Original: [onPlayerTeleport](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerTeleport/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who gets teleported by the game.
|
||||
* `str` **vobName**: represents the name of the vob that player gets teleported to.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerTeleport')
|
||||
def onTeleport(**kwargs):
|
||||
print(kwargs['player'], 'teleported to', kwargs['vobName'])
|
||||
```
|
||||
20
python/docs/defaultEvents/player/onPlayerToggleFaceAni.md
Normal file
20
python/docs/defaultEvents/player/onPlayerToggleFaceAni.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# `event` onPlayerTeleport
|
||||
This event is triggered when player face animation is toggled (played or stopped), due to eating or other activities.
|
||||
|
||||
Original: [onPlayerToggleFaceAni](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerToggleFaceAni/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who gets teleported by the game.
|
||||
* `str` **aniName**: the face animation name.
|
||||
* `bool` **toggle**: `true` when player is started playing face animation, otherwise `false`.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPlayerToggleFaceAni')
|
||||
def onToggleFA(**kwargs):
|
||||
if kwargs['toggle']:
|
||||
print(kwargs['player'], 'started face ani',kwargs['aniName'])
|
||||
```
|
||||
Reference in New Issue
Block a user