• 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!

Sometimes this ability damages twice and sometimes it doesn't damage at all...

Level 17
Joined
Jul 19, 2007
Messages
973
Hi. Like the title says. I have an ability in my map that sometimes damages enemy units twice and sometimes it doesn't do any damage at all. What could be the problem? It doesn't happening very often but still it's very annoying :-/

  • Valinors Arrow Run
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Valinor's Arrow
    • Actions
      • -------- Setting the casting and targeted unit --------
      • Set VariableSet Unit[1] = (Triggering unit)
      • Set VariableSet Unit[2] = (Target unit of ability being cast)
      • -------- - --------
      • -------- Checking if the unit have enough life to cast this spell --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of Unit[1]) Greater than or equal to 0.00
        • Then - Actions
          • -------- Setting the life of casting unit to life of casting unit - 90 x Level of ability, simple math formula --------
          • Unit - Set life of Unit[1] to ((Life of Unit[1]) - (25.00 x (Real((Level of Valinor's Arrow for Unit[1])))))
          • -------- - --------
          • -------- This "wait" waits untill the arrow hits the targeted unit cehcking every 0.10 secodnds as it is minimum --------
          • Wait until ((Unit[2] has buff Valinor's Arrow(custom) ) Equal to True), checking every 0.10 seconds
          • -------- - --------
          • -------- Checking if the targeted unit dies before the arrow hits it --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Unit[2] has buff Valinor's Arrow(custom) ) Equal to False) and ((Unit[2] is alive) Equal to False)
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to (8 x (Level of Valinor's Arrow for Unit[1]))
                • Then - Actions
                  • Set VariableSet ValArrow_Damage_Multiplier = (1.35 x (70.00 x (Real((Level of Valinor's Arrow for (Triggering unit))))))
                  • -------- Damaging the targeted unit --------
                  • Unit - Cause Unit[1] to damage Unit[2], dealing (1.35 x (70.00 x (Real((Level of Valinor's Arrow for Unit[1]))))) damage of attack type Spells and damage type Unknown
                  • -------- - --------
                  • -------- Creating a floating text --------
                  • Floating Text - Create floating text that reads ((String((Integer(ValArrow_Damage_Multiplier)))) + !) above Unit[2] with Z offset 0.00, using font size 10.00, color (75.00%, 0.00%, 0.00%), and 0.00% transparency
                  • -------- - --------
                  • -------- Creating a nice special effect on the targeted unit --------
                  • Special Effect - Create a special effect attached to the origin of Unit[2] using <Empty String>
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • -------- Damaging the targeted unit --------
                  • Unit - Cause Unit[1] to damage Unit[2], dealing (70.00 x (Real((Level of Valinor's Arrow for Unit[1])))) damage of attack type Spells and damage type Unknown
                  • -------- - --------
                  • -------- Creating a floating text --------
                  • Floating Text - Create floating text that reads ((String((70 x (Level of Valinor's Arrow for Unit[1])))) + !) above Unit[2] with Z offset 0.00, using font size 10.00, color (75.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • -------- - --------
              • -------- Creating a nice special effect on the targeted unit --------
              • Special Effect - Create a special effect attached to the origin of Unit[2] using <Empty String>
              • Special Effect - Destroy (Last created special effect)
              • -------- - --------
              • -------- Condition checks if the unit is still "alive" --------
              • -------- I left it that it checks if life is less than 5, it doesnt matter, it can go up to 15 but 5 is enough --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Life of Unit[2]) Less than 5.00
                • Then - Actions
                  • -------- Setting the location of targeted unit --------
                  • Set VariableSet pointval[1] = (Position of Unit[2])
                  • -------- - --------
                  • -------- Damaging the unit kills the unit since its life is less than 5 and mekes you the killer --------
                  • Unit - Cause Unit[1] to damage Unit[2], dealing 500.00 damage of attack type Spells and damage type Unknown
                  • -------- - --------
                  • -------- "Healing" heals caster for 120 x Level of ability, a little of math :P --------
                  • Unit - Set life of Unit[1] to ((Life of Unit[1]) + (25.00 x (Real((Level of Valinor's Arrow for Unit[1])))))
                  • -------- - --------
                  • -------- Creating the dummy at the give location --------
                  • -------- Giving and setting the ability --------
                  • -------- Ordering Dummy to cast the given spell --------
                  • -------- - --------
                  • Unit - Create 1 Dummy (Valinor's Arrow) for (Owner of Unit[1]) at pointval[1] facing Default building facing degrees
                  • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
                  • Unit - Add Valinor's Arrow(dummy) to (Last created unit)
                  • Unit - Set level of Valinor's Arrow(dummy) for (Last created unit) to (Level of Valinor's Arrow for Unit[1])
                  • Unit - Order (Last created unit) to Neutral Pit Lord - Howl Of Terror.
                  • -------- - --------
                  • -------- Creating a nice special effect on the targeted and casting unit --------
                  • Special Effect - Create a special effect attached to the origin of Unit[1] using <Empty String>
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at pointval[1] using war3mapImported\WhiteChakraExplosion.mdx
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect at pointval[1] using <Empty String>
                  • Special Effect - Destroy (Last created special effect)
                  • -------- - --------
                  • -------- Claring leaks --------
                  • Custom script: call RemoveLocation(udg_pointval[1])
                • Else - Actions
        • Else - Actions
 
Use new unique variable for storing the triggering and target units. Since I have your map, I checked where the "Unit[]" array is used and saw that it is used by DDS trigger "DAMAGE THE ENEMY" in Systems folder. So it is possible that the DDS is overwriting what you configured in "Valinors Arrow Run" trigger, causing the issues.
 
Use new unique variable for storing the triggering and target units. Since I have your map, I checked where the "Unit[]" array is used and saw that it is used by DDS trigger "DAMAGE THE ENEMY" in Systems folder. So it is possible that the DDS is overwriting what you configured in "Valinors Arrow Run" trigger, causing the issues.
Oh I see. I didn't noticed that myself. I hope it works now. I'll tell you if there is anymore problems.
 
Back
Top