- Joined
- Aug 5, 2007
- Messages
- 49
Made an ability for an AOE sleep, for some reason it only works on 1 nearby target. If I put the message call for "pick" before the If / then / else in the Pick Every Unit, it returns "pick" for every unit, when I put it in the If /then /else it will only return once.
Code:
MassSleep
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Sleeping Powder
Actions
Set UnitGroupsForTrigs[5] = (Units within 800.00 of (Position of (Casting unit)))
Unit Group - Pick every unit in UnitGroupsForTrigs[5] and do (Actions)
Loop - Actions
Set TempPoin = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Picked unit)) is an enemy of (Owner of (Casting unit))) Equal to True
((Picked unit) is A structure) Not equal to True
Then - Actions
Game - Display to (All players) the text: pick
Unit - Create 1 Dummy for (Owner of (Casting unit)) at TempPoin facing Default building facing degrees
Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
Unit - Add DummySleep to (Last created unit)
Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
Else - Actions
Custom script: call RemoveLocation (udg_TempPoin)
Custom script: call DestroyGroup (udg_UnitGroupsForTrigs[5])