Warcraft III resources & community, 2003–2006 · archived

String to spellability ID?

4 posts
#1

String to spellability ID?

Ive been trying to convert a string to a spellability ID the 4 integerletter code but I cannot figure out how to do so.

I tried,
        set udg_itemnameidcode = SubStringBJ(udg_Itembase[udg_rowp[udg_pagenumber]], ( StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]) - 7 ), ( StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]) - 4 ))

        set udg_spells = S2I(udg_itemnameidcode)

        set udg_itemnameidcode2 = SubStringBJ(udg_Itembase[udg_rowp[udg_pagenumber]], ( StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]) - 3 ), StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]))

        set udg_spells_attackspeed = S2I(udg_itemnameidcode2)


which takes item Longsword A00AA00V
and chops the end of its name into
A00A
A00V
the S2I converts it to an integer so it should be a usable spell ID right?

and the spell longsword is A00A while its swingspeed modifier is spellid A00V.

And when i use the:

        Unit - Add spells to Hero
              Unit - Add spells_attackspeed to Hero


it will not give the ability to the guy! i know it works because if i do it manually it does.
but i cannot get it to use the string to apellID.

Please help.
#2
rawcodes are Integers 'A001" this is an integer rawcode,
or this is what u need I2S(GetSpellAbilityId())