From 3ac8d8012ed0ed5ab1a894b3e68540988ea5a941 Mon Sep 17 00:00:00 2001 From: hookstar Date: Sat, 4 May 2024 10:07:37 -0500 Subject: [PATCH] [LUA] Checks for Halver trust in missions/quests --- scripts/missions/bastok/2_3_1_The_Emissary_Sandoria.lua | 9 +++++++-- scripts/missions/sandoria/2_3_0_Journey_Abroad.lua | 9 +++++++-- .../windurst/2_3_1_The_Three_Kingdoms_Sandoria.lua | 9 +++++++-- .../windurst/2_3_3_The_Three_Kingdoms_Sandoria2.lua | 9 +++++++-- scripts/quests/hiddenQuests/Trust_Halver.lua | 3 ++- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/scripts/missions/bastok/2_3_1_The_Emissary_Sandoria.lua b/scripts/missions/bastok/2_3_1_The_Emissary_Sandoria.lua index 1e9a52967f7..d11bc941d7a 100644 --- a/scripts/missions/bastok/2_3_1_The_Emissary_Sandoria.lua +++ b/scripts/missions/bastok/2_3_1_The_Emissary_Sandoria.lua @@ -30,9 +30,13 @@ mission.sections = local missionStatus = player:getMissionStatus(mission.areaId) if missionStatus == 3 then - local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 + if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then + local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 - return mission:progressEvent(501, { [7] = needsHalverTrust }) + return mission:progressEvent(501, { [7] = needsHalverTrust }) + else + return mission:progressEvent(501) + end elseif missionStatus > 3 then return mission:messageText(chateauID.text.HALVER_OFFSET + 266) end @@ -45,6 +49,7 @@ mission.sections = player:setMissionStatus(mission.areaId, 4) if + xi.settings.main.ENABLE_TRUST_QUESTS == 1 and not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO) then diff --git a/scripts/missions/sandoria/2_3_0_Journey_Abroad.lua b/scripts/missions/sandoria/2_3_0_Journey_Abroad.lua index 8de83c6a953..0e31473c689 100644 --- a/scripts/missions/sandoria/2_3_0_Journey_Abroad.lua +++ b/scripts/missions/sandoria/2_3_0_Journey_Abroad.lua @@ -111,9 +111,13 @@ mission.sections = if missionStatus == 11 then return mission:progressEvent(507) elseif missionStatus == 0 then - local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 + if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then + local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 - return mission:progressEvent(505, { [7] = needsHalverTrust }) + return mission:progressEvent(505, { [7] = needsHalverTrust }) + else + return mission:progressEvent(505) + end else return mission:progressEvent(532) end @@ -127,6 +131,7 @@ mission.sections = npcUtil.giveKeyItem(player, xi.ki.LETTER_TO_THE_CONSULS_SANDORIA) if + xi.settings.main.ENABLE_TRUST_QUESTS == 1 and not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO) then diff --git a/scripts/missions/windurst/2_3_1_The_Three_Kingdoms_Sandoria.lua b/scripts/missions/windurst/2_3_1_The_Three_Kingdoms_Sandoria.lua index 607b513c1fc..674c739238a 100644 --- a/scripts/missions/windurst/2_3_1_The_Three_Kingdoms_Sandoria.lua +++ b/scripts/missions/windurst/2_3_1_The_Three_Kingdoms_Sandoria.lua @@ -30,9 +30,13 @@ mission.sections = local missionStatus = player:getMissionStatus(mission.areaId) if missionStatus == 3 then - local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 + if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then + local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 - return mission:progressEvent(502, { [7] = needsHalverTrust }) + return mission:progressEvent(502, { [7] = needsHalverTrust }) + else + return mission:progressEvent(502) + end else return mission:messageText(chateauID.text.HALVER_OFFSET + 279) end @@ -45,6 +49,7 @@ mission.sections = player:setMissionStatus(mission.areaId, 4) if + xi.settings.main.ENABLE_TRUST_QUESTS == 1 and not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO) then diff --git a/scripts/missions/windurst/2_3_3_The_Three_Kingdoms_Sandoria2.lua b/scripts/missions/windurst/2_3_3_The_Three_Kingdoms_Sandoria2.lua index 045904146d2..564cc99b80c 100644 --- a/scripts/missions/windurst/2_3_3_The_Three_Kingdoms_Sandoria2.lua +++ b/scripts/missions/windurst/2_3_3_The_Three_Kingdoms_Sandoria2.lua @@ -29,9 +29,13 @@ mission.sections = local missionStatus = player:getMissionStatus(mission.areaId) if missionStatus == 8 then - local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 + if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then + local needsHalverTrust = (not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO)) and 1 or 0 - return mission:progressEvent(504, { [7] = needsHalverTrust }) + return mission:progressEvent(504, { [7] = needsHalverTrust }) + else + return mission:progressEvent(504) + end else return mission:messageText(chateauID.text.HALVER_OFFSET + 279) end @@ -44,6 +48,7 @@ mission.sections = player:setMissionStatus(mission.areaId, 9) if + xi.settings.main.ENABLE_TRUST_QUESTS == 1 and not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO) then diff --git a/scripts/quests/hiddenQuests/Trust_Halver.lua b/scripts/quests/hiddenQuests/Trust_Halver.lua index 3dc68d8f46b..4d0ca8eb16d 100644 --- a/scripts/quests/hiddenQuests/Trust_Halver.lua +++ b/scripts/quests/hiddenQuests/Trust_Halver.lua @@ -8,7 +8,8 @@ quest.sections = { { check = function(player, questVars, vars) - return not player:hasSpell(xi.magic.spell.HALVER) and + return xi.settings.main.ENABLE_TRUST_QUESTS == 1 and + not player:hasSpell(xi.magic.spell.HALVER) and not player:findItem(xi.item.CIPHER_OF_HALVERS_ALTER_EGO) and player:hasCompletedMission(xi.mission.log_id.ROV, xi.mission.id.rov.THE_PATH_UNTRAVELED) end,