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

Need help with my ressurect trigger

Status
Not open for further replies.
Level 5
Joined
Jul 25, 2008
Messages
126
Hey this is what I need. I'm completely baffled on how to go about it. I need it

so when your hero dies it resurrects at the 'nearest' friendly town hall.

Note Town halls can be captured so there isn't always a

designated friendly town hall, players choose teams at start so you don't always

know whos on your team.
 
Mh I think best way is jass but I can try to do it in gui...

Event: Unit dies
condition
Action: For integer Counter 1-10000
Pick every unit within 10 x Counter range of triggering unit
If picked unit = town hall
Owner of picked unit is ally of owner of triggering unit = true
Then: Set Counter = 10000
Resecure hero


That COULD work
 
Hopefully you understand my explanation.

Unit group, all units that match <town hall> allied to player, set total1 = total1 +1;

Unit group, all units that match <town hall> allied to player, set distance1 = distance from hero to <picked unit> if distance1 > distance2, set distance2 = distance1, total1 = total1 - 1, if total1 <= 0: if distance1 < distance2, spawn hero at distance2, else spawn hero at distance1.

That's what I would do.
 
Last edited:
Status
Not open for further replies.
Back
Top