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

[Spell] Chance to Revive (reincarnation) spell

Status
Not open for further replies.
Level 2
Joined
Apr 25, 2018
Messages
13
I'm trying to make an ability that triggers a non-assured revive to a hero when it dies, used with a percentage (integer). When I try to test it without the ability requirement it works, but when i try to add the ability condition it doesnt work. The ability that I want to add the chance to revive effect is with a passive leveled ability, but I got no luck with it.

PD: I've played this game years ago, and I have some very basic WE knowledge, but I have zero experience with the trigger editor. Also, the ability is not based on the Reincarnation spell, I just use an aura ability. I want the hero to have a chance to revive with triggers only if he has learned the ability.
A non hero version might also be helpful (just for curiosity), but not needed.
 
Last edited:
Level 17
Joined
Mar 21, 2011
Messages
1,597
i would base it on reincarnation, otherwise the unit still dies, which means that "A unit dies" triggers do trigger and units get experience and stuff.


  • Trigger1
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Trigger2 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • IF-Conditions
          • ((Random integer number between 1 and 10) > 9) and ((Damage taken) >= (Life of (Triggering unit)))
        • THEN-Actions
          • Unit - Add Reincarnation to (Triggering unit)
        • ELSE-Actions


this is a simple example. when the life drops to 0, you add reincarnation to the unit by chance.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
GUI Unit Event v2.5.0.0 this has some reincarnation events.
With this you can detect reincarnation... not sure if you can stop it though...

I'd put passive reincarnation, make a trigger based off the reincarnation and once the event fires check conditions (has chanced reincarnation & rolls good number) then reincarnate, if rolls a bad number... kill the unit by again & do some special effects around?

Also, if it is only for heroes, you can trigger it yourself and do:
  • Event
    • Unit - A Unit dies
  • Conditions
    • Triggering unit has ability RiskyRevive
  • Actions
    • If (Random number between 1 and 100) > 50
      • Wait 5.00 seconds
      • Revive (Triggering unit) instantly at Position, show revival graphics
@GIMLI_2 would that work at all ?
It would definitely not work for units that are not pre-set in the map.

I may be wrong on thsis: (Damage taken), I am pretty sure this happens after a unit has received damage, in this case, the unit is already dead. I may be mistaken on this.
Also, this is not used widely for a very good reason, and people have went through the trouble of making all these Damage Detection Systems & Damage Engines & Custom Event Systems because of the reason I cannot remember... :|
 
Last edited:
Level 13
Joined
Oct 12, 2016
Messages
769
What Nedio95 mentioned could also work for units, too, but you'll need a dummy unit with a modified Resurrection spell to revive the unit at a temporary point for the "triggering unit"
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
And in which category do I find the "triggering unit has ability" trigger? I cannot find it... :(
That is under Conditions > Boolean Comparison, it may NOT be worded the same way, but should be something very similar.
You could also look around for:
  • Level of WhateverSpellYouHave for Triggering Unit bigger than 0
This is under, Conditions > Integer Comparison
What Nedio95 mentioned could also work for units, too, but you'll need a dummy unit with a modified Resurrection spell to revive the unit at a temporary point for the "triggering unit"
Ah, no, I meant the passive from Ankh of Resurection, if I remember the item name properly...
//Edit: Hold on, I described two different ways, which one are you talking about? :p
 
Level 13
Joined
Oct 12, 2016
Messages
769
Naw, the problem nedio95 mentioned is with piling bodies.
Yea, it'll put the dummy unit at the correct location,
but if there's another corpse on that exact location within the wait period, it may not revive the correct unit.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Actually yea. Now that I think about it, it won't work properly because of the "wait." If it's instant revival, then it's OK.
Even if it is instant, it is still not OK.
What if there is a dead unit from before the unit dies? You again have two corpses (or even more?) on top of each other or in close proximity.

-Ned
 
Level 2
Joined
Apr 25, 2018
Messages
13
Okay, I've tested it and it works, but as GIMLI replied, the attacking units receive experience and all that. Is there an alternative way of reviving the unit without adding a Reincarnation ability? Like, for example, make the unit revive (or fully heal) just when it reaches a certain % of its max HP (less than or equal to 15%), and still make the ability a requirement and of course, the chanced effect.

Edit: I've been testing again and I got the effect I wanted (more or less), and I ended up using a Disabled Spellbook with a Reincarnation spell in it, so I changed the event with "A unit is attacked".

Here's how I did it:

Event - A unit is attacked
Condition - Level of (Required ability to make the effect work) for Triggering unit greater than 0
Condition - Random integer number between 1 and 100 less than or equal to 35
Action - Add DisabledSpellbook to Triggering unit
Action - Wait 8.00 seconds
Action - Remove DisabledSpellbook from Triggering unit
 
Last edited:
Level 17
Joined
Mar 21, 2011
Messages
1,597
Ugh.. so what happens here is that you add the ability for each auto attack to the target. Also, if the unit dies from spelldamage, the trigger wont fire (if the unit didnt get attacked the last few seconds)
I'd still recommend you to go with damage detection
 
As far as I know, you can intercept the death of a unit with an undefend order that is issued on the death of a unit. The only prerequisite is the required addition of the defend ability or its variants to said unit, which enables said detection, (ability is) already provided by GUI Unit Event.

Death events only fire as long as the unit is not going to be revived when its' health goes below 0.406 or something.

So, when the unit issues an undefend order, add the reincarnation ability and remove it after detecting resurrection.
 
Status
Not open for further replies.
Top