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

[Spell] Stampede but uses triggers & dummies

Level 7
Joined
Oct 6, 2022
Messages
135
Hello, good morning/afternoon/evening everyone. I would like to know how to create a "Stampede but using with triggers & dummies". Damage is also in trigger so as its AoE. Last within 15 seconds would be enough.

Hope you guys could help me with it
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,567
I attached an example map that relies on a Unit Indexer to create the spell. Unfortunately, you're on 1.30 so you won't be able to open my map.

Here are the triggers and variables so you can recreate it:
  • TriggeredStampede Start Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Triggered Stampede
    • Actions
      • Set VariableSet TS_Source = (Triggering unit)
      • Set VariableSet TS_CV = (Custom value of TS_Source)
      • -------- --------
      • Unit Group - Add TS_Source to TS_Caster_Group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TS_Caster_Group) Equal to 1
        • Then - Actions
          • Trigger - Turn on TriggeredStampede Loop <gen>
          • Trigger - Turn on TriggeredStampede Dummy Dies <gen>
        • Else - Actions
      • -------- --------
      • Set VariableSet TS_Elapsed_Time[TS_CV] = 0.00
      • -------- --------
      • Set VariableSet TS_Point[0] = (Position of TS_Source)
      • Set VariableSet TS_Point[1] = (Target point of ability being cast)
      • -------- --------
      • Set VariableSet TS_Angle[TS_CV] = (Angle from TS_Point[0] to TS_Point[1])
      • Set VariableSet TS_Angle[TS_CV] = (TS_Angle[TS_CV] - 180.00)
      • -------- --------
      • Custom script: call RemoveLocation( udg_TS_Point[0] )
      • Custom script: call RemoveLocation( udg_TS_Point[1] )
      • -------- --------
      • -------- [ DEFINE THE STATS OF THE ABILITY ] --------
      • -------- --------
      • -------- Define the stampede damage: --------
      • Set VariableSet TS_DEFINE_Damage[TS_CV] = 100.00
      • -------- --------
      • -------- Define the area of effect when dealing damage: --------
      • Set VariableSet TS_DEFINE_Damage_Radius[TS_CV] = 160.00
      • -------- --------
      • -------- Define the area of effect for colliding with an enemy unit: --------
      • Set VariableSet TS_DEFINE_Collision_Radius[TS_CV] = 90.00
      • -------- --------
      • -------- Define the stampede spawn interval: --------
      • Set VariableSet TS_DEFINE_Dummy_Interval[TS_CV] = 0.20
      • -------- --------
      • -------- Define the stampede speed (10 = 500 distance per second): --------
      • Set VariableSet TS_DEFINE_Dummy_Speed[TS_CV] = 10.00
      • -------- --------
      • -------- Define the stampede dummy duration: --------
      • Set VariableSet TS_DEFINE_Dummy_Duration[TS_CV] = 2.00
      • -------- --------
      • -------- [ STOP ] --------
      • -------- --------
      • -------- This helps fix a floating point issue (don't change this): --------
      • Set VariableSet TS_DEFINE_Dummy_Interval[TS_CV] = (TS_DEFINE_Dummy_Interval[TS_CV] - 0.01)
  • TriggeredStampede Stop Cast
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Triggered Stampede
    • Actions
      • Unit Group - Remove (Triggering unit) from TS_Caster_Group.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_Dummy_Count Equal to 0
          • (Number of units in TS_Caster_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off TriggeredStampede Loop <gen>
          • Trigger - Turn off TriggeredStampede Dummy Dies <gen>
        • Else - Actions
  • TriggeredStampede Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • -------- This trigger should be Initially OFF! --------
      • -------- --------
      • -------- Manage the Stampede dummies: --------
      • Unit Group - Pick every unit in TS_Dummy_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TS_Source = (Picked unit)
          • Set VariableSet TS_CV = (Custom value of TS_Source)
          • Set VariableSet TS_CV_Hero = (Custom value of TS_Dummy_Hero[TS_CV])
          • -------- --------
          • Set VariableSet TS_Point[0] = (Position of TS_Source)
          • Set VariableSet TS_Point[1] = (TS_Point[0] offset by TS_DEFINE_Dummy_Speed[TS_CV_Hero] towards (Facing of TS_Source) degrees.)
          • -------- --------
          • Custom script: call SetUnitX( udg_TS_Source, GetLocationX( udg_TS_Point[1] ))
          • Custom script: call SetUnitY( udg_TS_Source, GetLocationY( udg_TS_Point[1] ))
          • -------- --------
          • Set VariableSet TS_Collision_Has_Occurred = False
          • -------- --------
          • -------- Find a nearby target to collide with: --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within TS_DEFINE_Collision_Radius[TS_CV_Hero] of TS_Point[1].) and do (Actions)
            • Loop - Actions
              • Set VariableSet TS_Target = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TS_Target belongs to an enemy of (Owner of TS_Source).) Equal to True
                  • (TS_Target is alive) Equal to True
                  • (TS_Target is A ground unit) Equal to True
                • Then - Actions
                  • Set VariableSet TS_Collision_Has_Occurred = True
                • Else - Actions
          • -------- --------
          • -------- If it collided with a target then deal damage in a radius and kill the dummy: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TS_Collision_Has_Occurred Equal to True
            • Then - Actions
              • -------- Damage nearby targets: --------
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within TS_DEFINE_Damage_Radius[TS_CV_Hero] of TS_Point[1].) and do (Actions)
                • Loop - Actions
                  • Set VariableSet TS_Target = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TS_Target belongs to an enemy of (Owner of TS_Source).) Equal to True
                      • (TS_Target is alive) Equal to True
                      • (TS_Target is A ground unit) Equal to True
                    • Then - Actions
                      • Unit - Cause TS_Dummy_Hero[TS_CV] to damage TS_Target, dealing TS_DEFINE_Damage[TS_CV_Hero] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the chest of TS_Target using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • -------- --------
              • Unit - Kill TS_Source
            • Else - Actions
          • -------- --------
          • Custom script: call RemoveLocation( udg_TS_Point[0] )
          • Custom script: call RemoveLocation( udg_TS_Point[1] )
      • -------- --------
      • -------- Manage the Stampede casters: --------
      • Unit Group - Pick every unit in TS_Caster_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TS_Source = (Picked unit)
          • Set VariableSet TS_CV = (Custom value of TS_Source)
          • -------- --------
          • Set VariableSet TS_Elapsed_Time[TS_CV] = (TS_Elapsed_Time[TS_CV] + 0.02)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TS_Elapsed_Time[TS_CV] Greater than or equal to TS_DEFINE_Dummy_Interval[TS_CV]
            • Then - Actions
              • Set VariableSet TS_Elapsed_Time[TS_CV] = 0.00
              • -------- --------
              • Set VariableSet TS_Point[0] = (Position of TS_Source)
              • Set VariableSet TS_Point[1] = (TS_Point[0] offset by (Random real number between 400.00 and 600.00) towards TS_Angle[TS_CV] degrees.)
              • Set VariableSet TS_Point[2] = (TS_Point[1] offset by (Random real number between -600.00 and 600.00) towards (TS_Angle[TS_CV] - 90.00) degrees.)
              • -------- --------
              • Unit - Create 1 Triggered Stampede (Dummy) for (Owner of TS_Source) at TS_Point[2] facing (TS_Angle[TS_CV] + 180.00) degrees
              • Set VariableSet TS_Target = (Last created unit)
              • Set VariableSet TS_Dummy_Hero[(Custom value of TS_Target)] = TS_Source
              • -------- --------
              • -------- How long the stampede dummy lasts: --------
              • Unit - Add a TS_DEFINE_Dummy_Duration[TS_CV] second Generic expiration timer to TS_Target
              • -------- --------
              • Unit Group - Add TS_Target to TS_Dummy_Group
              • Set VariableSet TS_Dummy_Count = (TS_Dummy_Count + 1)
              • -------- --------
              • Custom script: call RemoveLocation( udg_TS_Point[0] )
              • Custom script: call RemoveLocation( udg_TS_Point[1] )
              • Custom script: call RemoveLocation( udg_TS_Point[2] )
            • Else - Actions
      • -------- --------
      • -------- Turn off when finished: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_Dummy_Count Equal to 0
          • (Number of units in TS_Caster_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off TriggeredStampede Loop <gen>
          • Trigger - Turn off TriggeredStampede Dummy Dies <gen>
        • Else - Actions
  • TriggeredStampede Dummy Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Triggered Stampede (Dummy)
    • Actions
      • -------- This trigger should be Initially OFF! --------
      • Unit Group - Remove (Triggering unit) from TS_Dummy_Group.
      • Set VariableSet TS_Dummy_Count = (TS_Dummy_Count - 1)
ts vars.png


Notes:
  • The ability is based on Channel with a Follow Through Time of 15.00 seconds and Disable Other Abilities set to FALSE.
  • The dummy unit is based on the Locust with some settings tweaked so it won't attack or do anything weird.
  • The _Speed variable is how far a Dummy unit moves every 0.02 seconds. If it helps to understand better you can multiply this value by 50 to determine the distance traveled per second. For example, I've defaulted it to: 10.00 * 50 = 500 distance per second.
  • I reuse some variables for the sake of efficiency (I didn't want to create even MORE variables). So the names of the variables can be misleading in some parts.
You can adjust the Stampede spawn offset (where the Dummy units are created) here:
  • -------- Manage the Stampede casters: --------
  • Set VariableSet TS_Point[0] = (Position of TS_Source)
  • Set VariableSet TS_Point[1] = (TS_Point[0] offset by (Random real number between 400.00 and 600.00) towards TS_Angle[TS_CV] degrees.)
  • Set VariableSet TS_Point[2] = (TS_Point[1] offset by (Random real number between -600.00 and 600.00) towards (TS_Angle[TS_CV] - 90.00) degrees.)
TS_Point[1] determines how far the Dummy unit will spawn behind the Hero. I set it to a random distance between 400 and 600 by default. You could lower these to negative values to make it spawn in front of the Hero instead.

TS_Point[2] determines the exact spot that the Dummy unit will spawn at. It uses TS_Point[1] as an origin point. I set it to a random distance between -600 and 600 which basically means it can spawn the dummy at a random point along a 1200 distance line.

So by default, I spawn the Dummy at a random point along a 1200 distance line that is anywhere between 400 to 600 distance behind the hero. This results in a somewhat random pattern that should resemble the original Stampede ability.

You'll have to play around with these values to get it working how you'd like. It may also be desirable to add some consistency to the pattern to prevent rare cases of RNG. At the moment nothing is stopping it from creating 5 close together Dummy units in a row, although it consistently spread them out during my tests.
 

Attachments

  • Triggered Stampede.w3m
    30.7 KB · Views: 2
Last edited:
Level 7
Joined
Oct 6, 2022
Messages
135
I attached an example map that relies on a Unit Indexer to create the spell. Unfortunately, you're on 1.30 so you won't be able to open my map.

Here are the triggers and variables so you can recreate it:
  • TriggeredStampede Start Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Triggered Stampede
    • Actions
      • Set VariableSet TS_Source = (Triggering unit)
      • Set VariableSet TS_CV = (Custom value of TS_Source)
      • -------- --------
      • Unit Group - Add TS_Source to TS_Caster_Group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TS_Caster_Group) Equal to 1
        • Then - Actions
          • Trigger - Turn on TriggeredStampede Loop <gen>
          • Trigger - Turn on TriggeredStampede Dummy Dies <gen>
        • Else - Actions
      • -------- --------
      • Set VariableSet TS_Elapsed_Time[TS_CV] = 0.00
      • -------- --------
      • Set VariableSet TS_Point[0] = (Position of TS_Source)
      • Set VariableSet TS_Point[1] = (Target point of ability being cast)
      • -------- --------
      • Set VariableSet TS_Angle[TS_CV] = (Angle from TS_Point[0] to TS_Point[1])
      • Set VariableSet TS_Angle[TS_CV] = (TS_Angle[TS_CV] - 180.00)
      • -------- --------
      • Custom script: call RemoveLocation( udg_TS_Point[0] )
      • Custom script: call RemoveLocation( udg_TS_Point[1] )
      • -------- --------
      • -------- [ DEFINE THE STATS OF THE ABILITY ] --------
      • -------- --------
      • -------- Define the stampede damage: --------
      • Set VariableSet TS_DEFINE_Damage[TS_CV] = 100.00
      • -------- --------
      • -------- Define the area of effect when dealing damage: --------
      • Set VariableSet TS_DEFINE_Damage_Radius[TS_CV] = 160.00
      • -------- --------
      • -------- Define the area of effect for colliding with an enemy unit: --------
      • Set VariableSet TS_DEFINE_Collision_Radius[TS_CV] = 90.00
      • -------- --------
      • -------- Define the stampede spawn interval: --------
      • Set VariableSet TS_DEFINE_Dummy_Interval[TS_CV] = 0.20
      • -------- --------
      • -------- Define the stampede speed (10 = 500 distance per second): --------
      • Set VariableSet TS_DEFINE_Dummy_Speed[TS_CV] = 10.00
      • -------- --------
      • -------- Define the stampede dummy duration: --------
      • Set VariableSet TS_DEFINE_Dummy_Duration[TS_CV] = 2.00
      • -------- --------
      • -------- [ STOP ] --------
      • -------- --------
      • -------- This helps fix a floating point issue (don't change this): --------
      • Set VariableSet TS_DEFINE_Dummy_Interval[TS_CV] = (TS_DEFINE_Dummy_Interval[TS_CV] - 0.01)
  • TriggeredStampede Stop Cast
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Triggered Stampede
    • Actions
      • Unit Group - Remove (Triggering unit) from TS_Caster_Group.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_Dummy_Count Equal to 0
          • (Number of units in TS_Caster_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off TriggeredStampede Loop <gen>
          • Trigger - Turn off TriggeredStampede Dummy Dies <gen>
        • Else - Actions
  • TriggeredStampede Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • -------- This trigger should be Initially OFF! --------
      • -------- --------
      • -------- Manage the Stampede dummies: --------
      • Unit Group - Pick every unit in TS_Dummy_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TS_Source = (Picked unit)
          • Set VariableSet TS_CV = (Custom value of TS_Source)
          • Set VariableSet TS_CV_Hero = (Custom value of TS_Dummy_Hero[TS_CV])
          • -------- --------
          • Set VariableSet TS_Point[0] = (Position of TS_Source)
          • Set VariableSet TS_Point[1] = (TS_Point[0] offset by TS_DEFINE_Dummy_Speed[TS_CV_Hero] towards (Facing of TS_Source) degrees.)
          • -------- --------
          • Custom script: call SetUnitX( udg_TS_Source, GetLocationX( udg_TS_Point[1] ))
          • Custom script: call SetUnitY( udg_TS_Source, GetLocationY( udg_TS_Point[1] ))
          • -------- --------
          • Set VariableSet TS_Collision_Has_Occurred = False
          • -------- --------
          • -------- Find a nearby target to collide with: --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within TS_DEFINE_Collision_Radius[TS_CV_Hero] of TS_Point[1].) and do (Actions)
            • Loop - Actions
              • Set VariableSet TS_Target = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TS_Target belongs to an enemy of (Owner of TS_Source).) Equal to True
                  • (TS_Target is alive) Equal to True
                  • (TS_Target is A ground unit) Equal to True
                • Then - Actions
                  • Set VariableSet TS_Collision_Has_Occurred = True
                • Else - Actions
          • -------- --------
          • -------- If it collided with a target then deal damage in a radius and kill the dummy: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TS_Collision_Has_Occurred Equal to True
            • Then - Actions
              • -------- Damage nearby targets: --------
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within TS_DEFINE_Damage_Radius[TS_CV_Hero] of TS_Point[1].) and do (Actions)
                • Loop - Actions
                  • Set VariableSet TS_Target = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TS_Target belongs to an enemy of (Owner of TS_Source).) Equal to True
                      • (TS_Target is alive) Equal to True
                      • (TS_Target is A ground unit) Equal to True
                    • Then - Actions
                      • Unit - Cause TS_Dummy_Hero[TS_CV] to damage TS_Target, dealing TS_DEFINE_Damage[TS_CV_Hero] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the chest of TS_Target using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • -------- --------
              • Unit - Kill TS_Source
            • Else - Actions
          • -------- --------
          • Custom script: call RemoveLocation( udg_TS_Point[0] )
          • Custom script: call RemoveLocation( udg_TS_Point[1] )
      • -------- --------
      • -------- Manage the Stampede casters: --------
      • Unit Group - Pick every unit in TS_Caster_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TS_Source = (Picked unit)
          • Set VariableSet TS_CV = (Custom value of TS_Source)
          • -------- --------
          • Set VariableSet TS_Elapsed_Time[TS_CV] = (TS_Elapsed_Time[TS_CV] + 0.02)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TS_Elapsed_Time[TS_CV] Greater than or equal to TS_DEFINE_Dummy_Interval[TS_CV]
            • Then - Actions
              • Set VariableSet TS_Elapsed_Time[TS_CV] = 0.00
              • -------- --------
              • Set VariableSet TS_Point[0] = (Position of TS_Source)
              • Set VariableSet TS_Point[1] = (TS_Point[0] offset by (Random real number between 400.00 and 600.00) towards TS_Angle[TS_CV] degrees.)
              • Set VariableSet TS_Point[2] = (TS_Point[1] offset by (Random real number between -600.00 and 600.00) towards (TS_Angle[TS_CV] - 90.00) degrees.)
              • -------- --------
              • Unit - Create 1 Triggered Stampede (Dummy) for (Owner of TS_Source) at TS_Point[2] facing (TS_Angle[TS_CV] + 180.00) degrees
              • Set VariableSet TS_Target = (Last created unit)
              • Set VariableSet TS_Dummy_Hero[(Custom value of TS_Target)] = TS_Source
              • -------- --------
              • -------- How long the stampede dummy lasts: --------
              • Unit - Add a TS_DEFINE_Dummy_Duration[TS_CV] second Generic expiration timer to TS_Target
              • -------- --------
              • Unit Group - Add TS_Target to TS_Dummy_Group
              • Set VariableSet TS_Dummy_Count = (TS_Dummy_Count + 1)
              • -------- --------
              • Custom script: call RemoveLocation( udg_TS_Point[0] )
              • Custom script: call RemoveLocation( udg_TS_Point[1] )
              • Custom script: call RemoveLocation( udg_TS_Point[2] )
            • Else - Actions
      • -------- --------
      • -------- Turn off when finished: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_Dummy_Count Equal to 0
          • (Number of units in TS_Caster_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off TriggeredStampede Loop <gen>
          • Trigger - Turn off TriggeredStampede Dummy Dies <gen>
        • Else - Actions
  • TriggeredStampede Dummy Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Triggered Stampede (Dummy)
    • Actions
      • -------- This trigger should be Initially OFF! --------
      • Unit Group - Remove (Triggering unit) from TS_Dummy_Group.
      • Set VariableSet TS_Dummy_Count = (TS_Dummy_Count - 1)
View attachment 458060

Notes:
  • The ability is based on Channel with a Follow Through Time of 15.00 seconds and Disable Other Abilities set to FALSE.
  • The dummy unit is based on the Locust with some settings tweaked so it won't attack or do anything weird.
  • The _Speed variable is how far a Dummy unit moves every 0.02 seconds. If it helps to understand better you can multiply this value by 50 to determine the distance traveled per second. For example, I've defaulted it to: 10.00 * 50 = 500 distance per second.
  • I reuse some variables for the sake of efficiency (I didn't want to create even MORE variables). So the names of the variables can be misleading in some parts.
You can adjust the Stampede spawn offset (where the Dummy units are created) here:
  • -------- Manage the Stampede casters: --------
  • Set VariableSet TS_Point[0] = (Position of TS_Source)
  • Set VariableSet TS_Point[1] = (TS_Point[0] offset by (Random real number between 400.00 and 600.00) towards TS_Angle[TS_CV] degrees.)
  • Set VariableSet TS_Point[2] = (TS_Point[1] offset by (Random real number between -600.00 and 600.00) towards (TS_Angle[TS_CV] - 90.00) degrees.)
TS_Point[1] determines how far the Dummy unit will spawn behind the Hero. I set it to a random distance between 400 and 600 by default. You could lower these to negative values to make it spawn in front of the Hero instead.

TS_Point[2] determines the exact spot that the Dummy unit will spawn at. It uses TS_Point[1] as an origin point. I set it to a random distance between -600 and 600 which basically means it can spawn the dummy at a random point along a 1200 distance line.

So by default, I spawn the Dummy at a random point along a 1200 distance line that is anywhere between 400 to 600 distance behind the hero. This results in a somewhat random pattern that should resemble the original Stampede ability.

You'll have to play around with these values to get it working how you'd like. It may also be desirable to add some consistency to the pattern to prevent rare cases of RNG. At the moment nothing is stopping it from creating 5 close together Dummy units in a row, although it consistently spread them out during my tests.
Hello again, sorry for bothering you again. Can i ask how to make this but it'll only stop within 10 seconds or the hero dies, it'll update its position and towards when the hero moves and change its facing angle? Thank you in advance
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,567
1) Use a different Point ability that isn't channeled. Shockwave comes to mind with the Targets Allowed set to None.

2) Inside of the Loop trigger, update TS_Angle to be the current facing angle of the caster. Also, create a new Real array variable to track the duration:
  • -------- Manage the Stampede casters: --------
  • Unit Group - Pick every unit in TS_Caster_Group and do (Actions)
    • Loop - Actions
      • Set VariableSet TS_Source = (Picked unit)
      • Set VariableSet TS_CV = (Custom value of TS_Source)
      • -------- --------
      • -------- NEW: Update the angle to be the current facing angle of the caster: --------
      • Set VariableSet TS_Angle[TS_CV] = (Facing of TS_Source)
      • -------- --------
      • Set VariableSet TS_Elapsed_Time[TS_CV] = (TS_Elapsed_Time[TS_CV] + 0.02)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • -------- --------
      • -------- NEW: Keep track of the total time that has passed: --------
      • Set VariableSet TS_Total_Time[TS_CV] = (TS_Total_Time[TS_CV] - 0.02)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_Total_Time[TS_CV] Less than or equal to 0.01
        • Then - Actions
          • Unit Group - Remove TS_Source from TS_Caster_Group
        • Else - Actions
Note that I deleted the other Actions to make it easier to read. DO NOT DELETE ANY ACTIONS!

3) In the Start trigger, set the new variable TS_Total_Time to 10.00 seconds:
  • TriggeredStampede Start Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Triggered Stampede
    • Actions
      • -------- --------
      • -------- [ DEFINE THE STATS OF THE ABILITY ] --------
      • -------- --------
      • -------- NEW: Keep track of the total duration of the ability: --------
      • Set VariableSet TS_Total_Time[TS_CV] = 10.00
Note that I deleted the other Actions to make it easier to read. DO NOT DELETE ANY ACTIONS!

4) In the Stop trigger, change the Event and Condition to happen when the hero dies:
  • TriggeredStampede Stop Cast
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Triggered Stampede for (Triggering unit)) Greater than 0
    • Actions
      • Unit Group - Remove (Triggering unit) from TS_Caster_Group.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TS_Dummy_Count Equal to 0
          • (Number of units in TS_Caster_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off TriggeredStampede Loop <gen>
          • Trigger - Turn off TriggeredStampede Dummy Dies <gen>
        • Else - Actions
Note that all of these changes are "lazy" and could definitely be improved. But it should work fine.
 
Last edited:
Top