[Trigger] Hero Revival

Level 16
Joined
Apr 4, 2011
Messages
997
I found an example hero revival system online that uses local variables via custom script to create hero revivals. Problem is, other players can see the timers for their enemies and allies, which I need changed for my map. I want only the player whos hero died to be able to see the timer. I am a GUI guy, so a GUI solution would be best (as in custom script is ok, I don't want to write the whole thing in JASS because I might screw it up o_O)

  • 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) )
      • Custom script: call PolledWait( HEROWAIT )
      • Custom script: call ReviveHeroLoc( OURHERO, GetPlayerStartLocationLoc(GetOwningPlayer(OURHERO)), true )
      • Custom script: call DestroyTimerDialog(WINDOW)
 
Level 25
Joined
Aug 18, 2009
Messages
4,087
JASS:
function CreateTimerDialogBJ takes timer t, string title returns timerdialog
    set bj_lastCreatedTimerDialog = CreateTimerDialog(t)
    call TimerDialogSetTitle(bj_lastCreatedTimerDialog, title)
    call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
    return bj_lastCreatedTimerDialog
endfunction

displays the dialog on default.
 
Top