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

Resurrection Spell

Status
Not open for further replies.
Level 5
Joined
Jul 4, 2007
Messages
166
I'm working on a map that gives a unit the ability to resurrect a friendly unit owned by the player when it dies (as long as there is a corpse within range that is not the unit itself). The problem I'm running into is that there's no good method (from what I've seen) to resurrect a unit (not hero) based on triggers.

Here's what I've got so far.

  • Redemption
  • Events
    • Unit - A unit dies.
  • Conditions
    • Unit - type of (dying unit) equal to Dark Paladin.
  • Actions
    • Unit Group - Pick every unit in (units within range of 600.0) and do (actions):
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Picked unit) is not equal to (dying unit).
          • (Owner of (picked unit)) is equal to (owner of (dying unit)).
          • ((Picked Unit) is dead) equal to true.
        • Then - Actions
          • //Resurrect picked unit.
          • Special Effect - Attach special effect Resurrection (target) to (picked unit).
          • Skip Remaining Actions
        • Else - Actions
If I can't find a resolution, I may have to just create a unit of the picked unit's type on top of the corpse and remove the picked unit, or just make a dummy unit spawn on top of the dead unit, cast resurrection, and remove itself.

Is there anything more efficient than what I suggested?
 
Level 5
Joined
Jul 4, 2007
Messages
166
SO if the Dark Paladin die, you want resurrect units.
1) Only 1 unit? Or all units in range?
2) The units of the owner of dying unit or all friendly units of the owner of dieing unit?

As noted in the code I included with my post, it should only resurrect one unit, and as represented in the code and the bit I included before it, it should only resurrect units owned by the player who owns the dying unit, and only if they are in a range of 600.

Just use the trigger above and create a dummy on the position of the dying unit and order it to cast 'Ressurection'.

Other than that, you can make a group of nearby dead units owned by the player which paladin dies, and then create the same unit type for him, removing the corpse.

I actually mentioned both of these solutions in my original post.

Me said:
If I can't find a resolution, I may have to just create a unit of the picked unit's type on top of the corpse and remove the picked unit, or just make a dummy unit spawn on top of the dead unit, cast resurrection, and remove itself.

Is there anything more efficient than what I suggested?

I wanted to know if there was a way to resurrect a unit solely with code, rather than using a dummy unit or creating a new unit.
 
Status
Not open for further replies.
Top