San-D
New Member
- Reaction score
- 15
The idea here is to make an ability that targets a unit, damages it, picks all enemies in 500 of unit, damage them, pick all units in 500 of all the picked units that have not been yet affected by this spell and damage them, pick all in 500 of those units and so on
To check out if it works I made a map with a streaming line of Wisps to see. The problem is - it only continues on the left side of the stream and leaves the right behind (Right side has units in 500 of previous) and damages already damaged units over and over!
HELP!
Code:
Chain Reaction
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Chain Reaction (Neutral Hostile)
Actions
Set Target = (Target unit of ability being cast)
Unit Group - Add Target to Reactio_Group
Set Temp_Point = (Position of Target)
Unit - Create 1 Dummy for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 500.00 at Temp_Point, dealing 500.00 damage of attack type Spells and damage type Normal
For each (Integer A) from 1 to (Number of units in (Units in (Playable map area))), do (Actions)
Loop - Actions
Wait 1.00 seconds
Unit Group - Pick every unit in (Units within 500.00 of (Position of Target)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is in Reactio_Group) Equal to False
((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
Then - Actions
Set Target = (Picked unit)
Unit Group - Add Target to Reactio_Group
Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Picked unit)), dealing 500.00 damage of attack type Spells and damage type Normal
Else - Actions
To check out if it works I made a map with a streaming line of Wisps to see. The problem is - it only continues on the left side of the stream and leaves the right behind (Right side has units in 500 of previous) and damages already damaged units over and over!
HELP!