• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Spell] Total Destruction

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2006
Messages
179
  • Total Destruction armor raising
    • Events
    • Conditions
      • (Level of Total Destruction for (Summoned unit)) Greater than 0
    • Actions
      • Set SpiritoftheFallen = (Summoned unit)
      • Set DamagingChance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamagingChance Less than or equal to 50
        • Then - Actions
          • Unit - Add Armor Raise (+4) to (Summoned unit)
          • Special Effect - Create a special effect attached to the overhead of (Summoned unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl
          • Wait 5.00 seconds
          • Unit - Remove Armor Raise (+4) from (Summoned unit)
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
This gives the Spirit of the Fallen 4 armor for 5 seconds.
Since the Spirit of the Fallen is a unit summoned by the Blademaster, I specified at the variable above.
This doesn't work. I'm pretty sure it's some flaw I can't notice. Can anyone help me with this code?
 

ISL

ISL

Level 13
Joined
Nov 7, 2014
Messages
238
After the Wait action, you still reffer to that unit as to summoned unit, which is an event response.

Event responses don't work after a wait action, use the unit's variable (SpiritoftheFallen) to refer to it instead.
 
After the Wait action, you still reffer to that unit as to summoned unit, which is an event response.

Event responses don't work after a wait action, use the unit's variable (SpiritoftheFallen) to refer to it instead.
Some event response work after wait (there was a thread about all this stuff, can't recall right now). Using the variable guaranteed a bug if there's more than one summon activate the trigger between the wait phase since it's a global. You need to either make it local or shadow it.

***

The problem is the trigger lacks an event. In this case, the even would be A unit is summoned or something around that line.
 
Level 5
Joined
Jul 27, 2017
Messages
73
Another little problem might be that you want to destroy the last created special effect.
Generally it is a good idea to reduce map lag but you should store the effect in a variable if you create more special effects. (it's like "Summoned Unit" saved in a global variable that can be changed when the event raises another time)

Apart from that smaller problem it is like the posts above me said: an event might be a good idea.
 
Level 15
Joined
Aug 14, 2007
Messages
936
For event, please use Generic - when a unit is summoned.
Mistake Highlight -
(Level of Total Destruction for (Summoned unit)) Greater than 0 - Error is detected.
Correction -
(Level of Total Destruction for (Summoning unit)) Greater than 0 - You are checking for summoner not summoned minion.
 
Last edited:
Level 6
Joined
Sep 19, 2006
Messages
179
Well, the spell does its job when the Blademaster actually summons the Spirit of the Fallen. Thanks, Acutesharpness!
 
Status
Not open for further replies.
Top