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

[Trigger] Revive Aura

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
This ability isn't very easy to to so i'll need some help ...
When i say Revive Aura i mean that if a hero unit near the unit with this aura dies he will be revived ...
Lets say a summoning : i summon a unit posesing this ability ... if i die i'll resurect , if the unit dies the aura banishes ...
This is it ... i wait for some ideas or a bit of professional help
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Make it a dummy aura using e.g. devotion aura.
After, set up a trigger like this:

  • Events
    • Unit - A unit dies
  • Conditions
    • (Dying unit) has *aurabuff* equal to True
  • Actions
    • Set tempoint1=Position of (Dying unit)
    • Hero - Revive Dying unit at temppoint1 enabled/disabled level up graphics
    • Custom script: call RemoveLocation(udg_temppoint1)
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Ah shit - i forgot ^^
Well here we go:
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Conditions
      • ((Dying unit) is a hero) Equal to True
    • 'THEN'-Actions
      • Set temppoint1 = (Position of (Dying unit))
      • Set tempreg = (Region centered at temppoint1 with size (x, y))
      • Set tempgroup = (Units in tempreg matching (((Matching unit) has buff Revival Aura) Equal To True))
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • If ((Number of units in tempgroup) Greater or equal than 1) then do (Hero - Instantly revive (Dying unit) at temppoint1, Disabled/Enabled revival graphics) else do (Do nothing)
    • 'ELSE'-Actions
    • Custom script: call RemoveLocation(udg_temppoint1)
    • Custom script: call RemoveRect(udg_tempreg)
    • Custom script: call DestroyGroup(udg_tempgroup)
Seems ok for me.. it puts a region around the dying hero, checks if there's a unit with the buff of the aura and if so, revives the hero.
Btw. the aura-having unit must have the buff in this case.
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
Ah shit - i forgot ^^
Well here we go:
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Conditions
      • ((Dying unit) is a hero) Equal to True
    • 'THEN'-Actions
      • Set temppoint1 = (Position of (Dying unit))
      • Set tempreg = (Region centered at temppoint1 with size (x, y))
      • Set tempgroup = (Units in tempreg matching (((Matching unit) has buff Revival Aura) Equal To True))
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • If ((Number of units in tempgroup) Greater or equal than 1) then do (Hero - Instantly revive (Dying unit) at temppoint1, Disabled/Enabled revival graphics) else do (Do nothing)
    • 'ELSE'-Actions
    • Custom script: call RemoveLocation(udg_temppoint1)
    • Custom script: call RemoveRect(udg_tempreg)
    • Custom script: call DestroyGroup(udg_tempgroup)
Seems ok for me.. it puts a region around the dying hero, checks if there's a unit with the buff of the aura and if so, revives the hero.
Btw. the aura-having unit must have the buff in this case.
not effective enough, since the region is a square and the aura will be shaped as a circle

use Units within X Range of POINT instead, since that works as a circle
 
Level 4
Joined
Jul 23, 2007
Messages
129
Try this, a slight modification of Squiggy's original idea. This creates a dummy unit and checks to see if that unit has the buff instead checking to see if the dying hero has the buff.

  • Revival Aura
  • Events:
  • Unit - A Unit Dies
  • Conditions:
  • (Dying Unit) is (a hero) equal to (true)
  • Actions:
    • Set Temp_Point = Position of (Dying Unit)
    • Unit - Create 1 Dummy_BuffChecker at Temp_Point for (Owner of (Dying Unit))
    • Unit - Add a 3 second generic expiration timer to (last created unit)
    • If conditions, then actions, else actions:
      • If, Conditions:
        • Unit - Last Created Unit has buff (Revival Buff) equal to (true)
      • Then, Actions:
        • Unit - Revive (Dying Unit) Instantly at Temp_Point showing revival graphics
      • Else, Actions:
      • Custom script: call RemoveLocation ( udg_Temp_Point )
[EDIT]Since your aura only affects heroes, your dummy unit needs to be a hero. You need to use the object editor to disable the hero death messages and the hero icon for your dummy hero as well as the standard no collision, invulnerability, no model file, no attacks, no movement, etc.

I really like this idea. Only I think it would be good for a ward! :D If its ok, I'm gonna trigger this ability for my map.
 
Last edited:
Level 4
Joined
Jul 23, 2007
Messages
129
Squiggy is right! I checked this weekend and you can disable the hero icon and the hero death audio message in the object editor!!

That being the case, you can indeed make the dummy unit a hero and my idea above will work fine!
 
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
Squiggy is right! I checked this weekend and you can also disable the hero death audio message in the object editor too!!

That being the case, you can indeed make the dummy unit a hero and my idea above will work fine!

Hehe... You should have explored the Object Editor a bit more. There are lots of cool stuff in there. You can even tell units to do victory animation in the Editor.
 
Level 4
Joined
Jul 23, 2007
Messages
129
Yea, I still learn about new trigger functions and object editor fields and so on almost every time I boot up the WE.

((BIG Thanks to the hive )) my knowledge of the WE has grown vastly over the past 2-3 months. Case in point: I recently went back and re-wrote a spawn-movement trigger I wrote 2 months ago. The original had 96 action lines (no joke, I was checking each region for units for each player and directing them to pre-set locations). Due to my hive-gained knowledge, The new trigger works better and has... (wait for it)...

A single action line! (I LOVE ARRAYS!)

Plus, I was able add a condition that prevents the movement trigger from affecting units that are not idle.

Further, my map is a lot less leaky (there are still many leaks I have yet to fix, but I plugged the big ones). I had a custom spell that created 306 + (40 times the # of enemy units in range) memory leaks each time it was cast!! It now produces no memory leaks.

Sorry for the length of the post, but I felt the urge to explain how much the hive has helped me.

Go hive!
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Actually I recon that Need_O2's solution is the best.
Just check distances between units with auras and the dying unit.

The original had 96 action lines (no joke, I was checking each region for units for each player and directing them to pre-set locations).

96 lines isn't big at all. Convert it to Jass and see how many lines you have (thanks to the crappy way the GUI is made).
Besides, every self respecting system has at least 150+ lines. It's the same as having about 10 triggers in GUI to work in the same trigger.
 
Level 4
Joined
Jul 23, 2007
Messages
129
I can see how that would be true. In this case, however, 1 line is a big improvement (especially considering that it isn't buggy).

That's cool too. Perhaps I will take the JASS plunge one of these days...
 
Status
Not open for further replies.
Top