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

[Trigger] Spell should damage once

Status
Not open for further replies.
Level 8
Joined
Dec 16, 2007
Messages
252
This is a sliding spell that damages units in range once per slide. It works alright on the first cast but sometmes on the second cast (or more) it damages a unit more than once (it actually damage the unit until the slide is over). How come?

  • Fire Rush Slide
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (Number of units in s_FRGroup) Greater than 0
    • Actions
      • Unit Group - Pick every unit in s_FRGroup and do (Actions)
        • Loop - Actions
          • Set s_FRLoc1[1] = (Position of (Picked unit))
          • Set s_FRLoc1[2] = (s_FRLoc1[1] offset by 25.00 towards s_FRAngle[(Custom value of (Picked unit))] degrees)
          • Set s_FRLoc1[3] = (s_FRLoc1[2] offset by 120.00 towards s_FRAngle[(Custom value of (Picked unit))] degrees)
          • Set s_FRCV = (Custom value of (Picked unit))
          • Special Effect - Create a special effect at s_FRLoc1[3] using Abilities\Spells\Other\Doom\DoomDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Move (Picked unit) instantly to s_FRLoc1[2], facing s_FRAngle[(Custom value of (Picked unit))] degrees
          • Set s_FRGroup2[(Custom value of (Picked unit))] = (Units within 250.00 of s_FRLoc1[2] matching ((((Matching unit) belongs to an enemy of (Owner of s_FRCaster[s_FRCV])) Equal to True) and (((Matching unit) is in s_FRGroup3[s_FRCV]) Equal to False)))
          • Unit Group - Pick every unit in s_FRGroup2[s_FRCV] and do (Actions)
            • Loop - Actions
              • Game - Display to (All players) for 0.08 seconds the text: True
              • Unit - Cause s_FRCaster[s_FRCV] to damage (Picked unit), dealing (1.00 + (1.00 x (Real((Level of Fire Rush for s_FRCaster[s_FRCV]))))) damage of attack type Spells and damage type Normal
              • Unit Group - Remove (Picked unit) from s_FRGroup2[s_FRCV]
              • Unit Group - Add (Picked unit) to s_FRGroup3[s_FRCV]
          • Custom script: call DestroyGroup(udg_s_FRGroup2[udg_s_FRCV])
          • Unit Group - Pick every unit in s_FRGroup4[s_FRCV] and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to s_FRLoc1[2], facing s_FRAngle[(Custom value of (Picked unit))] degrees
          • Custom script: call RemoveLocation (udg_s_FRLoc1[1])
          • Custom script: call RemoveLocation (udg_s_FRLoc1[2])
          • Custom script: call RemoveLocation (udg_s_FRLoc1[3])
          • Set s_FRInterval[s_FRCV] = (s_FRInterval[s_FRCV] + 25)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • s_FRInterval[s_FRCV] Greater than or equal to (400 + (150 x (Level of Fire Rush for s_FRCaster[s_FRCV])))
            • Then - Actions
              • Set s_FRInterval[s_FRCV] = 0
              • Unit - Unhide s_FRCaster[s_FRCV]
              • Selection - Select s_FRCaster[s_FRCV] for (Owner of s_FRCaster[s_FRCV])
              • Unit - Turn collision for s_FRCaster[s_FRCV] On
              • Unit Group - Pick every unit in s_FRGroup3[s_FRCV] and do (Actions)
                • Loop - Actions
                  • Unit Group - Remove (Picked unit) from s_FRGroup3[s_FRCV]
              • Unit Group - Pick every unit in s_FRGroup4[s_FRCV] and do (Actions)
                • Loop - Actions
                  • Unit Group - Remove (Picked unit) from s_FRGroup4[s_FRCV]
                  • Unit - Remove (Picked unit) from the game
              • Unit Group - Remove s_FRCaster[s_FRCV] from s_FRGroup
            • Else - Actions
 
Level 8
Joined
Dec 16, 2007
Messages
252
1. This condition should filter thoose units that have been damaged already.
  • Set s_FRGroup2[(Custom value of (Picked unit))] = (Units within 250.00 of s_FRLoc1[2] matching ((((Matching unit) belongs to an enemy of (Owner of s_FRCaster[s_FRCV])) Equal to True) and (((Matching unit) is in s_FRGroup3[s_FRCV]) Equal to False)))
2.And how would I be able to damage it in the first trigger? I think I wasn't descriptive enough, this is a "charge" spell that damage any unit in range.

But nevermind, I changed it so it's now supposed to damage every 0.03 second. But though I'm curious why it didn't damage only once.
 
Status
Not open for further replies.
Top