Hello,
I did a modifycation to this trigger in order that it could revive in a random region... But now I want to put a limit of time to revive... of 120 seconds.
Can someone help to do it? i don't know nothing about JASS
I did a modifycation to this trigger in order that it could revive in a random region... But now I want to put a limit of time to revive... of 120 seconds.
Can someone help to do it? i don't know nothing about JASS
Code:
Revive
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
Actions
Custom script: local timerdialog WINDOW
Custom script: local integer HEROWAIT
Custom script: local timer OURTIMER
Custom script: local unit OURHERO
Custom script: set OURHERO = GetDyingUnit()
Custom script: set HEROWAIT = ( GetHeroLevel(OURHERO) * 4 )
Custom script: set OURTIMER = CreateTimer()
Custom script: call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
Custom script: call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
Custom script: set WINDOW = GetLastCreatedTimerDialogBJ()
Custom script: call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) )
Custom script: call PolledWait( HEROWAIT )
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 50
Then - Actions
Custom script: call ReviveHeroLoc( GetTriggerUnit(), GetRectCenter(gg_rct_ItemsHums), true )
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)
Else - Actions
Custom script: call ReviveHeroLoc( GetTriggerUnit(), GetRectCenter(gg_rct_HumsBL), true )
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)