Hi Guys. I have a problem. I Want to create Dota similar revive system. It means , when you have money you can instantly revive hero. If you havent money you must wait until timer ends. Here is my revive triger
When I revive hero from altar , this triger still working and revive hero again. Or when I revive from altar and Unit death in few second Triger revive hero in old Herowait. I dont know how to fix it
Code:
Revive Hero
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) 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) * 5 )
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) )
Countdown Timer - Hide (Last created timer window)
Countdown Timer - Change the title of (Last created timer window) to Respawn in
Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
Custom script: call PolledWait( HEROWAIT )
Hero - Instantly revive (Triggering unit) at ((Owner of (Triggering unit)) start location), Show revival graphics
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)