W!†A_cRaft
Ultra Cool Member
- Reaction score
- 28
Apparently when you want to get a level of an ability unit has you use a native
but when you want to detect if a unit has a buff you use:
and that function does nothing else than call the above mentioned one, but with a comparison to see if it is >0 like this:
Sooo how does world editor differ am i asking for a buff or a unit with an ability?
only possible answer in my opinion is by the rawcode, but i am not sure that it is it so i am asking?
and also, this means that no buff and abiltiy will ever have the same rawcode, and that we can use abilities (passive or hidden in a spellbook) to act as buffs for checking things with a little jassing? correct?
JASS:
GetUnitAbilityLevel(unit u, integer ability_rawcode)
but when you want to detect if a unit has a buff you use:
JASS:
UnitHasBuffBJ(unit u, integer buff_rawcode)
and that function does nothing else than call the above mentioned one, but with a comparison to see if it is >0 like this:
JASS:
function UnitHasBuffBJ takes unit whichUnit, integer buffcode returns boolean
return (GetUnitAbilityLevel(whichUnit, buffcode) > 0)
endfunction
Sooo how does world editor differ am i asking for a buff or a unit with an ability?
only possible answer in my opinion is by the rawcode, but i am not sure that it is it so i am asking?
and also, this means that no buff and abiltiy will ever have the same rawcode, and that we can use abilities (passive or hidden in a spellbook) to act as buffs for checking things with a little jassing? correct?