- Joined
- Sep 6, 2007
- Messages
- 440
I was making a spell which has a Level*5 chance to turn a unit to your own side for level*5 seconds. The problem is the first creep converted does not return to his own owner. Here is the trigger check it out.
-
Mind Tricks
-
Events
- Unit - A unit Is attacked
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- ((Attacked unit) is A Hero) Equal to False
- (Level of Mind Tricks for (Attacking unit)) Greater than or equal to 1
-
Conditions
-
And - All (Conditions) are true
-
Actions
- Set CasterB = (Attacking unit)
- Set VictimB = (Attacked unit)
- Set Chance = (Random integer number between 1 and 100)
- Set OwnerA = (Owner of VictimB)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Chance Less than or equal to ((Level of Mind Tricks for CasterB) x 5)
-
Then - Actions
- Special Effect - Create a special effect attached to the chest of VictimB using Abilities\Spells\Other\Charm\CharmTarget.mdl
- Unit - Change ownership of VictimB to (Owner of CasterB) and Change color
- Countdown Timer - Start Timer as a One-shot timer that will expire in ((Real((Level of Mind Tricks for CasterB))) x 5.00) seconds
- Trigger - Turn on Expires <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Expires
-
Events
- Time - Timer expires
- Conditions
-
Actions
- Unit - Change ownership of VictimB to OwnerA and Change color
- Trigger - Turn off (This trigger)
-
Events