From 4b9eae916a295781adea3db2a66c4dca0c6816ae Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 19 Jan 2025 22:58:14 +0100 Subject: [PATCH] Add logic for using items on the Spotted Mudpuppy in 'Factual Folklore' --- .../927_Factual Folklore.json | 9 ++++++--- QuestPaths/quest-v1.json | 9 ++++++--- .../Converter/CombatItemUseConditionConverter.cs | 1 + Questionable.Model/Questing/ECombatItemUseCondition.cs | 1 + Questionable/Controller/CombatModules/ItemUseModule.cs | 4 ++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/B9-Coerthas Central Highlands, Whitebrim Front/927_Factual Folklore.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/B9-Coerthas Central Highlands, Whitebrim Front/927_Factual Folklore.json index b9550d58..924c6a9d 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/B9-Coerthas Central Highlands, Whitebrim Front/927_Factual Folklore.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/B9-Coerthas Central Highlands, Whitebrim Front/927_Factual Folklore.json @@ -35,10 +35,13 @@ "Z": 89.58569 }, "TerritoryId": 155, - "InteractionType": "Instruction", - "Comment": "Use Quest item on enemy to weaken it first", - "$": "Status Effects: 22 (HP Penalty) + 62 (Damage Down)", + "InteractionType": "Combat", "EnemySpawnType": "AfterInteraction", + "CombatItemUse": { + "ItemId": 2000961, + "Condition": "MissingStatus", + "Value": 22 + }, "ComplexCombatData": [ { "DataId": 2196 diff --git a/QuestPaths/quest-v1.json b/QuestPaths/quest-v1.json index 99105c93..f0f82637 100644 --- a/QuestPaths/quest-v1.json +++ b/QuestPaths/quest-v1.json @@ -183,7 +183,8 @@ "null" ], "description": "The Item to use", - "exclusiveMinimum": 0 + "exclusiveMinimum": 0, + "maximum": 2010000 }, "SkipConditions": { "type": "object", @@ -648,13 +649,15 @@ "type": "object", "properties": { "ItemId": { - "type": "integer" + "type": "integer", + "maximum": 2010000 }, "Condition": { "type": "string", "enum": [ "Incapacitated", - "Health%" + "Health%", + "MissingStatus" ] }, "Value": { diff --git a/Questionable.Model/Questing/Converter/CombatItemUseConditionConverter.cs b/Questionable.Model/Questing/Converter/CombatItemUseConditionConverter.cs index 1b4086ff..deadc4f6 100644 --- a/Questionable.Model/Questing/Converter/CombatItemUseConditionConverter.cs +++ b/Questionable.Model/Questing/Converter/CombatItemUseConditionConverter.cs @@ -9,5 +9,6 @@ public sealed class CombatItemUseConditionConverter() : EnumConverterUseItem(_combatData.CombatItemUse.ItemId); } _continueAt = DateTime.Now.AddSeconds(2); @@ -147,6 +148,9 @@ internal sealed class ItemUseModule : ICombatModule if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.HealthPercent) return (100f * battleChara->Health / battleChara->MaxHealth) < _combatData.CombatItemUse.Value; + + if (_combatData.CombatItemUse.Condition == ECombatItemUseCondition.MissingStatus) + return !battleChara->StatusManager.HasStatus((uint)_combatData.CombatItemUse.Value); } return false;