• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Spell] Dummy unit is sometimes not removed.

Level 17
Joined
Jul 19, 2007
Messages
972
I dunno why but this simple passive ability named "Double Attack" sometimes doesn't remove the dummy unit and I can't see the reason for it...
  • Double Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set VariableSet Caster_Loc = (Position of (Triggering unit))
      • Set VariableSet DA_Attacker = (Attacking unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 1.00 and 100.00) Less than or equal to (10.00 x (Real((Level of Double Attack for DA_Attacker))))
        • Then - Actions
          • Unit - Create 1 Dummy (Double Attack) for (Owner of DA_Attacker) at Caster_Loc facing Caster_Loc
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy DA_Attacker
          • Trigger - Turn off (This trigger)
          • Wait 1.00 seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Caster_Loc)
 
Apart from what Duckfarter said, you are creating Caster_Loc everytime there is an attack, needlessly.
Add a condition, checking if the attacker even has double attack.

Also this is clear case for a reusable dummy caster, no need to create and remove it all the time.
 
Back
Top