The first trigger should fire when you want the quest to start, or you can create the quest at map initialization, but mark it as "undiscovered" instead of "discovered" - that way when you press F9, you will see an undiscovered quest slot.
-
Quest Start
-
Events
-
<Your event, or whatever is supposed to start the quest>
-
Conditions
-
Actions
-
Trigger - Turn off (This trigger)
-
-------- -------------------------------- --------
-
-------- CREATES QUEST AND QUEST REQUIREMENT --------
-
Quest - Create a Required quest titled <Title> with the description <Description>, using icon path <Icon>
-
Set Your_Quest = (Last created quest)
-
Quest - Enable Your_Quest
-
Quest - Mark Your_Quest as Discovered
-
Quest - Create a quest requirement for Your_Quest with the description Kill 5 gnolls (0/5)
-
Set Quest_Requirement[1] = (Last created quest requirement)
-
Set Quest_Count = 0
-
-------- -------------------------------- --------
-
-------- QUEST MESSAGE --------
-
Quest - Display to (All players) the Quest Discovered message: NEW QUEST <Your qu...
-
-------- -------------------------------- --------
-
Trigger - Turn on Quest Update <gen>
This second trigger may be the most complicated. Whenever a gnoll dies, the quest will be updated.
-
Quest Update
-
Events
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Gnoll
-
(Unit-type of (Triggering unit)) Equal to Gnoll Brute
-
(Unit-type of (Triggering unit)) Equal to Gnoll Assassin
-
(Unit-type of (Triggering unit)) Equal to Gnoll Poacher
-
(Unit-type of (Triggering unit)) Equal to Gnoll Warden
-
(Unit-type of (Triggering unit)) Equal to Gnoll Overseer
-
Actions
-
Set Quest_Count = (Quest_Count + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Quest_Count Greater than or equal to 1
-
Quest_Count Less than or equal to 4
-
Then - Actions
-
Quest - Change the description of Quest_Requirement[1] to (Kill 5 gnolls ( + ((String(Quest_Count)) + /5)))
-
Quest - Display to (All players) the Quest Update message: (QUEST UPDATE|n<Quest name>|n- Kill 5 gnolls ( + ((String(Quest_Count)) + /5)))
-
Else - Actions
-
Trigger - Turn off (This trigger)
-
Quest - Change the description of Quest_Requirement[1] to (Kill 5 gnolls ( + ((String(Quest_Count)) + /5)))
-
Quest - Mark Quest_Requirement[1] as Completed
-
-------- -------------------------------- --------
-
Quest - Create a quest requirement for Your_Quest with the description Return to Goblin Ti...
-
Set Quest_Requirement[2] = (Last created quest requirement)
-
-------- -------------------------------- --------
-
Quest - Display to (All players) the Quest Requirement message: (QUEST UPDATE|n<Quest name>|n|c007d7d7dKill 5 gnolls (5/5) (Completed)|r|n- Return to Goblin Tinker + ((String(Quest_Count)) + /5)))
-
-------- -------------------------------- --------
-
Trigger - Turn on Quest Complete <gen>
Quest_Count will be increased by 1 and then we check value of Quest_Count. If the value is in interval <1;4>, the quest will be simply updated (updated by quest message and in quest log).
When Quest_Count is 5, the whole trigger will switch off (so no further kills will start this trigger), that quest objective is marked as completed and new objective is add (a "go back to quest giver" objective).
-
Quest Complete
-
Events
-
Unit - A unit comes within 256.00 of Goblin_Tinker
-
Conditions
-
(Triggering unit) Equal to Your_Hero
-
Actions
-
Trigger - Turn off (This trigger)
-
Quest - Display to (All players) the Quest Completed message: QUEST COMPLETED <Q...
-
Quest - Mark Quest_Requirement[2] as Completed
-
Quest - Mark Your_Quest as Completed
-
Hero - Create <Reward> and give it to (Triggering unit)
This trigger will fire only once you have killed 5 gnolls. Then whenever your hero gets back to quest giver, the whole quest will be marked as completed and you will get your reward.
Variables used:
Your_Quest => "Quest" variable, it's needed so you update that quest
Quest_Count => "Integer" variable, it's needed so you can keep check of how many gnolls have been slain.
Quest_Requirement => A "Quest Requirement" array variable (check the "array" box in variable editor). So we can easily edit requirements.