LibMounts-1.0

LibMounts-1.0 manual documented

lib:GetMountInfo(id)

Retrieves Mount Information including type, speed and location restrictions

Parameters

id
Spell id of a Mount

Return values

  1. ground boolean true if mount is primarily a ground mount (or can switch between ground and air only modes)
  2. air boolean true if mount is primarily an air mount (or can switch between air and ground only modes)
  3. water boolean true if mount is primarily a water mount
  4. speed number speed of mount if non standard (will always be slower than standard)
  5. location string location this mount is restricted to (valid returns are "Temple of Ahn'Qiraj" for the bug mounts and "Vashj'ir" for the Seahorse)
  6. passagners number number of additional passangers a mount can carry. returns nil if 0

Usage

local ground, air, water, speed, location = LibStub("LibMounts-1.0"):GetMountInfo(id)


lib:GetProfessionRestriction(id)

Checks if the mount has Proffession restrictions and if we meet those restrictions

Parameters

id
Spell id of a Mount

Return values

  1. summanable boolean true if we meet the Profession Restrictions and can summon the mount
  2. profession string Localized Profession name. Nil if the mount has no restrictions
  3. level number Required Profession level

Usage

local summanable, profession, level = LibStub("LibMounts-1.0"):GetProfessionRestriction(id)


lib:GetMountList(MountType)

Retrieves a hash table of all mounts in the db of a certain type

Parameters

MountType
acceptable types include: ground, air, water, Temple of Ahn'Qiraj, Vashj'ir

Return value

mountTable hash table returns a hash table of mount ID's from the given mount type (mounts with special speeds are not returned)

Usage

local mounts = LibStub("LibMounts-1.0"):GetMountList(type)


lib:GetCurrentMountType()

forces a currently usable mount type update and also returns primary and secondary currently usable mount types

Return values

  1. primary string Primary currently usable mount type
  2. secondary string Secondary currently usable mount type
  3. tertiary string Tertiary currently usable mount type

Usage

local primary, secondary = LibStub("LibMounts-1.0"):GetCurrentMountType()


lib.RegisterCallback(addon, event[, callback])

Register for a LibMount-1.0 callback The callback will always be called with the event as the first argument Any arguments to the event will be passed on after that.

Parameters

addon
your addon table/object
event
The event to register for. Currently available: "MOUNT_TYPE_UPDATE" (has primary, secondary and tertiary currently usable mount types as first, second and third arg(lib does not care if the player has mounts for the returned categories))
callback
The callback function to call when the event is triggered (funcref or method, defaults to a method with the event name)

Usage

LibStub("LibMounts-1.0").RegisterCallback(addon, "MOUNT_TYPE_UPDATE", function(...) print(...) end)


lib.UnregisterCallback(addon, event)

Unregister a callback.

Parameters

addon
your addon table/object
event
The event to unregister

Usage

LibStub("LibMounts-1.0").UnregisterCallback(addon, "MOUNT_TYPE_UPDATE")


lib.UnregisterAllCallbacks(addon)

Unregister a callback.

Parameters

addon
your addon table/object

Usage

LibStub("LibMounts-1.0").UnregisterAllCallbacks(addon)


You must login to post a comment. Don't have an account? Register to get one!