Scripting
Script Structure
onEquipItem(player, item, slot)Parameters:
player: Player equipping the item.
item: Item being equipped.
slot: Slot where the item is being equipped.
CONST_SLOT_HEAD
CONST_SLOT_NECKLACE
CONST_SLOT_BACKPACK
CONST_SLOT_ARMOR
CONST_SLOT_RIGHT
CONST_SLOT_LEFT
CONST_SLOT_LEGS
CONST_SLOT_FEET
CONST_SLOT_AMMO
CONST_SLOT_RING
Return Value:
true: Item will be equipped to the slot.
false: Item will not be equipped to the slot, sends player the message "You cannot equip this item".
Example:
onDeEquipItem(player, item, slot)Parameters:
player: Player removing the item from their inventory.
item: Item being removed.
slot: Slot where the item is located (see onEquipItem slot for slot enums)
Return Value:
true: Item will be de-equipped from the slot.
false: Item will not be de-equipped from the slot.
Example:
onStepIn(creature, item, position, fromPosition)Parameters:
creature: Creature moving (includes Players / Monsters / NPCs).
item: Item the creature is moved to.
position: Position the creature is moving to.
fromPosition: Position the creature is moving from.
Return Value:
None
Example:
onStepOut(creature, item, position, fromPosition)Parameters:
creature: Creature moving (includes Players / Monsters / NPCs).
item: Item the creature is moved to.
position: Position the creature is moving to.
fromPosition: Position the creature is moving from.
Return Value:
None
Example:
onAddItem(moveitem, tileitem, pos)Parameters:
moveitem: Item being moved.
tileitem: The item on top of the tile item stack where the item is being thrown to.
pos: Position the item is being moved to.
Return Value:
true: Item will be thrown at the destination.
false: Item will not be moved to the destination.
Example:
onRemoveItem(moveitem, tileitem, pos)Parameters:
moveitem: Item being moved.
tileitem: The item on top of the tile item stack where the item is being thrown to.
pos: Position the item is being moved to.
Return Value:
true: Item will be removed from the tile.
false: Item will not be removed from the tile.
Example:
Last updated