• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell isn't working!

Status
Not open for further replies.
Level 6
Joined
Jun 11, 2009
Messages
151
It wont doing anything!
  • Spirit Break
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set Caster = (Attacked unit)
      • Set Target = (Attacking unit)
      • Set tempPoint = (Position of Caster)
        • Do Multiple ActionsFor each (Integer A) from 1 to 100, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Caster has buff Spirit Break (Aura)) Equal to (==) True
                • (Integer A) Equal to (==) 15
              • Then - Actions
                • Unit - Create 1 Dummy Caster for (Owner of Caster) at tempPoint facing Default building facing (270.0) degrees
                • Unit - Add Spirit Break[dummy] to (Last created unit)
                • Unit - Set level of Spirit Break[dummy] for (Last created unit) to (Level of Spirit Break for Caster)
                • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Target
                • Wait until ((Target has buff Spirit Break (Stun)) Equal to (==) True), checking every 0.10 seconds
                • Unit - Remove (Last created unit) from the game
              • Else - Actions
      • Custom script: call RemoveLocation (udg_tempPoint)
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)


Ahhhh.... now I think I know what you want. ( 15% change to stunt )
If yes you need this condition not "For each integer from A.."

  • (Random integer number between 1 and 100) Greater than or equal to 85
  • Spirit Break
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked Unit has buff Spirit Break (Aura)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than or equal to 85
        • Then - Actions
          • Set Caster = (Attacked unit)
          • Set Target = (Attacking unit)
          • Set tempPoint = (Position of Caster)
          • Unit - Create 1 Dummy Caster for (Owner of Caster) at tempPoint facing Default building facing (270.0) degrees
          • Unit - Add Spirit Break[dummy] to (Last created unit)
          • Unit - Set level of Spirit Break[dummy] for (Last created unit) to (Level of Spirit Break for Caster)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Target
          • Wait until ((Target has buff Spirit Break (Stun)) Equal to (==) True), checking every 0.10 seconds
          • Unit - Remove (Last created unit) from the game
      • Else - Actions
  • Custom script: call RemoveLocation (udg_tempPoint)
 
Level 9
Joined
Dec 12, 2007
Messages
489
  • Spirit Break
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked Unit has buff Spirit Break (Aura)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than or equal to 85
        • Then - Actions
          • Set Caster = (Attacked unit)
          • Set Target = (Attacking unit)
          • Set tempPoint = (Position of Caster)
          • Unit - Create 1 Dummy Caster for (Owner of Caster) at tempPoint facing Default building facing (270.0) degrees
          • Unit - Add Spirit Break[dummy] to (Last created unit)
          • Unit - Set level of Spirit Break[dummy] for (Last created unit) to (Level of Spirit Break for Caster)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Target
          • Wait until ((Target has buff Spirit Break (Stun)) Equal to (==) True), checking every 0.10 seconds
          • Unit - Remove (Last created unit) from the game
      • Else - Actions
  • Custom script: call RemoveLocation (udg_tempPoint)

I believe that the "wait until ..." is not needed, you can just add expiration timer to it,
and the custom script remove location should be placed inside the if-then-else, and I know this is just a matter of style but I believe its better if you check the condition of random integer to "less than or equal to 15" rather than "greater than or equal to 85", its easier to understand IMO.

so its should end like this:
  • Spirit Break
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked Unit has buff Spirit Break (Aura)) Equal to True
    • 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 15
        • Then - Actions
          • Set Caster = (Attacked unit)
          • Set Target = (Attacking unit)
          • Set tempPoint = (Position of Caster)
          • Unit - Create 1 Dummy Caster for (Owner of Caster) at tempPoint facing Default building facing (270.0) degrees
          • Unit - Add Spirit Break[dummy] to (Last created unit)
          • Unit - Set level of Spirit Break[dummy] for (Last created unit) to (Level of Spirit Break for Caster)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Target
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_tempPoint)
      • Else - Actions
 
Status
Not open for further replies.
Top