tommerbob
Minecraft. :D
- Reaction score
- 110
So I've got this DOT spell (we will call it Plague). What I need help with is this:
Unit A has Plague (buff). He comes within 100 of Unit B. Unit B then also gains Plague.
Because the spell is MUI, how can I detect when a unit comes close to a unit that has the Plague spell on it? Is it possible to do a unit group loop inside another unit group loop?
Here is the trigger:
Any advice is welcome.
Unit A has Plague (buff). He comes within 100 of Unit B. Unit B then also gains Plague.
Because the spell is MUI, how can I detect when a unit comes close to a unit that has the Plague spell on it? Is it possible to do a unit group loop inside another unit group loop?
Here is the trigger:
Code:
Plague DOT
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Plague_Group and do (Actions)
Loop - Actions
Set Plague_Duration = (Load 0 of (Key (Picked unit)) from Plague_Table)
Hashtable - Save (Plague_Duration - 1.00) as 0 of (Key (Picked unit)) in Plague_Table
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Plague_Duration Less than or equal to 0.00
Then - Actions
Unit - Remove Plague of Affliction (dummy) buff from (Picked unit)
Unit Group - Remove (Picked unit) from Plague_Group
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Plague_Table
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Plague of Affliction (dummy)) Equal to True
Then - Actions
Unit - Cause Spell_Caster to damage (Picked unit), dealing Plague_Damage damage of attack type Spells and damage type Magic
Else - Actions
Unit Group - Remove (Picked unit) from Plague_Group
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Plague_Table
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Plague_Group) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Any advice is welcome.