Angel_Island
Much long, many time, wow
- Reaction score
- 56
While playing with impale, I got really annoyed by not being able to impale enemies again when they are stuned or in the air. So I made this system.
Code:
Screenshot:
It is like DotA's impale system. You can impale enemies again when they are stuned or in the air. I have included an impale and Burrowstrike that uses this system. Enjoy!
Changelog:
Code:
Trigger:
- Impale System Initialization
- Events
- Map initialization
- Conditions
- Actions
- -------- Set ImpaleRange to how long you want the impale to be --------
- Set ImpaleRange = 600.00
- -------- This is how much space there will be between every spikes. The amount of spike spawned is (ImpaleRange/ImpaleSpace) --------
- Set ImpaleSpace = 150.00
- -------- Set ImpaleAoE to how big AoE you want the impale to have --------
- Set ImpaleAoE = 175.00
- Events
Trigger:
- Impale System Start
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Ability being cast) Equal to Burrowstrike
- (Ability being cast) Equal to Impale (Triggered)
- Conditions
- Or - Any (Conditions) are true
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ImpaleInstances Equal to 1000
- Then - Actions
- Set ImpaleInstances = 1
- Else - Actions
- Set ImpaleInstances = (ImpaleInstances + 1)
- If - Conditions
- Set ImpaleCaster[ImpaleInstances] = (Triggering unit)
- Set ImpaleUnitPoint[ImpaleInstances] = (Position of ImpaleCaster[ImpaleInstances])
- Set ImpaleAbilityCast = (Ability being cast)
- Set ImpaleOffset[ImpaleInstances] = 0.00
- Set ImpaleLevel[ImpaleInstances] = (Level of ImpaleAbilityCast for ImpaleCaster[ImpaleInstances])
- Set ImpaleEffect = Abilities\Spells\Undead\Impale\ImpaleHitTarget.mdl
- Set ImpaleTargetPoint[ImpaleInstances] = (Target point of ability being cast)
- -------- This thing down here is for burrowstrike, because it's based on cast range --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ImpaleAbilityCast Equal to Burrowstrike
- Then - Actions
- Set BurrowInstances = (BurrowInstances + 1)
- Set ImpaleDummySpell[ImpaleInstances] = Burrowstrike Stun
- Set BurrowUnit[ImpaleInstances] = (Triggering unit)
- Set BurrowPoint = (Position of BurrowUnit[ImpaleInstances])
- Set BurrowPoint2[ImpaleInstances] = (Target point of ability being cast)
- Set BurrowTarget[ImpaleInstances] = (Target unit of ability being cast)
- Set BurrowTargetPosition[ImpaleInstances] = (Position of BurrowTarget[ImpaleInstances])
- Countdown Timer - Start BurrowTimer as a One-shot timer that will expire in (((ImpaleRange / ImpaleSpace) / 10.00) / (750.00 / (Distance between BurrowPoint and BurrowPoint2[ImpaleInstances]))) seconds
- Unit - Turn collision for BurrowUnit[ImpaleInstances] Off
- Custom script: call RemoveLocation(udg_BurrowPoint)
- Wait 0.17 seconds
- Set BurrowInstances = (BurrowInstances - 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- BurrowTarget[(ImpaleInstances - BurrowInstances)] Equal to No unit
- Then - Actions
- Unit - Move BurrowUnit[(ImpaleInstances - BurrowInstances)] instantly to BurrowPoint2[(ImpaleInstances - BurrowInstances)]
- Else - Actions
- Unit - Move BurrowUnit[(ImpaleInstances - BurrowInstances)] instantly to BurrowTargetPosition[(ImpaleInstances - BurrowInstances)]
- If - Conditions
- Animation - Play BurrowUnit[(ImpaleInstances - BurrowInstances)]'s morph alternate animation
- Unit - Turn collision for BurrowUnit[(ImpaleInstances - BurrowInstances)] On
- Custom script: call RemoveLocation(udg_BurrowPoint2[udg_ImpaleInstances - udg_BurrowInstances])
- Custom script: call RemoveLocation(udg_BurrowTargetPosition[udg_ImpaleInstances - udg_BurrowInstances])
- Else - Actions
- Set ImpaleDummySpell[ImpaleInstances] = Impale Stun
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- Impale System Spikes
- Events
- Time - Every 0.10 seconds of game time
- Conditions
- Actions
- For each (Integer ImpaleLoop) from 1 to ImpaleInstances, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ImpaleOffset[ImpaleLoop] Less than ImpaleRange
- Then - Actions
- Set ImpaleOffset[ImpaleLoop] = (ImpaleOffset[ImpaleLoop] + ImpaleSpace)
- Set ImpaleSpikesPoint = (ImpaleUnitPoint[ImpaleLoop] offset by ImpaleOffset[ImpaleLoop] towards (Angle from ImpaleUnitPoint[ImpaleLoop] to ImpaleTargetPoint[ImpaleLoop]) degrees)
- Unit - Create 1 Impale Dummy for (Owner of ImpaleCaster[ImpaleLoop]) at ImpaleSpikesPoint facing Default building facing degrees
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
- Set ImpaleDummyPoint = (Position of (Last created unit))
- Set ImpaleHitUnits = (Units within ImpaleAoE of ImpaleDummyPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) Not equal to (Triggering unit)) and ((((Matching unit) is in ImpaleGroup[ImpaleLoop]) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of ImpaleCaster[ImpaleLoop])) Equal to True)
- Custom script: call RemoveLocation(udg_ImpaleDummyPoint)
- Custom script: call RemoveLocation(udg_ImpaleSpikesPoint)
- Unit Group - Add all units of ImpaleHitUnits to ImpaleGroup[ImpaleLoop]
- Unit Group - Pick every unit in ImpaleHitUnits and do (Actions)
- Loop - Actions
- Set ImpalePickedUnitPoint = (Position of (Picked unit))
- Special Effect - Create a special effect at ImpalePickedUnitPoint using ImpaleEffect
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_ImpalePickedUnitPoint)
- Loop - Actions
- Custom script: call DestroyGroup(udg_ImpaleHitUnits)
- Unit Group - Pick every unit in ImpaleGroup[ImpaleLoop] and do (Actions)
- Loop - Actions
- Unit - Add Impale Stun to (Picked unit)
- Unit - Set level of Impale Stun for (Picked unit) to ImpaleLevel[ImpaleLoop]
- Unit - Add Storm Crow Form to (Picked unit)
- Unit - Remove Storm Crow Form from (Picked unit)
- Unit - Turn collision for (Picked unit) Off
- Unit - Pause (Picked unit)
- Loop - Actions
- Else - Actions
- Custom script: call RemoveLocation(udg_ImpaleUnitPoint[udg_ImpaleLoop])
- Custom script: call RemoveLocation(udg_ImpaleTargetPoint[udg_ImpaleLoop])
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer ImpaleLoop) from 1 to ImpaleInstances, do (Actions)
- Events
Trigger:
- Impale System Flying
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- Actions
- For each (Integer ImpaleLoop3) from 1 to ImpaleInstances, do (Actions)
- Loop - Actions
- Unit Group - Pick every unit in ImpaleGroup[ImpaleLoop3] and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Picked unit)) Less than 42
- Then - Actions
- Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 2)
- Animation - Change (Picked unit) flying height to ((Power(22.50, 2.00)) - ((22.50 - (Real((Custom value of (Picked unit))))) x (22.50 - (Real((Custom value of (Picked unit))))))) at 0.00
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Picked unit)) Equal to 42
- Then - Actions
- Set ImpalePickingUnits = (Units in (Playable map area) matching ((((Matching unit) is in ImpaleGroup[ImpaleLoop3]) Equal to True) and ((Custom value of (Matching unit)) Greater than or equal to 42)))
- Unit Group - Pick every unit in ImpalePickingUnits and do (Actions)
- Loop - Actions
- Animation - Change (Picked unit) flying height to 0.00 at 0.00
- Unit - Turn collision for (Picked unit) On
- Custom script: call RemoveLocation(udg_ImpalePickedUnitPosition)
- Unit - Unpause (Picked unit)
- Unit - Set the custom value of (Picked unit) to 0
- Custom script: call DestroyGroup(udg_ImpalePickingUnits)
- Loop - Actions
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Picked unit)) Equal to 0
- Then - Actions
- Unit Group - Remove (Picked unit) from ImpaleGroup[ImpaleLoop3]
- Set ImpalePickedUnitPosition = (Position of (Picked unit))
- Unit - Create 1 Dummy for (Owner of ImpaleCaster[ImpaleLoop3]) at ImpalePickedUnitPosition facing Default building facing degrees
- Custom script: call RemoveLocation(udg_ImpalePickedUnitPosition)
- Unit - Add ImpaleDummySpell[ImpaleLoop3] to (Last created unit)
- Unit - Set level of ImpaleDummySpell[ImpaleLoop3] for (Last created unit) to (Level of Impale Stun for (Picked unit))
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
- Unit - Remove Impale Stun from (Picked unit)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in ImpaleGroup[ImpaleLoop3]) Equal to 0
- Then - Actions
- Custom script: call DestroyGroup(udg_ImpaleGroup[udg_ImpaleLoop3])
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in ImpaleGroup[ImpaleLoop3] and do (Actions)
- Loop - Actions
- For each (Integer ImpaleLoop3) from 1 to ImpaleInstances, do (Actions)
- Events
Trigger:
- Burrowstrike Stop
- Events
- Time - BurrowTimer expires
- Conditions
- Actions
- Set ImpaleOffset[ImpaleInstances] = ImpaleRange
- Events
It is like DotA's impale system. You can impale enemies again when they are stuned or in the air. I have included an impale and Burrowstrike that uses this system. Enjoy!
Changelog:
v1.0 - Initial release
v1.1 - Minor improvments to Burrowstrike and made the impale more smooth
v1.1 - Minor improvments to Burrowstrike and made the impale more smooth