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)
NOTE:
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
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.