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

Periodic Lightning Ability not working

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
  • Lightning Periodic
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Remove all units of Temp_UnitGroup from Temp_UnitGroup
      • Unit Group - Remove all units of TempUnitGroup2 from TempUnitGroup2
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Mind of the Storm T1 ELEM for (Picked unit)) Greater than 0
            • Then - Actions
              • Unit Group - Add (Picked unit) to Temp_UnitGroup
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_UnitGroup) Not equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
            • Loop - Actions
              • Set TempUnit = (Picked unit)
              • Set TempLoc = (Position of TempUnit)
              • Set TempUnitGroup2 = (Units within (525.00 + (75.00 x (Real((Level of Mind of the Storm T1 ELEM for TempUnit))))) of TempLoc matching (((Owner of TempUnit) Equal to Neutral Hostile) or ((Owner of TempUnit) Equal to Player 12 (Brown))))
              • Custom script: call RemoveLocation(udg_TempLoc)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in TempUnitGroup2) Not equal to 0
                • Then - Actions
                  • Unit Group - Pick every unit in TempUnitGroup2 and do (Actions)
                    • Loop - Actions
                      • Game - Display to (All players) for 30.00 seconds the text: Successful?
                      • Set TempLoc = (Position of (Picked unit))
                      • Special Effect - Create a special effect at TempLoc using war3mapImported\Great Lightning.mdx
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause TempUnit to damage (Picked unit), dealing (((Real((Intelligence of TempUnit (Include bonuses)))) x (2.00 + (Real((Level of Mind of the Storm T1 ELEM for (Picked unit)))))) + 0.00) damage of attack type Spells and damage type Normal
                      • Custom script: call RemoveLocation(udg_TempLoc)
                      • Game - Display to (All players) for 30.00 seconds the text: Successful!
                • Else - Actions
                  • Game - Display to (All players) for 30.00 seconds the text: No Targets!
        • Else - Actions
          • Game - Display to (All players) for 30.00 seconds the text: No Heroes!
1) It always returns "No Heroes!" even if i get a hero and research the ability
2) Anyone else see something i did wrong? All its supposed to do is, every 6 seconds, cast lightning on nearby enemies dealing (3 + ability level) x int
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You should have a different approach altogether. The periodic trigger shouldn't detect units that have the ability, leave that for another trigger.

Unit learns an ability
Ability == your ability
Add unit to group

Every 6 seconds
pick units in group
if unit is not dead then cast ability
 
Status
Not open for further replies.
Top