Take GetSpellAbilityId and convert to String Order?

cleeezzz

The Undead Ranger.
Reaction score
268
This is probably obvious but i cant seem to convert an ability ID into a string order. like if the raw id for shockwave is "A001" then a conversion of that id would return "shockwave"
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I don't think that's possible ? :S
Wouldn't you need an array or something for it, and manually type in the stuff ? ...
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
JASS:
GetObjectName('A000')

If you don't change the name of the ability, the string will change depends the wc3 language installed. (English,French,Spanish and so one)
 

Romek

Super Moderator
Reaction score
964
> If you don't change the name of the ability, the string will change depends the wc3 language installed. (English,French,Spanish and so one)
This wouldn't work for many abilities.

You'd have to manually store each string into a hashtable, with the ability id as the key, so you could retrieve the string from the id.
This take a ridiculously long time to do, and may not be worth it. :p
 
Reaction score
341
Something like this should work for most default abilities.

JASS:
function GetSpecialSpellOrder takes string order returns string 
    if (order == "stormbolt") then 
        set order = "thunderbolt" 
    endif 
    if (order == "siphonmana" and order == "lifedrain") then 
        set order = "drain" 
    endif 
    if (order == "holylight") then 
        set order = "holybolt" 
    endif 
    if (order == "aerialshackles") then 
        set order = "magicleash" 
    endif 
    if (order == "dispelmagic") then 
        set order = "dispel" 
    endif 
    if (order == "abolishmagic") then 
        set order = "autodispel" 
    endif 
    return order 
endfunction 

function GetSpellAbilityOrder takes integer abilId returns string
    local string order = StringCase(GetObjectName(abilId), false)
    local string out   = ""
    local integer ln   = StringLength(order)
    local integer i    = 0
    loop
        exitwhen i > ln
        if not (SubString(order, i, i + 1) == " " or SubString(order, i, i + 1) == "-") then
            set out = out + SubString(order, i, i + 1)
        endif
        set i = i + 1
    endloop
    return GetSpecialSpellOrder(out)
endfunction


Though, if you don't need it to be dynamic I would suggest poots object data extractor (once it supports abilities)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
JASS:
if (order == "siphonmana" and order == "lifedrain") then


Shouldn't it be [ljass]or[/ljass] there ? :S
 

cleeezzz

The Undead Ranger.
Reaction score
268
ah thanks but i realized i could just change the event to Unit issued order and convert order id to string lol, rep anyway
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top