• 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.

Hero, Creep Revive v1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Wolf_Wing
This is just a simple hero revive for both creep and players. Also a creep revive system not much you can really use to explain it there are 2 variables needed to import this not hard to find them also made is jass useful for RPGs to import this copy the Systems folder and paste it into your map make sure you have auto create missing variables on although there is only 3 variables that you need to recreate

  • Hero Revival
    • Events
      • Unit - A unit Dies
    • Conditions
      • (((Dying unit) is A Hero) Equal to True) and (((Owner of (Dying unit)) is an enemy of Neutral Hostile) Equal to True)
    • Actions
      • Set Hero_loc = (Center of Respawn <gen>)
      • Game - Display to (All players) for 15.00 seconds the text: ((|cffff0000 + (Name of (Owner of (Dying unit)))) + (|r + ( has been killed by a + (|cffff0000 + ((Name of (Killing unit)) + |r)))))
      • Countdown Timer - Start OURTIMER as a One-shot timer that will expire in 15.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Hero Revival
      • Set Timer_window = (Last created timer window)
      • Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
      • Wait 15.00 seconds
      • Countdown Timer - Destroy Timer_window
      • Hero - Instantly revive (Dying unit) at Hero_loc, Hide revival graphics
      • Camera - Pan camera for (Owner of (Dying unit)) to Hero_loc over 0.00 seconds
      • Custom script: call RemoveLocation(udg_Hero_loc)
JASS:
function Trig_Hero_dying_Func001001 takes nothing returns boolean
    return ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true )
endfunction

function Trig_Hero_dying_Func001002 takes nothing returns boolean
    return ( IsUnitType(GetDyingUnit(), UNIT_TYPE_SUMMONED) == false )
endfunction

function Trig_Hero_dying_Conditions takes nothing returns boolean
    if ( not GetBooleanAnd( Trig_Hero_dying_Func001001(), Trig_Hero_dying_Func001002() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_dying_Actions takes nothing returns nothing
    local unit u = GetDyingUnit()
    local integer utype=GetUnitTypeId(u)
    local real ang = GetUnitFacing(u)
    local integer herolv = GetHeroLevel(u)
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    call TriggerSleepAction( 60.00 )
    call RemoveUnit(u)
    set u = CreateUnit(GetTriggerPlayer(),utype,x,y,ang)
    if herolv > 1 then
    call SetHeroLevel(u,herolv,false)
    endif
    set u = null
endfunction

//===========================================================================
function InitTrig_Hero_dying takes nothing returns nothing
    set gg_trg_Hero_dying = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Hero_dying, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Hero_dying, Condition( function Trig_Hero_dying_Conditions ) )
    call TriggerAddAction( gg_trg_Hero_dying, function Trig_Hero_dying_Actions )
endfunction

JASS:
function Trig_Unit_dieing_Func001001 takes nothing returns boolean
    return ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == false )
endfunction

function Trig_Unit_dieing_Func001002 takes nothing returns boolean
    return ( IsUnitType(GetDyingUnit(), UNIT_TYPE_SUMMONED) == false )
endfunction

function Trig_Unit_dieing_Conditions takes nothing returns boolean
    if ( not GetBooleanAnd( Trig_Unit_dieing_Func001001(), Trig_Unit_dieing_Func001002() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Unit_dieing_Actions takes nothing returns nothing
    local unit u = GetDyingUnit()
    local integer utype=GetUnitTypeId(u)
    local real ang = GetUnitFacing(u)
    local integer herolv = GetHeroLevel(u)
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    call TriggerSleepAction( 30.00 )
    call RemoveUnit(u)
    set u = CreateUnit(GetTriggerPlayer(),utype,x,y,ang)
    if herolv > 1 then
    call SetHeroLevel(u,herolv,false)
    endif
    set u = null
endfunction

//===========================================================================
function InitTrig_Unit_dieing takes nothing returns nothing
    set gg_trg_Unit_dieing = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Unit_dieing, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Unit_dieing, Condition( function Trig_Unit_dieing_Conditions ) )
    call TriggerAddAction( gg_trg_Unit_dieing, function Trig_Unit_dieing_Actions )
endfunction

Keywords:
RPG, creep, respawn, hero, revive, test, new , jass, gui
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Hero, Creep Revive v1 | Reviewed by Maker | 10th Mar 2013 NEEDS FIX The coding is not good enough. I suggest you ask for tips in Trigger and Scripts forum...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.


Hero, Creep Revive v1 | Reviewed by Maker | 10th Mar 2013
NEEDS FIX


126248-albums6177-picture66522.png


  • The coding is not good enough.
    I suggest you ask for tips in Trigger and Scripts forum.
126248-albums6177-picture66524.png
[tr]
 
The unit type should be stored as a local integer.

Didnt think you are going to answer.. there could be done some tricks to do so but general point was that location of unit is attribute of object class that actually represents unit and once unit is gone it's attribute is gone as well, so location is lost. I wanted to give him thinking problems, thats all.
Of course, i do not need that, please do not bother yourself trying to explain to me how it should work (answer is simple), thats task just for this guy. Thanks ;)
 
Top