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

Ground Charge v1.00

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: LovG
Ground Charge


Spell Info:
Starts charging on the target location moving at a greater speed. All enemy units passed through will be knockback.
Upon reaching the target location, it will damage and knockback enemy units within range.

CONFIGURABLES

  • Charge Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- --------------------------- Spell Mechanics --------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- Set the Ability Variable --------
      • Set Ch_Ability = Ground Charge
      • -------- Determines if the charging unit will stop when passing unwalkable path. --------
      • Set Ch_Stoppable = False
      • -------- Destroy Trees collided --------
      • Set Ch_DestroyTrees = True
      • -------- Set the peak height of the knocked unit --------
      • Set Ch_KnockHeight = 100.00
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- -------------------------------- Spell Visuals ---------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- Knocked unit effect --------
      • Set Ch_KnockEffect = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • -------- Charge Landing Effect --------
      • Set Ch_LandingEffect = Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • -------- Charging Unit Attachment Effect --------
      • Set Ch_ChargingUnitEff = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • -------- Determines the charging unit's transparency (in percent) when charging --------
      • Set Ch_Transparency = 30.00
      • -------- Determines the animation speed of "walk" when charging --------
      • Set Ch_AnimationSpeed = 250.00
      • -------- Determines how long the each Shadow lasts --------
      • Set Ch_ShadowLifeTime = 1.25
      • -------- Every 2nd periodic loop, a new Shadow Trail is created --------
      • Set Ch_ShadowCreateInterval = 2
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- --------------------------------- Spell Stats ----------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- Determines the damage to collided units while charging --------
      • Set Ch_DamageOnCollide[1] = 60.00
      • Set Ch_DamageOnCollide[2] = 100.00
      • Set Ch_DamageOnCollide[3] = 140.00
      • -------- Determines the damage to the units within range of the target point --------
      • Set Ch_AoEDamage[1] = 50.00
      • Set Ch_AoEDamage[2] = 100.00
      • Set Ch_AoEDamage[3] = 150.00
      • -------- Determines the movement speed the charging unit will move --------
      • Set Ch_Speed[1] = 800.00
      • Set Ch_Speed[2] = 1000.00
      • Set Ch_Speed[3] = 1200.00
      • -------- Determines the damage radius when the target point is reached --------
      • Set Ch_AoE[1] = 200.00
      • Set Ch_AoE[2] = 300.00
      • Set Ch_AoE[3] = 400.00
      • -------- Determines the time the collided units will be pushed --------
      • Set Ch_KnockDuration[1] = 1.00
      • Set Ch_KnockDuration[2] = 1.50
      • Set Ch_KnockDuration[3] = 2.00
      • -------- Determines the colliding radius --------
      • Set Ch_CollideAoE[1] = 80.00
      • Set Ch_CollideAoE[2] = 100.00
      • Set Ch_CollideAoE[3] = 120.00
      • -------- Determines how much distance the collided units will be pushed --------
      • Set Ch_KnockDist[1] = 80.00
      • Set Ch_KnockDist[2] = 140.00
      • Set Ch_KnockDist[3] = 200.00
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- -------Variables used in looping: ------------ --------
      • -------- - Modify it when the periodic time (0.03) is changed --------
      • -------- - Modify it when the number of levels (3) in the spell is changed ------------ --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • For each (Integer Ch_LoopInt) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set Ch_RealSpd[Ch_LoopInt] = (Ch_Speed[Ch_LoopInt] x 0.03)
          • Set Ch_KnockSpd[Ch_LoopInt] = ((0.03 x Ch_KnockDist[Ch_LoopInt]) / Ch_KnockDuration[Ch_LoopInt])

SPELL TRIGGERS:
  • Charge Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ch_Ability
    • Actions
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ----------------------------------- Indexing ------------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Set Ch_MaxIndex = (Ch_MaxIndex + 1)
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------- Spell Data ------------------------------------ --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Set Ch_Caster[Ch_MaxIndex] = (Triggering unit)
      • Set Ch_TempLoc1 = (Position of Ch_Caster[Ch_MaxIndex])
      • Set Ch_TargetPt[Ch_MaxIndex] = (Target point of ability being cast)
      • Set Ch_FacingAngle[Ch_MaxIndex] = (Angle from Ch_TempLoc1 to Ch_TargetPt[Ch_MaxIndex])
      • -------- If Self-Target --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (X of Ch_TargetPt[Ch_MaxIndex]) Equal to (X of Ch_TempLoc1)
          • (Y of Ch_TargetPt[Ch_MaxIndex]) Equal to (Y of Ch_TempLoc1)
        • Then - Actions
          • Set Ch_FacingAngle[Ch_MaxIndex] = (Facing of Ch_Caster[Ch_MaxIndex])
          • Custom script: call RemoveLocation(udg_Ch_TargetPt[udg_Ch_MaxIndex])
          • Set Ch_TempLoc2 = (Target point of ability being cast)
          • Set Ch_TargetPt[Ch_MaxIndex] = (Ch_TempLoc2 offset by Ch_RealSpd[(Level of Ch_Ability for Ch_Caster[Ch_MaxIndex])] towards Ch_FacingAngle[Ch_MaxIndex] degrees)
          • Custom script: call RemoveLocation(udg_Ch_TempLoc2)
        • Else - Actions
      • Set Ch_ShadowCreateCtr[Ch_MaxIndex] = 0
      • Custom script: set udg_Ch_AffectedUnits[udg_Ch_MaxIndex] = CreateGroup()
      • Unit - Turn collision for Ch_Caster[Ch_MaxIndex] Off
      • -------- ----------------------------------------------------------------------------------------- --------
      • -------- -------------------------------- Spell Visuals ---------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------- --------
      • Custom script: call SetUnitAnimationByIndex(udg_Ch_Caster[udg_Ch_MaxIndex], LoadInteger(udg_Ch_Hash, GetUnitTypeId(udg_Ch_Caster[udg_Ch_MaxIndex]), 0))
      • Animation - Change Ch_Caster[Ch_MaxIndex]'s animation speed to Ch_AnimationSpeed% of its original speed
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ch_Transparency Less than 100.00
          • Ch_Transparency Greater than 0.00
        • Then - Actions
          • Animation - Change Ch_Caster[Ch_MaxIndex]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Ch_Transparency% transparency
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Ch_TempLoc1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ch_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Charge Periodic <gen>
        • Else - Actions
  • Charge Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Ch_LoopInt) from 1 to Ch_MaxIndex, do (Actions)
        • Loop - Actions
          • -------- ----------------------------------------------------------------------------------------- --------
          • -------- ------------------------ Spell Caster Movement -------------------------- --------
          • -------- ----------------------------------------------------------------------------------------- --------
          • Set Ch_Level = (Level of Ch_Ability for Ch_Caster[Ch_LoopInt])
          • Set Ch_TempLoc1 = (Position of Ch_Caster[Ch_LoopInt])
          • Set Ch_TempLoc2 = (Ch_TempLoc1 offset by Ch_RealSpd[Ch_Level] towards Ch_FacingAngle[Ch_LoopInt] degrees)
          • -------- Sets the new position of the charging unit that will not interrupt order --------
          • Custom script: call SetUnitX(udg_Ch_Caster[udg_Ch_LoopInt], GetLocationX(udg_Ch_TempLoc2))
          • Custom script: call SetUnitY(udg_Ch_Caster[udg_Ch_LoopInt], GetLocationY(udg_Ch_TempLoc2))
          • -------- ----------------------------------------------------------------------------------------- --------
          • -------- -------------------------- Spell Pathing Check ---------------------------- --------
          • -------- ----------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ch_Stoppable Equal to True
            • Then - Actions
              • Set CP_Point = Ch_TempLoc2
              • Trigger - Run Check Walkability <gen> (ignoring conditions)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CP_PointIsWalkable Equal to False
                • Then - Actions
                  • Unit - Move Ch_Caster[Ch_LoopInt] instantly to Ch_TempLoc2
                • Else - Actions
              • Custom script: set udg_CP_Point = null
            • Else - Actions
          • -------- Stop the charging unit pathing check --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (X of Ch_TempLoc2) Greater than or equal to (Max X of (Playable map area))
                  • (X of Ch_TempLoc2) Less than or equal to (Min X of (Playable map area))
                  • (Y of Ch_TempLoc2) Greater than or equal to (Max Y of (Playable map area))
                  • (Y of Ch_TempLoc2) Less than or equal to (Min Y of (Playable map area))
                  • (Ch_Caster[Ch_LoopInt] is dead) Equal to True
                  • And - All (Conditions) are true
                    • Conditions
                      • CP_PointIsWalkable Equal to False
                      • Ch_Stoppable Equal to True
            • Then - Actions
              • Unit - Move Ch_Caster[Ch_LoopInt] instantly to Ch_TempLoc2
            • Else - Actions
          • -------- Destroy Trees --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ch_DestroyTrees Equal to True
            • Then - Actions
              • Set Ch_TempRegion = (Region centered at Ch_TempLoc2 with size (180.00, 180.00))
              • Destructible - Pick every destructible in Ch_TempRegion and do (Actions)
                • Loop - Actions
                  • Destructible - Kill (Picked destructible)
              • Custom script: call RemoveRect(udg_Ch_TempRegion)
            • Else - Actions
          • -------- ----------------------------------------------------------------------------------------- --------
          • -------- ---------------------------- Spell Visual Effects ---------------------------- --------
          • -------- ----------------------------------------------------------------------------------------- --------
          • Special Effect - Create a special effect at Ch_TempLoc1 using Ch_ChargingUnitEff
          • Special Effect - Destroy (Last created special effect)
          • Set Ch_ShadowCreateCtr[Ch_LoopInt] = (Ch_ShadowCreateCtr[Ch_LoopInt] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ch_ShadowCreateCtr[Ch_LoopInt] Greater than Ch_ShadowCreateInterval
            • Then - Actions
              • Set ChS_MaxIndex = (ChS_MaxIndex + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ChS_MaxIndex Greater than 100
                • Then - Actions
                  • Set ChS_MaxIndex = 1
                • Else - Actions
              • Custom script: if FirstOfGroup(udg_Ch_ShadowGroup) == null then
              • Trigger - Turn on Charge Shadow Periodic <gen>
              • Custom script: endif
              • Unit - Create 1 (Unit-type of Ch_Caster[Ch_LoopInt]) for Neutral Passive at Ch_TempLoc1 facing (Facing of Ch_Caster[Ch_LoopInt]) degrees
              • Set Ch_TempUnit = (Last created unit)
              • Unit Group - Add Ch_TempUnit to Ch_ShadowGroup
              • Unit - Set the custom value of Ch_TempUnit to ChS_MaxIndex
              • Set ChS_TimeLeft[ChS_MaxIndex] = Ch_ShadowLifeTime
              • Set ChS_Transparency[ChS_MaxIndex] = 15.00
              • Custom script: call UnitAddAbility(udg_Ch_TempUnit, 'Aloc')
              • Unit - Pause Ch_TempUnit
              • Animation - Change ChS_Unit[ChS_MaxIndex]'s animation speed to 0.00% of its original speed
              • Animation - Change Ch_TempUnit's vertex coloring to (85.00%, 85.00%, 85.00%) with ChS_Transparency[ChS_MaxIndex]% transparency
              • Custom script: call SetUnitX(udg_Ch_TempUnit, GetLocationX(udg_Ch_TempLoc1))
              • Custom script: call SetUnitY(udg_Ch_TempUnit, GetLocationY(udg_Ch_TempLoc1))
              • Set Ch_ShadowCreateCtr[Ch_LoopInt] = 1
            • Else - Actions
          • -------- ----------------------------------------------------------------------------------------- --------
          • -------- Destroy Location 1 --------
          • Custom script: call RemoveLocation(udg_Ch_TempLoc1)
          • -------- -------------------------- Spell Collision Check --------------------------- --------
          • -------- ----------------------------------------------------------------------------------------- --------
          • -------- Condtion: Not a Structure, Enemy, Alive --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within Ch_CollideAoE[Ch_Level] of Ch_TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of Ch_Caster[Ch_LoopInt])) Equal to True) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
            • Loop - Actions
              • Set Ch_TempUnit = (Picked unit)
              • -------- If the picked enemy unit is not already hit --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ch_TempUnit is in Ch_AffectedUnits[Ch_LoopInt]) Equal to False
                • Then - Actions
                  • Unit Group - Add Ch_TempUnit to Ch_AffectedUnits[Ch_LoopInt]
                  • Unit - Cause Ch_Caster[Ch_LoopInt] to damage Ch_TempUnit, dealing Ch_DamageOnCollide[Ch_Level] damage of attack type Spells and damage type Magic
                  • Unit - Turn collision for Ch_TempUnit Off
                  • -------- ----------------------------------------------------------------------------------------- --------
                  • -------- --------------------------- Collision Knockback --------------------------- --------
                  • -------- ----------------------------------------------------------------------------------------- --------
                  • Set ChK_MaxIndex = (ChK_MaxIndex + 1)
                  • Set ChK_Unit[ChK_MaxIndex] = Ch_TempUnit
                  • Set ChK_Duration[ChK_MaxIndex] = Ch_KnockDuration[Ch_Level]
                  • Set Ch_TempLoc1 = (Position of Ch_TempUnit)
                  • Set ChK_Angle[ChK_MaxIndex] = (Angle from Ch_TempLoc2 to Ch_TempLoc1)
                  • Set ChK_Level[ChK_MaxIndex] = Ch_Level
                  • Set ChK_KnockingUp[ChK_MaxIndex] = True
                  • Custom script: if UnitAddAbility(udg_Ch_TempUnit,'Amrf') then
                  • Custom script: call UnitRemoveAbility(udg_Ch_TempUnit,'Amrf')
                  • Custom script: endif
                  • Animation - Change Ch_TempUnit flying height to Ch_KnockHeight at 1000.00
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ChK_MaxIndex Equal to 1
                    • Then - Actions
                      • Trigger - Turn on Charge Knock Periodic <gen>
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_Ch_TempLoc1)
                • Else - Actions
          • -------- ----------------------------------------------------------------------------------------- --------
          • -------- ----------------------- Spell Destination Check ------------------------- --------
          • -------- ----------------------------------------------------------------------------------------- --------
          • Set Ch_TempReal = (Distance between Ch_TempLoc2 and Ch_TargetPt[Ch_LoopInt])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ch_TempReal Less than or equal to Ch_RealSpd[Ch_Level]
            • Then - Actions
              • -------- ----------------------------------------------------------------------------------------- --------
              • -------- -------- Damage and Knockback Enemy Units AoE ---------- --------
              • -------- ----------------------------------------------------------------------------------------- --------
              • Special Effect - Create a special effect at Ch_TempLoc2 using Ch_LandingEffect
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within Ch_AoE[Ch_LoopInt] of Ch_TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of Ch_Caster[Ch_LoopInt])) Equal to True) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
                • Loop - Actions
                  • Set Ch_TempUnit = (Picked unit)
                  • Unit - Cause Ch_Caster[Ch_LoopInt] to damage Ch_TempUnit, dealing Ch_AoEDamage[Ch_Level] damage of attack type Spells and damage type Magic
                  • -------- Special Effects --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ch_TempUnit is in Ch_AffectedUnits[Ch_LoopInt]) Equal to False
                    • Then - Actions
                      • Unit Group - Add Ch_TempUnit to Ch_AffectedUnits[Ch_LoopInt]
                      • Unit - Cause Ch_Caster[Ch_LoopInt] to damage Ch_TempUnit, dealing Ch_DamageOnCollide[Ch_Level] damage of attack type Spells and damage type Magic
                      • Unit - Turn collision for Ch_TempUnit Off
                      • -------- ----------------------------------------------------------------------------------------- --------
                      • -------- --------------------------- Collision Knockback --------------------------- --------
                      • -------- ----------------------------------------------------------------------------------------- --------
                      • Set ChK_MaxIndex = (ChK_MaxIndex + 1)
                      • Set ChK_Unit[ChK_MaxIndex] = Ch_TempUnit
                      • Set ChK_Duration[ChK_MaxIndex] = Ch_KnockDuration[Ch_Level]
                      • Set Ch_TempLoc1 = (Position of Ch_TempUnit)
                      • Set ChK_Angle[ChK_MaxIndex] = (Angle from Ch_TargetPt[Ch_LoopInt] to Ch_TempLoc1)
                      • Set ChK_Level[ChK_MaxIndex] = Ch_Level
                      • Set ChK_KnockingUp[ChK_MaxIndex] = True
                      • Custom script: if UnitAddAbility(udg_Ch_TempUnit,'Amrf') then
                      • Custom script: call UnitRemoveAbility(udg_Ch_TempUnit,'Amrf')
                      • Custom script: endif
                      • Animation - Change Ch_TempUnit flying height to ((Default flying height of Ch_TempUnit) + Ch_KnockHeight) at 600.00
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ChK_MaxIndex Equal to 1
                        • Then - Actions
                          • Trigger - Turn on Charge Knock Periodic <gen>
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_Ch_TempLoc1)
                    • Else - Actions
                      • For each (Integer ChK_LoopInt) from 1 to ChK_MaxIndex, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ChK_Unit[ChK_LoopInt] Equal to Ch_TempUnit
                            • Then - Actions
                              • Set ChK_Duration[Ch_LoopInt] = Ch_KnockDuration[Ch_Level]
                              • Set Ch_TempLoc1 = (Position of Ch_TempUnit)
                              • Set ChK_Angle[ChK_LoopInt] = (Angle from Ch_TargetPt[Ch_LoopInt] to Ch_TempLoc1)
                              • Set ChK_Level[ChK_LoopInt] = Ch_Level
                              • Set ChK_KnockingUp[ChK_LoopInt] = True
                              • Custom script: if UnitAddAbility(udg_Ch_TempUnit,'Amrf') then
                              • Custom script: call UnitRemoveAbility(udg_Ch_TempUnit,'Amrf')
                              • Custom script: endif
                              • Animation - Change Ch_TempUnit flying height to (Default flying height of Ch_TempUnit) at 0.00
                              • Animation - Change Ch_TempUnit flying height to ((Default flying height of Ch_TempUnit) + Ch_KnockHeight) at 600.00
                              • Custom script: call RemoveLocation(udg_Ch_TempLoc1)
                            • Else - Actions
              • -------- ----------------------------------------------------------------------------------------- --------
              • -------- ---- Stop the Charger when the Destination is reached ----- --------
              • -------- ----------------------------------------------------------------------------------------- --------
              • Unit - Move Ch_Caster[Ch_LoopInt] instantly to Ch_TempLoc2
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Ch_TempLoc2)
  • Charge Stop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Ch_Ability
    • Actions
      • Set Ch_TempUnit = (Triggering unit)
      • For each (Integer Ch_LoopInt) from 1 to Ch_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ch_TempUnit Equal to Ch_Caster[Ch_LoopInt]
            • Then - Actions
              • -------- ----------------------------------------------------------------------------------------- --------
              • -------- ---------------------------------- De-indexing --------------------------------- --------
              • -------- ----------------------------------------------------------------------------------------- --------
              • -------- Destroy Handles --------
              • Custom script: call RemoveLocation(udg_Ch_TargetPt[udg_Ch_LoopInt])
              • Custom script: call DestroyGroup(udg_Ch_AffectedUnits[udg_Ch_LoopInt])
              • -------- Remove Effects on Charging Unit --------
              • Animation - Change Ch_Caster[Ch_LoopInt]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Animation - Change Ch_Caster[Ch_LoopInt]'s animation speed to 100.00% of its original speed
              • Unit - Turn collision for Ch_Caster[Ch_MaxIndex] On
              • -------- Transfer Data --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Ch_LoopInt Not equal to Ch_MaxIndex
                • Then - Actions
                  • Set Ch_AffectedUnits[Ch_LoopInt] = Ch_AffectedUnits[ChK_MaxIndex]
                  • Set Ch_Caster[Ch_LoopInt] = Ch_Caster[Ch_MaxIndex]
                  • Set Ch_TargetPt[Ch_LoopInt] = Ch_TargetPt[Ch_MaxIndex]
                  • Set Ch_ShadowCreateCtr[Ch_LoopInt] = Ch_ShadowCreateCtr[Ch_MaxIndex]
                • Else - Actions
              • -------- De-indexing --------
              • Set Ch_MaxIndex = (Ch_MaxIndex - 1)
              • Set Ch_LoopInt = (Ch_LoopInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Ch_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off Charge Periodic <gen>
                • Else - Actions
            • Else - Actions
  • Charge Knock Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ChK_LoopInt) from 1 to ChK_MaxIndex, do (Actions)
        • Loop - Actions
          • Set Ch_TempLoc1 = (Position of ChK_Unit[ChK_LoopInt])
          • Set Ch_TempLoc2 = (Ch_TempLoc1 offset by Ch_KnockSpd[ChK_Level[ChK_LoopInt]] towards ChK_Angle[ChK_LoopInt] degrees)
          • Unit - Move ChK_Unit[ChK_LoopInt] instantly to Ch_TempLoc2
          • Special Effect - Create a special effect attached to the origin of ChK_Unit[ChK_LoopInt] using Ch_KnockEffect
          • Special Effect - Destroy (Last created special effect)
          • Set ChK_Duration[ChK_LoopInt] = (ChK_Duration[ChK_LoopInt] - 0.03)
          • -------- Knocked unit will then go down --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ChK_KnockingUp[ChK_LoopInt] Equal to True
              • ChK_Duration[ChK_LoopInt] Less than or equal to (Ch_KnockDuration[ChK_Level[Ch_LoopInt]] - 0.15)
            • Then - Actions
              • Custom script: if UnitAddAbility(udg_ChK_Unit[udg_ChK_LoopInt], 'Amrf') then
              • Custom script: call UnitRemoveAbility(udg_ChK_Unit[udg_ChK_LoopInt], 'Amrf')
              • Custom script: endif
              • Animation - Change ChK_Unit[ChK_LoopInt] flying height to (Default flying height of ChK_Unit[ChK_LoopInt]) at 600.00
              • Set ChK_KnockingUp[ChK_LoopInt] = False
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ChK_Duration[ChK_LoopInt] Less than or equal to 0.00
                  • (ChK_Unit[ChK_LoopInt] is dead) Equal to True
            • Then - Actions
              • -------- ----------------------------------------------------------------------------------------- --------
              • -------- ---------------------------------- De-indexing --------------------------------- --------
              • -------- ----------------------------------------------------------------------------------------- --------
              • Unit - Turn collision for ChK_Unit[ChK_LoopInt] On
              • -------- Transfer Data --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ChK_LoopInt Not equal to ChK_MaxIndex
                • Then - Actions
                  • Set ChK_Angle[ChK_LoopInt] = ChK_Angle[ChK_MaxIndex]
                  • Set ChK_Duration[ChK_LoopInt] = ChK_Duration[ChK_MaxIndex]
                  • Set ChK_Level[ChK_LoopInt] = ChK_Level[ChK_MaxIndex]
                  • Set ChK_Unit[ChK_LoopInt] = ChK_Unit[ChK_MaxIndex]
                • Else - Actions
              • -------- De-indexing --------
              • Set ChK_MaxIndex = (ChK_MaxIndex - 1)
              • Set ChK_LoopInt = (ChK_LoopInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ChK_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off Charge Knock Periodic <gen>
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Ch_TempLoc1)
          • Custom script: call RemoveLocation(udg_Ch_TempLoc2)
  • Charge Shadow Periodic
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Ch_ShadowGroup and do (Actions)
        • Loop - Actions
          • Set Ch_TempUnit = (Picked unit)
          • Set ChS_LoopInt = (Custom value of Ch_TempUnit)
          • Set ChS_TimeLeft[ChS_LoopInt] = (ChS_TimeLeft[ChS_LoopInt] - 0.10)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ChS_TimeLeft[ChS_LoopInt] Less than or equal to 0.00
            • Then - Actions
              • -------- Destroy Handles --------
              • Unit - Remove Ch_TempUnit from the game
              • Unit Group - Remove Ch_TempUnit from Ch_ShadowGroup
              • Custom script: if FirstOfGroup(udg_Ch_ShadowGroup) == null then
              • Trigger - Turn off Charge Shadow Periodic <gen>
              • Custom script: endif
            • Else - Actions
              • Set ChS_Transparency[ChS_LoopInt] = (ChS_Transparency[ChS_LoopInt] + 9.00)
              • Animation - Change Ch_TempUnit's vertex coloring to (85.00%, 85.00%, 85.00%) with ChS_Transparency[ChS_LoopInt]% transparency
NOTE:
This Spell requires the Check Walkability by PurgeandFire.

IMPLEMENTATION
1) Make sure you check the "Automatically create unknown variables while pasting trigger data" in File->Preferences of World Editor.
2) Copy the Systems Trigger Folder to your map
3) Copy the Spells Trigger Folder to your map
4) Find the walk animation index of your unit/units that will have the Charge Spell using the Find Animation Index Trigger
5) To use the Find Animation Index Trigger, set the Ch_TempUnit to a unit and keep pressing Esc. When the walk animation is showing, take note of the last Animation Index value.
6) Store the Animation Index to the Spell using the Charge MUI Animation trigger, set the Ch_TempUnit variable to a certain unit and change the last number in the custom script equal to the animation index of that specific unit.
7) Test the map.


CREDITS:
- PurgeandFire for the Check Walkability
- Rising_Dusk & Vexorian for the original implementation of the pathing check.

Keywords:
charge, collide, knockback, fast movement
Contents

Just another Warcraft III map (Map)

Reviews
13:34, 27th Aug 2015 IcemanBo: Posts in thread.
  • (X of Ch_TempLoc2) Greater than or equal to (Max X of (Playable map area))
    • (X of Ch_TempLoc2) Less than or equal to (Min X of (Playable map area))
    • (Y of Ch_TempLoc2) Greater than or equal to (Max Y of (Playable map area))
    • (Y of Ch_TempLoc2) Less than or equal to (Min Y of (Playable map area))
I believe there is a gui condition that checks if your point is in playable map area, so you don't need to check for cooditnates by yourself.

You don't check for trees, but kill all destructables. So also bridges, gates and others will be killed, too.

Manipulating custom value of units is not allowed. It's reserved for unit indexers only. (at least here in public resources)

  • Custom script: set udg_Ch_AffectedUnits[udg_Ch_MaxIndex] = CreateGroup()
^You do this without any check. But group [0] and [1] already are initialiszed so it will leak.
You can simple avoid the leak by destroying them onInit, then no check is needed, or check if group equals null before you create a group.

Honestly I think your check for x/y onCast if they equal with caster's position is not needed. It will be like never the case that they are exactly the same.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
  • (X of Ch_TempLoc2) Greater than or equal to (Max X of (Playable map area))
    • (X of Ch_TempLoc2) Less than or equal to (Min X of (Playable map area))
    • (Y of Ch_TempLoc2) Greater than or equal to (Max Y of (Playable map area))
    • (Y of Ch_TempLoc2) Less than or equal to (Min Y of (Playable map area))
I believe there is a gui condition that checks if your point is in playable map area, so you don't need to check for cooditnates by yourself.
I see, I will use the GUI equivalent then

You don't check for trees, but kill all destructables. So also bridges, gates and others will be killed, too.
Noted.

Manipulating custom value of units is not allowed. It's reserved for unit indexers only. (at least here in public resources)
I manipulated the shadow trail's custom value not the actual caster so I don't see how that will affect anything

  • Custom script: set udg_Ch_AffectedUnits[udg_Ch_MaxIndex] = CreateGroup()
^You do this without any check. But group [0] and [1] already are initialiszed so it will leak.
You can simple avoid the leak by destroying them onInit, then no check is needed, or check if group equals null before you create a group.
The destroying at Init part is better so I will do that.

Honestly I think your check for x/y onCast if they equal with caster's position is not needed. It will be like never the case that they are exactly the same.
It happens when you clicked on the Hero's Portrait when the Hero is not moving.
 
...

  • I don't know if I very like the animation index system. Use UnitType over Unit as parameter, as a unit can exist or not, a unit type always does. (you need preplaced units)
    I'm not very sure now, but if you use channel I think there is a possiblity to loop a certain animation while casting. If so, it would drop the whole animation system.
    If someone knows what I mean he is welcome to post here, but I also need to test it myself again I think.
  • You know JASS, so you could actually create one static rect for tree destruction, which is never destroyed.
  • I repeat, don't manipulate custom values. You never know how systems work.
  • Index owner of caster.
  • It's more readably if you filter units via conditions inside your ITE statement then using "MatchingUnit".
  • Damage- Attack type should be configurable.
  • You can think of using system for knocking units and tree destruction.

The transparency feature looks cool. Also think of the points in the other post.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
...

  • I don't know if I very like the animation index system. Use UnitType over Unit as parameter, as a unit can exist or not, a unit type always does. (you need preplaced units)
    I'm not very sure now, but if you use channel I think there is a possiblity to loop a certain animation while casting. If so, it would drop the whole animation system.
    If someone knows what I mean he is welcome to post here, but I also need to test it myself again I think.
  • You know JASS, so you could actually create one static rect for tree destruction, which is never destroyed.
  • I repeat, don't manipulate custom values. You never know how systems work.
  • Index owner of caster.
  • It's more readably if you filter units via conditions inside your ITE statement then using "MatchingUnit".
  • Damage- Attack type should be configurable.
  • You can think of using system for knocking units and tree destruction.

The transparency feature looks cool. Also think of the points in the other post.
  • Yeah, using unit-type is better. I tried placing "walk" in the Animation Names but it does not work.
  • Ok, so I will use MoveRect?
  • I know it is in the Rules but I don't see how manipulating the custom value of the Shadow Units (not the caster) will affect anything. Will it not work if this is imported to a map with Unit Indexer? I just used it as a way to de-index easier (unit group acting as a linked list)
  • Ok
  • But the tendency is that unit-group will initially have a lot of units. To be honest, I don't know which is better in terms of performance. (That's why I asked)
  • Will do
  • That depends

Yeah I still keep in mind those other things you pointed in your first post.
 
Yeah, using unit-type is better. I tried placing "walk" in the Animation Names but it does not work.
Hm, sad if it won't work. :/

Ok, so I will use MoveRect?
Yes. I would not say it's required for GUI, but it's good habit to do so. And I think you are on that level! ^^

manipulating the custom value of the Shadow Units
It's not good if there exist more than one unit with same custom value.
A unit can't be identified anymore uniquely through custom value in what ever code.

But the tendency is that unit-group will initially have a lot of units.
True. It will be bigger, I'm not sure of performance differences, but it's much more readable, especially in GUI I think.
 
Top