Skip to content

Mount Functions


gObjGetMountIndex(lpItem)

Returns the mount index from a specific item object.

  • Parameters:
    • lpItem (GameItem): Mount item object.
  • Returns: integer — Mount index, or 0 if the item is not a mount.
local mountIdx = gObjGetMountIndex(player.Inventory[8])

GetMountIndex(lpObj)

Returns the mount index of the player's currently equipped mount.

  • Parameters:
    • lpObj (GameObject): Player object.
  • Returns: integer — Mount index, or 0 if no mount equipped.
local mount = GetMountIndex(player)
if mount > 0 then
    LogAdd(LOG_BLUE, "Riding mount index: " .. mount)
end

GetMountSlot(lpObj, index, checkValid, checkDur, checkPeriod)

Returns the mount slot with optional validation flags.

  • Parameters:
    • lpObj (GameObject): Player object.
    • index (integer): Mount slot index.
    • checkValid (boolean): Validate mount item exists.
    • checkDur (boolean): Check durability > 0.
    • checkPeriod (boolean): Check expiration period.
  • Returns: integer — Mount slot value, or -1 if validation fails.
local slot = GetMountSlot(player, 0, true, true, false)

MountDestroyMoveProc(lpObj)

Removes the mount when the player changes map (dismount on teleport).

  • Parameters:
    • lpObj (GameObject): Player object.
  • Returns: void
MountDestroyMoveProc(player)