• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How can I make the trigger create a unit to enemy of the casting unit?

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
772
In my map I have an item with that can cast a Mind Rot spell on a target enemy unit when used. The enemy unit with the Mind Rot buff should get silenced if it casts a spell but I got a problem. I can't create the dummy unit for an enemy unit of the owner of the casting unit. How do I solve it?

  • Mind Rot
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Casting unit) has buff Mind Rot (item)) Equal to True
    • Actions
      • Unit - Create 1 Silence Dummy (Mind Rot) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Silence (Mind Rot) to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Brewmaster - Drunken Haze (Casting unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Just to clarify, you want to create a dummy for the player who casted the Mind Rot spell on the (Triggering unit) of the "Mind Rot" trigger?
If so, there are these options:
  • If the spell is silence only, then does it need to be the original owner? Can't neutral passive suffice?
  • Try changing the silence spell's allowed targets to allow it to target friendly units. That way you can create the dummy for owner of the triggering unit
  • Store the owner of Mind Rot caster in a hashtable when the caster casts Mind Rot. When the affected unit casts a spell and has Mind Rot buff, load the owner of caster from the hashtable
 
Level 14
Joined
Jul 19, 2007
Messages
772
Just to clarify, you want to create a dummy for the player who casted the Mind Rot spell on the (Triggering unit) of the "Mind Rot" trigger?
If so, there are these options:
  • If the spell is silence only, then does it need to be the original owner? Can't neutral passive suffice?
  • Try changing the silence spell's allowed targets to allow it to target friendly units. That way you can create the dummy for owner of the triggering unit
  • Store the owner of Mind Rot caster in a hashtable when the caster casts Mind Rot. When the affected unit casts a spell and has Mind Rot buff, load the owner of caster from the hashtable
Oh I didn't think about that! I changed the silence spell's allowed targets to friendly and now it works like it should.
 
Status
Not open for further replies.
Top