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

FadedPromises Bastok Quest #559

Merged
merged 2 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions scripts/globals/treasure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ local treasureInfo =
{
treasureLvl = 43,
key = 1025,
misc =
{
{
test = function(player) return player:getQuestStatus(BASTOK,tpz.quest.id.bastok.FADED_PROMISES) == QUEST_ACCEPTED and player:getCharVar("FadedPromises") == 2 and not player:hasKeyItem(tpz.ki.DIARY_OF_MUKUNDA) end,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And that the test is for if the FadedPromises var is 1?

code = function(player) npcUtil.giveKeyItem(player, tpz.ki.DIARY_OF_MUKUNDA) end,
},
},
points =
{
{ 250.037, -32.069, 174.156, 227},
Expand Down
62 changes: 37 additions & 25 deletions scripts/zones/Metalworks/npcs/Alois.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,61 @@
-- Involved in Missions: Wading Beasts
-- !pos 96 -20 14 237
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/missions");
require("scripts/globals/settings")
require("scripts/globals/missions")
-----------------------------------

function onTrade(player,npc,trade)

if (player:getCurrentMission(BASTOK) == tpz.mission.id.bastok.WADING_BEASTS and trade:hasItemQty(4362,1) and trade:getItemCount() == 1) then -- Trade Lizard Egg
if (player:hasCompletedMission(BASTOK,tpz.mission.id.bastok.WADING_BEASTS) == false) then
player:startEvent(372);
player:startEvent(372)
else
player:startEvent(373);
player:startEvent(373)
end
end
end;
end

function onTrigger(player,npc)
if (player:getCurrentMission(BASTOK) == tpz.mission.id.bastok.THE_SALT_OF_THE_EARTH and player:getCharVar("BASTOK91") == 0) then
player:startEvent(773);
elseif (player:getCharVar("BASTOK91") == 1) then
player:startEvent(774);
elseif (player:getCharVar("BASTOK91") == 3) then
player:startEvent(775);
elseif (player:getCharVar("BASTOK91") == 4) then
player:startEvent(776);
else
player:startEvent(370);
local FadedPromises = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.FADED_PROMISES)

if (player:getCurrentMission(BASTOK) == tpz.mission.id.bastok.THE_SALT_OF_THE_EARTH and player:getCharVar("BASTOK91") == 0) then
player:startEvent(773)
elseif (player:getCharVar("BASTOK91") == 1) then
player:startEvent(774)
elseif (player:getCharVar("BASTOK91") == 3) then
player:startEvent(775)
elseif (player:getCharVar("BASTOK91") == 4) then
player:startEvent(776)
elseif (player:getCharVar("FadedPromises") == 4) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...And then the final check is for 3, right?

player:startEvent(805)
else
player:startEvent(370)
end
end
end;

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

function onEventFinish(player,csid,option)

if (csid == 372 or csid == 373) then
finishMissionTimeline(player,1,csid,option);
finishMissionTimeline(player,1,csid,option)
elseif (csid == 773) then
player:setCharVar("BASTOK91",1);
player:setCharVar("BASTOK91",1)
elseif (csid == 776) then
player:setCharVar("BASTOK91",0);
player:completeMission(BASTOK,tpz.mission.id.bastok.THE_SALT_OF_THE_EARTH);
player:addRankPoints(1500);
player:setCharVar("OptionalcsCornelia",1);
player:setCharVar("BASTOK91",0)
player:completeMission(BASTOK,tpz.mission.id.bastok.THE_SALT_OF_THE_EARTH)
player:addRankPoints(1500)
player:setCharVar("OptionalcsCornelia",1)
elseif (csid == 805) then
if npcUtil.completeQuest(
player,
BASTOK,
tpz.quest.id.bastok.FADED_PROMISES,
{item = 17775, tpz.title.ASSASSIN_REJECT, var = {"FadedPromises"}, fame=10})
then
player:delKeyItem(tpz.ki.DIARY_OF_MUKUNDA)
end
end

end;
end
65 changes: 37 additions & 28 deletions scripts/zones/Metalworks/npcs/Ayame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,73 @@
-- Starts and Finishes Quest: True Strength
-- !pos 133 -19 34 237
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/globals/quests");
local ID = require("scripts/zones/Metalworks/IDs");
require("scripts/globals/status")
require("scripts/globals/settings")
require("scripts/globals/titles")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
require("scripts/globals/quests")
local ID = require("scripts/zones/Metalworks/IDs")
-----------------------------------

function onTrade(player,npc,trade)

if (player:getQuestStatus(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH) == QUEST_ACCEPTED) then
if (trade:hasItemQty(1100,1) and trade:getItemCount() == 1) then -- Trade Xalmo Feather
player:startEvent(749); -- Finish Quest "True Strength"
player:startEvent(749) -- Finish Quest "True Strength"
end
end

end;
end

function onTrigger(player,npc)

local trueStrength = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH);
local WildcatBastok = player:getCharVar("WildcatBastok");
local trueStrength = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH)
local WildcatBastok = player:getCharVar("WildcatBastok")
local FadedPromises = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.FADED_PROMISES)

if (player:getQuestStatus(BASTOK,tpz.quest.id.bastok.LURE_OF_THE_WILDCAT) == QUEST_ACCEPTED and player:getMaskBit(WildcatBastok,9) == false) then
player:startEvent(935);
player:startEvent(935)
elseif (player:getCurrentMission(BASTOK) == tpz.mission.id.bastok.THE_CRYSTAL_LINE and player:hasKeyItem(tpz.ki.C_L_REPORTS)) then
player:startEvent(712);
player:startEvent(712)
elseif (trueStrength == QUEST_AVAILABLE and player:getMainJob() == tpz.job.MNK and player:getMainLvl() >= 50) then
player:startEvent(748); -- Start Quest "True Strength"
player:startEvent(748) -- Start Quest "True Strength"
elseif (player:getCharVar("FadedPromises") == 1) then
player:startEvent(803)
elseif (player:getCharVar("FadedPromises") == 2) then
player:startEvent(804)
else
player:startEvent(701); -- Standard dialog
player:startEvent(701) -- Standard dialog
end

end;
end

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

function onEventFinish(player,csid,option)

if (csid == 712) then
finishMissionTimeline(player,1,csid,option);
finishMissionTimeline(player,1,csid,option)
elseif (csid == 748) then
player:addQuest(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH);
player:addQuest(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH)
elseif (csid == 749) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,14215); -- Temple Hose
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,14215) -- Temple Hose
else
player:tradeComplete();
player:addTitle(tpz.title.PARAGON_OF_MONK_EXCELLENCE);
player:addItem(14215);
player:messageSpecial(ID.text.ITEM_OBTAINED,14215); -- Temple Hose
player:addFame(BASTOK,60);
player:completeQuest(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH);
player:tradeComplete()
player:addTitle(tpz.title.PARAGON_OF_MONK_EXCELLENCE)
player:addItem(14215)
player:messageSpecial(ID.text.ITEM_OBTAINED,14215) -- Temple Hose
player:addFame(BASTOK,60)
player:completeQuest(BASTOK,tpz.quest.id.bastok.TRUE_STRENGTH)
end
elseif (csid == 935) then
player:setMaskBit(player:getCharVar("WildcatBastok"),"WildcatBastok",9,true);
player:setMaskBit(player:getCharVar("WildcatBastok"),"WildcatBastok",9,true)
elseif (csid == 803) then
player:setCharVar("FadedPromises",2)
elseif (csid == 804) then
player:setCharVar("FadedPromises",4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..and then Ayame sets it to 3 in 804...

end

end;
end
18 changes: 12 additions & 6 deletions scripts/zones/Metalworks/npcs/Romualdo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@ function onTrade(player,npc,trade)
end;

function onTrigger(player,npc)
local StampHunt = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.STAMP_HUNT);
local StampHunt = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.STAMP_HUNT)
local FadedPromises = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.FADED_PROMISES)

if (StampHunt == QUEST_ACCEPTED and player:getMaskBit(player:getCharVar("StampHunt_Mask"),4) == false) then
player:startEvent(726);
player:startEvent(726)
elseif (FadedPromises == QUEST_AVAILABLE and player:getMainJob() == tpz.job.NIN and player:getMainLvl() >= 20 and player:getFameLevel(NORG) >= 4) then
player:startEvent(802)
else
player:startEvent(705);
player:startEvent(705)
end
end;
end

function onEventUpdate(player,csid,option)
end;

function onEventFinish(player,csid,option)

if (csid == 726) then
player:setMaskBit(player:getCharVar("StampHunt_Mask"),"StampHunt_Mask",4,true);
player:setMaskBit(player:getCharVar("StampHunt_Mask"),"StampHunt_Mask",4,true)
elseif csid == 802 then
player:addQuest(BASTOK,tpz.quest.id.bastok.FADED_PROMISES)
player:setCharVar("FadedPromises",1)
end

end;
end
33 changes: 19 additions & 14 deletions scripts/zones/Port_Bastok/npcs/Kagetora.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,48 @@
-- Involved in Quest: Ayame and Kaede, 20 in Pirate Years
-- !pos -96 -2 29 236
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/globals/settings")
require("scripts/globals/quests")
-----------------------------------

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

function onTrigger(player,npc)
local FadedPromises = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.FADED_PROMISES)

if (player:getQuestStatus(BASTOK,tpz.quest.id.bastok.AYAME_AND_KAEDE) == QUEST_ACCEPTED) then

AyameAndKaede = player:getCharVar("AyameAndKaede_Event");
AyameAndKaede = player:getCharVar("AyameAndKaede_Event")

if (AyameAndKaede == 0) then
player:startEvent(241);
player:startEvent(241)
elseif (AyameAndKaede > 2) then
player:startEvent(244);
player:startEvent(244)
else
player:startEvent(23);
player:startEvent(23)
end
elseif (player:getCharVar("twentyInPirateYearsCS") == 1) then
player:startEvent(261);
player:startEvent(261)
elseif (FadedPromises == QUEST_ACCEPTED and player:hasKeyItem(tpz.ki.DIARY_OF_MUKUNDA)) then
Copy link
Contributor

@ibm2431 ibm2431 May 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is supposed to be checking for FadedPromises == 1...

(Because the finish sets it to 2)

player:startEvent(296)
else
player:startEvent(23);
player:startEvent(23)
end

end;
end

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

function onEventFinish(player,csid,option)

if (csid == 241) then
player:setCharVar("AyameAndKaede_Event",1);
player:setCharVar("AyameAndKaede_Event",1)
elseif (csid == 261) then
player:setCharVar("twentyInPirateYearsCS",2);
player:setCharVar("twentyInPirateYearsCS",2)
elseif (csid == 296) then
player:setCharVar("FadedPromises",2)
end

end;
end