LordSaddler1
New Member
- Reaction score
- 4
So i pretty much have an ability where a Quillboar runs through an area impaling everybody in the way, and if someone gets killed by it, their dead body is on his back and gives him armor. Everything in the ability works fine except the dead people appearing on his back.
Plz tell me if u know what is wrong.
Code:
Impaling Back Spikes
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Impaling Back Spines
Actions
Set ImpalingBackCaster = (Triggering unit)
Set ImpalingPoint = (Target point of ability being cast)
Set ImpalingDistance = (Integer((Distance between (Position of ImpalingBackCaster) and ImpalingPoint)))
Set ImpalingAngle = (Angle from (Position of ImpalingBackCaster) to ImpalingPoint)
Set ImpalingLevel = (ImpalingDistance / 100)
Unit - Create 1 Casting Dummy for (Owner of ImpalingBackCaster) at (Position of ImpalingBackCaster) facing ImpalingAngle degrees
Set ImpalingDummy = (Last created unit)
Unit - Add ImpalingDummy to ImpalingDummy
Unit - Set level of ImpalingDummy for ImpalingDummy to (ImpalingLevel + 1)
Unit - Order ImpalingDummy to Undead Crypt Lord - Impale ImpalingPoint
Unit - Add a 6.00 second Generic expiration timer to ImpalingDummy
Unit - Pause ImpalingBackCaster
Trigger - Turn on Impaling Move <gen>
Wait 0.40 seconds
Unit - Unpause ImpalingBackCaster
Trigger - Turn off Impaling Move <gen>
Wait 0.70 seconds
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Impaled ) Equal to True)) and do (Actions)
Loop - Actions
Unit - Create 1 Casting Dummy for (Owner of ImpalingBackCaster) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add ImpalingSpike to (Last created unit)
Unit - Set level of ImpalingSpike for (Last created unit) to (Level of Impaling Back Spines for ImpalingBackCaster)
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
Set Impaling_Dead_Group = (Last created unit group)
Set Impaling_Dead_Group_Int[1] = (Number of units in Impaling_Dead_Group)
Trigger - Turn on Corpse Counter <gen>
Wait 3.00 seconds
Trigger - Turn off Corpse Counter <gen>
Code:
Impaling Move
Events
Time - Every 0.02 seconds of game time
Conditions
Actions
Unit - Turn collision for ImpalingBackCaster Off
Unit - Move ImpalingBackCaster instantly to ((Position of ImpalingBackCaster) offset by 10.00 towards (Angle from (Position of ImpalingBackCaster) to ImpalingPoint) degrees)
Animation - Play ImpalingBackCaster's walk animation
Code:
Corpse Counter
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Impaling_Dead_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is dead) Equal to True
Then - Actions
Unit Group - Remove (Picked unit) from Impaling_Dead_Group
Else - Actions
Do nothing
Set Impaling_Dead_Group_Int[2] = (Number of units in Impaling_Dead_Group)
Set Impaling_Dead_Group_Int[3] = (Impaling_Dead_Group_Int[1] - Impaling_Dead_Group_Int[2])
Set ImpalingCorpseCounter = Impaling_Dead_Group_Int[3]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(ImpalingCorpseCounter Greater than or equal to 1) and (ImpalingCorpseCounter Less than or equal to 4)
Then - Actions
Unit - Add Corpse Armor to ImpalingBackCaster
Unit - Add Corpse to ImpalingBackCaster
Unit - Set level of Corpse Armor for ImpalingBackCaster to ImpalingCorpseCounter
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ImpalingCorpseCounter Greater than or equal to 5
Then - Actions
Unit - Add Corpse to ImpalingBackCaster
Unit - Add Corpse Armor to ImpalingBackCaster
Unit - Set level of Corpse Armor for ImpalingBackCaster to 5
Else - Actions
Do nothing
Plz tell me if u know what is wrong.