So I've been trying to make a cone or line damage ability (like shockwave or carrion swarm) apply an armor debuff.
I based it on Breath of Frost since that applies a buff (Breath of Ruin Dummy) I could check for to apply the real debuff (Anathema).
My triggers currently are as follows:
Anathemizer is initially off. When activated it periodically checks for units that were hit by the spell (and thus have the dummy buff Breath of Ruin) but weren't yet hit by the real debuff (Anathema) and then hits them with that debuff.
Anathemizer also removes the real debuff (Anathema) from anyone who somehow has it but does not have the dummy buff (Breath of Ruin).
De Anathemizer is mostly there just in case of a mess up somehow and to turn Anathemizer back off, it just purges both of those debuffs.
The reason for the complexity of this trigger is really just that not every unit gets hit by the breath at once and I want them to be debuffed as they're hit (or close to it) rather than all at once. That's the reason for Anathemizer being a periodic event rather than something run once.
However, this version is inelegant and also not quite going to work as intended because units hit later will have the debuff purged from them 12 seconds after the cast which might be, say, only 11 seconds after they were hit. In that case they wouldn't have been debuffed for the full time.
Can anyone think of a better way to do this?
I based it on Breath of Frost since that applies a buff (Breath of Ruin Dummy) I could check for to apply the real debuff (Anathema).
My triggers currently are as follows:
-
Breath of Ruin Turn On
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Ability being cast) Equal to Breath of Ruin (Q)
- (Ability being cast) Equal to Breath of Ruin (E)
- (Ability being cast) Equal to Breath of Ruin (W)
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- Trigger - Turn on Anathemizer <gen>
- Wait (3.00 + (3.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) game-time seconds
- Trigger - Run De Anathemizer <gen> (ignoring conditions)
-
Events
-
Anathemizer
-
Events
- Time - Every 0.10 seconds of game time
- Conditions
-
Actions
- Set TempUnitGroup = (Units in (Playable map area) matching ((((Matching unit) has buff Breath of Ruin (Dummy)) Equal to True) and (((Matching unit) has buff Anathema ) Equal to False)))
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
- Set TempPoint = (Position of (Picked unit))
- Unit - Create 1 Dummy Caster (Main) for Neutral Hostile at TempPoint facing Default building facing degrees
- Unit - Add Breath of Ruin (Debuffer) to (Last created unit)
- Unit - Set level of Breath of Ruin (Debuffer) for (Last created unit) to (Intelligence of Reinherarch (Include bonuses))
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
- Custom script: call RemoveLocation (udg_TempPoint)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_TempUnitGroup)
- Set TempUnitGroup = (Units in (Playable map area) matching ((((Matching unit) has buff Breath of Ruin (Dummy)) Equal to False) and (((Matching unit) has buff Anathema ) Equal to True)))
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
- Unit - Remove Anathema buff from (Picked unit)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_TempUnitGroup)
-
Events
-
De Anathemizer
- Events
- Conditions
-
Actions
- Set TempUnitGroup = (Units in (Playable map area) matching ((((Matching unit) has buff Breath of Ruin (Dummy)) Equal to True) or (((Matching unit) has buff Anathema ) Equal to True)))
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
- Unit - Remove Anathema buff from (Picked unit)
- Unit - Remove Breath of Ruin (Dummy) buff from (Picked unit)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_TempUnitGroup)
- Trigger - Turn off Anathemizer <gen>
Anathemizer is initially off. When activated it periodically checks for units that were hit by the spell (and thus have the dummy buff Breath of Ruin) but weren't yet hit by the real debuff (Anathema) and then hits them with that debuff.
Anathemizer also removes the real debuff (Anathema) from anyone who somehow has it but does not have the dummy buff (Breath of Ruin).
De Anathemizer is mostly there just in case of a mess up somehow and to turn Anathemizer back off, it just purges both of those debuffs.
The reason for the complexity of this trigger is really just that not every unit gets hit by the breath at once and I want them to be debuffed as they're hit (or close to it) rather than all at once. That's the reason for Anathemizer being a periodic event rather than something run once.
However, this version is inelegant and also not quite going to work as intended because units hit later will have the debuff purged from them 12 seconds after the cast which might be, say, only 11 seconds after they were hit. In that case they wouldn't have been debuffed for the full time.
Can anyone think of a better way to do this?