Hello, I've just returned to mapmaking after a number of years, I was pretty advanced previously, but now I've gotten rusty.
Anyways, I'm trying to give my units a miss chance on attack using a custom version of the "curse" spell (varies from unit to unit). Right now, the trigger works and the spell is cast, BUT the triggering attack never misses (subsequent attacks for the curse duration DO miss, however... I've tested in game by extending the duration). Of course, I want the triggering, initial attack to miss, and not have the spell stick around.
I know my curse spell works because I tested it with a regular, non-dummy unit in-game (100% chance to miss).
My problem in a nutshell: The attack seems to be resolved before the effects of the curse spell are factored in, resulting in a 100% hit rate. Here is my trigger:
Anyways, I'm trying to give my units a miss chance on attack using a custom version of the "curse" spell (varies from unit to unit). Right now, the trigger works and the spell is cast, BUT the triggering attack never misses (subsequent attacks for the curse duration DO miss, however... I've tested in game by extending the duration). Of course, I want the triggering, initial attack to miss, and not have the spell stick around.
I know my curse spell works because I tested it with a regular, non-dummy unit in-game (100% chance to miss).
My problem in a nutshell: The attack seems to be resolved before the effects of the curse spell are factored in, resulting in a 100% hit rate. Here is my trigger:
-
Battle Engine
-
Events
- Unit - A unit Is attacked
- Conditions
-
Actions
- -------- 40% MISS chance --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Attacking unit)) Equal to Spearman
-
Then - Actions
- Set Random = (Random integer number between 1 and 100)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Random Less than or equal to 40
-
Then - Actions
- Set Point = (Position of (Attacking unit))
- Unit - Create 1 Dummy for Neutral Extra at Point facing Default building facing degrees
- Unit - Order (Last created unit) to Undead Banshee - Curse (Attacking unit)
- Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
- Custom script: call RemoveLocation(udg_Point)
- Floating Text - Create floating text that reads x above (Attacking unit) with Z offset 10.00, using font size 8.00, color (0.00%, 0.00%, 100.00%), and 25.00% transparency
- Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.25 seconds
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Events