When my any hero in my dies, a timer window appears. It destroys the window after a few seconds depending the level of the hero. My question here is, how can you destroy the timer window when you revive your in a tavern.
Here is the code for the hero revive thing:
I used custom script to give local variables. That way, multiple heroes can revive without variables overwriting themselves.
Here is the code for the hero revive thing:
Code:
Revive Hero
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
((Triggering unit) is A Hero) Equal to True
(Unit-type of (Triggering unit)) Not equal to Footman
(Unit-type of (Triggering unit)) Not equal to Goblin Merchant
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) * 1 )
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 )
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(gg_rct_herostartingpoint), true )
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)
I used custom script to give local variables. That way, multiple heroes can revive without variables overwriting themselves.