From 1c4b923a61b9cc63167823e2c8cc49dbbd6463ae Mon Sep 17 00:00:00 2001 From: cknight828 <128895471+cknight828@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:11:53 +0900 Subject: [PATCH] Backport #76478 --- data/json/npcs/missiondef.json | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/data/json/npcs/missiondef.json b/data/json/npcs/missiondef.json index 20c9890c7462a..2518eb1868d3c 100644 --- a/data/json/npcs/missiondef.json +++ b/data/json/npcs/missiondef.json @@ -34,8 +34,8 @@ "id": "MISSION_GET_INHALER", "type": "mission_definition", "name": { "str": "Find Inhaler" }, - "goal": "MGOAL_FIND_ITEM", - "item": "inhaler", + "goal": "MGOAL_CONDITION", + "goal_condition": { "u_has_item": "inhaler" }, "difficulty": 2, "value": 150000, "urgent": true, @@ -96,7 +96,21 @@ ] }, "end": { - "effect": [ { "npc_lose_effect": "infection" }, "stop_guard", { "set_npc_rule": "investigate_noises" }, "npc_thankful" ] + "effect": [ + { "npc_lose_effect": "infection" }, + "stop_guard", + { "set_npc_rule": "investigate_noises" }, + "npc_thankful", + { + "if": { "u_has_item": "antibiotics" }, + "then": { "u_consume_item": "antibiotics", "popup": true }, + "else": { + "if": { "u_has_item": "strong_antibiotic" }, + "then": { "u_consume_item": "strong_antibiotic", "popup": true }, + "else": { "u_consume_item": "panacea", "popup": true } + } + } + ] }, "fail": { "effect": "npc_die" } },