• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with revive hero {creating a grave for a dying hero}

Status
Not open for further replies.
Level 2
Joined
Jul 20, 2006
Messages
5
I want to try to make it so when a hero dies it dropes a grave prop where it dies at..and when an alli hero walks over that grave that specific dead hero gets revived.

Anyone have any idea on how to do this? i couldnt find out by my self
 
Level 8
Joined
Nov 9, 2008
Messages
502
Ok I found you a solution that works if each player can have only 1 hero. More than that and it gets messier.

This method u need to have preplaced a unit with the model of the grave for each player. Give these units things such as no sight, locust ability, targeted as none etc. so no-one can mess with it. Also set collision size to 0 so units may pass over it.

Put in a place out of sight a neutral building which will serve as a place to move them to. It's not necessary as you can use a point with offsets but it's easier. Also place all your graves there.

Then make these variables for each player

p(1,2,3...)_deadhero---------------type: Unit
p(1,2,3...)_deadhero_point--------type: Point

Then make these 2 triggers for each player.

  • p1 hero dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Set p1_deadhero = (Triggering unit)
      • Set p1_deadhero_point = (Position of (Triggering unit))
      • Unit - Move Grave 0004 <gen> instantly to p1_deadhero_point
Above, Grave 0004 <gen> is your preplaced grave for p1.

  • revive p1 hero
    • Events
      • Unit - A unit comes within 10.00 of Grave 0004 <gen>
    • Conditions
      • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Hero - Instantly revive p1_deadhero at p1_deadhero_point, Show revival graphics
      • Unit - Move Grave 0004 <gen> instantly to (Position of Goblin Merchant 0002 <gen>)
      • Custom script: call RemoveLocation(udg_p1_deadhero_point)
Above again note p1's grave and Goblin Merchant 0002 is just the neutral building serving as a point to move the grave to. Change the range if it's too small for you.

Hope that helps you, it's not so complicated with only 1 hero per player.
 
Status
Not open for further replies.
Top