I gave the Spell Breaker the Magic Raise ability, which allows the Spell Breaker to increase attack damage of friendly units by 20% and to reduce their defense by 3, at the cost of 160 hit points of the Spell Breaker. The caster will regain the hit points in 20 seconds, the same seconds the effect needs. The problem is that when the Spell Breaker has no health left, instead of dying, he turns into a spirit and then fades away. Is there a way to fix this? Code below:
Guess who made the code?
That's right! I did! This is pretty good for my first try, when it comes to easy.
-
The bad news
-
Events
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Magic Raise
-
-
Actions
-
Set Spell_Breaker = (Random unit from (Units of type Spell Breaker))
-
Unit - Set life of Spell_Breaker to ((Life of Spell_Breaker) - 160.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Life of Spell_Breaker) - 160.00) Greater than or equal to 0.00
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the overhead of Spell_Breaker using war3mapImported\RedSadEmoji.mdx
-
Wait 20.00 seconds
-
-
Else - Actions
-
Unit - Kill Spell_Breaker
-
-
-
Unit - Set life of Spell_Breaker to ((Life of Spell_Breaker) + 160.00)
-
Special Effect - Destroy (Last created special effect)
-
Special Effect - Create a special effect attached to the origin of Spell_Breaker using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
-
-
Guess who made the code?
That's right! I did! This is pretty good for my first try, when it comes to easy.