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

Resurrecting Heroes

Status
Not open for further replies.
Level 4
Joined
Jan 6, 2009
Messages
100
As an RPG is populated almost entirely by heroes, and the fact that it's inevitable that one of those heroes will die, is it possible to resurrect heroes as you would resurrect a unit?
 
Level 4
Joined
Jan 6, 2009
Messages
100
The spell "Ressurection" for the Paladin in W3 lets you revive 6 nearby friendly corpses. Thats what i mean by 'Resurrecting'. I hope that made it a bit more clearer.

But you have given me an interesting idea...
 
Level 3
Joined
Mar 2, 2006
Messages
36
Check the ability properties of ressurection. There should be a line:

Stats - Targets Allowed
I think if u add hero there it should work, and just put the number of corpses raised to 1 and this way you should be able to ressurect a hero.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Doesn't work.

I think its impossible, because heroes don't leave a corpse.

What if you change the "Combat - Death Type"?

That defines the properties the unit/building/hero's corpse has after it is killed. Determines whether it can be raised by abilities such as "Raise Skeleton" or "Animated Dead", and also whether it experiences natural decay or not.

Might be worth checking out ^^
(set it to "can raise, can decay" or something)
 
Level 4
Joined
Jan 6, 2009
Messages
100
What if you change the "Combat - Death Type"?

That defines the properties the unit/building/hero's corpse has after it is killed. Determines whether it can be raised by abilities such as "Raise Skeleton" or "Animated Dead", and also whether it experiences natural decay or not.

Might be worth checking out ^^
(set it to "can raise, can decay" or something)

Unfortunatly, this doesn't work. The resurrection spell couldn't seem to find any corpses.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Unfortunatly, this doesn't work. The resurrection spell couldn't seem to find any corpses.

What if you combine that with Dr Super Good's idea?
Move the corpse of the hero to the position of the dying unit (I suggest to wait a moment before doing that).

(It appears that the corpse of the hero is moved to the edge of the map)
 
Level 4
Joined
Jan 6, 2009
Messages
100
Would this be the right trigger?

  • Action - Unit - Create a (Unit-type of (Triggering unit)) corpse for Player 1 (Red) at (Position of (Triggering unit))
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Not really, since the hero has a corpse, it has just been moved.
Try this:
  • Set TempLoc = (Position of (Triggering unit))
  • Wait X.XX seconds
  • Unit - Move (Triggering unit) instantly to TempLoc
  • Custom script: call RemoveLocation(udg_TempLoc)
The wait has to be a little bit more than the duration of his death-animation, since he is moved after that (I think)
Be sure to set the Hero's death type to "Can Raise, Does Decay".

If this doesn't work, you can try yours, but you have to keep this in mind:
- You have created a new hero then, so it will be completely resetted
- The other hero needs to be removed

(and if it doesn't work, Dr. Super Good was wrong :O - that's something you don't see a lot ^^)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • Events
    • Unit - A unit dies
  • Conditions
    • Borlean - Dying unit is a (Hero) equal to true
  • Actions
    • Hero - Revive (Dying Unit) at (Position of (Dying Unit))

He wants to revive them with a spell (ressurection), your trigger is just a hero-revive system (which leaks by the way, use variables to remove the leak).

You can create the entire spell with triggers, but if there is an easier solution...
 
Level 4
Joined
Jan 6, 2009
Messages
100
Dr Super Good said

Um.... Heroes do have corpses. When a hero dies, its body is hidden and moved to the edge of the map I rememeber reading and seeing. Thus why you should always remove heroes that will never be resurrected again.

Try moving the hero back to where it died and unhiding it.

Im trying to figure out how to go about doing this in the Trigger Editor.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Doesn't work.

I think its impossible, because heroes don't leave a corpse.

Everything is possible in we :)..You can make corpse
lets say you have a hero called "Rambo"
than you make unit (with no attack and invulnerable) and you can call him "Rambo´s corpse"
He must not have a model file ,click on model file holding shift+enter and clear everything accept ".mdl"
now unit "Rambo´s corpse will be invisible and unable to be selected
Make that unit flying

There is an ability called "Spawn Hydra" but u make it spawn unit type "Rambo´s corpse" and give that ability to "Rambo"

  • Untitled Trigger 008
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Rambo´s Corpse
    • Actions
      • Set POSITION = (Position of (Dying unit))
      • Hero - Instantly revive (Random unit from (Units owned by (Owner of (Dying unit)) of type Small Rambo)) at POSITION, Hide revival graphics
      • Custom script: call RemoveLocation(udg_POSITION)
  • duble hero
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to YOUR ABILITY
    • Actions
      • Set FIXLAGS = (Position of (Casting unit))
      • Set UNITGROUP = (Units within 512.00 of FIXLAGS matching (((Matching unit) is A flying unit) Equal to True))
      • Unit Group - Pick every unit in (Units in UNITGROUP) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_FIXLAGS)
      • Custom script: call DestroyGroup(udg_UNITGROUP)
 
Level 4
Joined
Apr 25, 2008
Messages
75
Here, try this system.

(Use the manual attack to kill the mountain king)

WARNING: I do not know if it leaks, I am not good with leaks so be careful. If it does leak it shouldn't be too hard to fix.

Good Luck with your map and all.

(I did throw this together in a couple of mins while waiting for an answer to my own thread so instead of a wisp use something like a visible shade or tombstone and also remove the movement of this unit)
 

Attachments

  • Resurrect.w3x
    17.6 KB · Views: 50
Level 1
Joined
Mar 25, 2008
Messages
5
I made an RPG and I used revival stones at certain points in the game and If a unit enters a region near the stone the dying unit will instantly revive at that point.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
unit begins casting an ability - raise dead heros in range

pick every unit that is a hero and is not alive
-revive picked unit
>if distance between picked unit and casting unit is greather than <1000>
than
kill picked unit

(it revives all heros around 1000 range of casting unit)

if you think this could be a good idea i will solve the hero death massages so they dont appear when you kill a hero with this trigger
 
Level 4
Joined
Apr 25, 2008
Messages
75
Hey ALiEN, sorry to disappoint you but I beat you to it and solved this problem 4-5 months ago :p 3 posts up I think. But I guess that it's a little different with mine only resurrecting the target hero whereas yours resurrect everyone in 1000 radius.

Also, can't you do the opposite and only conditionally pick heroes within 1000 radius because right now it resurrects every hero then kills them all unless nearby. Also this will waste mana if accidental cast and also need to fix so doesn't revive enemies. Other than that I guess it works :)
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Hey ALiEN, sorry to disappoint you but I beat you to it and solved this problem 4-5 months ago :p 3 posts up I think. But I guess that it's a little different with mine only resurrecting the target hero whereas yours resurrect everyone in 1000 radius.

Also, can't you do the opposite and only conditionally pick heroes within 1000 radius because right now it resurrects every hero then kills them all unless nearby. Also this will waste mana if accidental cast and also need to fix so doesn't revive enemies. Other than that I guess it works :)
I couldn´t revive heroes around range for some reason,i did some mistake and i didnt see it...

>revive heroes within range

its just needed to pick every hero within (some range) of casting unit and revive picked unit

>revive targeted hero

unit begins casting an ability (ability that needs unit target or point target)

ability being cast equal to revive hero

revive rendom unit from (units within 100 range of target point of ability being cast) matching,matching unit is a hero...



when hero dies just create a wishp to know where it died

or better if it is possible to pause his animation when he dies so that he lies on the ground
 
Level 3
Joined
Mar 25, 2008
Messages
56
Hey ALiEN, sorry to disappoint you but I beat you to it and solved this problem 4-5 months ago :p 3 posts up I think. But I guess that it's a little different with mine only resurrecting the target hero whereas yours resurrect everyone in 1000 radius.

Also, can't you do the opposite and only conditionally pick heroes within 1000 radius because right now it resurrects every hero then kills them all unless nearby. Also this will waste mana if accidental cast and also need to fix so doesn't revive enemies. Other than that I guess it works :)

okay i know this is long ago but ive tried your trigger and it works fine but how to i set a cooldown for my skill? when it casts there isnt any cooldown
 
Level 3
Joined
Aug 28, 2009
Messages
53
Toilet maker's idea is awesome :) i would make the wisp looking like a grave and that he couldnt move so when you run around se a dead hero you can ressurect him :) cool cool plus rep for him
 
Level 3
Joined
Mar 25, 2008
Messages
56
oh btw i found another loophole, the rez spell only can be targetted at the most recent "soul" created and it wont rez any previous dead heroes
 
Level 4
Joined
Apr 25, 2008
Messages
75
Alright, I haven't been on Warcraft 3/Editor or Hive for a while but I'll try to help you anyway.
To set a cooldown go to your Object Editor and find your Resurrection spell and look for a parameter called: "Stats - Cooldown" Just change that to whatever you want. You can also change other things here if you need to such as animation (Special Effect-like things that occur when you use this spell), Mana Cost, Cast Range, Name and Tooltips. If you want more information look for a tutorial on the Object Editor.

oh btw i found another loophole, the rez spell only can be targetted at the most recent "soul" created and it wont rez any previous dead heroes

Now in regards to the above;
I did put this together in about 10 minutes and I intended it for an RPG which I assumed had only 1 hero per player. It will work for the last killed hero of that player. You can change this to only work on your "main" hero (ie. you have a secondary/less important hero in your map) by adding conditions such as:
  • (Dying unit) Equal to MAIN_HERO[(Player number of (Owner of (Dying unit)))]
Now if you have 2 "main" heroes for each player it gets a little sticky. I'm not in the mood for making a simple an efficient system at present but I will throw together a crude one for you:

  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Owner of (Dying unit)) controller) Equal to User
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to MAIN_HERO1[(Player number of (Owner of (Dying unit)))]
        • Then - Actions
          • Unit - Create 1 Wisp for (Owner of (Dying unit)) at (Position of (Dying unit)) facing Default building facing degrees
          • Set WISP1[(Player number of (Owner of (Dying unit)))] = (Last created unit)
          • Set MAIN_HERO1[(Player number of (Owner of (Dying unit)))] = (Dying unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to MAIN_HERO2[(Player number of (Owner of (Dying unit)))]
            • Then - Actions
              • Unit - Create 1 Wisp for (Owner of (Dying unit)) at (Position of (Dying unit)) facing Default building facing degrees
              • Set WISP2[(Player number of (Owner of (Dying unit)))] = (Last created unit)
              • Set MAIN_HERO2[(Player number of (Owner of (Dying unit)))] = (Dying unit)
            • Else - Actions
  • Ressurect
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Wisp
          • (Ability being cast) Equal to RESSERUCT
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to WISP1[(Player number of (Owner of (Target unit of ability being cast)))]
        • Then - Actions
          • Hero - Instantly revive MAIN_HERO1[(Player number of (Owner of (Target unit of ability being cast)))] at (Position of (Target unit of ability being cast)), Show revival graphics
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to WISP2[(Player number of (Owner of (Target unit of ability being cast)))]
        • Then - Actions
          • Hero - Instantly revive MAIN_HERO2[(Player number of (Owner of (Target unit of ability being cast)))] at (Position of (Target unit of ability being cast)), Show revival graphics
        • Else - Actions
      • Unit - Remove (Target unit of ability being cast) from the game

Hope that helps you. I strongly advise you mess around with triggers and look up tutorials especially on variables and arrays so that you can understand this and do it yourself.

Good Luck!
-TM
 
Level 3
Joined
Mar 25, 2008
Messages
56
hey man thanks for your quick reply, i know about the object editor thing but due to the trigger saying begins casting an ability, the cooldown and mana costs do not take effect, if im not wrong there must be a line to end this trigger and let the spell resume but im not sure what
 
Status
Not open for further replies.
Top