• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Limited Revive

Level 9
Joined
Mar 26, 2020
Messages
202
Hello hive pips, is it possible to limit to revive a hero? ex: a hero can only be revive twice (since the first is technically trained) and dying thrice can no longer be revive.

im trying to test a trigger where hero can only be field thrice, like fresh-wounded-critical-dead for good stage something like that
 
This should work:
  • Events
    • Unit - A unit Becomes revivable
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Paladin
  • Actions
    • Set Variable Paladin_Revives = (Paladin_Revives - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Paladin_Revives Equal to 0
      • Then - Actions
        • Unit - Remove (Triggering unit) from the game
      • Else - Actions
Paladin_Revives is an Integer variable, set it's initial value to 3.

Alternatively, you could try to change it's Owner to Neutral Passive. That way it's still accessible in the future if you ever wanted to revive it again. Removed units are gone for good.
 
  • Events
    • Unit - A unit Becomes revivable
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Paladin
  • Actions
    • Set Variable Paladin_Revives = (Paladin_Revives - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Paladin_Revives Equal to 0
      • Then - Actions
        • Unit - Remove (Triggering unit) from the game
      • Else - Actions
And indeed it does work, this is exactly what i had in mind, thank you very much Uncle, worked like a charm :thumbs_up:
 
Back
Top