Hello. I'm trying to make a spell that heals all allies units within 600 range of a specific point every second for X seconds. I want every second for X seconds, units within range to have a special effect.
My code is:
The special effect occurs only once. Help me please.
Sorry for my bad English.
My code is:
Code:
Events
Skip
Conditions
Skip
Actions
Custom Script: local location udg_mypoint
Custom Script: local group udg_mygroup
Custom Script: local integer udg_myint
Custom Script: local effect array udg_myfx
Unit - Create 1 Dummy_Unit for (Owner of (Triggering Unit)) at (Target point of ability being cast) facing Default building facing degrees
Add a 8 second Generic expiration timer to (Last created unit)
Set mypoint = (Position of (Last created Unit))
Set mygroup = (Units within 600 range of my point matching ((((Matching unit) is Alive) Equal to True) and (((Matching unit) belongs to an Ally of (Owner of (Triggering Unit))) Equal to True)))
For each (Integer A) 1 to 8, do (Actions)
Loop - Actions
Unit Group - Pick every unit in mygroup and do (Actions)
Set myint = (myint + 1)
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Set myfx[myint] = (Last created special effect)
Wait 1.00 seconds
For each (Integer A) 1 to (Number of Units in mygroup), do (Actions)
Special Effect - Destroy myfx[(Integer A)]
call RemoveLocation (udg_mypoint)
call DestroyGroup (udg_mygroup)
The special effect occurs only once. Help me please.
Sorry for my bad English.