Warcraft III resources & community, 2003–2006 · archived

Reincarnation Detection

not rated
Submitted by ArcanisteRJASS Enhanced257 downloads17 KB
Screenshot
Screenshot
This is the code that detects reincarnation, which I never heard to be done before. I hope it will be useful.



Have fun.
File Name
reincarnation.w3x
Author
ArcanisteR
Download

Comments

8
WTF IS BJ_WANTDESTROYGROUP=XXXX :?:
btw, why don't you just use

Event:
A unit begins casting a spell.

Condition:
Spell being casted equal to Reincarnation.

Action:
Floating Text, Create.


The Reincarnation spell is casted automaticly on tc's death, so it SHOULD work.
I was aware of triggered deaths, so I put in the demo map a function to execute before using any of the Kill unit or Set unit's life actions. Like the way bj_wantDestroyGroup works.

For blocking damage triggers, the only way to get it to work is to modify them a bit, or add some extra conditions to the Reincarnation Check, which I think is no problem for a decent triggerer.

And thanks for the feedback and the Unit's life get lower than 1 thing, I'll keep this in mind.
It works, though you shall change some stuff, for instance you don't need the variable, if you execute the trigger, Triggering Unit will work fine, also the event shouldn't be the one of damage, because the unit could have been killed by a trigger, and there are also trigger spells that block damage so it would detect reincarnation when it wasn't supposed to.

You should use Unit 's life gets lower than 1 for the event, the units actually die when they have less than 1 hit points, even if they are 0.99, I dunno why, just blame blizzard for that
Well using events like that must not be a very good detection method opposed to this one.
I think you found the wrong one, I know one(I think from here or WC3Campaigns) in that when the TC "dies" and he reincarnates it displays message "Reincarnating" just when he "died", if he died and reincarnation isn't activated it says "Not Reincarnating" or something like that. And when Reincarnation actually revives him it says "Reincarnated". I'll look for it in my maps, I have nearly all WC3Sear spell maps^^

Edit: Hmm, can't find it, just have to many maps. I'm sure it was done before, it used events "A unit's life..." and "A unit dies" or the condition "Unit is dead...", can't remember exactly.
I'd like to know how it was done like you said, and I actually looked for the thing in here and could never find it.

Here is a very small memory leak fix, I forgot to flush the stored integer.

EDIT: I actually found one in wc3campaigns.com, BUT that detection method is wrong, what it does is waiting for 7 seconds to see if the dying unit is alive, if yes it concludes that the unit has reincarnated.
This was already done before, I think it was even posted here in the spell section...
Wow how did you detect it?