Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Added Omens Quest (BLU AF2) #361

Merged
merged 2 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/globals/bcnm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ local battlefields = {
[64] = { -- NAVUKGO EXECUTION CHAMBER
-- { 0, 1120, 0}, -- Tough Nut to Crack (ISNM)
-- { 1, 1121, 0}, -- Happy Caster (ISNM)
-- { 2, 1122, 0}, -- Omens (Quest)
{ 2, 1122, 0}, -- Omens (BLU AF2)
{ 3, 1123, 2333}, -- Achieving True Power (PUP LB5)
{ 4, 1124, 0}, -- Shield of Diplomacy (TOAU22)
},
Expand Down Expand Up @@ -573,6 +573,7 @@ function checkReqs(player, npc, bfid, registrant)
[1090] = function() return ( player:hasKeyItem(tpz.ki.TOGGLE_SWITCH) ) end, -- Quest: Puppetmaster Blues
[1091] = function() return ( mjob == tpz.job.COR and mlvl >= 66 ) end, -- Quest: Breaking the Bonds of Fate (COR LB5)
[1092] = function() return ( toau == mi.toau.LEGACY_OF_THE_LOST ) end, -- TOAU35: Legacy of the Lost
[1122] = function() return ( player:getQuestStatus(AHT_URHGAN,tpz.quest.id.ahtUrhgan.OMENS) == QUEST_ACCEPTED and player:getCharVar('OmensProgress') == 1 ) end, -- Quest: Omens (BLU AF Quest 2)
[1123] = function() return ( mjob == tpz.job.PUP and mlvl >= 66 ) end, -- Quest: Achieving True Power (PUP LB5)
[1124] = function() return ( toau == mi.toau.SHIELD_OF_DIPLOMACY and toauStat == 2 ) end, -- TOAU22: Shield of Diplomacy
[1154] = function() return ( mjob == tpz.job.BLU and mlvl >= 66 ) end, -- Quest: The Beast Within (BLU LB5)
Expand Down
4 changes: 2 additions & 2 deletions scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ tpz.quest.id =
TOTOROONS_TREASURE_HUNT = 18,
WHAT_FRIENDS_ARE_FOR = 19,
ROCK_BOTTOM = 20,
BEGINNINGS = 21,
OMENS = 22,
BEGINNINGS = 21, -- + --
OMENS = 22, -- + --
TRANSFORMATIONS = 23,
EQUIPPED_FOR_ALL_OCCASIONS = 24, -- + --
NAVIGATING_THE_UNFRIENDLY_SEAS = 25, -- + --
Expand Down
46 changes: 41 additions & 5 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Lathuya.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,53 @@
-- Area: Aht Urhgan Whitegate
-- NPC: Lathuya
-- Standard Info NPC
-- Involved in quests: Omens
-- !pos -95.081 -6.000 31.638 50
-----------------------------------
require("scripts/globals/quests")
require("scripts/globals/npc_util")
-----------------------------------

function onTrade(player,npc,trade)
function onTrade(player, npc, trade)
end

function onTrigger(player,npc)
player:startEvent(770)
function onTrigger(player, npc)
local omensProgress = player:getCharVar("OmensProgress")
local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS)

-- OMENS
if omens >= QUEST_ACCEPTED then
if omensProgress == 3 then
player:startEvent(714) -- Tells Master location
elseif omensProgress == 4 then
player:startEvent(715) -- Reminder of master location
elseif omensProgress == 5 then
player:startEvent(716) -- Master spoken to
elseif omens == QUEST_COMPLETED then
player:startEvent(771) -- Default dialog
end

-- DEFAULT DIALOG
else
player:startEvent(770)
end
end

function onEventUpdate(player,csid,option)
function onEventUpdate(player, csid, option)
end

function onEventFinish(player,csid,option)
function onEventFinish(player, csid, option)
local omensProgress = player:getCharVar("OmensProgress")

-- OMENS
if csid == 714 and omensProgress == 3 then
player:setCharVar("OmensProgress", 4)
elseif csid == 716 and omensProgress == 5 then
npcUtil.completeQuest(player, AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS, {
item = 15684,
title = tpz.title.IMMORTAL_LION,
var = { OmensProgress }
})
player:delKeyItem(tpz.ki.SEALED_IMMORTAL_ENVELOPE)
end
end
137 changes: 87 additions & 50 deletions scripts/zones/Aht_Urhgan_Whitegate/npcs/Waoud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Area: Aht Urhgan Whitegate
-- NPC: Waoud
-- Standard Info NPC
-- Involved in quests: An Empty Vessel (BLU flag), Beginnings (BLU AF1)
-- Involved in quests: An Empty Vessel (BLU Unlock), Beginnings (BLU AF Quest 1), Omens (BLU AF Quest 2)
-- !pos 65 -6 -78 50
-----------------------------------
require("scripts/globals/settings")
Expand All @@ -13,33 +13,34 @@ require("scripts/globals/npc_util")
local ID = require("scripts/zones/Aht_Urhgan_Whitegate/IDs")
-----------------------------------

function onTrade(player,npc,trade)
local anEmptyVessel = player:getQuestStatus(AHT_URHGAN,tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL)
function onTrade(player, npc, trade)
local anEmptyVessel = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL)
local anEmptyVesselProgress = player:getCharVar("AnEmptyVesselProgress")
local StoneID = player:getCharVar("EmptyVesselStone")

-- AN EMPTY VESSEL (dangruf stone, valkurm sunsand, or siren's tear)
if anEmptyVessel == QUEST_ACCEPTED and anEmptyVesselProgress == 3 and trade:hasItemQty(StoneID,1) and trade:getItemCount() == 1 then
player:startEvent(67,StoneID) -- get the stone to Aydeewa
if anEmptyVessel == QUEST_ACCEPTED and anEmptyVesselProgress == 3 and trade:hasItemQty(StoneID, 1) and trade:getItemCount() == 1 then
player:startEvent(67, StoneID) -- get the stone to Aydeewa
end
end

function onTrigger(player,npc)
local anEmptyVessel = player:getQuestStatus(AHT_URHGAN,tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL)
function onTrigger(player, npc)
local anEmptyVessel = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL)
local anEmptyVesselProgress = player:getCharVar("AnEmptyVesselProgress")
local divinationReady = vanaDay() > player:getCharVar("LastDivinationDay")
local beginnings = player:getQuestStatus(AHT_URHGAN,tpz.quest.id.ahtUrhgan.BEGINNINGS)
local beginnings = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS)
local omens = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS)
local waoudNeedToZone = player:getLocalVar("WaoudNeedToZone")

-- AN EMPTY VESSEL
if ENABLE_TOAU == 1 and anEmptyVessel == QUEST_AVAILABLE and anEmptyVesselProgress <= 1 and player:getMainLvl() >= ADVANCED_JOB_LEVEL then
if divinationReady then
player:setCharVar("SuccessfullyAnswered",0)
player:startEvent(60,player:getGil()) -- you must answer these 10 questions
player:startEvent(60, player:getGil()) -- you must answer these 10 questions
else
player:startEvent(63) -- you failed, and must wait a gameday to try again
end
elseif anEmptyVesselProgress == 2 then
if divinationReady and not player:needToZone() then
if divinationReady and waoudNeedToZone == 0 then
player:startEvent(65) -- gives you a clue about the stone he wants (specific conditions)
else -- Have not zoned, or have not waited, or both.
player:startEvent(64) -- you have succeeded, but you need to wait a gameday and zone
Expand All @@ -53,13 +54,13 @@ function onTrigger(player,npc)

-- BEGINNINGS
elseif anEmptyVessel == QUEST_COMPLETED and beginnings == QUEST_AVAILABLE and player:getCurrentMission(TOAU) > tpz.mission.id.toau.IMMORTAL_SENTRIES
and player:getMainJob() == tpz.job.BLU and player:getMainLvl() >= ADVANCED_JOB_LEVEL then
and player:getMainJob() == tpz.job.BLU and player:getMainLvl() >= AF1_QUEST_LEVEL then
if not divinationReady then
player:startEvent(63)
elseif player:needToZone() then
player:startEvent(78,player:getGil()) -- dummy questions, costs you 1000 gil
elseif waoudNeedToZone == 1 then
player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil
else
player:startEvent(705,player:getGil()) -- start AF1 quest
player:startEvent(705, player:getGil()) -- start AF1 quest
end
elseif beginnings == QUEST_ACCEPTED then
local brand1 = player:hasKeyItem(tpz.ki.BRAND_OF_THE_SPRINGSERPENT)
Expand All @@ -70,7 +71,25 @@ function onTrigger(player,npc)
if brand1 and brand2 and brand3 and brand4 and brand5 then
player:startEvent(707) -- reward immortal's scimitar
else
player:startEvent(706,player:getGil()) -- clue about the five staging points, costs you 1000 gil
player:startEvent(706, player:getGil()) -- clue about the five staging points, costs you 1000 gil
end

-- OMENS
elseif beginnings == QUEST_COMPLETED and omens == QUEST_AVAILABLE and player:getMainJob() == tpz.job.BLU and player:getMainLvl() >= AF2_QUEST_LEVEL then
if not divinationReady then
player:startEvent(63)
elseif waoudNeedToZone == 1 then
player:startEvent(78, player:getGil()) -- dummy questions, costs you 1000 gil
else
player:startEvent(710) -- start AF2 quest
end
elseif omens == QUEST_ACCEPTED then
if player:getCharVar("OmensProgress") == 1 then
player:startEvent(711, player:getGil()) -- clue about bcnm location, costs you 1000 gil
elseif player:getCharVar("OmensProgress") == 2 then
player:startEvent(712) -- gives keyitem to claim armour piece
elseif player:getCharVar("OmensProgress") >= 3 then
player:startEvent(713, player:getGil()) -- clue about location of armour piece, costs you 1000 gil
end

-- DEFAULT DIALOG
Expand All @@ -79,84 +98,102 @@ function onTrigger(player,npc)
end
end

function onEventUpdate(player,csid,option)
function onEventUpdate(player, csid, option)
-- AN EMPTY VESSEL
if csid == 60 then
local success = player:getCharVar("SuccessfullyAnswered")
local success = player:getLocalVar("SuccessfullyAnswered")

-- record correct answers
if option < 40 then
local correctAnswers = {2,6,9,12,13,18,21,24,26,30}
for k,v in pairs(correctAnswers) do
local correctAnswers = {2, 6, 9, 12, 13, 18, 21, 24, 26, 30}
for k, v in pairs(correctAnswers) do
if (v == option) then
player:setCharVar("SuccessfullyAnswered", success + 1)
player:setLocalVar("SuccessfullyAnswered", success + 1)
break
end
end

-- determine results
elseif option == 40 then
if success < 2 then player:updateEvent(player:getGil(),0,0,0,0,0,0,10) -- Springserpent
elseif success < 4 then player:updateEvent(player:getGil(),0,0,0,0,0,0,20) -- Stoneserpent
elseif success < 6 then player:updateEvent(player:getGil(),0,0,0,0,0,0,30) -- Galeserpent
elseif success < 8 then player:updateEvent(player:getGil(),0,0,0,0,0,0,40) -- Flameserpent
elseif success < 10 then player:updateEvent(player:getGil(),0,0,0,0,0,0,60) -- Skyserpent
if success < 2 then player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, 0, 10) -- Springserpent
elseif success < 4 then player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, 0, 20) -- Stoneserpent
elseif success < 6 then player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, 0, 30) -- Galeserpent
elseif success < 8 then player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, 0, 40) -- Flameserpent
elseif success < 10 then player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, 0, 60) -- Skyserpent
else
local rand = math.random(1,3)
switch (rand): caseof {
[1] = function (x) player:setCharVar("EmptyVesselStone",576) end, -- (576) Siren's Tear (576)
[2] = function (x) player:setCharVar("EmptyVesselStone",503) end, -- (502) Valkurm Sunsand (502)
[3] = function (x) player:setCharVar("EmptyVesselStone",553) end -- (553) Dangruf Stone (553)
[1] = function (x) player:setCharVar("EmptyVesselStone", 576) end, -- (576) Siren's Tear (576)
[2] = function (x) player:setCharVar("EmptyVesselStone", 503) end, -- (502) Valkurm Sunsand (502)
[3] = function (x) player:setCharVar("EmptyVesselStone", 553) end -- (553) Dangruf Stone (553)
}
player:setCharVar("SuccessfullyAnswered", 0)
player:updateEvent(player:getGil(),0,0,0,0,0,rand,70) -- all 5 serpents / success!
player:setLocalVar("SuccessfullyAnswered", 0)
player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, rand, 70) -- all 5 serpents / success!
end
end
elseif csid == 65 and option == 2 then
player:setCharVar("AnEmptyVesselProgress",3)
player:setCharVar("AnEmptyVesselProgress", 3)

-- BEGINNINGS
elseif csid == 78 and option == 40 then
local serpent = math.random(1,5) * 10
player:updateEvent(player:getGil(),0,0,0,0,0,0,serpent)
local serpent = math.random(1, 5) * 10
player:updateEvent(player:getGil(), 0, 0, 0, 0, 0, 0, serpent)

end
end

function onEventFinish(player,csid,option)
function onEventFinish(player, csid, option)
local beginnings = player:getQuestStatus(AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS)
local omensProgress = player:getCharVar("OmensProgress")

-- AN EMPTY VESSEL
if csid == 60 then
player:setLocalVar("SuccessfullyAnswered", 0)
if option == 0 then
player:setCharVar("AnEmptyVesselProgress", 1)
elseif option == 50 then
player:needToZone(true)
player:setCharVar("LastDivinationDay",vanaDay())
player:setCharVar("AnEmptyVesselProgress",2)
player:addQuest(AHT_URHGAN,tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL)
else
player:setCharVar("LastDivinationDay",vanaDay())
player:setCharVar("AnEmptyVesselProgress",1)
player:setLocalVar("waoudNeedToZone", 1)
player:setCharVar("LastDivinationDay", vanaDay())
player:setCharVar("AnEmptyVesselProgress", 2)
player:addQuest(AHT_URHGAN, tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL)
elseif player:getGil() >= 1000 then
player:setCharVar("LastDivinationDay", vanaDay())
player:setCharVar("AnEmptyVesselProgress", 1)
player:delGil(1000)
player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination.
end
elseif csid == 67 then -- Turn in stone, go to Aydeewa
player:setCharVar("AnEmptyVesselProgress",4)
player:setCharVar("AnEmptyVesselProgress", 4)
elseif csid == 69 and option == 1 then
player:needToZone(true)
player:setCharVar("LastDivinationDay",vanaDay())
player:setCharVar("BluAFBeginnings_Waoud",1)
player:setLocalVar("waoudNeedToZone", 1)
player:setCharVar("LastDivinationDay", vanaDay())
player:setCharVar("BluAFBeginnings_Waoud", 1)

-- BEGINNINGS
elseif csid == 78 and option == 1 then
player:setCharVar("LastDivinationDay",vanaDay())
elseif csid == 78 and option == 1 and player:getGil() >= 1000 then
player:setCharVar("LastDivinationDay", vanaDay())
player:delGil(1000)
player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination.
elseif csid == 705 and option == 1 then
player:addQuest(AHT_URHGAN,tpz.quest.id.ahtUrhgan.BEGINNINGS)
elseif csid == 706 and option == 1 then
player:addQuest(AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS)
elseif csid == 706 and option == 1 and player:getGil() >= 1000 then
player:delGil(1000)
player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination.
elseif csid == 707 then
npcUtil.completeQuest(player, AHT_URHGAN, tpz.quest.id.ahtUrhgan.BEGINNINGS, {item=17717})

-- OMENS
elseif csid == 710 and beginnings == QUEST_COMPLETED then
player:addQuest(AHT_URHGAN, tpz.quest.id.ahtUrhgan.OMENS)
player:setCharVar("OmensProgress", 1)
elseif csid == 711 and option == 1 and omensProgress == 1 and player:getGil() >= 1000 then
player:delGil(1000)
kaincenteno marked this conversation as resolved.
Show resolved Hide resolved
player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination.
elseif csid == 712 and omensProgress == 2 then
npcUtil.giveKeyItem(player, tpz.ki.SEALED_IMMORTAL_ENVELOPE)
player:setCharVar("OmensProgress", 3)
elseif csid == 713 and option == 1 and omensProgress == 3 and player:getGil() >= 1000 then
player:delGil(1000)
player:messageSpecial(ID.text.PAY_DIVINATION) -- You pay 1000 gil for the divination.
end
end
28 changes: 28 additions & 0 deletions scripts/zones/Aydeewa_Subterrane/npcs/15.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----------------------------------
-- Area: Aydeewa Subterrane
-- NPC: Blank (Blue AF2 Quest)
-- !pos 342.129 36.509 -24.856 68
-----------------------------------
require("scripts/globals/keyitems");
local ID = require("scripts/zones/Aydeewa_Subterrane/IDs");
-----------------------------------

function onTrade(player,npc,trade)
end

function onTrigger(player,npc)
if player:getCharVar("OmensProgress") == 4 then
player:startEvent(9)
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end
end

function onEventUpdate(player,csid,option)
end

function onEventFinish(player,csid,option)
if csid == 9 then
player:setCharVar("OmensProgress",5)
end
end
5 changes: 5 additions & 0 deletions scripts/zones/Navukgo_Execution_Chamber/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ zones[tpz.zone.NAVUKGO_EXECUTION_CHAMBER] =
mob =
{
KARABABA_OFFSET = 17039401,
IMMORTAL_FLAN2 = 17039375, -- IMMORTAL_FLAN1 always pops in battlefield, other flans pop depending on party size
IMMORTAL_FLAN3 = 17039376,
IMMORTAL_FLAN4 = 17039377,
IMMORTAL_FLAN5 = 17039378,
IMMORTAL_FLAN6 = 17039379,
},
npc =
{
Expand Down
Loading