Mind Control,cant make it work

Level 12
Joined
Nov 5, 2007
Messages
730
Im making a spell named Mind Control,its supposed to make an enemy target hero attack its allies for a short duration.I made the trigger,and it works fine to the point where the hero becomes invulnerable and changes owner,but after that,its like the trigger turned off,he doesnt turn back vulnerable or retain its former owner.

  • Charm
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mind Control
    • Actions
      • Wait 0.10 seconds
      • Set Charmed_Owner[1] = (Owner of (Target unit of ability being cast))
      • Unit - Add Berserk to (Target unit of ability being cast)
      • Unit - Remove All buffs from (Target unit of ability being cast)
      • Wait 0.05 seconds
      • Unit - Order (Target unit of ability being cast) to Orc Troll Berserker - Berserk
      • Unit - Make (Target unit of ability being cast) Invulnerable
      • Unit - Change ownership of (Target unit of ability being cast) to Player 6 (Orange) and Retain color
      • Wait ((Real((Level of Mind Control for (Casting unit)))) + 3.00) seconds
      • Unit - Remove Berserk from (Target unit of ability being cast)
      • Unit - Remove All buffs from (Target unit of ability being cast)
      • Unit - Make (Target unit of ability being cast) Vulnerable
      • Unit - Change ownership of (Target unit of ability being cast) to Charmed_Owner[1] and Retain color
Any ideas?
Also id like to make the hero NOT lose his hero icon to its former owner while hes charmed...can this be done?
 
Level 11
Joined
Feb 22, 2006
Messages
752
First of all, set this line of code:

Set Charmed_Owner[1] = (Owner of (Target unit of ability being cast))

at the beginning before any waits.

Second of all, at the beginning, save the target unit to a variable and reference that variable throughout your trigger instead of using <Target unit of ability being cast>.

The reasion is: the function <Target unit of ability being cast> is bugged if you use it after waits. Basically, any of the "event" functions that return something to do with an event ( except GetTriggerUnit() ), will have the same problem.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Just a tip, don't make this trigger :p
It will bug if there is more then 1 cast of the spell within the time it waits.

Change your trigger into custom script and add a local (its really easy, if you can't do it yourself ill be glad to lol, belive me, im a total idiot when talking about JASS).
 
Level 12
Joined
Nov 5, 2007
Messages
730
First of all, set this line of code:

Set Charmed_Owner[1] = (Owner of (Target unit of ability being cast))

at the beginning before any waits.

Second of all, at the beginning, save the target unit to a variable and reference that variable throughout your trigger instead of using <Target unit of ability being cast>.

The reasion is: the function <Target unit of ability being cast> is bugged if you use it after waits. Basically, any of the "event" functions that return something to do with an event ( except GetTriggerUnit() ), will have the same problem.

Thanks,it works perfectly :)

Just a tip, don't make this trigger :p
It will bug if there is more then 1 cast of the spell within the time it waits.

Change your trigger into custom script and add a local (its really easy, if you can't do it yourself ill be glad to lol, belive me, im a total idiot when talking about JASS).

Thanks for the tip,but theres only one unit on the whole map that casts mind control,so its ok :)
 
Top