S
Scroller
Guest
Hi I have a problem with a spell. It works somewhat. I get the desired effect but the spell spawns like a gazillion dummy units and lags up the whole map. Here's the trigger.
Any help would be greatly apprecitated. Will +rep those who solve the problem.
Code:
Restoration
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Restoration
Actions
Set AlliedG = (Units in (Playable map area))
Unit Group - Pick every unit in AlliedG and do (Actions)
Loop - Actions
Unit Group - Pick every unit in AlliedG and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Picked unit) is A Hero) Equal to True) and (((Picked unit) belongs to an ally of (Owner of (Casting unit))) Equal to True)
Then - Actions
Set Playerpt = (Position of (Casting unit))
Unit - Create 1 Dummyunit for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
Unit - Add Dummyrest to (Last created unit)
Unit - Set level of Dummyrest for (Last created unit) to (Level of Restoration for (Casting unit))
Unit - Order (Last created unit) to Human Paladin - Holy Light (Picked unit)
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_Playerpt)
Else - Actions
Do nothing
Custom script: call DestroyGroup(udg_AlliedG)