Lua: how to get info if a skill can be used

  • Hi!

    Some skills have additional requirements, for example Harmony on B/D requires a staff to be equipped, while Tempo requires an instrument.


    To see from lua if a skill can be used at all at a specific moment, I put such a skill on action bar, and use GetActionUsable(idx). Similarly based on other skills you can figure out if you are in melee range etc.


    Is it possible to get this info for a specific skill without dragging it to a fixed slot in the action bar? Kind of GetSkillUsable(type, idx) = "would it be enabled or grayed-out if it was put on action bar"

    I couldn't find anything in arcadia lua wiki...


    PS: btw, there is a IsSpellUsable( int Index ). What is it? What is the index here? (when I loop from 1 to 100 I just get true for all values of Index...)

    • Official Post

    IsSpellUsable( int Index )

    The function is exactly for what you want to do, accepts skill ID as parameter and returns boolean whether it is usable or not. However, even if it is rare, some skills cannot reach this information as requirement is defined server side, for example Rune Overload of Champion class.


    Greetings

  • Great, thanks, yes, works. :D


    PS: Probably adding docu of functions on lua wiki would cost a lot of work. But maybe renaming arguments would be not be too much effort? Good that the wiki is there, at least we can ask questions as above, but if API said

    Code
    IsSpellUsable( int SkillId )

    instead of "IsSpellUsable( int Index )", probably no questions would be needed. Esp. when skills are numbered per page in skill book, or by id; or equipment by eq slot or bag slot or item id etc. 3 out of 4 integer arguments are called "index" :P


    Still, this lua wiki, even as it is, is the best thing ever. :)