From 7abd925621b535159cd698ffd2c3c4c88c429e30 Mon Sep 17 00:00:00 2001 From: Aeshur Date: Fri, 5 Jun 2026 19:29:38 -0400 Subject: [PATCH] [lua] Convert The Tigress Stirs + Tigress Strikes to IF --- scripts/globals/quests.lua | 4 +- .../crystalWar/Better_Part_of_Valor.lua | 8 +- .../quests/crystalWar/The_Tigress_Stirs.lua | 90 ++++++++++++ .../quests/crystalWar/The_Tigress_Strikes.lua | 133 ++++++++++++++++++ .../Fort_Karugo-Narugo_[S]/DefaultActions.lua | 5 + .../Fort_Karugo-Narugo_[S]/mobs/War_Lynx.lua | 11 -- .../npcs/Rotih_Moalghett.lua | 26 ---- .../zones/Fort_Karugo-Narugo_[S]/npcs/qm4.lua | 37 ----- .../zones/West_Sarutabaruta_[S]/npcs/qm4.lua | 19 --- .../Windurst_Waters_[S]/DefaultActions.lua | 1 + .../npcs/Dhea_Prandoleh.lua | 49 ------- .../npcs/Door_Acolyte_Hostel_down.lua | 12 +- 12 files changed, 235 insertions(+), 160 deletions(-) create mode 100644 scripts/quests/crystalWar/The_Tigress_Stirs.lua create mode 100644 scripts/quests/crystalWar/The_Tigress_Strikes.lua create mode 100644 scripts/zones/Fort_Karugo-Narugo_[S]/DefaultActions.lua delete mode 100644 scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Rotih_Moalghett.lua delete mode 100644 scripts/zones/Fort_Karugo-Narugo_[S]/npcs/qm4.lua delete mode 100644 scripts/zones/West_Sarutabaruta_[S]/npcs/qm4.lua delete mode 100644 scripts/zones/Windurst_Waters_[S]/npcs/Dhea_Prandoleh.lua diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 7940603d12f..1881224ca15 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -723,8 +723,8 @@ xi.quest.id = HAMMERING_HEARTS = 14, -- + Converted GIFTS_OF_THE_GRIFFON = 15, -- + Converted CLAWS_OF_THE_GRIFFON = 16, -- + Converted - THE_TIGRESS_STIRS = 17, -- + - THE_TIGRESS_STRIKES = 18, + THE_TIGRESS_STIRS = 17, -- + Converted + THE_TIGRESS_STRIKES = 18, -- + Converted LIGHT_IN_THE_DARKNESS = 19, -- + Converted BURDEN_OF_SUSPICION = 20, EVIL_AT_THE_INLET = 21, diff --git a/scripts/quests/crystalWar/Better_Part_of_Valor.lua b/scripts/quests/crystalWar/Better_Part_of_Valor.lua index a1cb26e9324..3aba9fbd473 100644 --- a/scripts/quests/crystalWar/Better_Part_of_Valor.lua +++ b/scripts/quests/crystalWar/Better_Part_of_Valor.lua @@ -20,16 +20,14 @@ quest.sections = { { check = function(player, status, vars) - return status == xi.questStatus.QUEST_AVAILABLE + return status == xi.questStatus.QUEST_AVAILABLE and + xi.wotg.helpers.hasCompletedFirstQuest(player) end, [xi.zone.NORTH_GUSTABERG_S] = { onZoneIn = function(player, prevZone) - if - prevZone == xi.zone.BASTOK_MARKETS_S and - player:getCampaignAllegiance() > 0 - then + if prevZone == xi.zone.BASTOK_MARKETS_S then return 1 end end, diff --git a/scripts/quests/crystalWar/The_Tigress_Stirs.lua b/scripts/quests/crystalWar/The_Tigress_Stirs.lua new file mode 100644 index 00000000000..463f512345f --- /dev/null +++ b/scripts/quests/crystalWar/The_Tigress_Stirs.lua @@ -0,0 +1,90 @@ +----------------------------------- +-- The Tigress Stirs +----------------------------------- +-- !addquest 7 17 +-- Dhea Prandoleh : !pos 1 -1 15 94 +-- Door:Acolyte Hostel (down) : !pos 124 -3 222 94 +-- qm4 (West Sarutabaruta [S]) : !pos 150 -39 331 95 +----------------------------------- + +local quest = Quest:new(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) + +quest.reward = +{ + item = xi.item.HI_ELIXIR, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + xi.wotg.helpers.hasCompletedFirstQuest(player) + end, + + [xi.zone.WINDURST_WATERS_S] = + { + ['Dhea_Prandoleh'] = + { + onTrigger = function(player, npc) + return quest:progressEvent(128) + end, + }, + + onEventFinish = + { + [128] = function(player, csid, option, npc) + quest:begin(player) + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.WEST_SARUTABARUTA_S] = + { + ['qm4'] = + { + onTrigger = function(player, npc) + if not player:hasKeyItem(xi.ki.SMALL_STARFRUIT) then + return quest:keyItem(xi.ki.SMALL_STARFRUIT) + end + end, + }, + }, + + [xi.zone.WINDURST_WATERS_S] = + { + ['Dhea_Prandoleh'] = + { + onTrigger = function(player, npc) + return quest:event(160) + end, + }, + + ['Door_Acolyte_Hostel_down'] = + { + onTrigger = function(player, npc) + if player:hasKeyItem(xi.ki.SMALL_STARFRUIT) then + return quest:progressEvent(129) + end + end, + }, + + onEventFinish = + { + [129] = function(player, csid, option, npc) + if quest:complete(player) then + player:delKeyItem(xi.ki.SMALL_STARFRUIT) + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/quests/crystalWar/The_Tigress_Strikes.lua b/scripts/quests/crystalWar/The_Tigress_Strikes.lua new file mode 100644 index 00000000000..1d5eaaa223f --- /dev/null +++ b/scripts/quests/crystalWar/The_Tigress_Strikes.lua @@ -0,0 +1,133 @@ +----------------------------------- +-- The Tigress Strikes +----------------------------------- +-- !addquest 7 18 +-- Dhea Prandoleh : !pos 1 -1 15 94 +-- Rotih Moalghett : !pos -64 -75 4 96 +-- qm4 (Fort Karugo-Narugo [S]) : !pos 208 -30 54 96 +----------------------------------- +local fortKarugoID = zones[xi.zone.FORT_KARUGO_NARUGO_S] +----------------------------------- + +local quest = Quest:new(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) + +quest.reward = +{ + item = xi.item.STAR_GLOBE, + title = xi.title.AJIDO_MARUJIDOS_MINDER, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:hasCompletedQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) + end, + + [xi.zone.WINDURST_WATERS_S] = + { + ['Dhea_Prandoleh'] = + { + onTrigger = function(player, npc) + return quest:progressEvent(133) + end, + }, + + onEventFinish = + { + [133] = function(player, csid, option, npc) + quest:begin(player) + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.FORT_KARUGO_NARUGO_S] = + { + ['Rotih_Moalghett'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 0 then + return quest:progressEvent(101) + else + return quest:event(104) + end + end, + }, + + ['qm4'] = + { + onTrigger = function(player, npc) + local prog = quest:getVar(player, 'Prog') + + if prog == 1 then + return quest:progressEvent(102) + elseif quest:getVar(player, 'LynxKilled') == 1 then + return quest:progressEvent(103) + elseif + prog == 2 and + not GetMobByID(fortKarugoID.mob.TIGRESS_STRIKES_WAR_LYNX):isSpawned() + then + SpawnMob(fortKarugoID.mob.TIGRESS_STRIKES_WAR_LYNX):updateClaim(player) + return quest:noAction() + end + end, + }, + + ['War_Lynx'] = + { + onMobDeath = function(mob, player, optParams) + if mob:getID() == fortKarugoID.mob.TIGRESS_STRIKES_WAR_LYNX then + quest:setVar(player, 'LynxKilled', 1) + end + end, + }, + + onEventFinish = + { + [101] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 1) + end, + + [102] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 2) + end, + + [103] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 3) + end, + }, + }, + + [xi.zone.WINDURST_WATERS_S] = + { + ['Dhea_Prandoleh'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 3 then + return quest:progressEvent(134) + else + return quest:event(135) + end + end, + }, + + onEventFinish = + { + [134] = function(player, csid, option, npc) + if quest:complete(player) then + player:needToZone(true) + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Fort_Karugo-Narugo_[S]/DefaultActions.lua b/scripts/zones/Fort_Karugo-Narugo_[S]/DefaultActions.lua new file mode 100644 index 00000000000..0fdb1008253 --- /dev/null +++ b/scripts/zones/Fort_Karugo-Narugo_[S]/DefaultActions.lua @@ -0,0 +1,5 @@ +local ID = zones[xi.zone.FORT_KARUGO_NARUGO_S] + +return { + ['qm4'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY }, +} diff --git a/scripts/zones/Fort_Karugo-Narugo_[S]/mobs/War_Lynx.lua b/scripts/zones/Fort_Karugo-Narugo_[S]/mobs/War_Lynx.lua index 82994bed290..6271057f16a 100644 --- a/scripts/zones/Fort_Karugo-Narugo_[S]/mobs/War_Lynx.lua +++ b/scripts/zones/Fort_Karugo-Narugo_[S]/mobs/War_Lynx.lua @@ -3,8 +3,6 @@ -- Mob: War Lynx -- The Tigress Strikes Fight ----------------------------------- -local ID = zones[xi.zone.FORT_KARUGO_NARUGO_S] ------------------------------------ ---@type TMobEntity local entity = {} @@ -12,13 +10,4 @@ entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.IDLE_DESPAWN, 300) end -entity.onMobDeath = function(mob, player, optParams) - if - mob:getID() == ID.mob.TIGRESS_STRIKES_WAR_LYNX and - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_ACCEPTED - then - player:setCharVar('WarLynxKilled', 1) - end -end - return entity diff --git a/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Rotih_Moalghett.lua b/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Rotih_Moalghett.lua deleted file mode 100644 index 0f72317bd0b..00000000000 --- a/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Rotih_Moalghett.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------ --- Area: Fort Karugo Narugo [S] --- NPC: Rotih_Moalghett --- Type: Quest --- !pos -64 -75 4 96 ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrigger = function(player, npc) - if player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_ACCEPTED then - if player:getCharVar('TigressStrikesProg') == 1 then - player:startEvent(104) - else - player:startEvent(101) - end - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 101 then - player:setCharVar('TigressStrikesProg', 1) - end -end - -return entity diff --git a/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/qm4.lua b/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/qm4.lua deleted file mode 100644 index 43f290a5a8d..00000000000 --- a/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/qm4.lua +++ /dev/null @@ -1,37 +0,0 @@ ------------------------------------ --- Area: Fort Karugo Narugo [S] --- NPC: ??? --- Type: Quest --- !pos 208 -30 54 96 ------------------------------------ -local ID = zones[xi.zone.FORT_KARUGO_NARUGO_S] ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrigger = function(player, npc) - local ttsStat = player:getCharVar('TigressStrikesProg') - - if ttsStat == 1 then - player:startEvent(102) - elseif player:getCharVar('WarLynxKilled') == 1 then - player:startEvent(103) - elseif - ttsStat == 2 and - not GetMobByID(ID.mob.TIGRESS_STRIKES_WAR_LYNX):isSpawned() - then - SpawnMob(ID.mob.TIGRESS_STRIKES_WAR_LYNX):updateClaim(player) - else - player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY) - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 102 then - player:setCharVar('TigressStrikesProg', 2) - elseif csid == 103 then - player:setCharVar('TigressStrikesProg', 3) - end -end - -return entity diff --git a/scripts/zones/West_Sarutabaruta_[S]/npcs/qm4.lua b/scripts/zones/West_Sarutabaruta_[S]/npcs/qm4.lua deleted file mode 100644 index ea4c6c63c97..00000000000 --- a/scripts/zones/West_Sarutabaruta_[S]/npcs/qm4.lua +++ /dev/null @@ -1,19 +0,0 @@ ------------------------------------ --- Area: West Sarutabaruta [S] --- NPC: qm4 --- Note: Involved in quest "The Tigress Stirs" --- !pos 150 -39 331 95 ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrigger = function(player, npc) - if - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) == xi.questStatus.QUEST_ACCEPTED and - not player:hasKeyItem(xi.ki.SMALL_STARFRUIT) - then - npcUtil.giveKeyItem(player, xi.ki.SMALL_STARFRUIT) - end -end - -return entity diff --git a/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua b/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua index a84c2cc1a5d..deb90c3043b 100644 --- a/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua +++ b/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua @@ -11,6 +11,7 @@ return { ['Churacoco'] = { event = 434 }, ['Corbrere'] = { event = 414 }, ['Dallus-Mallus'] = { event = 323 }, + ['Dhea_Prandoleh'] = { event = 136 }, ['Eih_Lhogotan'] = { event = 407 }, ['Ekki-Mokki'] = { event = 409 }, ['Emhi_Tchaoryo'] = { event = 307 }, diff --git a/scripts/zones/Windurst_Waters_[S]/npcs/Dhea_Prandoleh.lua b/scripts/zones/Windurst_Waters_[S]/npcs/Dhea_Prandoleh.lua deleted file mode 100644 index 66b64207192..00000000000 --- a/scripts/zones/Windurst_Waters_[S]/npcs/Dhea_Prandoleh.lua +++ /dev/null @@ -1,49 +0,0 @@ ------------------------------------ --- Area: Windurst Waters (S) --- NPC: Dhea Prandoleh --- !pos 1 -1 15 94 ------------------------------------ -local ID = zones[xi.zone.WINDURST_WATERS_S] ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrigger = function(player, npc) - if - player:getCampaignAllegiance() > 0 and - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) == xi.questStatus.QUEST_AVAILABLE - then - player:startEvent(128) - elseif player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) == xi.questStatus.QUEST_ACCEPTED then - player:startEvent(160) - elseif - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) == xi.questStatus.QUEST_COMPLETED and - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_AVAILABLE - then - player:startEvent(133) - elseif player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_ACCEPTED then - if player:getCharVar('TigressStrikesProg') < 3 then - player:startEvent(135) - elseif player:getCharVar('TigressStrikesProg') == 3 then - player:startEvent(134) - end - else - player:startEvent(136) - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 128 then - player:addQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) - elseif csid == 133 then - player:addQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) - elseif csid == 134 then - player:addItem(xi.item.STAR_GLOBE) - player:messageSpecial(ID.text.ITEM_OBTAINED, xi.item.STAR_GLOBE) - player:completeQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) - player:needToZone(true) - player:addTitle(xi.title.AJIDO_MARUJIDOS_MINDER) - end -end - -return entity diff --git a/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua b/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua index 914a46c8fe5..2e78f86107a 100644 --- a/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua +++ b/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua @@ -10,11 +10,6 @@ local entity = {} entity.onTrigger = function(player, npc) if - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) == xi.questStatus.QUEST_ACCEPTED and - player:hasKeyItem(xi.ki.SMALL_STARFRUIT) - then - player:startEvent(129) - elseif player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_COMPLETED and player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_AVAILABLE and player:hasCompletedMission(xi.mission.log_id.WOTG, xi.mission.id.wotg.BACK_TO_THE_BEGINNING) @@ -28,12 +23,7 @@ entity.onTrigger = function(player, npc) end entity.onEventFinish = function(player, csid, option, npc) - if csid == 129 then - player:addItem(xi.item.HI_ELIXIR) - player:messageSpecial(ID.text.ITEM_OBTAINED, 4144) - player:delKeyItem(xi.ki.SMALL_STARFRUIT) - player:completeQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) - elseif csid == 151 then + if csid == 151 then player:addQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) end end