B
Banli
Guest
I have the following trigger which is basically mass ensare based off a dummy spell: The trigger works fine when I disable the custom script making PointTemp a local variable, but I understand that locals are better for making things mui and what not. Am I doing something wrong with the local... or what do I need to do to make this a completely mui skill?
Code:
Take Captive
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Take Captive (Vagabond)
Actions
****Custom script: local location udg_PointTemp
Set PointTemp = (Position of (Casting unit))
Set UnitGroupTemp = (Units within (500.00 + (100.00 x (Real((Level of (Ability being cast) for (Casting unit)))))) of PointTemp matching (((Owner of (Casting unit)) is an ally of (Owner of (Matching unit))) Equal to False))
Unit Group - Pick every unit in UnitGroupTemp and do (Actions)
Loop - Actions
Unit - Create 1 Dummy Caster for (Owner of (Casting unit)) at PointTemp facing Default building facing degrees
Unit - Add Ensnare (Vagabond) to (Last created unit)
Unit - Set level of Ensnare (Vagabond) for (Last created unit) to (Level of Take Captive (Vagabond) for (Casting unit))
Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit)
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_PointTemp)
Custom script: call DestroyGroup(udg_UnitGroupTemp)