• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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