• 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.

need help with simple trigger

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
did u tryed something like this?
  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Mountain King
          • (Unit-type of (Triggering unit)) Equal to Blood Mage
          • (Unit-type of (Triggering unit)) Equal to Archmage
          • (Unit-type of (Triggering unit)) Equal to Paladin
          • (Unit-type of (Triggering unit)) Equal to Sylvanas Windrunner
    • Actions
      • Set integer = (integer - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • integer Equal to 0
        • Then - Actions
          • Set p = (Random point in (Playable map area))
          • Unit - Create 1 Footman for (Owner of (Killing unit)) at p facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_p)
        • Else - Actions
if that npc not respawn then this better

  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Blood Mage 0003 <gen>
          • (Triggering unit) Equal to Mountain King 0002 <gen>
          • (Triggering unit) Equal to Sylvanas Windrunner 0004 <gen>
          • (Triggering unit) Equal to Archmage 0001 <gen>
          • (Triggering unit) Equal to Paladin 0000 <gen>
    • Actions
      • Set integer = (integer - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • integer Equal to 0
        • Then - Actions
          • Set p = (Random point in (Playable map area))
          • Unit - Create 1 Footman for (Owner of (Killing unit)) at p facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_p)
        • Else - Actions
 
Level 5
Joined
Dec 8, 2012
Messages
149
when all 5 are killed, a boss will spawn.

Above, i think he wants all 5 units are killed and conditions must be [trigger=this]
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Footman
(Unit-type of (Triggering unit)) Equal to Knight
(Unit-type of (Triggering unit)) Equal to Rifleman
(Unit-type of (Triggering unit)) Equal to Mortar Team
(Unit-type of (Triggering unit)) Equal to Flying Machine
[/trigger]
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Above, i think he wants all 5 units are killed and conditions must be [trigger=this]
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Footman
(Unit-type of (Triggering unit)) Equal to Knight
(Unit-type of (Triggering unit)) Equal to Rifleman
(Unit-type of (Triggering unit)) Equal to Mortar Team
(Unit-type of (Triggering unit)) Equal to Flying Machine
[/trigger]

The "And - All (Conditions) are true" is unnecessary and adds extra code in cases like this. Place the codition directly under the main "Conditions".
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
If they are preset it could be like this:
  • Events
    • Unit - A unit Dies
  • Conditions
    • And - all (Conditions) are true
      • Conditions
        • (Guard 0000 <gen> is dead) Equal to True
        • (Guard 0001 <gen> is dead) Equal to True
        • (Guard 0002 <gen> is dead) Equal to True
        • (Guard 0003 <gen> is dead) Equal to True
        • (Guard 0004 <gen> is dead) Equal to True
  • Actions
    • Set p = (Random point in (Playable map area))
    • Unit - Create 1 Final boss for Neutral Hostile at p facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_p)
    • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top