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

Want to use Paladon's Knockback to knockback units in range of a point

Status
Not open for further replies.
Level 6
Joined
Jun 18, 2011
Messages
147
I can get the knockback to work on a single unit, but I am not experienced enough to think of a way to knockback a unit group or loop the trigger to knockback each unit (in range of the point I create when casting a spell) one at a time.

  • Actions to apply
    • Events
    • Conditions
    • Actions
      • -------- This is the caster of the knockback. --------
      • -------- If you use spells, it´s mostly the 'triggering unit' or the 'casting unit'. --------
      • Set KBA_Caster = (Triggering unit)
      • -------- --------
      • -------- This is the unit knocked back. Set this variable to the unit which should receive the knockback. --------
      • -------- Use for example 'Target unit of ability being cast' or 'picked unit', 'attacking unit', 'casting unit', 'triggering unit' or whatever. --------
      • Set KBA_TargetUnit = (Target unit of ability being cast)
      • -------- --------
      • -------- This is the location from where the unit should be knocked back. --------
      • -------- Don´t set this location to the position of the unit which should be knocked back. --------
      • Set KBA_StartingPosition = (Target point of ability being cast)
      • -------- --------
      • -------- This saves the level of the spell. --------
      • -------- If the level shouldn´t influence the knockback, set the variable to 1. --------
      • Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
      • -------- --------
      • -------- This determines the speed of the knockback. --------
      • -------- If you set the speed to 0, the unit won´t move. --------
      • Set KBA_Speed = 7.00
      • -------- --------
      • -------- This determines the distance knockbacked per level of the spell. --------
      • -------- If the level shouldn´t influence the knockback, simply set this variable to the distance you wish. --------
      • Set KBA_DistancePerLevel = 200.00
      • -------- --------
      • -------- The following both variables store the path of the effects used. --------
      • -------- Effect[1] is more often used than Effect[2]. --------
      • Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Set KBA_SpecialEffects[2] = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
      • -------- --------
      • -------- Set the following variable to 'false' to allow trees to survive a collision with a knocked unit. --------
      • -------- Set the following variable to 'true' to kill trees upon collision with a knocked unit. --------
      • Set KBA_DestroyTrees = True
      • -------- --------
      • -------- After setting the needed variables we start the knockback. --------
      • Trigger - Run Cast A Knockback <gen> (checking conditions)
      • -------- Done. The unit knockbacked if the trigger triggers. --------
  • Cast A Knockback
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (KBA_TargetUnit is in KB_KnockbackedUnits) Equal to True
        • Then - Actions
          • Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits
          • Set KB_CountBuffs = (KB_CountBuffs - 1)
          • For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KB_Units[KB_GeneralIntegers[1]] Equal to KBA_TargetUnit
                • Then - Actions
                  • Set KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
                  • Set KB_GeneralIntegers[2] = KB_TotalKnockUnits
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
            • Then - Actions
              • Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
              • Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
              • Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
              • Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
              • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
              • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
              • Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
              • Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
              • Set KB_Effects_2[KB_EffectCounter2[1]] = KB_Effects_2[KB_TotalKnockUnits]
              • Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
              • Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
              • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
              • Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
            • Else - Actions
          • Set KB_Units[KB_TotalKnockUnits] = No unit
          • Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KB_CountBuffs Equal to 0
            • Then - Actions
              • Set KB_TotalKnockUnits = 0
              • Trigger - Turn off Get Knockback <gen>
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KB_CountBuffs Equal to 0
        • Then - Actions
          • Trigger - Turn on Get Knockback <gen>
        • Else - Actions
      • Set KB_CountBuffs = (KB_CountBuffs + 1)
      • Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
      • Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
      • Set KB_Levels[KB_TotalKnockUnits] = KBA_Level
      • Set KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
      • Set KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
      • Set KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
      • Set KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
      • Set KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
      • Set KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
      • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
      • Set KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
      • Set KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
      • Set KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
      • Set KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
      • Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
      • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
      • Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
      • Custom script: call RemoveLocation (udg_KBA_StartingPosition)
      • Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
      • Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
  • Get Knockback
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KB_ReachedDistance[KB_GeneralIntegers[1]] Greater than or equal to KB_MaxDistance[KB_GeneralIntegers[1]]
                • Then - Actions
                  • Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits
                  • Set KB_CountBuffs = (KB_CountBuffs - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
                    • Then - Actions
                      • Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
                      • Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
                      • Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
                      • Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
                      • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
                      • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
                      • Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
                      • Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
                      • Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
                      • Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
                      • Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
                      • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
                      • Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
                    • Else - Actions
                  • Set KB_Units[KB_TotalKnockUnits] = No unit
                  • Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KB_CountBuffs Equal to 0
                    • Then - Actions
                      • Set KB_TotalKnockUnits = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Set KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
                  • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
                  • Set KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
                  • Set KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
                  • Set KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees)
                  • Set KB_EffectCounter[KB_GeneralIntegers[1]] = (KB_EffectCounter[1] + 1)
                  • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = (KB_EffectCounter2[KB_GeneralIntegers[1]] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KB_DestroyTrees[KB_GeneralIntegers[1]] Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
                        • Loop - Actions
                          • Destructible - Kill (Picked destructible)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KB_EffectCounter[KB_GeneralIntegers[1]] Equal to 6
                    • Then - Actions
                      • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
                      • Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KB_EffectCounter2[KB_GeneralIntegers[1]] Equal to 8
                    • Then - Actions
                      • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
                      • Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                  • Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
                  • Custom script: call RemoveLocation (udg_KB_TempPoint[1])
                  • Custom script: call RemoveLocation (udg_KB_TempPoint[2])
                  • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
            • Else - Actions
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
Use "Group Enumerate Units Within Range of Point"

and "Pick every unit in group and do actions"

I'm not experienced with Paladon's knockback but I imagine you just give it a number that represents the strength of the knockback, give it "Picked Unit" for the unit to knock, and for the direction use "angle between points" from the center point to the position of the unit.
 
Level 6
Joined
Jun 18, 2011
Messages
147
I've never seen Group Enumerate Units Within Range of Point in the GUI. Is that JASS? Paladon's Knockback triggers are in the spoiler in my first post. I don't have a WarIII disc to use newgen and try to learn JASS at the moment.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Here is the solution:

  • Actions to apply
  • Events
    • Unit - Starts the effect of the ability
  • Conditions
    • (Ability being cast) Equal to AoE Knockback
  • Actions
    • Set temp_point = (Target point of ability being cast)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick ever unit in (Unit in 500 range of (temp_point) Matching condition <your conditions>)
      • Loop - Actions
        • Set KBA_Caster = (Triggering unit)
        • Set KBA_TargetUnit = (Picked unit)
        • Set KBA_StartingPosition = (temp_point)
        • Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
        • Set KBA_Speed = 7.00
        • Set KBA_DistancePerLevel = 200.00
        • Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
        • Set KBA_SpecialEffects[2] = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
        • Set KBA_DestroyTrees = True
        • Trigger - Run Cast A Knockback <gen> (checking conditions)
    • Custom script: call RemoveLocation (udg_temp_point)
Cuztomize range and conditions. Don't forget about setting ability being cast to your ability.
 
Level 6
Joined
Jun 18, 2011
Messages
147
Thank you all for the quick replies. I got a Battle Chest and so I'm gonna try out Newgen today.

1. Do I need to find a 1.21b patch from some mirror. I only see the latest patch on Blizzard's site. Or, should I just run and be ok without grimoire or war3err or w/e it is that needs that patch.

Anyway,

2. Shouldn't I be using this next to every place I see a Turn off (Get a Knockback) function:
  • Custom Script: call DestroyGroup( udg_tempGroup )
instead of this:
  • Custom script: set bj_wantDestroyGroup = true
I was looking up the use for that script and found out it breaks triggers by destroying the group after the first loop. Actually, it looks like you know what you're doing, I don't understand it, but just thought I'd mention my curiousity.

3.
  • Unit Group - Pick ever unit in (Unit in 500 range of (temp_point) Matching condition <your conditions>)
Will this work?:
  • ...Matching (matching unit is an enemy of owner of KBA_Caster equal to True)
And, will it effect Neutral Hostiles as well?

4. This question might be easier for me to figure out using trial and error, so please only take time to answer this one if you really want to, maybe even in a separate reply.

  • Set temp_point = (Target point of ability being cast)
  • Custom script: call RemoveLocation (udg_temp_point)
I plan to use where the boulder lands as the point to create the knockback from (KBA_StartingingPosition) from this spell below called Eternal Chain. The spell description goes a something like this: A boulder falls from the sky (causing damage and knockback) and is chained to the target forcing the unit to drag the boulder drastically reducing the ability to move.

I don't know how the boulder lands nearer to the Target of the Ability being Cast because the Points for the Dummy unit and Special Effect are both set to the Position of the Casting Unit. Also, I don't know if that point will be set before Paladon's Knockback calls for the index and be used close to the time of the boulders impact.

My first guess would be just to try this in your loop:
  • Set temp_point = EC_Point[0]
EC ------ Integer ------ 0
EC_Angle ------ Real Array 1 ------ 0
EC_Distance ------ Real Array 1 ------ 0
EC_Dummy1 ------ Unit Array 1 ------ None
EC_Dummy_Chain ------ Unit Array 1 ------ None
EC_Dummy_Chain2 ------ Unit Array 1 ------ None
EC_Dummy_Chain3 ------ Unit Array 1 ------ None
EC_Dummy_Chain4 ------ Unit Array 1 ------ None
EC_Floating ------ Floating Text Array 1 ------ None
EC_Fly ------ Real Array 1 ------ 0
EC_Height ------ Real Array 1 ------ 0
EC_Max_Distance ------ Real Array 1 ------ 0
EC_Off ------ Boolean Array 1 ------ False
EC_Part ------ Integer Array 1 ------ 0
EC_Point ------ Point Array 1 ------ None
EC_Power ------ Real Array 1 ------ 0
EC_Skip ------ Integer ------ 0
EC_Special ------ Special Effect Array 1 ------ None
EC_Special2 ------ Special Effect Array 1 ------ None
EC_Special3 ------ Special Effect Array 1 ------ None
EC_Special4 ------ Special Effect Array 1 ------ None
EC_Speed ------ Real Array 1 ------ 0
EC_String ------ String Array 1 ------ None
EC_Struggle ------ Real Array 1 ------ 0
EC_Target ------ Unit Array 1 ------ None
EC_Times ------ Integer ------ 0
EC_Weight ------ Real Array 1 ------ 0


  • Eternal Chain On
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Eternal Chain
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EC_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on Eternal Chain Loop <gen>
        • Else - Actions
      • Set EC_Times = (EC_Times + 1)
      • Set EC_Skip = (EC_Skip + 1)
      • Set EC_Off[EC_Times] = True
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • Set EC_Target[EC_Times] = (Target unit of ability being cast)
      • Set EC_Point[0] = (Position of (Casting unit))
      • Set EC_Point[1] = (Position of EC_Target[EC_Times])
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • Set EC_Part[EC_Times] = 0
      • Set EC_Distance[EC_Times] = ((Distance between EC_Point[0] and EC_Point[1]) - 75.00)
      • Set EC_Max_Distance[EC_Times] = EC_Distance[EC_Times]
      • Set EC_Speed[EC_Times] = 12.50
      • Set EC_Angle[EC_Times] = ((Angle from EC_Point[0] to EC_Point[1]) + (Random real number between 3.00 and 9.00))
      • Set EC_Height[EC_Times] = 600.00
      • Set EC_Weight[EC_Times] = 10.00
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • Unit - Create 1 Eternal chain dummy for (Owner of (Casting unit)) at EC_Point[0] facing Default building facing degrees
      • Unit - Add Storm Crow Form to (Last created unit)
      • Unit - Remove Storm Crow Form from (Last created unit)
      • Set EC_Dummy1[EC_Times] = (Last created unit)
      • Animation - Change EC_Dummy1[EC_Times]'s size to (300.00%, 300.00%, 300.00%) of its original size
      • -------- ----------------------------------------------------------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_EC_Point[0])
      • Custom script: call RemoveLocation(udg_EC_Point[1])
  • Eternal Chain Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer EC) from 1 to EC_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EC_Off[EC] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • EC_Part[EC] Equal to 0
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • EC_Distance[EC] Less than or equal to 0.00
                    • Then - Actions
                      • Set EC_Part[EC] = 1
                      • Animation - Change EC_Dummy1[EC] flying height to 38.00 at 0.00
                      • Animation - Change EC_Dummy1[EC]'s animation speed to 0.00% of its original speed
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Point[6] = (Position of EC_Dummy1[EC])
                      • Set EC_Point[7] = (Position of EC_Target[EC])
                      • Special Effect - Create a special effect at EC_Point[6] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Fly[EC] = 1500.00
                      • Set EC_Power[EC] = 100.00
                      • Set EC_Struggle[EC] = ((Current movement speed of EC_Target[EC]) / 680.00)
                      • Floating Text - Create floating text that reads (String((Integer(EC_Power[EC])))) at EC_Point[6] with Z offset ((Current flying height of EC_Dummy1[EC]) + 25.00), using font size 10.00, color ((Random percentage)%, (Random percentage)%, (Random percentage)%), and 0.00% transparency
                      • Set EC_Floating[EC] = (Last created floating text)
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Distance[EC] = ((Distance between EC_Point[6] and EC_Point[7]) / 6.00)
                      • Set EC_Angle[EC] = (Angle from EC_Point[6] to EC_Point[7])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_String[0] = Abilities\Weapons\SerpentWardMissile\SerpentWardMissile.mdl
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Point[8] = (EC_Point[6] offset by (EC_Distance[EC] x 1.00) towards EC_Angle[EC] degrees)
                      • Unit - Create 1 Dummy_For_Map for (Owner of EC_Dummy1[EC]) at EC_Point[8] facing EC_Angle[EC] degrees
                      • Set EC_Dummy_Chain2[EC] = (Last created unit)
                      • Special Effect - Create a special effect attached to the chest of EC_Dummy_Chain2[EC] using EC_String[0]
                      • Set EC_Special2[EC] = (Last created special effect)
                      • Custom script: call RemoveLocation(udg_EC_Point[8])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Point[8] = (EC_Point[6] offset by (EC_Distance[EC] x 2.40) towards EC_Angle[EC] degrees)
                      • Unit - Create 1 Dummy_For_Map for (Owner of EC_Dummy1[EC]) at EC_Point[8] facing EC_Angle[EC] degrees
                      • Set EC_Dummy_Chain3[EC] = (Last created unit)
                      • Special Effect - Create a special effect attached to the chest of EC_Dummy_Chain3[EC] using EC_String[0]
                      • Set EC_Special3[EC] = (Last created special effect)
                      • Custom script: call RemoveLocation(udg_EC_Point[8])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Point[8] = (EC_Point[6] offset by (EC_Distance[EC] x 3.80) towards EC_Angle[EC] degrees)
                      • Unit - Create 1 Dummy_For_Map for (Owner of EC_Dummy1[EC]) at EC_Point[8] facing EC_Angle[EC] degrees
                      • Set EC_Dummy_Chain[EC] = (Last created unit)
                      • Special Effect - Create a special effect attached to the chest of EC_Dummy_Chain[EC] using EC_String[0]
                      • Set EC_Special[EC] = (Last created special effect)
                      • Custom script: call RemoveLocation(udg_EC_Point[8])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Point[8] = (EC_Point[6] offset by (EC_Distance[EC] x 5.20) towards EC_Angle[EC] degrees)
                      • Unit - Create 1 Dummy_For_Map for (Owner of EC_Dummy1[EC]) at EC_Point[8] facing EC_Angle[EC] degrees
                      • Set EC_Dummy_Chain4[EC] = (Last created unit)
                      • Special Effect - Create a special effect attached to the chest of EC_Dummy_Chain4[EC] using EC_String[0]
                      • Set EC_Special4[EC] = (Last created special effect)
                      • Custom script: call RemoveLocation(udg_EC_Point[8])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (EC_Target[EC] is A flying unit) Equal to True
                        • Then - Actions
                          • Set EC_Height[EC] = (((Current flying height of EC_Target[EC]) + 25.00) / 6.00)
                          • Animation - Change EC_Dummy_Chain2[EC] flying height to (EC_Height[EC] x 1.00) at 0.00
                          • Animation - Change EC_Dummy_Chain3[EC] flying height to (EC_Height[EC] x 2.40) at 0.00
                          • Animation - Change EC_Dummy_Chain[EC] flying height to (EC_Height[EC] x 3.80) at 0.00
                          • Animation - Change EC_Dummy_Chain4[EC] flying height to (EC_Height[EC] x 5.20) at 0.00
                        • Else - Actions
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Custom script: call RemoveLocation(udg_EC_Point[6])
                      • Custom script: call RemoveLocation(udg_EC_Point[7])
                    • Else - Actions
                      • Set EC_Distance[EC] = (EC_Distance[EC] - EC_Speed[EC])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Point[2] = (Position of EC_Dummy1[EC])
                      • Set EC_Point[3] = (EC_Point[2] offset by EC_Speed[EC] towards EC_Angle[EC] degrees)
                      • Unit - Move EC_Dummy1[EC] instantly to EC_Point[3]
                      • Custom script: call RemoveLocation(udg_EC_Point[2])
                      • Custom script: call RemoveLocation(udg_EC_Point[3])
                      • -------- ----------------------------------------------------------------------------------------------------------- --------
                      • Set EC_Fly[EC] = (((4.00 x EC_Height[EC]) / EC_Max_Distance[EC]) x ((EC_Max_Distance[EC] - EC_Distance[EC]) x (EC_Distance[EC] / EC_Max_Distance[EC])))
                      • Animation - Change EC_Dummy1[EC] flying height to EC_Fly[EC] at 0.00
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • EC_Part[EC] Equal to 1
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • EC_Power[EC] Less than or equal to 0.00
                              • EC_Fly[EC] Less than or equal to 0.00
                              • (EC_Target[EC] is dead) Equal to True
                        • Then - Actions
                          • Set EC_Skip = (EC_Skip - 1)
                          • Set EC_Off[EC] = False
                          • Floating Text - Destroy EC_Floating[EC]
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Special Effect - Destroy EC_Special[EC]
                          • Special Effect - Destroy EC_Special2[EC]
                          • Special Effect - Destroy EC_Special3[EC]
                          • Special Effect - Destroy EC_Special4[EC]
                          • Unit - Add a 0.01 second Generic expiration timer to EC_Dummy_Chain[EC]
                          • Unit - Add a 0.01 second Generic expiration timer to EC_Dummy_Chain2[EC]
                          • Unit - Add a 0.01 second Generic expiration timer to EC_Dummy_Chain3[EC]
                          • Unit - Add a 0.01 second Generic expiration timer to EC_Dummy_Chain4[EC]
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Set EC_Point[10] = (Position of EC_Dummy1[EC])
                          • Special Effect - Create a special effect at EC_Point[10] using Abilities\Spells\Other\Doom\DoomDeath.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation(udg_EC_Point[10])
                          • Unit - Kill EC_Dummy1[EC]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • EC_Skip Equal to 0
                            • Then - Actions
                              • Set EC_Times = 0
                              • Trigger - Turn off Eternal Chain Loop <gen>
                            • Else - Actions
                        • Else - Actions
                          • Set EC_Fly[EC] = (EC_Fly[EC] - 1.00)
                          • Set EC_Point[2] = (Position of EC_Dummy1[EC])
                          • Set EC_Point[3] = (Position of EC_Target[EC])
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Set EC_Distance[EC] = ((Distance between EC_Point[2] and EC_Point[3]) / 6.00)
                          • Set EC_Angle[EC] = (Angle from EC_Point[2] to EC_Point[3])
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Set EC_Point[8] = (EC_Point[2] offset by (EC_Distance[EC] x 1.00) towards EC_Angle[EC] degrees)
                          • Unit - Move EC_Dummy_Chain2[EC] instantly to EC_Point[8], facing EC_Angle[EC] degrees
                          • Custom script: call RemoveLocation(udg_EC_Point[8])
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Set EC_Point[8] = (EC_Point[2] offset by (EC_Distance[EC] x 2.40) towards EC_Angle[EC] degrees)
                          • Unit - Move EC_Dummy_Chain3[EC] instantly to EC_Point[8], facing EC_Angle[EC] degrees
                          • Custom script: call RemoveLocation(udg_EC_Point[8])
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Set EC_Point[8] = (EC_Point[2] offset by (EC_Distance[EC] x 3.80) towards EC_Angle[EC] degrees)
                          • Unit - Move EC_Dummy_Chain[EC] instantly to EC_Point[8], facing EC_Angle[EC] degrees
                          • Custom script: call RemoveLocation(udg_EC_Point[8])
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • Set EC_Point[8] = (EC_Point[2] offset by (EC_Distance[EC] x 5.20) towards EC_Angle[EC] degrees)
                          • Unit - Move EC_Dummy_Chain4[EC] instantly to EC_Point[8], facing EC_Angle[EC] degrees
                          • Custom script: call RemoveLocation(udg_EC_Point[8])
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (EC_Target[EC] is A flying unit) Equal to True
                            • Then - Actions
                              • Set EC_Height[EC] = (((Current flying height of EC_Target[EC]) + 25.00) / 6.00)
                              • Animation - Change EC_Dummy_Chain2[EC] flying height to (EC_Height[EC] x 1.00) at 0.00
                              • Animation - Change EC_Dummy_Chain3[EC] flying height to (EC_Height[EC] x 2.40) at 0.00
                              • Animation - Change EC_Dummy_Chain[EC] flying height to (EC_Height[EC] x 3.80) at 0.00
                              • Animation - Change EC_Dummy_Chain4[EC] flying height to (EC_Height[EC] x 5.20) at 0.00
                            • Else - Actions
                          • -------- ----------------------------------------------------------------------------------------------------------- --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Distance between EC_Point[2] and EC_Point[3]) Less than or equal to 400.00
                            • Then - Actions
                            • Else - Actions
                              • -------- ----------------------------------------------------------------------------------------------------------- --------
                              • Set EC_Struggle[EC] = ((Current movement speed of EC_Target[EC]) / 680.00)
                              • Set EC_Power[EC] = (EC_Power[EC] - EC_Struggle[EC])
                              • Floating Text - Change the position of EC_Floating[EC] to EC_Point[2] with Z offset ((Current flying height of EC_Dummy1[EC]) + 25.00)
                              • Floating Text - Change text of EC_Floating[EC] to (String((Integer(EC_Power[EC])))) using font size 10.00
                              • Floating Text - Change the color of EC_Floating[EC] to ((Random percentage)%, (Random percentage)%, (Random percentage)%) with 0.00% transparency
                              • -------- ----------------------------------------------------------------------------------------------------------- --------
                              • Set EC_Point[4] = (EC_Point[2] offset by ((10.00 / EC_Weight[EC]) x 0.70) towards EC_Angle[EC] degrees)
                              • Set EC_Point[5] = (EC_Point[3] offset by EC_Weight[EC] towards (EC_Angle[EC] - 180.00) degrees)
                              • Custom script: call SetUnitX(udg_EC_Dummy1[udg_EC], GetLocationX(udg_EC_Point[4]))
                              • Custom script: call SetUnitY(udg_EC_Dummy1[udg_EC], GetLocationY(udg_EC_Point[4]))
                              • Custom script: call SetUnitX(udg_EC_Target[udg_EC], GetLocationX(udg_EC_Point[5]))
                              • Custom script: call SetUnitY(udg_EC_Target[udg_EC], GetLocationY(udg_EC_Point[5]))
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Random integer number between 1 and 6) Equal to 2
                                • Then - Actions
                                  • Special Effect - Create a special effect at EC_Point[2] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
                                  • Special Effect - Destroy (Last created special effect)
                                • Else - Actions
                              • Custom script: call RemoveLocation(udg_EC_Point[4])
                              • Custom script: call RemoveLocation(udg_EC_Point[5])
                          • Custom script: call RemoveLocation(udg_EC_Point[2])
                          • Custom script: call RemoveLocation(udg_EC_Point[3])
                    • Else - Actions
            • Else - Actions
Below is the map with Eternal Chain and a few other great GUI spells and here is Paladon's Knocback.
 
Last edited:

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Thank you all for the quick replies. I got a Battle Chest and so I'm gonna try out Newgen today.

1. Do I need to find a 1.21b patch from some mirror. I only see the latest patch on Blizzard's site. Or, should I just run and be ok without grimoire or war3err or w/e it is that needs that patch.

NewGen works fine, and there is no version avaible for newer versions of war3.

Anyway,

2. Shouldn't I be using this next to every place I see a Turn off (Get a Knockback) function:
  • Custom Script: call DestroyGroup( udg_tempGroup )
instead of this:
  • Custom script: set bj_wantDestroyGroup = true
I was looking up the use for that script and found out it breaks triggers by destroying the group after the first loop. Actually, it looks like you know what you're doing, I don't understand it, but just thought I'd mention my curiousity.
I saw you know how to remove leaks, despite that, there are two ways of destroying them.

One of them forces you to set unit group via variable - you 'create it' - then you use it via Pick all units action and after using it you destroy it to free up memory.

However, you can also use custom script: bj_wantDestroyGroup = true.
By default its set to false, although when true it destroys automatically the next created group just after its created (but don't worry, you've already used actions), when everything is done its set again to false,

If you want to use this group for further purposes, don't destroy it in anyway.

3.
  • Unit Group - Pick ever unit in (Unit in 500 range of (temp_point) Matching condition <your conditions>)
Will this work?:
  • ...Matching (matching unit is an enemy of owner of KBA_Caster equal to True)
And, will it effect Neutral Hostiles as well?

Its proper made condition, and yes since Neutrals are enemies to each player, spell will affect them too.

4. This question might be easier for me to figure out using trial and error, so please only take time to answer this one if you really want to, maybe even in a separate reply.

  • Set temp_point = (Target point of ability being cast)
  • Custom script: call RemoveLocation (udg_temp_point)
I plan to use where the boulder lands as the point to create the knockback from (KBA_StartingingPosition) from this spell below called Eternal Chain. The spell description goes a something like this: A boulder falls from the sky (causing damage and knockback) and is chained to the target forcing the unit to drag the boulder drastically reducing the ability to move.

I don't know how the boulder lands nearer to the Target of the Ability being Cast because the Points for the Dummy unit and Special Effect are both set to the Position of the Casting Unit. Also, I don't know if that point will be set before Paladon's Knockback calls for the index and be used close to the time of the boulders impact.
I'll look on it soon.
 
Status
Not open for further replies.
Top