Kayoss666
Member
- Reaction score
- 7
i am just getting the hang of Jass but this code is just not working at all but jasshelper finds no problems with it. So i am assuming i inserted something right but not for what i want. i commented to the three spots i think the error could be but i don't know Jass good enough to tell.
JASS:
function Trig_ReviveHero_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
return false //^^error might be here not sure if IsUnitType was set up right
endif
return true
endfunction
function Trig_ReviveHero_Actions takes nothing returns nothing
if ( Trig_ReviveHero_Conditions() and GetLocalPlayer()==GetOwningPlayer(GetDyingUnit()) ) then //also this if state might be the cause
set udg_deathtollwindow[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] = CreateTimerDialog(udg_deathtoll[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])
call TimerDialogDisplay(udg_deathtollwindow[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], true)
call TimerDialogSetTitle(udg_deathtollwindow[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], "Revive")
call TimerStart( udg_deathtoll[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], 40.00, false, null)
call TriggerSleepAction( 40.00 )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetDyingUnit()), udg_Restart_point[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], 0 )
call ReviveHeroLoc( GetDyingUnit(), udg_Restart_point[(GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit())))], false )
call DestroyTimerDialog(udg_deathtollwindow[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_ReviveHero takes nothing returns nothing
set gg_trg_ReviveHero = CreateTrigger( )
//The error might be in the player part on next line but i believe it should work.vv
call TriggerRegisterPlayerUnitEvent(gg_trg_ReviveHero, GetOwningPlayer(GetDyingUnit()), EVENT_PLAYER_UNIT_DEATH, null)
call TriggerAddAction( gg_trg_ReviveHero, function Trig_ReviveHero_Actions )
endfunction