H
Hjalle
Guest
Ok, this is among my first triggers i made in Jass, since i learned it yesterday.
So i wanted to make a hero revive trigger that revives the hero at the position where it died after 10 seconds.
So first I wonder if this is a good way to do it:
Secondly, can i create a local unit variable in, lets say the first function. And call it u, set it to triggering unit.
Then create another function that takes unit u, the local variable to another function?
At last, How come my revive trigger revive creeps that dies to?
So i wanted to make a hero revive trigger that revives the hero at the position where it died after 10 seconds.
So first I wonder if this is a good way to do it:
JASS:
function If_Hero takes nothing returns boolean
if( not( IsUnitType( GetTriggerUnit() , UNIT_TYPE_HERO ) == true ) ) then
return false
endif
return true
endfunction
function Revive_Hero takes nothing returns nothing
local real X = GetUnitX( GetTriggerUnit() )
local real Y = GetUnitY( GetTriggerUnit() )
call DisplayTextToForce( GetPlayersAll(), "|cffff0000Hello there, a hero died|r." )
call TriggerSleepAction( 10.00 )
call ReviveHeroLoc( GetTriggerUnit(), OffsetLocation( GetRectCenter( GetEntireMapRect() ), X, Y ), true )
endfunction
//===========================================================================
function InitTrig_TRevive takes nothing returns nothing
set gg_trg_TRevive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_TRevive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_TRevive, function Revive_Hero )
endfunction
Secondly, can i create a local unit variable in, lets say the first function. And call it u, set it to triggering unit.
Then create another function that takes unit u, the local variable to another function?
At last, How come my revive trigger revive creeps that dies to?