Interface:Creature Events - RodrigoOt/forgottenserver GitHub Wiki
These events run whenever something happens to a creature and/or player.
###Available events:
onAdvance()
onDeath()
onExtendedOpcode()
onHealthChange()
onKill()
onLogin()
onLogout()
onManaChange()
onModalWindow()
onPrepareDeath()
onTextEdit()
onThink()
###### onAdvance() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onDeath() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onExtendedOpcode() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onHealthChange() > **Description:** This event runs each time a (registered) creatures health changes. > **Parameters:**
- _creature_ - _Creature userdata of the victim_
- _attacker_ - _Creature userdata of the attacker, can be nil_
- _primaryDamage_ - _First part of the damage (always a positive value)_
- _primaryType_ - _First damage type_
- _secondaryDamage_ - _Second part of the damage (always a positive value)_
- _secondaryType_ - _Second damage type_
- _origin_ - _What were you hit by? A spell? Melee?_
###### onKill() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onLogin() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onLogout() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onManaChange() > **Description:** This event runs each time a (registered) creatures mana changes. > **Parameters:**
- _creature_ - _Creature userdata of the victim_
- _attacker_ - _Creature userdata of the attacker, can be nil_
- _manaChange_ - _How much mana you have gained or lost (always a positive value)_
###### onModalWindow() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onPrepareDeath() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onTextEdit() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0
###### onThink() > **Description:** N/A > **Parameters:** N/A > **Accepted return values:** N/A > **Example:** ```Lua N/A ``` Added in version: 1.0