Yoww89
New Member
- Reaction score
- 0
I'm new to Jass.
local unit u = GetLastCreatedUnit()
set u = null<< ?
call RemoveUnit( u )
local unit u = GetLastCreatedUnit()
set u = null<< ?
call RemoveUnit( u )
function GetArmor takes unit a returns real
local real r1
local real r2
local real r3
local location p1
local unit u1
set r1 = GetUnitStateSwap(UNIT_STATE_LIFE, a)
set p1 = GetUnitLoc(a)
call CreateNUnitsAtLoc( 1, 039;h000039;, GetOwningPlayer(a), p1, bj_UNIT_FACING )
set u1 = GetLastCreatedUnit()
call UnitDamageTargetBJ( u1, a, 10.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call RemoveUnit( u1 )
set r2 = ( r1 - GetUnitStateSwap(UNIT_STATE_LIFE, a) )
if ( r2 > 10.00 ) then
set r3 = ( ( -1.00 * ( 10.00 - r2 ) ) / ( r2 * 0.06 ) )
else
set r3 = ( ( 10.00 - r2 ) / ( r2 * 0.06 ) )
endif
call SetUnitLifeBJ( a, r1 )
return r3
set u1 = null
set p1 = null
endfunction