triggers

Level 4
Joined
Feb 28, 2025
Messages
27
Hello guys !
I am creating a campaign and in one of the missions, the player needs to destroy the 6 Demon Gates to complete the mission. How do I create the quest validation triggers and the end of the game triggers?
Thank you very much!!!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Here's an Event that lets you do stuff whenever any unit dies:
  • Events
    • Unit - A unit Dies
Here's a Condition that lets you determine that the "any unit" was actually a Demon Gate:
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Demon Gate
Here's an Action that reduces an Integer variable by 1:
  • Actions
    • Set Variable Gate_Count = (Gate_Count - 1)
1742325158282.png


Here's an "If Then Else" Action that lets you ask more questions (Conditions) anywhere in your trigger:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • Then - Actions
      • Else - Actions
^ That's a good place to check the value of Gate_Count after subtracting from it.

The Then - Actions section of an "If Then Else" only occurs if the If - Conditions are met. So that's where you can declare Victory:
  • If - Conditions
    • Gate_Count Equal to 0
  • Then - Actions
    • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
Lastly, you can insert any Quest related Actions wherever it seems logical:
  • Actions
    • Set Variable Gate_Count = (Gate_Count - 1)
    • Quest - Change the description of (Last created quest) to (Demon Gates Remaining: + (String(Gate_Count)))
It's up to you to decide how you want your Quests to work.
 
Last edited:
Top