- Joined
- Oct 25, 2018
- Messages
- 108
How can I create a quest where the main requirement is to kill 10 villagers?
Repeatable, multiplayer shared or for each player an own?
Single player non repeatable quest:
Init VillagerQuest
Events
Map initialization
Conditions
Actions
Quest - Create a Required quest titled Kill Villagers with the description Lord darklem does w..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
Set Quest_KillVillagers = (Last created quest)
Quest - Create a quest requirement for (Last created quest) with the description 0/10 Villagers slain
Set Quest_KillVillagersReq = (Last created quest requirement)
Kill VillagerQuest
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Dorfbewohner (Männlich 2)
(Unit-type of (Triggering unit)) Equal to Dorfbewohnerin (Weiblich)
(Unit-type of (Triggering unit)) Equal to Kind
(Unit-type of (Triggering unit)) Equal to Kind (2)
(Unit-type of (Triggering unit)) Equal to Dorfbewohner (Männlich)
Actions
Quest - Change the description of Quest_KillVillagersReq to ((String((Execution count of (This trigger)))) + (/10 + slain villagers))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Execution count of (This trigger)) Greater than or equal to 10
Then - Actions
Trigger - Turn off (This trigger)
Quest - Display to (All players) the Quest Completed message: Kill Villagers comp...
Quest - Mark Quest_KillVillagersReq as Completed
Quest - Mark Quest_KillVillagers as Completed
Else - Actions
Each trigger has an unique execution counter without you doing anything.
Execution counter increases before actions are executed, Therefore if conditions are true.
In my example if any default village unit dies the kill quest trigger executes -> execution counter + 1. Then I update the quest requierment text to execution counter of 10.
when the trigger executed 10 times the quest is completed and the trigger disables itself.
Thanks!!Here you have one