Smarter
Member
- Joined
- Jan 15, 2010
- Messages
- 763
- Reaction score
- 9
I am making a PB Profile for training riding, and purchasing a default mount, because i'm so lazy I can't be bothered to manually do such a thing
. However, I'd like to check if the character owns the "Default Mount" of my choosing before it goes buying it anyways .... but I cannot seem to find an LUA function for checking known mounts? :-\ Unless I enumerate GetCompanionInfo, which would be improbable in PB?

Code:
var mountList = new List<string>();
using (new FrameLock())
{
var count = Lua.GetReturnVal<int>("GetNumCompanions(\"MOUNT\");", 0);
for (int i = 1; i <= count; i++)
{
var companionInfo = Lua.GetReturnValues("return GetCompanionInfo(\"MOUNT\", " + i + ");");
/*
* creatureID - Unique ID of the companion (usable with PlayerModel:SetCreature) (number)
* creatureName - Localized name of the companion (string)
* spellID - The "spell" for summoning the companion (usable with GetSpellLink et al) (number)
* icon - Path to an icon texture for the companion (string)
* active - 1 if the companion queried is currently summoned; otherwise nil (1nil)
* mountFlags - A bitfield that indicates mount capabilities. Only returned for mounts. (bitfield) *
*/
mountList.Add(companionInfo[1]);
}
}
Last edited: