- man0u0 : Updated script to work with the recent changes in how quest data is requested.

This commit is contained in:
CuriousJorge 2022-02-20 23:32:47 -05:00
parent d2e814b4ee
commit 8c70d0ddb6

View File

@ -107,12 +107,14 @@ function onStateChange(player, quest, sequence)
if (sequence == SEQ_000) then if (sequence == SEQ_000) then
-- Setup states incase we loaded in. -- Setup states incase we loaded in.
local asciliaCanPush = not quest:GetFlag(FLAG_SEQ000_MINITUT0); local data = quest:GetData();
local asciliaFlag = quest:GetFlag(FLAG_SEQ000_MINITUT1) and QFLAG_NONE or QFLAG_PLATE;
local fretfulfarmhandFlag = quest:GetFlag(FLAG_SEQ000_MINITUT2) and QFLAG_NONE or QFLAG_PLATE;
local gildiggingmistressFlag = quest:GetFlag(FLAG_SEQ000_MINITUT3) and QFLAG_NONE or QFLAG_PLATE;
local exitFlag = quest:GetFlags() == 0xF and QFLAG_MAP or QFLAG_NONE; local asciliaCanPush = not data:GetFlag(FLAG_SEQ000_MINITUT0);
local asciliaFlag = data:GetFlag(FLAG_SEQ000_MINITUT1) and QFLAG_NONE or QFLAG_PLATE;
local fretfulfarmhandFlag = data:GetFlag(FLAG_SEQ000_MINITUT2) and QFLAG_NONE or QFLAG_PLATE;
local gildiggingmistressFlag = data:GetFlag(FLAG_SEQ000_MINITUT3) and QFLAG_NONE or QFLAG_PLATE;
local exitFlag = data:GetFlags() == 0xF and QFLAG_MAP or QFLAG_NONE;
if (asciliaCanPush) then if (asciliaCanPush) then
fretfulfarmhandFlag = QFLAG_NONE; fretfulfarmhandFlag = QFLAG_NONE;
@ -135,7 +137,8 @@ function onStateChange(player, quest, sequence)
quest:SetENpc(OPENING_STOPER_ULDAH, QFLAG_NONE, false, false, true); quest:SetENpc(OPENING_STOPER_ULDAH, QFLAG_NONE, false, false, true);
elseif (sequence == SEQ_010) then elseif (sequence == SEQ_010) then
local yayatokiFlag = quest:GetFlag(FLAG_SEQ010_TALK0) and QFLAG_NONE or QFLAG_PLATE; local data = quest:GetData();
local yayatokiFlag = data:GetFlag(FLAG_SEQ010_TALK0) and QFLAG_NONE or QFLAG_PLATE;
local uldahopeningexitFlag = QFLAG_MAP; local uldahopeningexitFlag = QFLAG_MAP;
quest:SetENpc(KEEN_EYED_MERCHANT); quest:SetENpc(KEEN_EYED_MERCHANT);
quest:SetENpc(HIGH_SPIRITED_FELLOW); quest:SetENpc(HIGH_SPIRITED_FELLOW);
@ -166,13 +169,13 @@ function onPush(player, quest, npc)
local sequence = quest:getSequence(); local sequence = quest:getSequence();
local classId = npc:GetActorClassId(); local classId = npc:GetActorClassId();
local data = quest:GetData();
if (sequence == SEQ_000) then if (sequence == SEQ_000) then
if (classId == ASCILIA) then if (classId == ASCILIA) then
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal002"); callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal002");
player:EndEvent(); player:EndEvent();
elseif (classId == EXIT_TRIGGER) then elseif (classId == EXIT_TRIGGER) then
if (quest:GetFlags() == 0xF) then if (data:GetFlags() == 0xF) then
doExitTrigger(player, quest, npc); doExitTrigger(player, quest, npc);
return; return;
else else
@ -208,29 +211,29 @@ function onNotice(player, quest, target)
end end
function seq000_onTalk(player, quest, npc, classId) function seq000_onTalk(player, quest, npc, classId)
local data = quest:GetData();
if (classId == ASCILIA) then if (classId == ASCILIA) then
if (not quest:GetFlag(FLAG_SEQ000_MINITUT0)) then -- If Talk tutorial if (not data:GetFlag(FLAG_SEQ000_MINITUT0)) then -- If Talk tutorial
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal003"); callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal003");
quest:SetFlag(FLAG_SEQ000_MINITUT0); -- Used to disable her PushEvent / Allow for her next TalkEvent data:SetFlag(FLAG_SEQ000_MINITUT0); -- Used to disable her PushEvent / Allow for her next TalkEvent
else else
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001"); callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001");
quest:SetFlag(FLAG_SEQ000_MINITUT1); -- Ascilia has now been talked to. data:SetFlag(FLAG_SEQ000_MINITUT1); -- Ascilia has now been talked to.
end end
elseif (classId == FRETFUL_FARMHAND) then elseif (classId == FRETFUL_FARMHAND) then
if (not quest:GetFlag(FLAG_SEQ000_MINITUT2)) then if (not data:GetFlag(FLAG_SEQ000_MINITUT2)) then
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002_first"); callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002_first");
quest:SetFlag(FLAG_SEQ000_MINITUT2); data:SetFlag(FLAG_SEQ000_MINITUT2);
else else
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002"); callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002");
end end
elseif (classId == GIL_DIGGING_MISTRESS) then elseif (classId == GIL_DIGGING_MISTRESS) then
if (not quest:GetFlag(FLAG_SEQ000_MINITUT3)) then if (not data:GetFlag(FLAG_SEQ000_MINITUT3)) then
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003_first"); callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003_first");
quest:SetFlag(FLAG_SEQ000_MINITUT3); data:SetFlag(FLAG_SEQ000_MINITUT3);
else else
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003"); callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003");
end end
@ -257,7 +260,7 @@ function seq000_onTalk(player, quest, npc, classId)
end end
function seq010_onTalk(player, quest, npc, classId) function seq010_onTalk(player, quest, npc, classId)
local data = quest:GetData();
if (classId == KEEN_EYED_MERCHANT) then if (classId == KEEN_EYED_MERCHANT) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_2"); callClientFunction(player, "delegateEvent", player, quest, "processEvent020_2");
elseif (classId == HIGH_SPIRITED_FELLOW) then elseif (classId == HIGH_SPIRITED_FELLOW) then
@ -273,9 +276,9 @@ function seq010_onTalk(player, quest, npc, classId)
elseif (classId == FULL_LIPPED_FILLE) then elseif (classId == FULL_LIPPED_FILLE) then
callClientFunction(player, "delegateEvent", player, quest, "processEtc002"); callClientFunction(player, "delegateEvent", player, quest, "processEtc002");
elseif (classId == YAYATOKI) then elseif (classId == YAYATOKI) then
if (not quest:GetFlag(FLAG_SEQ010_TALK0)) then if (not data:GetFlag(FLAG_SEQ010_TALK0)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_8"); callClientFunction(player, "delegateEvent", player, quest, "processEvent020_8");
quest:SetFlag(FLAG_SEQ010_TALK0); data:SetFlag(FLAG_SEQ010_TALK0);
else else
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_8"); callClientFunction(player, "delegateEvent", player, quest, "processEvent020_8");
end end
@ -287,16 +290,18 @@ end
function getJournalMapMarkerList(player, quest) function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence(); local sequence = quest:getSequence();
local possibleMarkers = {}; local possibleMarkers = {};
local data = quest:GetData();
if (sequence == SEQ_000) then if (sequence == SEQ_000) then
if (quest:GetFlag(FLAG_SEQ000_MINITUT0)) then
if (not quest:GetFlag(FLAG_SEQ000_MINITUT1)) then table.insert(possibleMarkers, MRKR_ASCILIA); end if (data:GetFlag(FLAG_SEQ000_MINITUT0)) then
if (not quest:GetFlag(FLAG_SEQ000_MINITUT2)) then table.insert(possibleMarkers, MRKR_FRETFUL_FARMHAND); end if (not data:GetFlag(FLAG_SEQ000_MINITUT1)) then table.insert(possibleMarkers, MRKR_ASCILIA); end
if (not quest:GetFlag(FLAG_SEQ000_MINITUT3)) then table.insert(possibleMarkers, MRKR_GIL_DIGGING_MISTRESS); end if (not data:GetFlag(FLAG_SEQ000_MINITUT2)) then table.insert(possibleMarkers, MRKR_FRETFUL_FARMHAND); end
if (not data:GetFlag(FLAG_SEQ000_MINITUT3)) then table.insert(possibleMarkers, MRKR_GIL_DIGGING_MISTRESS); end
end end
elseif (sequence == SEQ_010) then elseif (sequence == SEQ_010) then
if (not quest:GetFlag(FLAG_SEQ010_TALK0)) then if (not data:GetFlag(FLAG_SEQ010_TALK0)) then
table.insert(possibleMarkers, MRKR_YAYATOKI) table.insert(possibleMarkers, MRKR_YAYATOKI)
end end
table.insert(possibleMarkers, MRKR_ADV_GUILD); table.insert(possibleMarkers, MRKR_ADV_GUILD);
@ -309,7 +314,7 @@ end
function doExitTrigger(player, quest, npc) function doExitTrigger(player, quest, npc)
quest:ClearData(); quest:GetData():ClearData();
quest:StartSequence(SEQ_005); quest:StartSequence(SEQ_005);
contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0u01", "SimpleContent30079", "Quest/QuestDirectorMan0u001"); contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0u01", "SimpleContent30079", "Quest/QuestDirectorMan0u001");