- Joined
- Aug 18, 2013
- Messages
- 71
Hi guys, I'm new with jass. like this being converted gui, and I'm adding something to it for improvised functionality.
What I added was "local unit u = GetDyingUnit()" but i get errors saying expected a statement on this line etc. I have several years of c++/java coding experience so I understand that my syntax is incorrect. but this is what other people i've looked at on the forums use. Any help?
for those wondering why i added local unit var, i'm assuming this will make it MUI for each player. I didnt want the wait to mess up the getdyingunit() function in GUI
What I added was "local unit u = GetDyingUnit()" but i get errors saying expected a statement on this line etc. I have several years of c++/java coding experience so I understand that my syntax is incorrect. but this is what other people i've looked at on the forums use. Any help?
Code:
function Trig_ReviveHerotest_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_ReviveHerotest_Func010C takes nothing returns boolean
if ( not ( IsPlayerAlly(GetOwningPlayer(GetDyingUnit()), Player(9)) == true ) ) then
return false
endif
return true
endfunction
function Trig_ReviveHerotest_Actions takes nothing returns nothing
set udg_DeathTimeWait[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] = ( I2R(GetHeroLevel(GetDyingUnit())) * 1.50 )
set udg_DeathTimeWait[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] = ( udg_DeathTimeWait[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] + 15.00 )
local unit u = GetDyingUnit()
call StartTimerBJ( udg_DeathTimer[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], false, udg_DeathTimeWait[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))] )
call CreateTimerDialogBJ( udg_DeathTimer[R2I(udg_DeathTimeWait[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])], "TRIGSTR_2145" )
call TimerDialogDisplayForPlayerBJ( true, udg_DeathTimer_Window[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))], GetOwningPlayer(GetDyingUnit()) )
call PolledWait( udg_DeathTimeWait[R2I(udg_DeathTimeWait[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])] )
call TimerDialogDisplayForPlayerBJ( false, udg_DeathTimer_Window[GetConvertedPlayerId(GetOwningPlayer(u))], GetOwningPlayer(u) )
call DestroyTimerDialogBJ( udg_DeathTimer_Window[GetConvertedPlayerId(GetOwningPlayer(u))] )
if ( Trig_ReviveHerotest_Func010C() ) then
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_LightSidePool), true )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetDyingUnit()), GetRectCenter(gg_rct_LightSidePool), 0.00 )
else
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_DarkSidePool), true )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetDyingUnit()), GetRectCenter(gg_rct_DarkSidePool), 0.00 )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_ReviveHerotest takes nothing returns nothing
set gg_trg_ReviveHerotest = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ReviveHerotest, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ReviveHerotest, Condition( function Trig_ReviveHerotest_Conditions ) )
call TriggerAddAction( gg_trg_ReviveHerotest, function Trig_ReviveHerotest_Actions )
endfunction
for those wondering why i added local unit var, i'm assuming this will make it MUI for each player. I didnt want the wait to mess up the getdyingunit() function in GUI