Need help to make spells

Level 2
Joined
May 30, 2019
Messages
25
Code:
Primal Roar
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Primal Roar
Actions
Set PrimalRoar_Caster = (Triggering unit)
Set PrimalRoar_Caster_Loc = (Position of PrimalRoar_Caster)
Set PrimalRoar_Target = (Target unit of ability being cast)
Set PrimalRoar_Target_Loc = (Target point of ability being cast)
Set PrimalRoar_Angle = (Angle from PrimalRoar_Caster_Loc to PrimalRoar_Target_Loc)
For each (Integer PrimalRoar) from 1 to 4, do (Actions)
Loop - Actions
Set PrimalRoar_Temp_Loc[PrimalRoar] = (PrimalRoar_Caster_Loc offset by (200.00 x (Real(PrimalRoar))) towards PrimalRoar_Angle degrees)
Unit - Create 1 Primal Roar Effect Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
Set PrimalRoar_Effect_Dummy[PrimalRoar] = (Last created unit)
Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Effect_Dummy[PrimalRoar]
Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
Set PrimalRoar_Dummy[PrimalRoar] = (Last created unit)
Animation - Change PrimalRoar_Dummy[PrimalRoar] prop window angle to -180.00
Unit - Set level of Primal Roar Slow Effect for PrimalRoar_Dummy[PrimalRoar] to (Level of Primal Roar for PrimalRoar_Caster)
Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Dummy[PrimalRoar]
Unit - Order PrimalRoar_Dummy[PrimalRoar] to Human Mountain King - Thunder Clap
Wait 0.35 seconds
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to False) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Primal Roar (Slow)) Equal to True)) and (((Matching unit) Not equal to PrimalRoar_Target) and do (Actions)
Loop - Actions
Custom script: call SetUnitPathing(GetEnumUnit(), false)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PrimalRoar_Angle Greater than 90.00
PrimalRoar_Angle Less than or equal to 270.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to PrimalRoar_Angle
Then - Actions
Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
Else - Actions
Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to (PrimalRoar_Angle + 180.00)) or ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Less than PrimalRoar_Angle)
Then - Actions
Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
Else - Actions
Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
Unit - Set level of Primal Roar Damage for (Last created unit) to (Level of Primal Roar for PrimalRoar_Caster)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Picked unit)) Equal to (Owner of PrimalRoar_Caster)
Then - Actions
Do nothing
Else - Actions
Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Picked unit)
Countdown Timer - Start PrimalRoar_Timer as a Repeating timer that will expire in 0.03 seconds
Unit - Order PrimalRoar_Caster to Attack PrimalRoar_Target
Custom script: call RemoveLocation (udg_PrimalRoar_Caster_Loc)
Custom script: call RemoveLocation (udg_PrimalRoar_Target_Loc)
Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[1])
Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[2])
Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[3])
Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[4])

Code:
Primal Roar Move Units
Events
Time - PrimalRoar_Timer expires
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PrimalRoar_Counter Less than 40
Then - Actions
Set PrimalRoar_Counter = (PrimalRoar_Counter + 1)
Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle + 90.00) degrees)
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle - 90.00) degrees)
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
Loop - Actions
Custom script: call SetUnitPathing(GetEnumUnit(), true)
Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
Loop - Actions
Custom script: call SetUnitPathing(GetEnumUnit(), true)
Countdown Timer - Pause PrimalRoar_Timer
Set PrimalRoar_Counter = 0
Set PrimalRoar_Angle = 0.00
Custom script: set bj_wantDestroyGroup = true
Unit Group - Remove all units from PrimalRoar_Right_Group
Custom script: set bj_wantDestroyGroup = true
Unit Group - Remove all units from PrimalRoar_Left_Group

In this trigger code can you make it to be a spells i am newbe
 
Level 8
Joined
May 21, 2019
Messages
435
I cleaned up your post for you:

  • Primal Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Primal Roar
    • Actions
      • Set PrimalRoar_Caster = (Triggering unit)
      • Set PrimalRoar_Caster_Loc = (Position of PrimalRoar_Caster)
      • Set PrimalRoar_Target = (Target unit of ability being cast)
      • Set PrimalRoar_Target_Loc = (Target point of ability being cast)
      • Set PrimalRoar_Angle = (Angle from PrimalRoar_Caster_Loc to PrimalRoar_Target_Loc)
      • For each (Integer PrimalRoar) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set PrimalRoar_Temp_Loc[PrimalRoar] = (PrimalRoar_Caster_Loc offset by (200.00 x (Real(PrimalRoar))) towards PrimalRoar_Angle degrees)
          • Unit - Create 1 Primal Roar Effect Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
          • Set PrimalRoar_Effect_Dummy[PrimalRoar] = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Effect_Dummy[PrimalRoar]
          • Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
          • Set PrimalRoar_Dummy[PrimalRoar] = (Last created unit)
          • Animation - Change PrimalRoar_Dummy[PrimalRoar] prop window angle to -180.00
          • Unit - Set level of Primal Roar Slow Effect for PrimalRoar_Dummy[PrimalRoar] to (Level of Primal Roar for PrimalRoar_Caster)
          • Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Dummy[PrimalRoar]
          • Unit - Order PrimalRoar_Dummy[PrimalRoar] to Human Mountain King - Thunder Clap
      • Wait 0.35 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to False) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Primal Roar (Slow)) Equal to True)) and (((Matching unit) Not equal to PrimalRoar_Target) and do (Actions)
        • Loop - Actions
          • Custom script: call SetUnitPathing(GetEnumUnit(), false)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PrimalRoar_Angle Greater than 90.00
              • PrimalRoar_Angle Less than or equal to 270.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to PrimalRoar_Angle
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
                • Else - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to (PrimalRoar_Angle + 180.00)) or ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Less than PrimalRoar_Angle)
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
                • Else - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
          • Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at (Position of (Picked unit)) facing Default building facing degrees
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Primal Roar Damage for (Last created unit) to (Level of Primal Roar for PrimalRoar_Caster)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Owner of PrimalRoar_Caster)
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Picked unit)
      • Countdown Timer - Start PrimalRoar_Timer as a Repeating timer that will expire in 0.03 seconds
      • Unit - Order PrimalRoar_Caster to Attack PrimalRoar_Target
      • Custom script: call RemoveLocation (udg_PrimalRoar_Caster_Loc)
      • Custom script: call RemoveLocation (udg_PrimalRoar_Target_Loc)
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[1])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[2])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[3])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[4])

  • Primal Roar Move Units
    • Events
      • Time - PrimalRoar_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PrimalRoar_Counter Less than 40
        • Then - Actions
          • Set PrimalRoar_Counter = (PrimalRoar_Counter + 1)
          • Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle + 90.00) degrees)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle - 90.00) degrees)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitPathing(GetEnumUnit(), true)
          • Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitPathing(GetEnumUnit(), true)
          • Countdown Timer - Pause PrimalRoar_Timer
          • Set PrimalRoar_Counter = 0
          • Set PrimalRoar_Angle = 0.00
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Remove all units from PrimalRoar_Right_Group
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Remove all units from PrimalRoar_Left_Group

Also, to answer what I assume is your question. I assume that you copy/pasted this spell from a resource somewhere, so I will just assume that the code works, and that what you're trying to do, is implement it in your map.

All you need to do, is create an ability that matches whatever this thing is supposed to interact with. Like Battle Roar maybe? Name it whatever you want, and then change the condition in the first trigger to that one:

  • Primal Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to PICK YOUR SPELL HERE
    • Actions
      • ...
 
Last edited:
Level 2
Joined
May 30, 2019
Messages
25
Code:
Code:

Primal Roar Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Primal Roar Actions Set PrimalRoar_Caster = (Triggering unit) Set PrimalRoar_Caster_Loc = (Position of PrimalRoar_Caster) Set PrimalRoar_Target = (Target unit of ability being cast) Set PrimalRoar_Target_Loc = (Target point of ability being cast) Set PrimalRoar_Angle = (Angle from PrimalRoar_Caster_Loc to PrimalRoar_Target_Loc) For each (Integer PrimalRoar) from 1 to 4, do (Actions) Loop - Actions Set PrimalRoar_Temp_Loc[PrimalRoar] = (PrimalRoar_Caster_Loc offset by (200.00 x (Real(PrimalRoar^))) towards PrimalRoar_Angle degrees) Unit - Create 1 Primal Roar Effect Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees Set PrimalRoar_Effect_Dummy[PrimalRoar] = (Last created unit) Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Effect_Dummy[PrimalRoar] Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees Set PrimalRoar_Dummy[PrimalRoar] = (Last created unit) Animation - Change PrimalRoar_Dummy[PrimalRoar] prop window angle to -180.00 Unit - Set level of Primal Roar Slow Effect for PrimalRoar_Dummy[PrimalRoar] to (Level of Primal Roar for PrimalRoar_Caster) Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Dummy[PrimalRoar] Unit - Order PrimalRoar_Dummy[PrimalRoar] to Human Mountain King - Thunder Clap Wait 0.35 seconds Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to False) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Primal Roar (Slow)) Equal to True)) and (((Matching unit) Not equal to PrimalRoar_Target) and do (Actions) Loop - Actions Custom script: call SetUnitPathing(GetEnumUnit(), false) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions PrimalRoar_Angle Greater than 90.00 PrimalRoar_Angle Less than or equal to 270.00 Then - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to PrimalRoar_Angle Then - Actions Unit Group - Add (Picked unit) to PrimalRoar_Right_Group Else - Actions Unit Group - Add (Picked unit) to PrimalRoar_Left_Group Else - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to (PrimalRoar_Angle + 180.00)) or ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Less than PrimalRoar_Angle) Then - Actions Unit Group - Add (Picked unit) to PrimalRoar_Left_Group Else - Actions Unit Group - Add (Picked unit) to PrimalRoar_Right_Group Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at (Position of (Picked unit)) facing Default building facing degrees Unit - Add a 0.90 second Generic expiration timer to (Last created unit) Unit - Set level of Primal Roar Damage for (Last created unit) to (Level of Primal Roar for PrimalRoar_Caster) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Owner of (Picked unit)) Equal to (Owner of PrimalRoar_Caster) Then - Actions Do nothing Else - Actions Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Picked unit) Countdown Timer - Start PrimalRoar_Timer as a Repeating timer that will expire in 0.03 seconds Unit - Order PrimalRoar_Caster to Attack PrimalRoar_Target Custom script: call RemoveLocation (udg_PrimalRoar_Caster_Loc) Custom script: call RemoveLocation (udg_PrimalRoar_Target_Loc) Custom script: call RemoveLo[1]) Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[2]) Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[3]) Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[4])

Code:

Primal Roar Move Units Events Time - PrimalRoar_Timer expires Conditions Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions PrimalRoar_Counter Less than 40 Then - Actions Set PrimalRoar_Counter = (PrimalRoar_Counter + 1) Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions) Loop - Actions Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle + 90.00) degrees) Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl Special Effect - Destroy (Last created special effect) Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl Special Effect - Destroy (Last created special effect) Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions) Loop - Actions Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle - 90.00) degrees) Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl Special Effect - Destroy (Last created special effect) Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl Special Effect - Destroy (Last created special effect) Else - Actions Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions) Loop - Actions Custom script: call SetUnitPathing(GetEnumUnit(), true) Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions) Loop - Actions Custom script: call SetUnitPathing(GetEnumUnit(), true) Countdown Timer - Pause PrimalRoar_Timer Set PrimalRoar_Counter = 0 Set PrimalRoar_Angle = 0.00 Custom script: set bj_wantDestroyGroup = true Unit Group - Remove all units from PrimalRoar_Right_Group Custom script: set bj_wantDestroyGroup = true Unit Group - Remove all units from PrimalRoar_Left_Group
I cleaned up your post for you:

  • Primal Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Primal Roar
    • Actions
      • Set PrimalRoar_Caster = (Triggering unit)
      • Set PrimalRoar_Caster_Loc = (Position of PrimalRoar_Caster)
      • Set PrimalRoar_Target = (Target unit of ability being cast)
      • Set PrimalRoar_Target_Loc = (Target point of ability being cast)
      • Set PrimalRoar_Angle = (Angle from PrimalRoar_Caster_Loc to PrimalRoar_Target_Loc)
      • For each (Integer PrimalRoar) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set PrimalRoar_Temp_Loc[PrimalRoar] = (PrimalRoar_Caster_Loc offset by (200.00 x (Real(PrimalRoar))) towards PrimalRoar_Angle degrees)
          • Unit - Create 1 Primal Roar Effect Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
          • Set PrimalRoar_Effect_Dummy[PrimalRoar] = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Effect_Dummy[PrimalRoar]
          • Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
          • Set PrimalRoar_Dummy[PrimalRoar] = (Last created unit)
          • Animation - Change PrimalRoar_Dummy[PrimalRoar] prop window angle to -180.00
          • Unit - Set level of Primal Roar Slow Effect for PrimalRoar_Dummy[PrimalRoar] to (Level of Primal Roar for PrimalRoar_Caster)
          • Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Dummy[PrimalRoar]
          • Unit - Order PrimalRoar_Dummy[PrimalRoar] to Human Mountain King - Thunder Clap
      • Wait 0.35 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to False) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Primal Roar (Slow)) Equal to True)) and (((Matching unit) Not equal to PrimalRoar_Target) and do (Actions)
        • Loop - Actions
          • Custom script: call SetUnitPathing(GetEnumUnit(), false)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PrimalRoar_Angle Greater than 90.00
              • PrimalRoar_Angle Less than or equal to 270.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to PrimalRoar_Angle
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
                • Else - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to (PrimalRoar_Angle + 180.00)) or ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Less than PrimalRoar_Angle)
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
                • Else - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
          • Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at (Position of (Picked unit)) facing Default building facing degrees
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Primal Roar Damage for (Last created unit) to (Level of Primal Roar for PrimalRoar_Caster)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Owner of PrimalRoar_Caster)
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Picked unit)
      • Countdown Timer - Start PrimalRoar_Timer as a Repeating timer that will expire in 0.03 seconds
      • Unit - Order PrimalRoar_Caster to Attack PrimalRoar_Target
      • Custom script: call RemoveLocation (udg_PrimalRoar_Caster_Loc)
      • Custom script: call RemoveLocation (udg_PrimalRoar_Target_Loc)
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[1])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[2])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[3])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[4])

  • Primal Roar Move Units
    • Events
      • Time - PrimalRoar_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PrimalRoar_Counter Less than 40
        • Then - Actions
          • Set PrimalRoar_Counter = (PrimalRoar_Counter + 1)
          • Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle + 90.00) degrees)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle - 90.00) degrees)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitPathing(GetEnumUnit(), true)
          • Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitPathing(GetEnumUnit(), true)
          • Countdown Timer - Pause PrimalRoar_Timer
          • Set PrimalRoar_Counter = 0
          • Set PrimalRoar_Angle = 0.00
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Remove all units from PrimalRoar_Right_Group
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Remove all units from PrimalRoar_Left_Group

Also, to answer what I assume is your question. I assume that you copy/pasted this spell from a resource somewhere, so I will just assume that the code works, and that what you're trying to do, is implement it in your map.

All you need to do, is create an ability that matches whatever this thing is supposed to interact with. Like Battle Roar maybe? Name it whatever you want, and then change the condition in the first trigger to that one:

  • Primal Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to PICK YOUR SPELL HERE
    • Actions
      • ...
[/QUOT
I cleaned up your post for you:

  • Primal Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Primal Roar
    • Actions
      • Set PrimalRoar_Caster = (Triggering unit)
      • Set PrimalRoar_Caster_Loc = (Position of PrimalRoar_Caster)
      • Set PrimalRoar_Target = (Target unit of ability being cast)
      • Set PrimalRoar_Target_Loc = (Target point of ability being cast)
      • Set PrimalRoar_Angle = (Angle from PrimalRoar_Caster_Loc to PrimalRoar_Target_Loc)
      • For each (Integer PrimalRoar) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set PrimalRoar_Temp_Loc[PrimalRoar] = (PrimalRoar_Caster_Loc offset by (200.00 x (Real(PrimalRoar))) towards PrimalRoar_Angle degrees)
          • Unit - Create 1 Primal Roar Effect Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
          • Set PrimalRoar_Effect_Dummy[PrimalRoar] = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Effect_Dummy[PrimalRoar]
          • Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at PrimalRoar_Temp_Loc[PrimalRoar] facing Default building facing degrees
          • Set PrimalRoar_Dummy[PrimalRoar] = (Last created unit)
          • Animation - Change PrimalRoar_Dummy[PrimalRoar] prop window angle to -180.00
          • Unit - Set level of Primal Roar Slow Effect for PrimalRoar_Dummy[PrimalRoar] to (Level of Primal Roar for PrimalRoar_Caster)
          • Unit - Add a 1.00 second Generic expiration timer to PrimalRoar_Dummy[PrimalRoar]
          • Unit - Order PrimalRoar_Dummy[PrimalRoar] to Human Mountain King - Thunder Clap
      • Wait 0.35 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to False) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Primal Roar (Slow)) Equal to True)) and (((Matching unit) Not equal to PrimalRoar_Target) and do (Actions)
        • Loop - Actions
          • Custom script: call SetUnitPathing(GetEnumUnit(), false)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PrimalRoar_Angle Greater than 90.00
              • PrimalRoar_Angle Less than or equal to 270.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to PrimalRoar_Angle
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
                • Else - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Greater than or equal to (PrimalRoar_Angle + 180.00)) or ((Angle from PrimalRoar_Caster_Loc to (Position of (Picked unit))) Less than PrimalRoar_Angle)
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Left_Group
                • Else - Actions
                  • Unit Group - Add (Picked unit) to PrimalRoar_Right_Group
          • Unit - Create 1 Primal Roar Dummy for (Owner of PrimalRoar_Caster) at (Position of (Picked unit)) facing Default building facing degrees
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Primal Roar Damage for (Last created unit) to (Level of Primal Roar for PrimalRoar_Caster)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Owner of PrimalRoar_Caster)
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Picked unit)
      • Countdown Timer - Start PrimalRoar_Timer as a Repeating timer that will expire in 0.03 seconds
      • Unit - Order PrimalRoar_Caster to Attack PrimalRoar_Target
      • Custom script: call RemoveLocation (udg_PrimalRoar_Caster_Loc)
      • Custom script: call RemoveLocation (udg_PrimalRoar_Target_Loc)
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[1])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[2])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[3])
      • Custom script: call RemoveLocation (udg_PrimalRoar_Temp_Loc[4])

  • Primal Roar Move Units
    • Events
      • Time - PrimalRoar_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PrimalRoar_Counter Less than 40
        • Then - Actions
          • Set PrimalRoar_Counter = (PrimalRoar_Counter + 1)
          • Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle + 90.00) degrees)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 12.00 towards (PrimalRoar_Angle - 90.00) degrees)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Unit Group - Pick every unit in PrimalRoar_Left_Group and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitPathing(GetEnumUnit(), true)
          • Unit Group - Pick every unit in PrimalRoar_Right_Group and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitPathing(GetEnumUnit(), true)
          • Countdown Timer - Pause PrimalRoar_Timer
          • Set PrimalRoar_Counter = 0
          • Set PrimalRoar_Angle = 0.00
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Remove all units from PrimalRoar_Right_Group
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Remove all units from PrimalRoar_Left_Group

Also, to answer what I assume is your question. I assume that you copy/pasted this spell from a resource somewhere, so I will just assume that the code works, and that what you're trying to do, is implement it in your map.

All you need to do, is create an ability that matches whatever this thing is supposed to interact with. Like Battle Roar maybe? Name it whatever you want, and then change the condition in the first trigger to that one:

  • Primal Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to PICK YOUR SPELL HERE
    • Actions
      • ...
Can you upload this spell please

Can you upload this spells

Please cespie
 
Last edited by a moderator:
Level 8
Joined
May 21, 2019
Messages
435
Top