- Joined
- Aug 5, 2010
- Messages
- 147
The below trigger selects all units within an area and Changes the owner to the casting units owner, the issues is when there are units owned by the player within the radius and i presume allied/friendly units, that unit will still be selected despite there being conditions saying not to pick those units.
Charm_Group is a group variable, Charm_Summon is an integer, Charm_Health is an Ability variable.
Ive tried like 6 solutions but none have worked.
-
Void Charm
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Void Charm [Standard]
-
-
Actions
-
Set Charm_Group = (Units within 300.00 of (Target point of ability being cast) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
-
Unit Group - Pick every unit in (Random Charm_Summon units from Charm_Group) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A structure) Equal to False
-
((Picked unit) is A Hero) Equal to False
-
((Picked unit) is Magic Immune) Equal to False
-
((Picked unit) is alive) Equal to True
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Charm\CharmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Change ownership of (Picked unit) to (Owner of (Triggering unit)) and Change color
-
Unit - Add Charm_Health[(Level of Void Charm [Standard] for (Triggering unit))] to (Picked unit)
-
Unit - Add a 10.00 second Generic expiration timer to (Picked unit)
-
-
Else - Actions
-
-
-
-
Custom script: call DestroyGroup(udg_Charm_Group)
-
-
Ive tried like 6 solutions but none have worked.