From 86c73804a3515789f57dab0a5341a99699cea621 Mon Sep 17 00:00:00 2001 From: claywar Date: Mon, 2 Sep 2024 10:45:17 -0400 Subject: [PATCH] Fix issues identified from TQuest definition --- scripts/quests/ahtUrhgan/Olduum.lua | 12 ++++++------ .../quests/otherAreas/RQ4_His_Name_is_Valgeir.lua | 2 +- scripts/quests/windurst/Overnight_Delivery.lua | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/quests/ahtUrhgan/Olduum.lua b/scripts/quests/ahtUrhgan/Olduum.lua index c9c50803db0..e890c2614b4 100644 --- a/scripts/quests/ahtUrhgan/Olduum.lua +++ b/scripts/quests/ahtUrhgan/Olduum.lua @@ -20,8 +20,8 @@ local keyItems = xi.ki.ELECTROLOCOMOTIVE, } -quest.hasKeyItem = function(player) - for i, v in pairs(keyItems) do +local hasQuestKeyItem = function(player) + for _, v in pairs(keyItems) do if player:hasKeyItem(v) then return true end @@ -68,7 +68,7 @@ quest.sections = ['Dkhaaya'] = { onTrigger = function(player, npc) - if quest.hasKeyItem(player) then + if hasQuestKeyItem(player) then return quest:progressEvent(6) else return quest:event(5) @@ -94,7 +94,7 @@ quest.sections = onTrade = function(player, npc, trade) if not player:hasItem(xi.item.OLDUUM_RING) and - not quest.hasKeyItem(player) and + not hasQuestKeyItem(player) and npcUtil.tradeHasExactly(trade, xi.item.PICKAXE) then if math.random(1, 10) > 5 then @@ -135,7 +135,7 @@ quest.sections = ['Dkhaaya'] = { onTrigger = function(player, npc) - if quest.hasKeyItem(player) then + if hasQuestKeyItem(player) then return quest:progressEvent(8) elseif player:hasItem(xi.item.OLDUUM_RING) or @@ -202,7 +202,7 @@ quest.sections = onTrade = function(player, npc, trade) if not player:hasItem(xi.item.OLDUUM_RING) and - not quest.hasKeyItem(player) and + not hasQuestKeyItem(player) and npcUtil.tradeHasExactly(trade, xi.item.PICKAXE) then if math.random(1, 10) > 5 then diff --git a/scripts/quests/otherAreas/RQ4_His_Name_is_Valgeir.lua b/scripts/quests/otherAreas/RQ4_His_Name_is_Valgeir.lua index 83d3f9cf9c5..1a994cbf762 100644 --- a/scripts/quests/otherAreas/RQ4_His_Name_is_Valgeir.lua +++ b/scripts/quests/otherAreas/RQ4_His_Name_is_Valgeir.lua @@ -72,7 +72,7 @@ quest.sections = if player:hasKeyItem(xi.ki.ARAGONEU_PIZZA) and -- No free ride after delivering Pizza. player:getZPos() > 38.5 and -- Pos check. - quest:setVar(player, 'Prog') == 0 -- Hasn't taken the free ride. + quest:getVar(player, 'Prog') == 0 -- Hasn't taken the free ride. then return quest:progressEvent(230) -- Free ride. 1 time only. Non-Mandatory step. end diff --git a/scripts/quests/windurst/Overnight_Delivery.lua b/scripts/quests/windurst/Overnight_Delivery.lua index 2bf745eb175..c86ee02e38f 100644 --- a/scripts/quests/windurst/Overnight_Delivery.lua +++ b/scripts/quests/windurst/Overnight_Delivery.lua @@ -185,7 +185,7 @@ quest.sections = [346] = function(player, csid, option, npc) player:delQuest(quest.areaId, quest.questId) player:delKeyItem(xi.ki.SMALL_BAG) - quest:setVar('dueDate', 0) + quest:setVar(player, 'dueDate', 0) quest:setVar(player, 'Prog', 256) end,