@JAKEZINC :
Thanks for the information, if the native crashes the thread with a nil parameter, it is something to take into consideration.
Yes, so far I always had used not IsUnitType(unit, UNIT_TYPE_DEAD) to check the alive status of a unit, and after reading some stuff in this very forum since my return in December, many seemed to believe that the common.ai native was better (maybe because the native had a single parameter ?).
Anyways I had forgotten about it until I started analyzing your Fire Storm vJass code.
And I wasn't sure I could use it straight away in Lua, but now I know I could if I wanted to.
By the way, I have not really had time to do any vJass besides simple scopes, and I have not yet used OOP in my Lua script.
But your code is really nicely written and quite explicit, this will help me a lot.
My map is quite uncommon, so is my script, so I can't simply translate your spell, but as soon as I will understand the mechanics, I will adapt it to the speechifies of my map. I really look forward to it, as it is really a beautiful spell. I really appreciate you sharing it !
The first 3rd party spell in my map will be totally worth the effort, especially as it does not even use any external model.
Again, thank you !!!
@iown_azz :
Thanks, but no.
This BJ from Blizzard.j is nothing but a wrapper for another wrapper :
JASS:
function IsUnitDeadBJ takes unit whichUnit returns boolean
return GetUnitState(whichUnit, UNIT_STATE_LIFE) <= 0
endfunction
//===========================================================================
function IsUnitAliveBJ takes unit whichUnit returns boolean
return not IsUnitDeadBJ(whichUnit)
endfunction
And please note this "GetUnitState(whichUnit, UNIT_STATE_LIFE) <= 0" is not reliable, because some spells like Tranquility (not sure if it still does today) can actually heal dead units HP without making them alive again.
In other words, the unit would be dead but with positive HP, then the BJ function would return false as if the unit was still alive.
"not IsUnitType(unit, UNIT_TYPE_DEAD)" seems to be a perfect pick, and has never let me down before.