- Joined
- Feb 13, 2019
- Messages
- 128
Say we have a trigger set up that attacks from behind (a units attack/attack animation literally strikes/touchs the back of another units model) does bonus damage,
would there a way to go about having units attempt to position well (attempt to move behind the units it is attacking) to get the most out of the extra damage trigger. I mean non-player controlled units, with no player controller.
Units probably wouldn't want to always be wasting their time in combat just walking around attempting to get a flank, also maybe we could just put it on lets say just the Archers in a combat situation, while a Mountain King isnt concerned with flanking anyone, and more or less is protecting it's archers and attempting to hold the enemy unit down with stuns.
Trigger Example
would there a way to go about having units attempt to position well (attempt to move behind the units it is attacking) to get the most out of the extra damage trigger. I mean non-player controlled units, with no player controller.
Units probably wouldn't want to always be wasting their time in combat just walking around attempting to get a flank, also maybe we could just put it on lets say just the Archers in a combat situation, while a Mountain King isnt concerned with flanking anyone, and more or less is protecting it's archers and attempting to hold the enemy unit down with stuns.
Trigger Example
-
Backstab
-
Events
-
Game - DamageEvent becomes Equal to 1.00
-
-
Conditions
-
IsDamageSpell Equal to False
-
-
Actions
-
-------- DamageEventSource is the unit dealing the damage --------
-
Set AttackingUnit = DamageEventSource
-
-------- DamageEventTarget is the unit that takes damage --------
-
Set AttackedUnit = DamageEventTarget
-
Set Point[1] = (Position of AttackedUnit)
-
Set Point[2] = (Position of AttackingUnit)
-
Set Angle[1] = (Facing of AttackedUnit)
-
Set Angle[2] = (Angle from Point[1] to Point[2])
-
Set Angle[3] = (Acos((Cos((Angle[2] - Angle[1])))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Angle[3] Greater than or equal to 120.00) and (Angle[3] Less than or equal to 240.00)
-
-
Then - Actions
-
-------- Instead of using unit-damage target, we use DamageEventAmount variable to change the damage amount --------
-
Set DamageEventAmount = (DamageEventAmount x 2.00)
-
-------- this will deal 2x damage, when backstabbed --------
-
Special Effect - Create a special effect at Point[1] using Objects\Spawnmodels\Human\HumanBlood\HumanBloodPriest.mdl
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_Point[1])
-
Custom script: call RemoveLocation(udg_Point[2])
-
-
Last edited: