IsMounted API Help
I'm trying to fix a portion of an addon but i'm a bit stuck.
The portion of the addon which causes a new random mount macro to be generate (I want this because it includes the tooltip and icon etc, is currently like this; Code:
function MountManager:UNIT_SPELLCAST_SUCCEEDED(event, unit, spellName) Code:
function MountManager:UNIT_SPELLCAST_SUCCEEDED() |
According to the documentation, the payload (...) for UNIT_SPELLCAST_SUCCEEDED is:
Code:
unitTarget, Type = string, Nilable = false |
Thanks Fizzlemizz,
I have this a try; Code:
function MountManager:UNIT_SPELLCAST_SUCCEEDED(event, unitTarget, spellName) I guess it just need it to basically generate the macro upon a successful mount cast |
Your original code seemed to be comparing spellName to a stored variable, possibly a mount name. Instead of the spell name, you can use the spell id.
Lua Code:
In the code above when I mount, I get a unitTarget of player and the spellId of the mount (17481 which is Rivendare's DeathCharger). Code:
function MountManager:UNIT_SPELLCAST_SUCCEEDED(event, unitTarget, castGUID, spellId) |
Thanks again Fizzlemizz,
For reference the full Lua is here - https://pastebin.com/eTjahqd0 Basically its a random mount macro, and the trigger is meant to detect when you mount it picks a new random mount causing the macro to update icon/tooltip etc |
All times are GMT -6. The time now is 03:37 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI