HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

String to Spell ability Id

12-05-2004, 01:39 AM#1
sansui
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,
Code:
        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:

Code:
        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 spellID.

Please help.
12-05-2004, 10:45 AM#2
PitzerMike
As soon as you have got the "A00A" and "A00V" as string you'll simply need to pass both to this function
http://kattana.users.whitehat.dk/script/?script=344

It will return the integer value. (S2I doesn't work in this case)
12-05-2004, 03:43 PM#3
sansui
Thankyou very much.