- Joined
- Feb 2, 2008
- Messages
- 41
I have a trigger that is supposed to replace a space unit with a space unit that doesn't have any abilities if a unit that can attack is on it. However, it replaces all of the spaces on the board, which is not supposed to happen.
Here is the trigger:
Here is the trigger:
-
Monster Space
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Move
-
Actions
-
For each (Integer A) from 1 to NumberofSpaces, do (Actions)
-
Loop - Actions
- Set OtherPoint = (Position of FriendlySpaces[(Integer A)])
- Set OtherUnitGroup = (Units within 50.00 of OtherPoint matching (((Matching unit) is Able to attack ground units) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- (Unit-type of FriendlySpaces[(Integer A)]) Equal to Space (Big)(No Move)
- (Number of units in OtherUnitGroup) Less than 1
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- Unit - Replace FriendlySpaces[(Integer A)] with a Space (Big)(Move) using The old unit's relative life and mana
- Set FriendlySpaces[(Integer A)] = (Last replaced unit)
- Animation - Change FriendlySpaces[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
- Unit - Change ownership of FriendlySpaces[(Integer A)] to Player 1 (Red) and Retain color
-
Else - Actions
- Unit - Replace FriendlySpaces[(Integer A)] with a Space (Big)(No Move) using The old unit's relative life and mana
- Set FriendlySpaces[(Integer A)] = (Last replaced unit)
- Custom script: call RemoveLocation(udg_Point)
- Custom script: call DestroyGroup(udg_UnitGroup)
-
If - Conditions
-
Loop - Actions
-
For each (Integer A) from 1 to NumberofSpaces, do (Actions)
-
Loop - Actions
- Set OtherPoint = (Position of FriendlySpaces[(Integer A)])
- Set OtherUnitGroup = (Units within 50.00 of OtherPoint matching (((Matching unit) is Able to attack ground units) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- (Unit-type of FriendlySpaces[(Integer A)]) Equal to Space (Small)(No Move)
- (Number of units in OtherUnitGroup) Less than 1
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- Unit - Replace FriendlySpaces[(Integer A)] with a Space (Small)(Move) using The old unit's relative life and mana
- Set FriendlySpaces[(Integer A)] = (Last replaced unit)
- Animation - Change FriendlySpaces[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
- Unit - Change ownership of FriendlySpaces[(Integer A)] to Player 1 (Red) and Retain color
-
Else - Actions
- Unit - Replace FriendlySpaces[(Integer A)] with a Space (Small)(No Move) using The old unit's relative life and mana
- Set FriendlySpaces[(Integer A)] = (Last replaced unit)
- Unit - Change ownership of FriendlySpaces[(Integer A)] to Player 1 (Red) and Retain color
- Custom script: call RemoveLocation(udg_Point)
- Custom script: call DestroyGroup(udg_UnitGroup)
-
If - Conditions
-
Loop - Actions
-
For each (Integer A) from 1 to NumberofSpaces, do (Actions)
-
Events