Method Global:RegisterUniqueCreatureEvent [-] [+]
Registers a Creature event handler for a single Creature.
In Multistate mode (default), events are either registered to the WORLD state (-1) or the MAP states (map ID). These events will only ever trigger on their respective state.
In Compatibility mode, all events are registered to the WORLD state (-1).
ID | Event | State | Parameters | Comment |
---|---|---|---|---|
1 | ON_ENTER_COMBAT | MAP | event, creature, target | Can return true to stop normal action |
2 | ON_LEAVE_COMBAT | MAP | event, creature | Can return true to stop normal action |
3 | ON_TARGET_DIED | MAP | event, creature, victim | Can return true to stop normal action |
4 | ON_DIED | MAP | event, creature, killer | Can return true to stop normal action |
5 | ON_SPAWN | MAP | event, creature | Can return true to stop normal action |
6 | ON_REACH_WP | MAP | event, creature, type, id | Can return true to stop normal action |
7 | ON_AIUPDATE | MAP | event, creature, diff | Can return true to stop normal action |
8 | ON_RECEIVE_EMOTE | MAP | event, creature, player, emoteid | Can return true to stop normal action |
9 | ON_DAMAGE_TAKEN | MAP | event, creature, attacker, damage | Can return true to stop normal action, can return new damage as second return value. |
10 | ON_PRE_COMBAT | MAP | event, creature, target | Can return true to stop normal action |
12 | ON_OWNER_ATTACKED | MAP | event, creature, target | Can return true to stop normal action. Not on mangos |
13 | ON_OWNER_ATTACKED_AT | MAP | event, creature, attacker | Can return true to stop normal action. Not on mangos |
14 | ON_HIT_BY_SPELL | MAP | event, creature, caster, spellid | Can return true to stop normal action |
15 | ON_SPELL_HIT_TARGET | MAP | event, creature, target, spellid | Can return true to stop normal action |
19 | ON_JUST_SUMMONED_CREATURE | MAP | event, creature, summon | Can return true to stop normal action |
20 | ON_SUMMONED_CREATURE_DESPAWN | MAP | event, creature, summon | Can return true to stop normal action |
21 | ON_SUMMONED_CREATURE_DIED | MAP | event, creature, summon, killer | Can return true to stop normal action. Not on mangos |
22 | ON_SUMMONED | MAP | event, creature, summoner | Can return true to stop normal action |
23 | ON_RESET | MAP | event, creature | |
24 | ON_REACH_HOME | MAP | event, creature | Can return true to stop normal action |
26 | ON_CORPSE_REMOVED | MAP | event, creature, respawndelay | Can return true to stop normal action, can return new respawndelay as second return value |
27 | ON_MOVE_IN_LOS | MAP | event, creature, who | Can return true to stop normal action. Does not actually check LOS, just uses the sight range |
30 | ON_DUMMY_EFFECT | MAP | event, caster, spellid, effindex, creature | |
31 | ON_QUEST_ACCEPT | MAP | event, player, creature, quest | Can return true |
34 | ON_QUEST_REWARD | MAP | event, player, creature, quest, opt | Can return true |
35 | ON_DIALOG_STATUS | MAP | event, player, creature | |
36 | ON_ADD | MAP | event, creature | |
37 | ON_REMOVE | MAP | event, creature |
Synopsis
cancel = RegisterUniqueCreatureEvent( guid, instance_id, event, function )
cancel = RegisterUniqueCreatureEvent( guid, instance_id, event, function, shots )
Arguments
number guid
The GUID of a single Creature.
Valid numbers: integers from 0 to 18,446,744,073,709,551,615.
number instance_id
The instance ID of a single Creature.
Valid numbers: integers from 0 to 4,294,967,295.
number event
Refer to table above.
Valid numbers: integers from 0 to 4,294,967,295.
function function
Function that will be called when the event occurs.
number shots (0)
The number of times the function will be called, 0 means "always call this function".
Valid numbers: integers from 0 to 4,294,967,295.
Returns
function cancel
A function that cancels the binding when called.