HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is reincarnation "cast"?

05-25-2004, 11:52 AM#1
Luther
I'm trying to do a skill, reincarnation but when the hero revives, the hero that killed it takes damage. I know I have to so the damage by a trigger, but I'm not sure if reincarnation is cast, or whether I have to do the whole thing via triggers - I could do both, just wondering if "unit casts an ability" will work with reincarnation.
05-25-2004, 12:03 PM#2
PatruX
Quote:
Originally Posted by Luther
I'm trying to do a skill, reincarnation but when the hero revives, the hero that killed it takes damage. I know I have to so the damage by a trigger, but I'm not sure if reincarnation is cast, or whether I have to do the whole thing via triggers - I could do both, just wondering if "unit casts an ability" will work with reincarnation.

Just try, I can't really help out right now since I'm kinda busy. As I said, just try different solutions.
05-25-2004, 12:55 PM#3
Milkman
Custom abilty based on the reincarnation abilty that the Tauren Chiefietan has? Why make a new one if there already are one? I don't really understand your problem, i mean if the hero revives, wth do the attacking unit take damage, at ALL?! I'm confused.
05-25-2004, 01:37 PM#4
AIAndy
When I last tried, reincarnation did not trigger the cast events but that has been some time ago.
05-25-2004, 02:07 PM#5
Kamux
No, it is not a cast ability. No event can detect reincarnation. The best solution is to trigger the ability.
05-25-2004, 03:05 PM#6
JJ912
I remember some time ago there was a thread that discussed Reancarnation. There is a way to detect it, but I cant remember what it was.
05-25-2004, 03:12 PM#7
-={tWiStÄr}=-
hmm, you could check if the tauren was dead or at really low health then trigger it... but the thing is to get the attacking unit, it would be very messy and may not work. you would use unit is attacked event, life of attacking unit <= some value that may be too high and the tauren may be alive, and then deal damage. oh and probably add a wait the time it takes for the unit to revive.
ok.. that was sorta confusing..
05-25-2004, 03:22 PM#8
Anitarf
There have been some threads about this a short while back, and I only recently implemented a triggered reincarnation-based ability into my map.

You can't directly detect reincarnation, because the spell is no "cast"; however, it can be determined if a unit has reincarnated with two other events: "unit dies" and "unit's hp drops below 0" (the first is in the "generic unit event" category, and the second is a category all by itself). Now, when the second event fires, but the first one doesn't, that's when the unit will ressurect.

Note: the "unit hp below something" is a bit of a problematic event. First of all, it functions like a specific unit event, so you will have to add an event to yout hp<0-detection-trigger, whenever a new unit that can have this ability is created.
The second difficulty is that this event fires a bit erratic, when I tested it, it usually triggered 3 times when a unit died in the test map, and 2 times in my final map. Also, the order of the events wasn't fixed: almost everytime, the "unit dies" came before the "unit hp<0"s, but rarely (in my experience only the first time it happens in a map), one of the "unit hp<0"s came before the unit dies event.
That can easily be fixed with two boolean variables (or one integer, where you can store two boleans in values from 1 to 4; you can also simulate booleans with unit variables, that's what I did, because I already had unit variables for each hero because of my other triggered spells, so I didn't feel like making a new integer variable) where you store information about what happened, and then, 7 seconds (or wathever the duration on your reincarnation is) after the "unit hp<0" event, you check: if the unit also died, then you do nothing, but if the unit didn't trigger the unit dies event, then you know the unit reincarnated.

Now, I read somewhere recently that the warcraft engine considers a unit dead already when it's hp drops below 1, havent had yet a chance to test if that's why my events were acting a little funny...

Oh, just remembered what you needed the spell to do, with this kind of triggering, it is not possible to get the "killing unit" because there isn't one, because your hero doesn't die when he reincarnates. The only way I can think of is not entirely accurate; you could also store into a unit variable the units that attack your hero (the "unit is attacked event") so that after he dies, damage would be dealt to the last hero that attacked him; but that may not necessarily be the "killing" unit, because the "unit is attacked" event happens when a unit begins the attack, not when the attack hits (there is a difference, especialy with ranged attacks), so it is possible that the last unit to start an attack against your hero is not the one that actualy dealt the finishing blow. This method would also not be able to detect the killing unit if your hero was killed by a spell...
05-26-2004, 12:05 PM#9
Luther
Yeah, that's what I found, since the unit doesn't die, you can't use unit dies, and since resurrection isn't cast, you can't use that trigger, not can you use killing unit, which is extremely irritating. What I think I'll do is to try to do your idea anitar about the unit's hp<0 and dies, but to change it so that it does a war-stomp style thing on reincarnation, though I haven't been able to find "cast war stomp", maybe I'll just summon multiple casters and do storm bolt with a pretty effect, which would suit the hero's theme. As you may have noticed, I'm ambitious but I don't know where 90% of triggers are, wish me luck, and thanks again everyone.

Hmm, after looking at "unit has less than <x> hp" I realise I'm totally out of my depth, and have no clue how to get the specific unit event to affect my priest unit. I think I'll go to a corner and cry
05-28-2004, 05:32 PM#10
xGT4x
Actually I only know the thing with the Reincarnation Cast but not the thing with the killing unit. Easier trigger for the thing, if you don't make the hero in abuilding you must change the event for the first trigger:
1. Trigger:
Code:
Event: A unit finishes training a unit.

Conditions: Unit type of Trained unit is equal to <YourUnitWithReincarnation>

Actions: Add to <2. Trigger> the event Unit - Trained unit's life becomes Less than or equal to 0.00
2. Trigger:
Code:
Event: None(Will be added by first trigger)
Conditions: Triggering Unit is death is equal to false
Actions: your actions...

But I'm not completely sure if it works it's just something I thinked because when the unit dies event doesnt fire on reincarnation the unit cant be death because it has to die to be death and a casting unit cant be death(reincarnation has casting time):D
05-29-2004, 01:16 AM#11
Pyrus
I know from experience there's absolutely no way to detect reincarnation. I spent 2 weeks on it. Unless Blizz does something in a patch you will have to use triggers to emulate reincarnation and that won't work on heroes.

If you want you could run triggers something like this:
when unit life>0 do damage to all units around unit
05-30-2004, 11:11 AM#12
Luther
Right, that's good to know - I've just given up and changed it from reincarnation to a "if the hero dies, major pain to all around and killing unit" style spell, a shame that it isn't what I had planned, but whatever.
05-30-2004, 07:25 PM#13
Anitarf
Pyrus is wrong, it can be detected with the method I described earlier, I have the reincarnation detection in the map I am currently developing and I shall copy it into a test map to proove it.

The problem with triggering the whole thing is that then, the ability has NO cooldown.

Edit: attached the test map.

Edit 2: Test map moved to a seperate thread in the trigger repository.
05-31-2004, 03:59 AM#14
logik
why not set up a dummy ability???

like.


Unit casts abitlity

ability = dummy ability

give targeted unit reicarnation
wait 30 seconds
remove last created ability

and if its a hero ability... just reduce the mana cost etc.

and you could make it auto cast as well... maybe base it on the heal ability??? so when someone is low on health they'd get reicarnation - when they are attaacked
06-01-2004, 12:41 AM#15
Pyrus
Quote:
Originally Posted by Anitar
Pyrus is wrong, it can be detected with the method I described earlier, I have the reincarnation detection in the map I am currently developing and I shall copy it into a test map to proove it.

The problem with triggering the whole thing is that then, the ability has NO cooldown.

Edit: attached the test map.
Technically reincarnation is'nt detected by that method so you cant use the ability event responses.
Emulating reincarnation with triggers involves too much work so dont try doing it.

And logik, once you remove an ability it can never be readded. You also will have to deal with the reincarnation icon in the targets UI card, which i find makes it look unprofessional.