Revive hero timer Dont work with altar.

streng

Member
Reaction score
1
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
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)
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
 

Inflicted

Currently inactive
Reaction score
63
You could remove it from the trigger queue if you want.

But it's probably easier just to add a condition before you "Hero - Instantly revive (Triggering unit) at ((Owner of (Triggering unit)) start location), Show revival graphics" asking if the unit is alive.

This is assuming that the unit won't die within the duration, this all depends on your time scaling and your map.

Otherwise you could recreate your system to be able to handle the canceling within the duration.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top