I want my unit to only be able to cast an ability if no enemies are near.
I tried this:
It doesn't work. The spell still turns on.
I tried this:
Code:
Turn On
Events
Unit - A unit Is issued an order with no target
Conditions
(Issued order) Equal to (Order(immolation))
Actions
Unit Group - Pick every unit in (Units within 500.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Last created unit group)) Equal to 0
Then - Actions
Trigger - Add to Out of Mana <gen> the event (Unit - (Triggering unit)'s mana becomes Less than or equal to 10.00)
Unit - Add Ghost to (Triggering unit)
Else - Actions
Unit - Order (Triggering unit) to Night Elf Demon Hunter - Deactivate Immolation
It doesn't work. The spell still turns on.