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

[Spell] Need help with this spell to give chance to damage enemies...

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
856
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,265
@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 15
Joined
Jul 19, 2007
Messages
856
@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