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

[JASS] Getting the reviving altar for EVENT_UNIT_HERO_REVIVE_START

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
You can rely on Orders:
  • Begin Reviving
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Level of Altar (Classification) for (Triggering unit)) Greater than 0
      • (Issued order) Not equal to (Order(setrally))
      • (Issued order) Not equal to (Order(smart))
    • Actions
      • -------- This occurs when an Altar begins reviving a Hero! --------
      • Game - Display to (All players) for 30.00 seconds the text: (Altar: + (Name of (Triggering unit)))
      • Game - Display to (All players) for 30.00 seconds the text: (Hero: + (Name of (Target unit of issued order)))
Altars issue an Order targeting the reviving Hero, however, the issued Order is (null) so it's not easy to detect. That's why I narrow it down by ensuring that:

1) It's an Altar that issued the order. I rely on a hidden ability based on Storm Hammers for this. You would add this to your Altars in the Object Editor.
2) It didn't issue an unrelated order like setrally or smart. You need to exclude other orders if say your Altar has an ability that can target a unit.

You can take this a step further by linking the Altar to the Hero so that you will always have a reference to it:
  • Begin Reviving Advanced
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Level of Altar (Classification) for (Triggering unit)) Greater than 0
      • (Issued order) Not equal to (Order(setrally))
      • (Issued order) Not equal to (Order(smart))
    • Actions
      • -------- This occurs when an Altar begins reviving a Hero! --------
      • Set VariableSet Hero_Altar[(Custom value of (Target unit of issued order))] = (Triggering unit)
  • Revive Events
    • Events
      • Unit - A unit Begins reviving
      • Unit - A unit Cancels reviving
      • Unit - A unit Finishes reviving
    • Conditions
    • Actions
      • -------- Hero_Altar[0] = The Altar that began/cancelled/finished reviving the hero: --------
      • Set VariableSet Hero_Altar[0] = Hero_Altar[(Custom value of (Triggering unit))]
      • Game - Display to (All players) for 30.00 seconds the text: (Altar: + (Name of Hero_Altar[0]))
I'm using a Unit Indexer for these "advanced" triggers but you could use a Hashtable instead.
 

Attachments

  • Altar Revive 1.w3m
    22.7 KB · Views: 2
Last edited:
Level 28
Joined
Feb 2, 2006
Messages
1,631
Wow thx so much effort this fix this.

I had some more ideas on this. If the target unit of the order is actually the hero being revived you could simply detect the unit classification hero of the target unit and make sure it is currently dead.

I have also learned now about these two order IDs if I also use HeroReviveCancelEvent v1.1 (for the cancel order):

JASS:
ORDER_ID_START_REVIVE = 852027 // issued when a hero is started being revived by the altar
ORDER_ID_REVIVE = 852039 // issued when the order is cancelled in the altar's queue if I use the system HeroReviveCancelEvent
 
Last edited:
Top