I tried everything.
Been working on this (what I thought) simple thing.. And it just doesn't work.
First I made 3 triggers that combined together worked out very good..
A hero could be resurrected by the targettable spell with X health and Y mana. But! I had to set the Hero's death time to 20 seconds... But that isn't enough! However... 20 sec is max you can select... So I started this:
When a unit dies and the conditions are fine (didn't make the conditions yet because I first want the actions to work.) this happens:
However now I have to change my spell triggers a bit.
For the resurrection spell I edited the Channel spell.
It's ground targetable and has a 6sec channel time.
I used 2 triggers for the spell with 2 different events:
Unit begins channeling an ability and unit finishes casting an ability.
At the begin of the cast I wanted to make the trigger set the Variable ResTarget[PlayerNumberofOwnerof(CastingUnit)]
I did it like this:
ResTarget[...] Means ResTarget[number of owner of casting unit]
I tried like Everything!
I even changed the triggers so when a hero dies there comes a rect/region under him. And when the hero casts the ability in the region he would become the 'ResTarget' unit...
I used UnitGroups too. To add a unit to a variable UnitGroupDeadHeroes when he dies.
It seems there's just something going wrong here with the second trigger.
This part seems like not working:
I'm getting very frustrated atm because this is ruining my day off
Been working on this (what I thought) simple thing.. And it just doesn't work.
First I made 3 triggers that combined together worked out very good..
A hero could be resurrected by the targettable spell with X health and Y mana. But! I had to set the Hero's death time to 20 seconds... But that isn't enough! However... 20 sec is max you can select... So I started this:
When a unit dies and the conditions are fine (didn't make the conditions yet because I first want the actions to work.) this happens:
-
Actions
- Hero - Instantly revive (Triggering unit) at (Position of (Triggering unit)), Hide revival graphics
- Hero - Disable experience gain for (Triggering unit)
- Unit - Add classification of Dead to (Triggering unit)
- Unit - Remove All buffs from (Triggering unit)
- Unit - Pause (Triggering unit)
- Unit - Set life of (Triggering unit) to 1.00
- Unit - Set mana of (Triggering unit) to 0.00
- Unit - Make (Triggering unit) Invulnerable
- Animation - Play (Triggering unit)'s death animation
- Unit - Add Locust to (Triggering unit)
However now I have to change my spell triggers a bit.
For the resurrection spell I edited the Channel spell.
It's ground targetable and has a 6sec channel time.
I used 2 triggers for the spell with 2 different events:
Unit begins channeling an ability and unit finishes casting an ability.
At the begin of the cast I wanted to make the trigger set the Variable ResTarget[PlayerNumberofOwnerof(CastingUnit)]
I did it like this:
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True)) and (((Matching unit Greater than (>) 0
- Then - Actions
-
If - Conditions
-
Set ResTarget[PlayerNumberofOwnerof(CastingUnit)] = Random Unit from (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True))
-
Else - Actions
- Unit - Order (Triggering unit) to Stop
- Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (==) (Owner of (Matching unit)))) the text: |cffffcc00You need to target an allied dead hero for this spell.|r
-
Else - Actions
ResTarget[...] Means ResTarget[number of owner of casting unit]
-
Actions
- Unit - Unpause ResTarget[...]
- Unit - Remove Locust from ResTarget[...]
- Unit - Remove classification of Dead from ResTarget[...]
- Unit - Make ResTarget[...] Vulnerable
- Unit - Set life of ResTarget[...] to 30.00%
- Unit - Set mana of ResTarget[...] to 5.00%
- Hero - Enable experience gain for ResTarget[...]
I tried like Everything!
I even changed the triggers so when a hero dies there comes a rect/region under him. And when the hero casts the ability in the region he would become the 'ResTarget' unit...
I used UnitGroups too. To add a unit to a variable UnitGroupDeadHeroes when he dies.
It seems there's just something going wrong here with the second trigger.
This part seems like not working:
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True)) and (((Matching unit Greater than (>) 0
- Then - Actions
-
If - Conditions
-
Set ResTarget[PlayerNumberofOwnerof(CastingUnit)] = Random Unit from (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True))
-
Else - Actions
- Unit - Order (Triggering unit) to Stop
- Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (==) (Owner of (Matching unit)))) the text: |cffffcc00You need to target an allied dead hero for this spell.|r
-
Else - Actions
I'm getting very frustrated atm because this is ruining my day off