• 🏆 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!

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