I am trying to make a spell in which a unit dies and then is reincarnated as a different unit, but of the same lvl and set with the lvl of abilities that the old unit had. I set the reicarnation ability to be the base ability for graphics purposes. Then I went into triggers and created the following.
Trigger 1
Name - Spell Reincarnation
Event:
Unit - a unit learns a skill
Conditions:
(learned hero skill) equal to Special reincarnation.
Action:
Trigger - run turn on replace unit <gen>
Trigger 2
Name - replace unit
Event: Unit - my preset unit <gen>'s life becomes less than or equal to 0.00
Conditions:
Actions:
Unit - Replace (triggering unit) with a hero ghoul using the new unit's default life and mana.
Hero - set(last created unit) hero-level to (hero lvl of (triggering unit)), hide lvl up graphics.
When I run this trigger, it creates 3 units instead of only 1. Also if someone can figure out the trigger to set ability of last created unit to the lvl of ability of triggering unit that would be good too. And if someone could tell me how to have the trigger target any unit instead of the preplaced one (i.e. my present unit <gen>) that would be very helpful also. thank you for your help.
Trigger 1
Name - Spell Reincarnation
Event:
Unit - a unit learns a skill
Conditions:
(learned hero skill) equal to Special reincarnation.
Action:
Trigger - run turn on replace unit <gen>
Trigger 2
Name - replace unit
Event: Unit - my preset unit <gen>'s life becomes less than or equal to 0.00
Conditions:
Actions:
Unit - Replace (triggering unit) with a hero ghoul using the new unit's default life and mana.
Hero - set(last created unit) hero-level to (hero lvl of (triggering unit)), hide lvl up graphics.
When I run this trigger, it creates 3 units instead of only 1. Also if someone can figure out the trigger to set ability of last created unit to the lvl of ability of triggering unit that would be good too. And if someone could tell me how to have the trigger target any unit instead of the preplaced one (i.e. my present unit <gen>) that would be very helpful also. thank you for your help.