XeNiM666
I lurk for pizza
- Reaction score
- 138
well simple question...
how would i know/set if an ability is an ultimate?
how would i know/set if an ability is an ultimate?
If it is a hero spell and its minimum required level is higher than 1, WC3 considers it an "ultimate", with a few exceptions (eg. Phoenix Fire).
No. What I mean is that even if you edit its settings to fit the profile of an "ultimate", it still won't target spell immune units even if the gameplay constants are set to allow ultimates to do so.Is Phoenix Fire an ultimate? It's not even a hero ability.
function IsAbilityUltimate takes integer id returns boolean
local string s = GetObjectName(id)
return SubString(s, StringLength(s)-4, StringLength(s)) == " (U)"
endfunction
if IsAbilityUltimate(039;A006039;) then
call BJDebugMsg("ULTI")
else
call BJDebugMsg("NOT ULTI")
endif
and will work faster in-game.
keyword ultimateList
globals
ultimateList spells
endglobals
struct ultimateList extends array
private boolean isUltimateX
// Not explicitly required, but if you wish to do something upon setting the boolean...
public method operator isUltimate= takes integer i, boolean flag returns nothing
set spells<i>.isUltimateX = flag
endmethod
public method operator isUltimate takes integer i returns boolean
debug if spells<i>.isUltimateX = null then
debug DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Warning (isUltimate): Null boolean!")
debug // Do something else? I.E. return false ?
debug endif
return spells<i>.isUltimateX
endmethod
private static method onInit takes nothing returns nothing
set spells = thistype.allocate()
set spells[A000].isUltimateX = true
set spells[A001].isUltimateX = true
endmethod
endstruct
//usage
scope myTest initializer init
private function init takes nothing returns nothing
if ( ultimates[A000].isUltimate ) then
// Do Something
else
// Do Something Else
endif
endfunction
endscope
</i></i></i>
forgot your own post...lololol...