• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

simple trigger needed

Status
Not open for further replies.
Level 12
Joined
Dec 17, 2009
Messages
951
i need a trigger that pick every "XX" unit type to cast "X" spell at any random unit of type "Y" when the mana of picked unit "XX" comes to 50 or less.
can you guys help me?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176

Triggers

Test Map

  • Detect XX
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to XX
    • Actions
      • Set unit[(XX + (200 x 0))] = (Triggering unit)
      • Trigger - Add to XX Actions <gen> the event (Unit - unit[(XX + (50 x 0))]'s mana becomes Less than or equal to 50.00)
      • Set XX = (XX + 1)
  • XX Actions
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set RandomY = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Y))
      • Unit - Order (Triggering unit) to X (Random unit from RandomY)


When a Footman(XX) cast Flame Strike which cause his Mana to be less than 50, the Footman(XX) will find random Gnolls(Y) and Firebolt(X) them.


- You should create the unit yourself via trigger instead of placing them in world editor because the triggers will only be triggered if the unit is entering the map.
- Remember to put the "X" spell to the "XX" unit or else the "XX" unit won't cast the spell that doesn't exist in his abilities.
 

Attachments

  • j.w3x
    17 KB · Views: 43
Last edited:
Status
Not open for further replies.
Top