Hekili Priority Helper

Hekili Priority Helper

44M Downloads

Issues with spells not being known

thunderchylde opened this issue ยท 2 comments

commented

I've been playing around with Shadow Priest and I've run into the same issue that I was having with Balance Druid's New Moon.

Shadow Priests have the spell Void Eruption, when you use this to go into Voidform it changes into the spell Void Bolt.

If I add Void Bolt to my APL it will never show up because:

[  3]  Checking void_bolt (Shadow - SimC_ShadowSingle - 2 )...
void_bolt is NOT known and enabled.

I'm using this for Void Bolt:

        void_bolt = {
            id = 205448,
            --id = 228226,
            cast = 0,
            cooldown = function ()
                return 5 * haste
            end,
            gcd = 'spell',
                
            spend = 0,
            spendType = 'insanity',
                
            startsCombat = true,
            texture = 1035040,
                
            bind = "void_eruption",
            buff = 'voidform',
            usable = function ()
                return buff.voidform.up 
            end,
                
            handler = function ()
            end,
        },

Looking at State.lua I'm assuming that it's failing on:

    if ability.known ~= nil then
        if type( ability.known ) == 'number' then
            return IsPlayerSpell( ability.known )
        end
        return ability.known
    end

I've checked with a macro of /script print(IsSpellKnown(205448)) and /script print(IsPlayerSpell(205448)) to confirm that the spell isn't 'known' even when in Voidform.

Looking at https://wow.gamepedia.com/API_IsPlayerSpell it seems that querying an overriding spell doesn't always return as expected.

Should state:IsKnown take into account the bind option to also check if the overridden spell is known in these instances? Or an alternative check?

commented

You can put in a 'known' function that returns true/false to override IsKnown.

commented

Oh, more on known since I just clicked this issue again.

For an ability that replaces another ability, you can generally put the base ability's ID for the known variable -- IsSpellKnown() will generally return true when the ability has swapped.

Otherwise, you can write a function that returns true/false, as I noted before, to report whether an ability is (or should be known).