Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Set Variable YourHero[custom value of (Last created unit)] = (Casting unit)
Unit - Order (Last created unit) to cast the damaging spell on (Target unit of ability being cast)
Now you've linked the Dummy to the Hero (casting unit). So if the Dummy unit gets a kill you'll be able to reference the Hero that it's linked to and restore their mana.
Events
Unit - A unit dies
Conditions
Unit-type of (Killing unit) Equal to Your Unique Dummy Unit
Actions
Unit - Set mana of YourHero[custom value of (Killing unit)] to X
So the idea is that the Hero casts a "fake" version of the spell which does nothing besides run the "A unit starts the effect of an ability" trigger. That trigger then creates a Dummy unit that casts the real damaging version of the spell. This ensures that the Dummy unit deals the damage and scores the killing blow which is necessary for our "A unit dies" trigger. Remember, our Dummy unit can only ever deal damage with this one spell so any kills it gets are guaranteed to have come from this spell. Using the Hero as the (Killing unit) wouldn't work properly since our Hero can kill units using many different spells/attacks.
A non-MUI solution would be to use the Player Number instead of Unit Indexing. You could then easily link the Hero/Dummy like so:
Set Variable YourHero[Player number of (Owner of (Casting unit))] = (Casting unit)
Unit - Set mana of YourHero[Player number of (Owner of (Killing unit))] to X
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.