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

Demon Slash

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
I wanted to make when hero use demon slash(it's wind walk), to damage every enemy it passes trhough, but it doesn't work

First Trigger
  • Demon Walk
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Demon Slash
    • Actions
      • Trigger - Turn on Demon Walk Loop <gen>
  • Demon Walk Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set DemonSlash_Unit = (Triggering unit)
      • Set Damage[1] = 300.00
      • Set Damage[2] = 600.00
      • Set Damage[3] = 1200.00
      • Set Damage[4] = 2400.00
      • Set Damage[5] = (4800.00 + (Real((Agility of DemonSlash_Unit (Include bonuses)))))
      • Set TempInteger = (Level of Demon Slash for DemonSlash_Unit)
      • Set DemonSlash_UnitGroup = (Units within 50.00 of (Position of DemonSlash_Unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Demon Slash
        • Then - Actions
          • Unit Group - Pick every unit in DemonSlash_UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Picked unit) belongs to an enemy of (Owner of DemonSlash_Unit)) Equal to True) and (((Picked unit) is alive) Equal to True)
                • Then - Actions
                  • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Banish\BanishTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause DemonSlash_Unit to damage (Picked unit), dealing Damage[TempInteger] damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Custom script: call DestroyGroup(udg_DemonSlash_UnitGroup)
        • Else - Actions
 
Last edited:
Level 9
Joined
Jul 10, 2011
Messages
562
it doesnt work because you set a triggering unit in a periodic trigger^^ theres no triggering unit xD set the triggering unit in the first trigger and then set the position periodicly in the second....then itll work.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Here's the trigger again

  • Demon Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Demon Slash
    • Actions
      • Set DemonSlash_Unit = (Triggering unit)
      • Trigger - Turn on Demon Slash Loop <gen>
  • Demon Slash Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of DemonSlash_Unit)
      • Set DemonSlash_UnitGroup = (Units within 50.00 of TempPoint)
      • Set Damage[1] = 300.00
      • Set Damage[2] = 600.00
      • Set Damage[3] = 1200.00
      • Set Damage[4] = 2400.00
      • Set Damage[5] = (4800.00 + (Real((Agility of DemonSlash_Unit (Include bonuses)))))
      • Set TempInteger = (Level of Demon Slash for DemonSlash_Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit Group - Pick every unit in DemonSlash_UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Picked unit) belongs to an enemy of (Owner of DemonSlash_Unit)) Equal to True) and (((Picked unit) is alive) Equal to True)
                • Then - Actions
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Banish\BanishTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause DemonSlash_Unit to damage (Picked unit), dealing Damage[TempInteger] damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Custom script: call DestroyGroup(udg_DemonSlash_UnitGroup)
                  • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Almost. You destroy the group within the group loop. Do the two custom script calls outside the Unit Group - Pick every ...
Also, the outer if statement is useless, so can be removed
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Try this for the second trigger:
  • Demon Slash Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of DemonSlash_Unit)
      • Set DemonSlash_UnitGroup = (Units within 50.00 of TempPoint)
      • Set Damage[1] = 300.00
      • Set Damage[2] = 600.00
      • Set Damage[3] = 1200.00
      • Set Damage[4] = 2400.00
      • Set Damage[5] = (4800.00 + (Real((Agility of DemonSlash_Unit (Include bonuses)))))
      • Set TempInteger = (Level of Demon Slash for DemonSlash_Unit)
        • Unit Group - Pick every unit in DemonSlash_UnitGroup and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (((Picked unit) belongs to an enemy of (Owner of DemonSlash_Unit)) Equal to True) and (((Picked unit) is alive) Equal to True)
              • Then - Actions
                • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Banish\BanishTarget.mdl
                • Special Effect - Destroy (Last created special effect)
                • Unit - Cause DemonSlash_Unit to damage (Picked unit), dealing Damage[TempInteger] damage of attack type Spells and damage type Normal
              • Else - Actions
      • Custom script: call DestroyGroup(udg_DemonSlash_UnitGroup)
      • Custom script: call RemoveLocation(udg_TempPoint)
Changes:
-The outer IF/THEN/ELSE is removed.
-The custom scripts are moved to outside/after the Group Loop (Pick every unit in..)
 
Status
Not open for further replies.
Top