-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Interface:Creature Events
These events run whenever something happens to a creature and/or player.
onAdvance()
onDeath()
onExtendedOpcode()
onHealthChange()
onKill()
onLogin()
onLogout()
onManaChange()
onModalWindow()
onPrepareDeath()
onTextEdit()
onThink()
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: This event runs each time a (registered) creatures health changes.
Parameters:Accepted return values: 2 or more values must be returned otherwise the event will be cancelled.
- 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?
return 5, COMBAT_FIREDAMAGE, 5, COMBAT_PHYSICALDAMAGE
Example:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
if not attacker then
return 5, COMBAT_FIREDAMAGE, 0, COMBAT_NONE
end
return primaryDamage, primaryType, -secondaryDamage, secondaryType
end
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: This event runs each time a (registered) creatures mana changes.
Parameters:Accepted return values: 1 value must be returned otherwise the event will be cancelled.
- 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)
return 5
Example:
function onManaChange(creature, attacker, manaChange)
if not attacker then
return 0
end
return manaChange
end
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0
Description: N/A
Parameters: N/A
Accepted return values: N/A
Example:
N/A
Added in version: 1.0