Registration

File Location: data/creaturescripts/creaturescripts.xml

Structure

  • type: Event type

  • login

    logout

    think

    preparedeath

    death

    kill

    advance

    healthchange

    manachange

    textedit

    modalwindow

    extendedopcode

  • name: Unique identifier for the event

  • script: Lua script file name & location (base directory is data/creaturescripts/scripts/)

Examples

Notes

When registering a new event that is not a login/logout event, the event must be registered to a creature in order for the script to execute, this is done by using creature:registerEvent(name), where name is the event name provided in creaturescripts.xml. If the event is intended to be registered to a player immediately, the event should be registered in login.lua located in data/creaturescripts/scripts/login.lua where the rest of the player:registerEvent(name) methods are.

Last updated

Was this helpful?