docs: Updated docs for 2.0.0 version
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
# `static class` Daedalus
|
||||
---
|
||||
::: g2o.classes.daedalus.Daedalus
|
||||
@@ -1,3 +0,0 @@
|
||||
# `class` DamageDescription
|
||||
---
|
||||
::: g2o.classes.damage.DamageDescription
|
||||
@@ -1,3 +0,0 @@
|
||||
# `static class` Sky
|
||||
---
|
||||
::: g2o.classes.sky.Sky
|
||||
@@ -1,3 +0,0 @@
|
||||
# `static class` ItemGround
|
||||
---
|
||||
::: g2o.classes.items.ItemGround
|
||||
@@ -1,3 +0,0 @@
|
||||
# `static class` ItemsGround
|
||||
---
|
||||
::: g2o.classes.items.ItemsGround
|
||||
@@ -1,3 +0,0 @@
|
||||
# `static class` Mds
|
||||
---
|
||||
::: g2o.classes.mds.Mds
|
||||
@@ -1,3 +0,0 @@
|
||||
# `class` Packet
|
||||
---
|
||||
::: g2o.classes.packets.Packet
|
||||
@@ -1,3 +0,0 @@
|
||||
# `class` Way
|
||||
---
|
||||
::: g2o.classes.way.Way
|
||||
@@ -1,97 +0,0 @@
|
||||
|
||||
* `addEventHandler` replaced with decorator [event](functions/event/event.md)
|
||||
```python
|
||||
@g2o.event('onInit')
|
||||
def evtInitFirst(**kwargs):
|
||||
print('Hello')
|
||||
|
||||
@g2o.event('onInit', 100) # '100' is priority
|
||||
def evtInitSecond(**kwargs):
|
||||
print('World')
|
||||
```
|
||||
---
|
||||
* Positional arguments inside event handles replaced with keyword arguments (see names of all keywords on the each event page)
|
||||
```python
|
||||
@g2o.event('onPlayerChangeColor')
|
||||
def evtColor(**kwargs):
|
||||
playerid = kwargs['playerid']
|
||||
r = kwargs['r']
|
||||
b = kwargs['b']
|
||||
```
|
||||
---
|
||||
* `callEvent` now also requires to pass keyword arguments instead of positional arguments
|
||||
```python
|
||||
@g2o.event('MyTestEvent')
|
||||
def testEvt(**kwargs):
|
||||
print(kwargs)
|
||||
|
||||
g2o.callEvent('MyTestEvent', name = 'aurumvorax', id = 15)
|
||||
# OR
|
||||
g2o.callEvent('MyTestEvent', {'name': 'aurumvorax', 'id': 15})
|
||||
# OR
|
||||
args = {'name': 'aurumvorax', 'id': 15}
|
||||
g2o.callEvent('MyTestEvent', args)
|
||||
```
|
||||
---
|
||||
* `cancelEvent` replaced with returning `False` inside the handler
|
||||
<sup>*(you don't need to explicitly return `True` if you don't want to cancel the event)*</sup>
|
||||
```python
|
||||
@g2o.event('onPlayerTakeItem')
|
||||
def evtTake(**kwargs):
|
||||
return False
|
||||
```
|
||||
---
|
||||
* `isEventCancelled` replaced with built-in function property `cancelled`, alongside with the `eventName`
|
||||
```python
|
||||
@g2o.event('onPlayerDropItem')
|
||||
def evtDrop(**kwargs):
|
||||
print(evtDrop.cancelled)
|
||||
print(evtDrop.eventName)
|
||||
```
|
||||
-----
|
||||
* Following functions have been removed <sub><sup>RIP :(</sub></sup>
|
||||
|
||||
* `md5`
|
||||
* `sha1`
|
||||
* `sha256`
|
||||
* `sha384`
|
||||
* `sha512`
|
||||
* `setReloadCallback`
|
||||
* `setUnloadCallback`
|
||||
* `getTimerExecuteTimes`
|
||||
* `getTimerInterval`
|
||||
* `killTimer`
|
||||
* `setTimer`
|
||||
* `setTimerExecuteTimes`
|
||||
* `setTimerInterval`
|
||||
* `sscanf`
|
||||
* `hexToRgb`
|
||||
* `rgbToHex`
|
||||
* `getTickCount`
|
||||
* `eventValue`
|
||||
* `getPlayerMagicLevel`
|
||||
* `setPlayerMagicLevel`
|
||||
|
||||
---
|
||||
* All functions and events that returned/passed a `null` in the Squirrel, now passes an empty string. Most notable in this list are all equipment related functions and events
|
||||
* `onPlayerEquipAmulet`
|
||||
* `onPlayerEquipArmor`
|
||||
* `onPlayerEquipBelt`
|
||||
* `onPlayerEquipHandItem`
|
||||
* `onPlayerEquipHelmet`
|
||||
* `onPlayerEquipMeleeWeapon`
|
||||
* `onPlayerEquipRangedWeapon`
|
||||
* `onPlayerEquipRing`
|
||||
* `onPlayerEquipShield`
|
||||
* `onPlayerEquipSpell`
|
||||
* `getPlayerAmulet`
|
||||
* `getPlayerArmor`
|
||||
* `getPlayerBelt`
|
||||
* `getPlayerHelmet`
|
||||
* `getPlayerMeleeWeapon`
|
||||
* `getPlayerRangedWeapon`
|
||||
* `getPlayerRing`
|
||||
* `getPlayerShield`
|
||||
* `getPlayerSpell`
|
||||
---
|
||||
* `ItemsGround.getById` throws an exception instead of returning `null` if there's no item with given ID
|
||||
@@ -1,5 +0,0 @@
|
||||
**Original:** [AntiCheat](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-constants/anticheat/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|AC_SPEED_HACK |Represents speed hack state. |
|
||||
@@ -1,6 +0,0 @@
|
||||
**Original:** [Context](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/context/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|DAMAGE_CTX | Represents damage script context. Damage context extends packet, that sent information about hit. |
|
||||
|EQUIPMENT_CTX | Represents equipment script context. Equipment context extends packet, that sent information about equip/unequip/use item. |
|
||||
@@ -1,13 +0,0 @@
|
||||
**Original:** [Damage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/damage/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|DAMAGE_UNKNOWN |Represents unknown damage type. |
|
||||
|DAMAGE_BARRIER |Represents barrier damage type. |
|
||||
|DAMAGE_BLUNT |Represents blunt (weapon) damage type. |
|
||||
|DAMAGE_EDGE |Represents edge/sharp (weapon) damage type. |
|
||||
|DAMAGE_FIRE |Represents fire damage type. |
|
||||
|DAMAGE_FLY |Represents fly damage type. |
|
||||
|DAMAGE_MAGIC |Represents magic damage type. |
|
||||
|DAMAGE_POINT |Represents point (weapon) damage type. |
|
||||
|DAMAGE_FALL |Represents fall damage type. |
|
||||
@@ -1,7 +0,0 @@
|
||||
**Original:** [General](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/general/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|DEBUG_MODE |Represents debug mode state. |
|
||||
|CLIENT_SIDE |`true` if parsed script is on client-side, otherwise `false`. |
|
||||
|SERVER_SIDE |`true` if parsed script is on server-side, otherwise `false`. |
|
||||
@@ -1,6 +0,0 @@
|
||||
**Original:** [Hand](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/hand/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|HAND_LEFT |Represents npc left hand slot id. |
|
||||
|HAND_RIGHT |Represents npc right hand slot id. |
|
||||
@@ -1,40 +0,0 @@
|
||||
**Original:** [Item](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/item/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|ITEM_CAT_NONE |Represents item flag for uncategorized items. |
|
||||
|ITEM_CAT_NF |Represents item flag for all melee weapons. |
|
||||
|ITEM_CAT_FF |Represents item flag for all ranged weapons. |
|
||||
|ITEM_CAT_MUN |Represents item flag for all types of ammunition. |
|
||||
|ITEM_CAT_ARMOR |Represents item flag for armors. |
|
||||
|ITEM_CAT_FOOD |Represents item flag for all food items. |
|
||||
|ITEM_CAT_DOCS |Represents item flag for all documents. |
|
||||
|ITEM_CAT_POTION |Represents item flag for all potions. |
|
||||
|ITEM_CAT_LIGHT |Represents item flag for all light sources (unused). |
|
||||
|ITEM_CAT_RUNE |Represents item flag for runes. |
|
||||
|ITEM_CAT_MAGIC |Represents item flag for magic items. |
|
||||
|ITEM_FLAG_DAG |Represents flag for weapons treated as daggers. |
|
||||
|ITEM_FLAG_SWD |Represents flag for weapons treated as swords. |
|
||||
|ITEM_FLAG_AXE |Represents flag for weapons treated as axes. |
|
||||
|ITEM_FLAG_2HD_SWD |Represents flag for weapons treated as two-handed swords. |
|
||||
|ITEM_FLAG_2HD_AXE |Represents flag for weapons treated as two-handed axes. |
|
||||
|ITEM_FLAG_SHIELD |Represents flag for weapons treated as shields. |
|
||||
|ITEM_FLAG_BOW |Represents flag for weapons treated as bows. |
|
||||
|ITEM_FLAG_CROSSBOW |Represents flag for weapons treated as crossbows. |
|
||||
|ITEM_FLAG_RING |Represents flag for items treated as rings. |
|
||||
|ITEM_FLAG_AMULET |Represents flag for items treated as amulets. |
|
||||
|ITEM_FLAG_BELT |Represents flag for items treated as belts. |
|
||||
|ITEM_FLAG_DROPPED |Represents flag for items that have been dropped (internal use). |
|
||||
|ITEM_FLAG_MI |Represents flag for mission items. |
|
||||
|ITEM_FLAG_MULTI |Represents flag for multi-item slots. |
|
||||
|ITEM_FLAG_NFOCUS |Represents flag for items to be ignored in focus (lighting swell). |
|
||||
|ITEM_FLAG_CREATEAMMO |Represents unused flag for weapons. |
|
||||
|ITEM_FLAG_NSPLIT |Represents flag for disabling the item splitting feature. |
|
||||
|ITEM_FLAG_DRINK |Represents flag for items that are drinks. |
|
||||
|ITEM_FLAG_TORCH |Represents flag for items treated as torches. |
|
||||
|ITEM_FLAG_THROW |Represents flag for items that can be thrown (unused). |
|
||||
|ITEM_FLAG_ACTIVE |Represents flag for items equipped in inventory. |
|
||||
|ITEM_WEAR_NO |Represents wear type for items that cannot be worn. |
|
||||
|ITEM_WEAR_TORSO |Represents wear type for items worn on the torso. |
|
||||
|ITEM_WEAR_HEAD |Represents wear type for items worn on the head. |
|
||||
|ITEM_WEAR_LIGHT |Represents unused wear type for items. |
|
||||
@@ -1,7 +0,0 @@
|
||||
**Original:** [Network](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-constants/network/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|DISCONNECTED |Represents disconnected player state. |
|
||||
|LOST_CONNECTION |Represents lost connection player state. |
|
||||
|HAS_CRASHED |Represents crash player state. |
|
||||
@@ -1,30 +0,0 @@
|
||||
**Original:** [NPC](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/npc/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|ATTACK_RUN |Represents attack run type. |
|
||||
|ATTACK_FORWARD |Represents attack forward type. |
|
||||
|ATTACK_LEFT |Represents attack left type. |
|
||||
|ATTACK_RIGHT |Represents attack right type. |
|
||||
|ACTION_CLEAR_QUEUE |Represents action clear queue type. |
|
||||
|ACTION_APPLY_OVERLAY |Represents action apply overlay type. |
|
||||
|ACTION_REMOVE_OVERLAY |Represents action remove overlay type. |
|
||||
|ACTION_PLAY_ANI |Represents action play ani type. |
|
||||
|ACTION_STOP_ANI |Represents action stop ani type. |
|
||||
|ACTION_EQUIP_ITEM |Represents action equip item type. |
|
||||
|ACTION_UNEQUIP_ITEM |Represents action unequip item type. |
|
||||
|ACTION_WEAPON_MODE |Represents action change weapon mode type. |
|
||||
|ACTION_DRAW_WEAPON |Represents action draw weapon type. |
|
||||
|ACTION_REMOVE_WEAPON |Represents action remove weapon type. |
|
||||
|ACTION_USE_ITEM |Represents action use item type. |
|
||||
|ACTION_USE_ITEM_TO_STATE |Represents action use item to state type. |
|
||||
|ACTION_READY_SPELL |Represents action ready spell type. |
|
||||
|ACTION_UNREADY_SPELL |Represents action unready spell type. |
|
||||
|ACTION_ATTACK_MELEE_WEAPON |Represents action attack melee weapon type. |
|
||||
|ACTION_ATTACK_RANGED_WEAPON |Represents action attack ranged weapon type. |
|
||||
|ACTION_SPELL_CAST |Represents action spell cast type. |
|
||||
|ACTION_USE_MOB_SCHEME |Represents action use mob scheme type. |
|
||||
|ACTION_SHOOT_AT |Represents action shoot at type. |
|
||||
|ACTION_START_AIM_AT |Represents action start aim at type. |
|
||||
|ACTION_STOP_AIM_AT |Represents action stop aim at type. |
|
||||
|ACTION_SCRIPT |Represents action script type. |
|
||||
@@ -1,9 +0,0 @@
|
||||
**Original:** [Reliability](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/reliability/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|UNRELIABLE |Unreliable packets are sent by straight UDP. They may arrive out of order, or not at all. This is best for data that is unimportant, or data that you send very frequently so even if some packets are missed newer packets will compensate. <br><br>**Advantages** - These packets don't need to be acknowledged by the network, saving the size of a UDP header in acknowledgment (about 50 bytes or so). The savings can really add up. <br><br>**Disadvantages** - No packet ordering, packets may never arrive, these packets are the first to get dropped if the send buffer is full.
|
||||
|UNRELIABLE_SEQUENCED |Unreliable sequenced packets are the same as unreliable packets, except that only the newest packet is ever accepted. Older packets are ignored. <br><br>**Advantages** - Same low overhead as unreliable packets, and you don't have to worry about older packets changing your data to old values. <br><br>**Disadvantages** - A LOT of packets will be dropped since they may never arrive because of UDP and may be dropped even when they do arrive. These packets are the first to get dropped if the send buffer is full. The last packet sent may never arrive, which can be a problem if you stop sending packets at some particular point. <br><br>Note that the transmission of one of the three reliable packets types is required for the detection of lost connections. If you never send reliable packets you need to implement lost connection detection manually.|
|
||||
|RELIABLE |Reliable packets are UDP packets monitored by a reliablilty layer to ensure they arrive at the destination. <br><br>**Advantages** - You know the packet will get there. Eventually... <br><br>**Disadvantages** - Retransmissions and acknowledgments can add significant bandwidth requirements. Packets may arrive very late if the network is busy. No packet ordering.|
|
||||
|RELIABLE_ORDERED |Reliable ordered packets are UDP packets monitored by a reliability layer to ensure they arrive at the destination and are ordered at the destination. <br><br>**Advantages** - The packet will get there and in the order it was sent. These are by far the easiest to program for because you don't have to worry about strange behavior due to out of order or lost packets. <br><br>**Disadvantages** - Retransmissions and acknowledgments can add significant bandwidth requirements. Packets may arrive very late if the network is busy. One late packet can delay many packets that arrived sooner, resulting in significant lag spikes. However, this disadvantage can be mitigated by the clever use of ordering streams.
|
||||
|RELIABLE_SEQUENCED |Reliable sequenced packets are UDP packets monitored by a reliability layer to ensure they arrive at the destination and are sequenced at the destination. <br><br>**Advantages** - You get the reliability of UDP packets, the ordering of ordered packets, yet don't have to wait for old packets. More packets will arrive with this method than with the unreliable sequenced method, and they will be distributed more evenly. The most important advantage however is that the latest packet sent will arrive, where with unreliable sequenced the latest packet sent may not arrive. <br><br>**Disadvantages** - Wasteful of bandwidth because it uses the overhead of reliable UDP packets to ensure late packets arrive that just get ignored anyway.|
|
||||
@@ -1,8 +0,0 @@
|
||||
**Original:** [Skill weapon](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/skill-weapon/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|WEAPON_1H |Represents npc one handed weapon skill. |
|
||||
|WEAPON_2H |Represents npc two handed weapon skill. |
|
||||
|WEAPON_BOW |Represents npc bow weapon skill. |
|
||||
|WEAPON_CBOW |Represents npc crossbow weapon skill. |
|
||||
@@ -1,26 +0,0 @@
|
||||
**Original:** [Talent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/talent/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|TALENT_1H |Represents npc one handed weapon skill talent (valid talent values are: 0,1,2). |
|
||||
|TALENT_2H |Represents npc two handed weapon skill talent (valid talent values are: 0,1,2). |
|
||||
|TALENT_BOW |Represents npc bow weapon skill talent (valid talent values are: 0,1,2). |
|
||||
|TALENT_CROSSBOW |Represents npc crossbow weapon skill talent (valid talent values are: 0,1,2). |
|
||||
|TALENT_PICK_LOCKS |Represents npc picklock talent. |
|
||||
|TALENT_PICKPOCKET |Represents npc pickpocket talent. |
|
||||
|TALENT_MAGE |Represents npc magic circle talent. |
|
||||
|TALENT_SNEAK |Represents npc sneak talent. |
|
||||
|TALENT_REGENERATE |Represents npc health regeneration talent. |
|
||||
|TALENT_FIREMASTER |Represents npc firemaster talent (unused by the game). |
|
||||
|TALENT_ACROBATIC |Represents npc acrobatic talent. |
|
||||
|TALENT_PICKPOCKET_UNUSED |Represents npc old pickpocket talent (unused by the game). |
|
||||
|TALENT_SMITH |Represents npc smith talent. |
|
||||
|TALENT_RUNES |Represents npc runes creation talent. |
|
||||
|TALENT_ALCHEMY |Represents npc potion creation talent. |
|
||||
|TALENT_THROPHY |Represents npc trophy gathering talent. |
|
||||
|TALENT_A |Represents npc talent A (unused by the game). |
|
||||
|TALENT_B |Represents npc talent B (unused by the game). |
|
||||
|TALENT_C |Represents npc talent C (unused by the game). |
|
||||
|TALENT_D |Represents npc talent D (unused by the game). |
|
||||
|TALENT_E |Represents npc talent E (unused by the game). |
|
||||
|TALENT_MAX |Represents maximum number of talents (the id itself isn't valid, it's mostly useful in for loops). |
|
||||
@@ -1,13 +0,0 @@
|
||||
**Original:** [Weapon mode](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/weapon-mode/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|WEAPONMODE_NONE |Represents npc none weapon mode. |
|
||||
|WEAPONMODE_FIST |Represents npc fist weapon mode. |
|
||||
|WEAPONMODE_DAG |Represents npc dagger weapon mode. |
|
||||
|WEAPONMODE_1HS |Represents npc one handed weapon mode (melee weapon). |
|
||||
|WEAPONMODE_2HS |Represents npc two handed weapon mode (melee weapon). |
|
||||
|WEAPONMODE_BOW |Represents npc bow weapon mode (ranged weapon). |
|
||||
|WEAPONMODE_CBOW |Represents npc crossbow weapon mode (ranged weapon). |
|
||||
|WEAPONMODE_MAG |Represents npc magic weapon mode (spell). |
|
||||
|WEAPONMODE_MAX |Represents npc maximum weapon mode (not actuall weapon mode, weapon modes count). |
|
||||
@@ -1,6 +0,0 @@
|
||||
**Original:** [Weather](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-constants/weather/)
|
||||
|
||||
|Name |Description |
|
||||
|-- | --|
|
||||
|WEATHER_SNOW |Represents snowing weather type. |
|
||||
|WEATHER_RAIN |Represents raining weather type. |
|
||||
@@ -1,21 +0,0 @@
|
||||
# `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']}.')
|
||||
```
|
||||
@@ -1,30 +0,0 @@
|
||||
# `event` onBan
|
||||
> [!TIP] This event can be cancelled
|
||||
!!! note
|
||||
If serial/mac/ip/name indexes doesn't exist, then the parameters has not been specified when ban was added.
|
||||
If timestamp doesn't exist, then ban was permanent.
|
||||
|
||||
This event is triggered when new ban is being added.
|
||||
|
||||
Original: [onBan](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/general/onBan/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `str` **mac**: MAC address of the banned player.
|
||||
* `str` **ip**: IP address of the banned player.
|
||||
* `str` **serial**: serial of the banned player.
|
||||
* `str` **name**: nickname of the banned player.
|
||||
* `int` **timestamp**: timestamp when the ban expires.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
from datetime import datetime
|
||||
|
||||
@g2o.event('onBan')
|
||||
def onBan(**kwargs):
|
||||
print(f'Player {kwargs['name']} has been banned.')
|
||||
if ('timestamp' in kwargs):
|
||||
banExpires = datetime.fromtimestamp(kwargs['timestamp'])
|
||||
print(f'Ban expires at {banExpires}')
|
||||
```
|
||||
@@ -1,17 +0,0 @@
|
||||
# `event` onExit
|
||||
This event is triggered when server is going to shut down.
|
||||
You can use it, to save some data before closing up, or do something else.
|
||||
|
||||
Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/general/onExit/)
|
||||
|
||||
## Parameters
|
||||
No parameters.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onExit')
|
||||
def onExitEvt(**kwargs):
|
||||
print('Bye')
|
||||
```
|
||||
@@ -1,16 +0,0 @@
|
||||
# `event` onInit
|
||||
This event is triggered when server successfully starts up.
|
||||
|
||||
Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/general/onInit/)
|
||||
|
||||
## Parameters
|
||||
No parameters.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onInit')
|
||||
def onInitEventHandler(**kwargs):
|
||||
print('Called onInit event')
|
||||
```
|
||||
@@ -1,16 +0,0 @@
|
||||
# `event` onTick
|
||||
This event is triggered in every server main loop iteration.
|
||||
|
||||
Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/general/onTick/)
|
||||
|
||||
## Parameters
|
||||
No parameters.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onTick')
|
||||
def onTickEvt(**kwargs):
|
||||
print('Tock')
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
# `event` onTime
|
||||
This event is triggered each time when game time minute passes.
|
||||
|
||||
Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/general/onTime/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **day**: the current ingame day.
|
||||
* `int` **hour**: the current ingame hour.
|
||||
* `int` **min**: the current ingame minutes.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onTick')
|
||||
def onTickEvt(**kwargs):
|
||||
day = kwargs['day']
|
||||
hour = kwargs['hour']
|
||||
mins = kwargs['min']
|
||||
print(f'Current time: Day {day}, Hour {hour}, Min {mins}')
|
||||
```
|
||||
@@ -1,26 +0,0 @@
|
||||
# `event` onUnban
|
||||
> [!TIP] This event can be cancelled
|
||||
!!! note
|
||||
If serial/mac/ip/name indexes doesn't exist, then the parameters has not been specified when ban was added.
|
||||
If timestamp doesn't exist, then ban was permanent.
|
||||
|
||||
This event is triggered when ban with specified info is being removed.
|
||||
|
||||
Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/general/onUnban/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `str` **mac**: MAC address of the banned player.
|
||||
* `str` **ip**: IP address of the banned player.
|
||||
* `str` **serial**: serial of the banned player.
|
||||
* `str` **name**: nickname of the banned player.
|
||||
* `int` **timestamp**: timestamp when the ban expires.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onUnban')
|
||||
def onUnban(**kwargs):
|
||||
print(f'Player {kwargs['name']} has been unbanned.')
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
# `event` onPacket
|
||||
This event is triggered when new packet arrives from the client.
|
||||
|
||||
Original: [onPacket](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/network/onPacket/)
|
||||
|
||||
## Parameters
|
||||
* `dict` **kwargs**:
|
||||
* `int` **playerid**: the id of the player who sent the packet.
|
||||
* `Packet` **data**: data sended over network from client side.
|
||||
|
||||
## Usage
|
||||
```python
|
||||
import g2o
|
||||
|
||||
@g2o.event('onPacket')
|
||||
def onPacketEvt(**kwargs):
|
||||
data = kwargs['data']
|
||||
message = data.readString()
|
||||
|
||||
print(f'Got packet from {kwargs['playerid']} (bytes used {data.bytesUsed})')
|
||||
print(f'Packet says: {message}')
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
# `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']}.')
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
# `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']}.')
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,25 +0,0 @@
|
||||
# `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}')
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
# `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?')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,24 +0,0 @@
|
||||
# `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
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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'])
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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')
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
# `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}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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']}')
|
||||
```
|
||||
@@ -1,17 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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'])
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
# `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')
|
||||
```
|
||||
@@ -1,17 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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.')
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
# `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'])
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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'])
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
# `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}')
|
||||
```
|
||||
@@ -1,18 +0,0 @@
|
||||
# `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'])
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
# `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'])
|
||||
```
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` sendMessageToAll
|
||||
::: g2o.functions.chat.sendMessageToAll
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` sendMessageToPlayer
|
||||
::: g2o.functions.chat.sendMessageToPlayer
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` sendPlayerMessageToAll
|
||||
::: g2o.functions.chat.sendPlayerMessageToAll
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` sendPlayerMessageToPlayer
|
||||
::: g2o.functions.chat.sendPlayerMessageToPlayer
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` addEvent
|
||||
::: g2o.functions.event.addEvent
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` callEvent
|
||||
::: g2o.functions.event.callEvent
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` event
|
||||
::: g2o.functions.event.event
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` removeEvent
|
||||
::: g2o.functions.event.removeEvent
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` removeEventHandler
|
||||
::: g2o.functions.event.removeEventHandler
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` toggleEvent
|
||||
::: g2o.functions.event.toggleEvent
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` exit
|
||||
::: g2o.functions.game.exit
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getDayLength
|
||||
::: g2o.functions.game.getDayLength
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getHostname
|
||||
::: g2o.functions.game.getHostname
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getMaxSlots
|
||||
::: g2o.functions.game.getMaxSlots
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getPlayersCount
|
||||
::: g2o.functions.game.getPlayersCount
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getServerDescription
|
||||
::: g2o.functions.game.getServerDescription
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getServerWorld
|
||||
::: g2o.functions.game.getServerWorld
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getTime
|
||||
::: g2o.functions.game.getTime
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` serverLog
|
||||
::: g2o.functions.game.serverLog
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` setDayLength
|
||||
::: g2o.functions.game.setDayLength
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` setServerDescription
|
||||
::: g2o.functions.game.setServerDescription
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` setServerWorld
|
||||
::: g2o.functions.game.setServerWorld
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` setTime
|
||||
::: g2o.functions.game.setTime
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` clearNpcActions
|
||||
::: g2o.functions.npc.clearNpcActions
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` createNpc
|
||||
::: g2o.functions.npc.createNpc
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` destroyNpc
|
||||
::: g2o.functions.npc.destroyNpc
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getNpcAction
|
||||
::: g2o.functions.npc.getNpcAction
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getNpcActions
|
||||
::: g2o.functions.npc.getNpcActions
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getNpcActionsCount
|
||||
::: g2o.functions.npc.getNpcActionsCount
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getNpcHostPlayer
|
||||
::: g2o.functions.npc.getNpcHostPlayer
|
||||
@@ -1,2 +0,0 @@
|
||||
# `function` getNpcLastActionId
|
||||
::: g2o.functions.npc.getNpcLastActionId
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user