• 🏆 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] Need help with this spell to give chance to damage enemies...

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
772
I have a spell in my map that damages enemy units affected by the spell if they cast a spell but I want it to instead have 50% chance to damage enemy units with the buff if they casts a spell. How can I make that?
  • Darkness lvl1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Casting unit) has buff Perpetual Darkness ) Equal to True
    • Actions
      • Unit - Create 1 Er-Murâzor (Darkness) for (Owner of Er-Murâzor 0260 <gen>) at (Position of (Triggering unit)) facing Default building facing degrees
      • Special Effect - Create a special effect attached to the origin of (Casting unit) using doombolttarget.mdx
      • Unit - Cause (Last created unit) to damage (Triggering unit), dealing 175.00 damage of attack type Spells and damage type Magic
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
@Dinodin the text after and including "//" is just to explain where to find things and how they're called, not a part of the trigger

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions) // Action -> If / Then / Else, Multiple Functions
      • If - Conditions
        • (Random integer number between 1 and 100) Less than or equal to 50 // Integer Comparison -> Function: Math - Random Number
      • Then - Actions
        • -------- Move all your actions here --------
      • Else - Actions
^That's the option with the If/Then/Else block, but as Riki said, you can skip this block entirely and just put this condition in the conditions part of the trigger, like this:

  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to 50
    • ((Casting unit) has buff Perpetual Darkness ) Equal to True
  • Actions
    • Unit - Create 1 Er-Murâzor (Darkness) for (Owner of Er-Murâzor 0260 <gen>) at (Position of (Triggering unit)) facing Default building facing degrees
    • Special Effect - Create a special effect attached to the origin of (Casting unit) using doombolttarget.mdx
    • Unit - Cause (Last created unit) to damage (Triggering unit), dealing 175.00 damage of attack type Spells and damage type Magic
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Feel free to pick whichever one you like more.
 
Last edited:
Level 14
Joined
Jul 19, 2007
Messages
772
@Dinodin the text after and including "//" is just to explain where to find things and how they're called, not a part of the trigger

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions) // Action -> If / Then / Else, Multiple Functions
      • If - Conditions
        • (Random integer number between 1 and 100) Less than or equal to 50 // Integer Comparison -> Function: Math - Random Number
      • Then - Actions
        • -------- Move all your actions here --------
      • Else - Actions
^That's the option with the If/Then/Else block, but as Riki said, you can skip this block entirely and just put this condition in the conditions part of the trigger, like this:

  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to 50
    • ((Casting unit) has buff Perpetual Darkness ) Equal to True
  • Actions
    • Unit - Create 1 Er-Murâzor (Darkness) for (Owner of Er-Murâzor 0260 <gen>) at (Position of (Triggering unit)) facing Default building facing degrees
    • Special Effect - Create a special effect attached to the origin of (Casting unit) using doombolttarget.mdx
    • Unit - Cause (Last created unit) to damage (Triggering unit), dealing 175.00 damage of attack type Spells and damage type Magic
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Feel free to pick whichever one you like more.
Oh I thought it was more complicated than that! Thanks for helping!
 
Status
Not open for further replies.
Top