D
Dreoh
Guest
I made this trigger for my rpg, and it works fine on the first hero that dies but every hero that dies after that it doesnt work, does anyone know whats wrong with it, or how to make it do more than one instance
JASS:
Untitled Trigger 002
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)*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 PolledWait( HEROWAIT )
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()), true )
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)