So I made a tentative spell for an auto-cast target spell (based off cold arrows) that temporarily (10 sec) removes a target hero's agility by 5 each attack, stackable up to 15 times. The resulting triggers are kind of a hybrid of what I was able to gather from searching on forums:
To detect autocast turned on/off:
Now, the trigger, using the GDD damage detection system:
For those who don't know how the GDD system works, whenever the variable GDD_Damage becomes 0, means damage is being detected. Also GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit, while GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
Ive tried testing different parts of the triggers to find the problem. It seems that for some reason the units are not being added to the unit group...yet the auto-cast detection triggers are firing. For the main trigger, if I remove the condition the unit still doesn't lose any agility. I have a feeling there is more than 1 mess up in my triggers, but I can't seem to understand where. Any help please?
To detect autocast turned on/off:
Trigger:
- Autocast On
- Events
- Unit - A unit Is issued an order with no target
- Conditions
- (Issued order) Equal to (Order(coldarrows))
- Actions
- Unit Group - Add (Triggering unit) to WeaknessStore
- Events
Trigger:
- Autocast Off
- Events
- Unit - A unit Is issued an order with no target
- Conditions
- (Issued order) Equal to (Order(uncoldarrows))
- Actions
- Unit Group - Remove (Triggering unit) from WeaknessStore
- Events
Now, the trigger, using the GDD damage detection system:
Trigger:
- Weakness Test
- Events
- Game - GDD_Damage becomes Equal to 0.00
- Conditions
- (GDD_DamageSource is in WeaknessStore) Equal to True
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of GDD_DamagedUnit) Less than 15
- Then - Actions
- Unit - Set the custom value of GDD_DamagedUnit to ((Custom value of GDD_DamagedUnit) + 1)
- Hero - Modify Agility of GDD_DamagedUnit: Subtract 5
- Wait 10.00 seconds
- Hero - Modify Agility of GDD_DamagedUnit: Add 5
- Unit - Set the custom value of GDD_DamagedUnit to ((Custom value of GDD_DamagedUnit) - 1)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
For those who don't know how the GDD system works, whenever the variable GDD_Damage becomes 0, means damage is being detected. Also GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit, while GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
Ive tried testing different parts of the triggers to find the problem. It seems that for some reason the units are not being added to the unit group...yet the auto-cast detection triggers are firing. For the main trigger, if I remove the condition the unit still doesn't lose any agility. I have a feeling there is more than 1 mess up in my triggers, but I can't seem to understand where. Any help please?