Is there a function to get an ability's string order Id?
like supposing i want a random spell to be cast which is to be chosen from an array of spells
Array spells [0] = firebolt
array spells [1] = stormbolt
array Spells [2] = cripple
So i create a dummy unit and add the ability to it, but how do I get the string order Id of the spell? =\
after a few minutes of researching I have come up with:
local integer i = GetRandomInt(0, 5)
call UnitAddAbility( dummy, udg_Spells)
call IssueTargetOrder( dummy , GetAbilityName(udg_Spells) , targetunit )
It works, BUT only because the name of the spell is the same as the name of the string order id.
Any1 got a better way of doing this?
like supposing i want a random spell to be cast which is to be chosen from an array of spells
Array spells [0] = firebolt
array spells [1] = stormbolt
array Spells [2] = cripple
So i create a dummy unit and add the ability to it, but how do I get the string order Id of the spell? =\
after a few minutes of researching I have come up with:
local integer i = GetRandomInt(0, 5)
call UnitAddAbility( dummy, udg_Spells)
call IssueTargetOrder( dummy , GetAbilityName(udg_Spells) , targetunit )
It works, BUT only because the name of the spell is the same as the name of the string order id.
Any1 got a better way of doing this?