• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Hero Ressurection Script

Status
Not open for further replies.
Level 12
Joined
May 30, 2009
Messages
829
A hero resurrection script written by SD_Ryoko and "uploaded" by me. Written in regular JASS not vJASS.

How to Implement: Copy and Paste this into your map. (Not into a trigger, the start script)

JASS:
function rez takes nothing returns nothing
 local timerdialog WINDOW
 local integer HEROWAIT
 local timer OURTIMER
 local unit OURHERO
 set OURHERO = GetDyingUnit()
 set HEROWAIT = ( GetHeroLevel(OURHERO)*5)
 set OURTIMER = CreateTimer()
 call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
 call CreateTimerDialogBJ(OURTIMER,GetPlayerName(GetOwningPlayer(OURHERO)))
 set WINDOW = GetLastCreatedTimerDialogBJ()
 call TimerDialogDisplayForPlayerBJ(true,WINDOW,GetOwningPlayer(OURHERO))
 call PolledWait(HEROWAIT)
 call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()),true)
 call PanCameraToTimedLocForPlayer(GetOwningPlayer(OURHERO),GetUnitLoc(OURHERO),0.60)
 call DestroyTimerDialog(WINDOW)
endfunction
  • Events
  • Conditions
  • 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, GetRectCenter(GetPlayableMapRect()),true)
    • Custom Script: call PanCameraToTimedLocForPlayer(GetOwningPlayer(OURHERO),GetUnitLoc(OURHERO),0.60)
    • Custom Script: call DestroyTimerDialog(WINDOW)
Attached map by SD_Ryoko contains the resurrection trigger and more. :thumbs_up:
 
Last edited:
Status
Not open for further replies.
Top