List of Lua Events
From OpenTibia Fans
All event types that can be tied in revscriptsys.
- OnAccountLogin - Triggered when the account list is retrieved from the database.
- OnActorLoadSpell - Triggered while loading a spell (happens during startup/reload).
- OnActorCastSpell - Triggered when an Actor casts a spell.
- OnAdvance - Triggered when a player advances.
- OnAttack - Triggered when a player or monster attacks (using physical weapons).
- OnCondition - Triggered when a condition is added/removed or ticks.
- OnChangeOutfit - Triggered when a player changes outfit using the outfit dialog.
- OnEquip - Triggered when a player equips/unequips an item.
- OnDamage - Triggered when a creature takes damage.
- OnDeath - Triggered when a creature dies.
- OnHear - Triggered when a creature hears someone say something.
- OnJoinChannel - Triggered when a player opens a new channel.
- OnAttack - Triggered when a creature attacks another creature (usually every 2 seconds).
- OnDamage - Triggered when a creature is taking damage (or heals).
- OnKill - Triggered when a creature kills another creature.
- OnLeaveChannel - Triggered when a player closes a channel.
- OnLoadItem - Triggered when an item with notifyOnLoad (?) attribute is loaded.
- OnLogout - Triggered when a player logs out.
- OnLogin - Triggered when a player logs in.
- OnLook - Triggered when a player looks at something.
- OnLoseCreature - Triggered when a creature loses sight of another creature.
- OnMove - Triggered when a creature walks.
- OnMoveItem - Triggered when an item is moved.
- OnSay - Triggered when a player or creature speaks.
- OnServerLoad - Triggered when the server is loaded, or reloaded.
- OnServerUnload - Triggered when the server is about to be reloaded, useful for storing script state through /reload.
- OnShopClose - Triggered when a player closes the shop window.
- OnShopPurchase - Triggered when a player wants to purchase an item from a NPC.
- OnShopSell - Triggered when a player wants to sell an item to a NPC.
- OnSpawn - Triggered when a monster spawns on the map.
- OnSpotCreature - Triggered when a creature sees another creature.
- OnThink - Triggered when a specific creature thinks, which is about one time each second.
- OnTradeBegin - Triggered when a player initiate a trade with another player.
- OnTradeEnd - Triggered when a trade is ended (cancelled or completed).
- OnTurn - Triggered when a player or creature turns.
- OnUseItem - Triggered when a player uses an item, both normal use and "use with...".
| Revscriptsys Reference |
|---|
| List of functions · List of Event Types · List of Examples |
| Lua Libraries - string · table · coroutine · math · IO · OS · Debug |
| Classes - Thing · Creature · Player · Actor · NPC · Item · Container · Teleport · Combat · Condition · Spell · Map · Tile · Town · House · Waypoint · Channel · Command · Vocation · Event · Enum · Thread |
| Events - OnAccountLogin · OnAttack · OnAdvance · OnConditionAdded · OnConditionExpired · OnConditionTick · OnChangeOutfit · OnDamage · OnDeath · OnEquip · OnHear · OnJoinChannel · OnKill · OnLeaveChannel · OnLoadItem · OnLogin · OnLogout · OnLook · OnLoseCreature · OnMove · OnMoveItem · OnSay · OnServerLoad · OnServerUnload · OnSpawn · OnSpotCreature · OnTimer · OnTurn · OnUseItem |

