Mercurial > wow > mylilpony
diff libMyLilPony/libMyLilPony_mountData.lua @ 52:64e8f8e5fa41
Simplified some functions since mount type is can be determined from slot ID
author | syzler |
---|---|
date | Sat, 07 Mar 2015 14:15:17 -0500 |
parents | 83e9649a6606 |
children | 81145a681a59 |
line wrap: on
line diff
--- a/libMyLilPony/libMyLilPony_mountData.lua Sat Mar 07 02:55:27 2015 -0500 +++ b/libMyLilPony/libMyLilPony_mountData.lua Sat Mar 07 14:15:17 2015 -0500 @@ -1,4 +1,4 @@ --- Copyright (c) 2012, Syzler +-- Copyright (c) 2015, Syzler -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -119,7 +119,7 @@ [75207] = "V"; -- abyssal seahorse }; ---- Checks whether or not the specified spell ID is a ground mount. +--- OBSOLETE. Checks whether or not the specified spell ID is a ground mount. -- @param spellId The spell ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified spell is a ground mount. function MyLilPony.IsGroundMount(spellId) @@ -127,7 +127,7 @@ return entry ~= nil and string.match(entry, "G"); end ---- Checks whether or not the specified spell ID is a flying mount. +--- OBSOLETE. Checks whether or not the specified spell ID is a flying mount. -- @param spellId The spell ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified spell is a flying mount. function MyLilPony.IsFlyingMount(spellId) @@ -135,7 +135,7 @@ return entry ~= nil and string.match(entry, "A"); end ---- Checks whether or not the specified spell ID is an aquatic mount. +--- OBSOLETE. Checks whether or not the specified spell ID is an aquatic mount. -- @param spellId The spell ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified spell is an aquatic mount. function MyLilPony.IsAquaticMount(spellId) @@ -143,7 +143,7 @@ return entry ~= nil and string.match(entry, "S"); end ---- Checks whether or not the specified spell ID is a Temple of Ahn'Qiraj mount. +--- OBSOLETE. Checks whether or not the specified spell ID is a Temple of Ahn'Qiraj mount. -- @param spellId The spell ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified spell is a Temple of Ahn'Qiraj mount. function MyLilPony.IsAhnQirajMount(spellId) @@ -151,10 +151,50 @@ return entry ~= nil and string.match(entry, "Q"); end ---- Checks whether or not the specified spell ID is a Vashj'ir mount. +--- OBSOLETE. Checks whether or not the specified spell ID is a Vashj'ir mount. -- @param spellId The spell ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified spell is a Vashj'ir mount. function MyLilPony.IsVashjirMount(spellId) local entry = MyLilPony_Mounts[spellId]; return entry ~= nil and string.match(entry, "V"); end + +--- Checks whether or not the specified slot ID is a ground mount. +-- @param slotID The slot ID of the mount to be checked. +-- @return A Boolean value indicating whether or not the specified mount is a ground mount. +function MyLilPony.IsGroundMountSlot(slotID) + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + return mountType == 230 or mountType == 284; +end + +--- Checks whether or not the specified slot ID is a flying mount. +-- @param slotID The slot ID of the mount to be checked. +-- @return A Boolean value indicating whether or not the specified mount is a flying mount. +function MyLilPony.IsFlyingMountSlot(slotID) + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + return mountType ==247 or mountType == 248; +end + +--- Checks whether or not the specified slot ID is an aquatic mount. +-- @param slotID The slot ID of the mount to be checked. +-- @return A Boolean value indicating whether or not the specified mount is an aquatic mount. +function MyLilPony.IsAquaticMountSlot(slotID) + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + return mountType == 231 or mountType == 254; +end + +--- Checks whether or not the specified slot ID is a Temple of Ahn'Qiraj mount. +-- @param slotID The slot ID of the mount to be checked. +-- @return A Boolean value indicating whether or not the specified mount is a Temple of Ahn'Qiraj mount. +function MyLilPony.IsAhnQirajMountSlot(slotID) + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + return mountType == 241; +end + +--- Checks whether or not the specified slot ID is a Vashj'ir mount. +-- @param slotID The slot ID of the mount to be checked. +-- @return A Boolean value indicating whether or not the specified mount is a Vashj'ir mount. +function MyLilPony.IsVashjirMountSlot(slotID) + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + return mountType == 232 or mountType == 231 or mountType == 254; +end