Demon Slash

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,108
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:
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.
 
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
 
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.
Back
Top