Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system

# Conflicts:
#	Data/scripts/commands/EmoteStandardCommand.lua
#	Data/scripts/quests/man/man0g0.lua
#	Data/scripts/quests/man/man0g1.lua
#	Data/scripts/quests/man/man0u0.lua

Resolved using Theirs.
This commit is contained in:
CuriousJorge 2022-03-04 21:04:17 -05:00
commit 02fe9e070d
182 changed files with 3871 additions and 1332 deletions

View file

@ -0,0 +1,104 @@
require ("global")
--[[
Quest Script
Name: The Search for Sicksa
Code: Etc1g5
Id: 110659
Prereq: Level 10, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Bristletail Marmots.
SEQ_001 = 1; -- Talk to Beli.
-- Actor Class Ids
ENPC_BELI = 1001077;
BNPC_BRISTLETAIL_MARMOT = 2104022;
-- Quest Markers
MRKR_BRISTLETAIL_AREA = 11065901;
MRKR_BELI = 11065902;
-- Counters
COUNTER_MARMOTHIDE = 0;
-- Quest Details
OBJECTIVE_MARMOTHIDE = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_BELI, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_BELI);
quest:SetENpc(BNPC_BRISTLETAIL_MARMOT);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_BELI, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_BELI and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventLahonoStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_BELI) then
callClientFunction(player, "delegateEvent", player, quest, "processEventFree");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_BELI) then
callClientFunction(player, "delegateEvent", player, quest, "processEventAfter");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_BRISTLETAIL_MARMOT) then
local counterAmount = quest:GetData():IncCounter(COUNTER_MARMOTHIDE);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_MARMOTHIDE) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_MARMOTHIDE);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_BRISTLETAIL_AREA;
elseif (sequence == SEQ_001) then
return MRKR_BELI;
end
end

View file

@ -0,0 +1,104 @@
require ("global")
--[[
Quest Script
Name: Assessing the Damage
Code: Etc1l0
Id: 110633
Prereq: Level 20, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Toll Puks.
SEQ_001 = 1; -- Talk to HALDBERK.
-- Actor Class Ids
ENPC_HALDBERK = 1000160;
BNPC_JETSAM_JELLIES = 2105409;
-- Quest Markers
MRKR_JELLIES_AREA = 11063301;
MRKR_HALDBERK = 11063302;
-- Counters
COUNTER_RINGS = 0;
-- Quest Details
OBJECTIVE_RINGS = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_HALDBERK, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_HALDBERK);
quest:SetENpc(BNPC_JETSAM_JELLIES);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_HALDBERK, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_HALDBERK and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventHaldberkStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_HALDBERK) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_HALDBERK) then
callClientFunction(player, "delegateEvent", player, quest, "Etc1l0.processEvent010");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_JETSAM_JELLIES) then
local counterAmount = quest:GetData():IncCounter(COUNTER_RINGS);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_RINGS) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_RINGS);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_JELLIES_AREA;
elseif (sequence == SEQ_001) then
return MRKR_HALDBERK;
end
end

View file

@ -0,0 +1,104 @@
require ("global")
--[[
Quest Script
Name: Bridging the Gap
Code: Etc1l1
Id: 110634
Prereq: Level 10, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Toll Puks.
SEQ_001 = 1; -- Talk to Hihine.
-- Actor Class Ids
ENPC_HIHINE = 1000267;
BNPC_TOLL_PUK = 2100113;
-- Quest Markers
MRKR_TOLLPUK_AREA = 11063401;
MRKR_HIHINE = 11063402;
-- Counters
COUNTER_KILLS = 0;
-- Quest Details
OBJECTIVE_KILLS = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_HIHINE, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_HIHINE);
quest:SetENpc(BNPC_TOLL_PUK);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_HIHINE, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_HIHINE and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventHihineStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_HIHINE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_2");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_HIHINE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_TOLL_PUK) then
local counterAmount = quest:GetData():IncCounter(COUNTER_SLUMBERNUT);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_SLUMBERNUT) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_SLUMBERNUT);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_TOLLPUK_AREA;
elseif (sequence == SEQ_001) then
return MRKR_HIHINE;
end
end

View file

@ -0,0 +1,108 @@
require ("global")
--[[
Quest Script
Name: Revenge on the Reavers
Code: Etc1l3
Id: 110636
Prereq: Level 45, Any DoW/DoM
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Reavers.
SEQ_001 = 1; -- Talk to Chaunollet.
-- Actor Class Ids
ENPC_CHAUNOLLET = 1000125;
BNPC_REAVER_CLAWS = 2180301;
BNPC_REAVER_FINS = 2180302;
BNPC_REAVER_EYES = 2180303;
-- Quest Markers
MRKR_REAVER_AREA = 11063601;
MRKR_CHAUNOLLET = 11063602;
-- Counters
COUNTER_QUESTITEM = 0;
-- Quest Details
OBJECTIVE_AMOUNT = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_CHAUNOLLET, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_CHAUNOLLET);
quest:SetENpc(BNPC_REAVER_EYES);
quest:SetENpc(BNPC_REAVER_FINS);
quest:SetENpc(BNPC_REAVER_CLAWS);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_CHAUNOLLET, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_CHAUNOLLET and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventChaunolletStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_CHAUNOLLET) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000Chaunollet");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_CHAUNOLLET) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010Chaunollet");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_REAVER_EYES or bnpc == BNPC_REAVER_FINS or bnpc == BNPC_REAVER_CLAWS) then
local counterAmount = quest:GetData():IncCounter(COUNTER_QUESTITEM);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_AMOUNT) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_QUESTITEM);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_REAVER_AREA;
elseif (sequence == SEQ_001) then
return MRKR_CHAUNOLLET;
end
end

View file

@ -0,0 +1,104 @@
require ("global")
--[[
Quest Script
Name: Till Death Do Us Part
Code: Etc1l5
Id: 110638
Prereq: Level 20, Any DoW/DoM
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Musk Roselings.
SEQ_001 = 1; -- Talk to H'lahono.
-- Actor Class Ids
ENPC_HLAHONO = 1000250;
BNPC_MUSK_ROSELING = 2102717;
-- Quest Markers
MRKR_ROSELING_AREA = 11063801;
MRKR_HLAHONO = 11063802;
-- Counters
COUNTER_QUESTITEM = 0;
-- Quest Details
OBJECTIVE_AMOUNT = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_HLAHONO, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_HLAHONO);
quest:SetENpc(BNPC_MUSK_ROSELING);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_HLAHONO, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_HLAHONO and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventLahonoStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_HLAHONO) then
callClientFunction(player, "delegateEvent", player, quest, "processEventFree");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_HLAHONO) then
callClientFunction(player, "delegateEvent", player, quest, "processEventAfter");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_MUSK_ROSELING) then
local counterAmount = quest:GetData():IncCounter(COUNTER_QUESTITEM);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_AMOUNT) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_QUESTITEM);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_ROSELING_AREA;
elseif (sequence == SEQ_001) then
return MRKR_HLAHONO;
end
end

View file

@ -0,0 +1,104 @@
require ("global")
--[[
Quest Script
Name: Beryl Overboard
Code: Etc1l6
Id: 110639
Prereq: Level 20, Any DoW/DoM, Requires Etc1l5
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Beryl Crabs.
SEQ_001 = 1; -- Talk to Nanapiri.
-- Actor Class Ids
ENPC_NANAPIRI = 1000136;
BNPC_BERYL_CRAB = 2107613;
-- Quest Markers
MRKR_CRAB_AREA = 11063901;
MRKR_NANAPIRI = 11063902;
-- Counters
COUNTER_QUESTITEM = 0;
-- Quest Details
OBJECTIVE_AMOUNT = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_NANAPIRI, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_NANAPIRI);
quest:SetENpc(BNPC_BERYL_CRAB);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_NANAPIRI, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_NANAPIRI and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventNanapiriStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_NANAPIRI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_2");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_NANAPIRI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_BERYL_CRAB) then
local counterAmount = quest:GetData():IncCounter(COUNTER_QUESTITEM);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_AMOUNT) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_QUESTITEM);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_CRAB_AREA;
elseif (sequence == SEQ_001) then
return MRKR_NANAPIRI;
end
end

View file

@ -0,0 +1,133 @@
require ("global")
--[[
Quest Script
Name: Have You Seen My Son
Code: Etc1l7
Id: 110640
Prereq: Level 30, Any DoW/DoM
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to Yuyubesu.
SEQ_001 = 1; -- Kill Bomb Embers.
SEQ_002 = 2; -- Return to Yuyubesu.
SEQ_003 = 3; -- Talk to Hildie.
-- Actor Class Ids
ENPC_IMANIA = 1001567;
ENPC_YUYUBESU = 1001166;
ENPC_HILDIE = 1000787;
BNPC_BOMB_EMBER = 2101609;
-- Quest Markers
MRKR_YUYUBESU = 11064001;
MRKR_HILDIE = 11064002;
MRKR_BOMB_AREA = 11064003;
-- Counters
COUNTER_QUESTITEM = 0;
-- Quest Details
OBJECTIVE_AMOUNT = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_IMANIA, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_IMANIA);
quest:SetENpc(ENPC_YUYUBESU, QFLAG_REWARD);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_YUYUBESU);
quest:SetENpc(BNPC_BOMB_EMBER);
elseif (sequence == SEQ_002) then
quest:SetENpc(ENPC_YUYUBESU, QFLAG_REWARD);
elseif (sequence == SEQ_003) then
quest:SetENpc(ENPC_YUYUBESU);
quest:SetENpc(ENPC_HILDIE, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_IMANIA and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventImaniaStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_IMANIA) then
callClientFunction(player, "delegateEvent", player, quest, "processEventImaniaFree");
elseif (npcClassId == ENPC_YUYUBESU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000");
quest:StartSequence(SEQ_001);
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_YUYUBESU) then
callClientFunction(player, "delegateEvent", player, quest, "processEventYuyubesuFree");
end
elseif (seq == SEQ_002) then
if (npcClassId == ENPC_YUYUBESU) then
callClientFunction(player, "delegateEvent", player, quest, "processEventYuyubesuAfter");
quest:StartSequence(SEQ_003);
end
elseif (seq == SEQ_003) then
if (npcClassId == ENPC_YUYUBESU) then
callClientFunction(player, "delegateEvent", player, quest, "processEventYuyubesuAfterFree");
elseif (npcClassId == ENPC_HILDIE) then
callClientFunction(player, "delegateEvent", player, quest, "processEventHildie");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_BOMB_EMBER) then
local counterAmount = quest:GetData():IncCounter(COUNTER_QUESTITEM);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_AMOUNT) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_002);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_QUESTITEM);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_YUYUBESU;
elseif (sequence == SEQ_001) then
return MRKR_BOMB_AREA;
elseif (sequence == SEQ_002) then
return MRKR_YUYUBESU;
elseif (sequence == SEQ_003) then
return MRKR_HILDIE;
end
end

View file

@ -0,0 +1,213 @@
require ("global")
--[[
Quest Script
Name: Food for Thought
Code: Etc1l8
Id: 110641
Prereq: Level 20, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Spread rumors to all, must perform /psych.
SEQ_001 = 1; -- Return to Dympna.
-- Actor Class Ids
DYMPNA = 1000331;
AERGWNYT = 1000347;
FERDILLAIX = 1000344;
BUBUROON = 1000219;
RBAHARRA = 1000340;
FUFUNA = 1000345;
-- Quest Markers
MRKR_DYMPNA = 11064101;
MRKR_AERGWNYT = 11064102;
MRKR_FERDILLAIX = 11064103;
MRKR_BUBUROON = 11064104;
MRKR_RBAHARRA = 11064105;
MRKR_FUFUNA = 11064106;
-- Quest Flags
FLAG_TALKED_AERGWNYT = 0;
FLAG_TALKED_FERDILLAIX = 1;
FLAG_TALKED_BUBUROON = 2;
FLAG_TALKED_RBAHARRA = 3;
FLAG_TALKED_FUFUNA = 4;
-- Quest Counters
COUNTER_TALKED = 0;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(DYMPNA, QFLAG_NORM);
end
local data = quest:GetData();
if (sequence == SEQ_000) then
quest:SetENpc(DYMPNA);
quest:SetENpc(AERGWNYT, (not data:GetFlag(FLAG_TALKED_AERGWNYT) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(FERDILLAIX, (not data:GetFlag(FLAG_TALKED_FERDILLAIX) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(BUBUROON, (not data:GetFlag(FLAG_TALKED_BUBUROON) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(RBAHARRA, (not data:GetFlag(FLAG_TALKED_RBAHARRA) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(FUFUNA, (not data:GetFlag(FLAG_TALKED_FUFUNA) and QFLAG_NORM or QFLAG_NONE));
elseif (sequence == SEQ_001) then
quest:SetENpc(DYMPNA, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == DYMPNA and not player:HasQuest(quest)) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
end
-- Quest Progress
local data = quest:GetData();
if (seq == SEQ_000) then
if (npcClassId == DYMPNA) then
callClientFunction(player, "delegateEvent", player, quest, "processEventOffersAfter");
elseif (npcClassId == AERGWNYT) then
if (not data:GetFlag(FLAG_TALKED_AERGWNYT)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventAergwyntSpeak");
else
callClientFunction(player, "delegateEvent", player, quest, "processEventAergwyntAfter");
end
elseif (npcClassId == FERDILLAIX) then
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventFerdillaixSpeak");
else
callClientFunction(player, "delegateEvent", player, quest, "processEventFerdillaixAfter");
end
elseif (npcClassId == BUBUROON) then
if (not data:GetFlag(FLAG_TALKED_BUBUROON)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventBuburoonSpeak");
else
callClientFunction(player, "delegateEvent", player, quest, "processEventBuburoonAfter");
end
elseif (npcClassId == RBAHARRA) then
if (not data:GetFlag(FLAG_TALKED_RBAHARRA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventBaharraSpeak");
else
callClientFunction(player, "delegateEvent", player, quest, "processEventBaharraAfter");
end
elseif (npcClassId == FUFUNA) then
if (not data:GetFlag(FLAG_TALKED_FUFUNA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventFufunaSpeak");
else
callClientFunction(player, "delegateEvent", player, quest, "processEventFufunaAfter");
end
end
elseif (seq == SEQ_001) then
--Quest Complete
if (npcClassId == DYMPNA) then
callClientFunction(player, "delegateEvent", player, quest, "processEventClear");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
function onEmote(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
local data = quest:GetData();
local incCounter = false;
if (seq == SEQ_000 and eventName == "emoteDefault1") then
if (npcClassId == AERGWNYT) then
if (not data:GetFlag(FLAG_TALKED_AERGWNYT)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventAergwynt");
data:SetFlag(FLAG_TALKED_AERGWNYT);
incCounter = true;
end
elseif (npcClassId == FERDILLAIX) then
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventFerdillaix");
data:SetFlag(FLAG_TALKED_FERDILLAIX);
incCounter = true;
end
elseif (npcClassId == BUBUROON) then
if (not data:GetFlag(FLAG_TALKED_BUBUROON)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventBuburoon");
data:SetFlag(FLAG_TALKED_BUBUROON);
incCounter = true;
end
elseif (npcClassId == RBAHARRA) then
if (not data:GetFlag(FLAG_TALKED_RBAHARRA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventBaharra");
data:SetFlag(FLAG_TALKED_RBAHARRA);
incCounter = true;
end
elseif (npcClassId == FUFUNA) then
if (not data:GetFlag(FLAG_TALKED_FUFUNA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventFufuna");
data:SetFlag(FLAG_TALKED_FUFUNA);
incCounter = true;
end
end
-- Increase objective counter & play relevant messages
if (incCounter == true) then
local counterAmount = data:IncCounter(COUNTER_TALKED);
attentionMessage(player, 51059, 0, counterAmount, 5); -- You have helped spread Dympna's rumor. (... of 5)
if (seq000_checkCondition(data)) then -- All informants spoken to
attentionMessage(player, 25225, quest.GetQuestId()); -- objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_001);
end
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- Check if all informants are talked to
function seq000_checkCondition(data)
return (data:GetFlag(FLAG_TALKED_AERGWNYT) and
data:GetFlag(FLAG_TALKED_FERDILLAIX) and
data:GetFlag(FLAG_TALKED_BUBUROON) and
data:GetFlag(FLAG_TALKED_RBAHARRA) and
data:GetFlag(FLAG_TALKED_FUFUNA));
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
if (sequence == SEQ_000) then
if (not data:GetFlag(FLAG_TALKED_AERGWNYT)) then table.insert(possibleMarkers, MRKR_AERGWNYT); end
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then table.insert(possibleMarkers, MRKR_FERDILLAIX); end
if (not data:GetFlag(FLAG_TALKED_BUBUROON)) then table.insert(possibleMarkers, MRKR_BUBUROON); end
if (not data:GetFlag(FLAG_TALKED_RBAHARRA)) then table.insert(possibleMarkers, MRKR_RBAHARRA); end
if (not data:GetFlag(FLAG_TALKED_FUFUNA)) then table.insert(possibleMarkers, MRKR_FUFUNA); end
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_DYMPNA);
end
return unpack(possibleMarkers)
end

View file

@ -0,0 +1,104 @@
require ("global")
--[[
Quest Script
Name: Sleepless in Eorzea
Code: Etc1u1
Id: 110676
Prereq: Level 10, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Kill Nutgrabber Marmots.
SEQ_001 = 1; -- Talk to Kukusi.
-- Actor Class Ids
ENPC_KUKUSI = 1001463;
BNPC_NUTGRABBER_MARMOT = 2104021;
-- Quest Markers
MRKR_NUTGRABBER_AREA = 11067601;
MRKR_KUKUSI = 11067602;
-- Counters
COUNTER_SLUMBERNUT = 0;
-- Quest Details
OBJECTIVE_SLUMBERNUT = 8;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(ENPC_KUKUSI, QFLAG_PLATE);
elseif (sequence == SEQ_000) then
quest:SetENpc(ENPC_KUKUSI);
quest:SetENpc(BNPC_NUTGRABBER_MARMOT);
elseif (sequence == SEQ_001) then
quest:SetENpc(ENPC_KUKUSI, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
-- Offer the quest
if (npcClassId == ENPC_KUKUSI and seq == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventKukusiStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (seq == SEQ_000) then
if (npcClassId == ENPC_KUKUSI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2");
end
--Quest Complete
elseif (seq == SEQ_001) then
if (npcClassId == ENPC_KUKUSI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_3");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- TODO FINISH THIS
function onKillBNpc(player, quest, bnpc)
if (bnpc == BNPC_NUTGRABBER_MARMOT) then
local counterAmount = quest:GetData():IncCounter(COUNTER_SLUMBERNUT);
attentionMessage(player, 51062, 0, counterAmount, 4); -- You obtain <item>
if (counterAmount >= OBJECTIVE_SLUMBERNUT) then
attentionMessage(player, 25225, quest:GetQuestId()); -- Objectives complete!
quest:StartSequence(SEQ_001);
end
end
end
function getJournalInformation(player, quest)
return quest:GetData():GetCounter(COUNTER_SLUMBERNUT);
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_NUTGRABBER_AREA;
elseif (sequence == SEQ_001) then
return MRKR_KUKUSI;
end
end

View file

@ -49,7 +49,7 @@ function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == 65535) then
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(KINNISON, QFLAG_PLATE);
end
@ -135,7 +135,7 @@ function onTalk(player, quest, npc, eventName)
attentionMessage(player, 51061, 0, counterAmount, 5); -- You have heard word of the Seedseers. (... of 5)
if (seq000_checkCondition(data)) then -- All Seers spoken to
attentionMessage(player, 25225, 110674); -- "Seeing the Seers" objectives complete!
attentionMessage(player, 25225, quest:GetQuestId()); -- "Seeing the Seers" objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_PLATE issue
quest:StartSequence(SEQ_001);
end
@ -166,6 +166,7 @@ end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
local data = quest:GetData();

View file

@ -0,0 +1,181 @@
require ("global")
--[[
Quest Script
Name: The Tug of the Whorl
Code: Etc3l0
Id: 110653
Prereq: Level 5, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to all the citizens.
SEQ_001 = 1; -- Return to Ginnade.
-- Actor Class Ids
GINNADE = 1000132;
ZONGGO = 1000057;
WHAHTOA = 1000475;
FERDILLAIX = 1000344;
FRAILOISE = 1000065;
ARNEGIS = 1000227;
-- Quest Markers
MRKR_ZONGGO = 11070001
MRKR_WHAHTOA = 11070002
MRKR_FERDILLAIX = 11070003
MRKR_FRAILOISE = 11070004
MRKR_ARNEGIS = 11070005
MRKR_GINNADE = 11070006
-- Quest Flags
FLAG_TALKED_ZONGGO = 0;
FLAG_TALKED_WHAHTOA = 1;
FLAG_TALKED_FERDILLAIX = 2;
FLAG_TALKED_FRAILOISE = 3;
FLAG_TALKED_ARNEGIS = 4;
-- Quest Counters
COUNTER_TALKED = 0;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(GINNADE, QFLAG_NORM);
end
local data = quest:GetData();
if (sequence == SEQ_000) then
quest:SetENpc(GINNADE);
quest:SetENpc(ZONGGO, (not data:GetFlag(FLAG_TALKED_ZONGGO) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(WHAHTOA, (not data:GetFlag(FLAG_TALKED_WHAHTOA) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(FERDILLAIX, (not data:GetFlag(FLAG_TALKED_FERDILLAIX) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(FRAILOISE, (not data:GetFlag(FLAG_TALKED_FRAILOISE) and QFLAG_NORM or QFLAG_NONE));
quest:SetENpc(ARNEGIS, (not data:GetFlag(FLAG_TALKED_ARNEGIS) and QFLAG_NORM or QFLAG_NONE));
elseif (sequence == SEQ_001) then
quest:SetENpc(GINNADE, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
local incCounter = false;
-- Offer the quest
if (npcClassId == GINNADE and not player:HasQuest(quest)) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventGinnadeStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
end
-- Quest Progress
local data = quest:GetData();
if (seq == SEQ_000) then
if (npcClassId == GINNADE) then
callClientFunction(player, "delegateEvent", player, quest, "followEvent005");
elseif (npcClassId == ZONGGO) then
if (not data:GetFlag(FLAG_TALKED_ZONGGO)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
data:SetFlag(FLAG_TALKED_ZONGGO);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent010");
end
elseif (npcClassId == WHAHTOA) then
if (not data:GetFlag(FLAG_TALKED_WHAHTOA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020");
data:SetFlag(FLAG_TALKED_WHAHTOA);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent020");
end
elseif (npcClassId == FERDILLAIX) then
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent030");
data:SetFlag(FLAG_TALKED_FERDILLAIX);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent030");
end
elseif (npcClassId == FRAILOISE) then
if (not data:GetFlag(FLAG_TALKED_FRAILOISE)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent040");
data:SetFlag(FLAG_TALKED_FRAILOISE);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent040");
end
elseif (npcClassId == ARNEGIS) then
if (not data:GetFlag(FLAG_TALKED_ARNEGIS)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050");
data:SetFlag(FLAG_TALKED_ARNEGIS);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "followEvent050");
end
end
-- Increase objective counter & play relevant messages
if (incCounter == true) then
local counterAmount = data:IncCounter(COUNTER_TALKED);
attentionMessage(player, 51060, 0, counterAmount, 5); -- You have spoken with a Barracuda informant. (... of 5)
if (seq000_checkCondition(data)) then -- All informants spoken to
attentionMessage(player, 25225, quest.GetQuestId()); -- "The Tug of the Whorl" objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_001);
end
end
elseif (seq == SEQ_001) then
--Quest Complete
if (npcClassId == GINNADE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent060");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- Check if all informants are talked to
function seq000_checkCondition(data)
return (data:GetFlag(FLAG_TALKED_ZONGGO) and
data:GetFlag(FLAG_TALKED_WHAHTOA) and
data:GetFlag(FLAG_TALKED_FERDILLAIX) and
data:GetFlag(FLAG_TALKED_FRAILOISE) and
data:GetFlag(FLAG_TALKED_ARNEGIS));
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
if (sequence == SEQ_000) then
if (not data:GetFlag(FLAG_TALKED_ZONGGO)) then table.insert(possibleMarkers, MRKR_ZONGGO); end
if (not data:GetFlag(FLAG_TALKED_WHAHTOA)) then table.insert(possibleMarkers, MRKR_WHAHTOA); end
if (not data:GetFlag(FLAG_TALKED_FERDILLAIX)) then table.insert(possibleMarkers, MRKR_FERDILLAIX); end
if (not data:GetFlag(FLAG_TALKED_FRAILOISE)) then table.insert(possibleMarkers, MRKR_FRAILOISE); end
if (not data:GetFlag(FLAG_TALKED_ARNEGIS)) then table.insert(possibleMarkers, MRKR_ARNEGIS); end
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_GINNADE);
end
return unpack(possibleMarkers)
end

View file

@ -0,0 +1,183 @@
require ("global")
--[[
Quest Script
Name: A Call to Arms
Code: Etc3u0
Id: 110695
Prereq: Level 5, Any Class
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to all the ___.
SEQ_001 = 1; -- Return to Fruhybolg.
-- Actor Class Ids
FRUHYBOLG = 1000964;
ZOENGTERBIN = 1000784;
LETTICE = 1000788;
THIMM = 1001439;
VANNES = 1001464;
JEGER = 1000655;
-- Quest Markers
MRKR_FRUHYBOLG = 11090001;
MRKR_ZOENGTERBIN = 11090002;
MRKR_LETTICE = 11090003;
MRKR_THIMM = 11090004;
MRKR_VANNES = 11090005;
MRKR_JEGER = 11090006;
-- Quest Flags
FLAG_TALKED_VANNES = 1;
FLAG_TALKED_JEGER = 2;
FLAG_TALKED_LETTICE = 3;
FLAG_TALKED_ZOENGTERBIN = 4;
FLAG_TALKED_THIMM = 5;
-- Quest Counters
COUNTER_TALKED = 0;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(FRUHYBOLG, QFLAG_PLATE);
end
local data = quest:GetData();
if (sequence == SEQ_000) then
quest:SetENpc(FRUHYBOLG);
quest:SetENpc(VANNES, (not data:GetFlag(FLAG_TALKED_VANNES) and QFLAG_PLATE or QFLAG_NONE));
quest:SetENpc(JEGER, (not data:GetFlag(FLAG_TALKED_JEGER) and QFLAG_PLATE or QFLAG_NONE));
quest:SetENpc(LETTICE, (not data:GetFlag(FLAG_TALKED_LETTICE) and QFLAG_PLATE or QFLAG_NONE));
quest:SetENpc(ZOENGTERBIN, (not data:GetFlag(FLAG_TALKED_ZOENGTERBIN) and QFLAG_PLATE or QFLAG_NONE));
quest:SetENpc(THIMM, (not data:GetFlag(FLAG_TALKED_THIMM) and QFLAG_PLATE or QFLAG_NONE));
elseif (sequence == SEQ_001) then
quest:SetENpc(FRUHYBOLG, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
local incCounter = false;
-- Offer the quest
if (npcClassId == FRUHYBOLG and not player:HasQuest(quest)) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventFhruybolgStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
end
-- Quest Progress
local data = quest:GetData();
if (seq == SEQ_000) then
if (npcClassId == FRUHYBOLG) then
callClientFunction(player, "delegateEvent", player, quest, "processEventOffersAfter");
elseif (npcClassId == VANNES) then
if (not data:GetFlag(FLAG_TALKED_VANNES)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_V");
data:SetFlag(FLAG_TALKED_VANNES);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_V_2");
end
elseif (npcClassId == JEGER) then
if (not data:GetFlag(FLAG_TALKED_JEGER)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_J");
data:SetFlag(FLAG_TALKED_JEGER);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_J_2");
end
elseif (npcClassId == LETTICE) then
if (not data:GetFlag(FLAG_TALKED_LETTICE)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_L");
data:SetFlag(FLAG_TALKED_LETTICE);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_L_2");
end
elseif (npcClassId == ZOENGTERBIN) then
if (not data:GetFlag(FLAG_TALKED_ZOENGTERBIN)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_Z");
data:SetFlag(FLAG_TALKED_ZOENGTERBIN);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_Z_2");
end
elseif (npcClassId == THIMM) then
if (not data:GetFlag(FLAG_TALKED_THIMM)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_T");
data:SetFlag(FLAG_TALKED_THIMM);
incCounter = true;
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_T_2");
end
end
-- Increase objective counter & play relevant messages
if (incCounter == true) then
local counterAmount = data:IncCounter(COUNTER_TALKED);
attentionMessage(player, 51062, 0, counterAmount, 5); -- You have passed on word of the rite. (... of 5)
if (seq000_checkCondition(data)) then -- All people spoken to
attentionMessage(player, 25225, quest:GetQuestId()); -- "A Call to Arms" objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_PLATE issue
quest:StartSequence(SEQ_001);
end
end
elseif (seq == SEQ_001) then
--Quest Complete
if (npcClassId == FRUHYBOLG) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest);
end
end
quest:UpdateENPCs();
player:EndEvent();
end
-- Check if all people are talked to
function seq000_checkCondition(data)
return (data:GetFlag(FLAG_TALKED_VANNES) and
data:GetFlag(FLAG_TALKED_JEGER) and
data:GetFlag(FLAG_TALKED_LETTICE) and
data:GetFlag(FLAG_TALKED_ZOENGTERBIN) and
data:GetFlag(FLAG_TALKED_THIMM));
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
if (sequence == SEQ_000) then
if (not data:GetFlag(FLAG_TALKED_VANNES)) then table.insert(possibleMarkers, MRKR_VANNES); end
if (not data:GetFlag(FLAG_TALKED_JEGER)) then table.insert(possibleMarkers, MRKR_JEGER); end
if (not data:GetFlag(FLAG_TALKED_LETTICE)) then table.insert(possibleMarkers, MRKR_LETTICE); end
if (not data:GetFlag(FLAG_TALKED_ZOENGTERBIN)) then table.insert(possibleMarkers, MRKR_ZOENGTERBIN); end
if (not data:GetFlag(FLAG_TALKED_THIMM)) then table.insert(possibleMarkers, MRKR_THIMM); end
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_FRUHYBOLG);
end
return unpack(possibleMarkers)
end

View file

@ -13,8 +13,8 @@ Notes: Rewards 200 gil
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to Pfarahr
SEQ_001 = 1; -- Return to V'korolon
SEQ_000 = 0; -- Talk to Pfarahr.
SEQ_001 = 1; -- Return to V'korolon.
-- Actor Class Ids
VKOROLON = 1000458;
@ -27,10 +27,7 @@ ITEM_WELL_WORN_BAG = 11000224;
MRKR_PFARAHR = 11082001;
MRKR_VKOROLON = 11082002;
function onStart(player, quest)
-- processEventVKOROLONStart -- No means of properly accepting quests yet
quest:StartSequence(SEQ_000);
player:SendGameMessage(GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, ITEM_WELL_WORN_BAG, 1);
end
@ -38,9 +35,11 @@ end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(VKOROLON, QFLAG_PLATE);
end
if (sequence == SEQ_000) then
quest:SetENpc(VKOROLON);
quest:SetENpc(PFARAHR, QFLAG_PLATE);
@ -54,20 +53,26 @@ function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_000) then
if (sequence == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventVKOROLONStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
elseif (sequence == SEQ_000) then
if (classId == VKOROLON) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
elseif (classId == PFARAHR) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
quest:StartSequence(SEQ_001);
quest:DoComplete(); -- Need ref since it feels out of place. Just placing it here since original script had it.
end
elseif (sequence == SEQ_001) then
if (classId == VKOROLON) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
--callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1); -- Reward window, shouldn't be handled by quest script
player:CompleteQuest(quest:GetQuestId());
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1)
player:CompleteQuest(quest);
elseif (classId == PFARAHR) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
end
@ -76,27 +81,21 @@ function onTalk(player, quest, npc)
quest:UpdateENPCs();
end
function getJournalInformation(player, quest)
local sequence = quest:getSequence();
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return ITEM_WELL_WORN_BAG;
end
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local possibleMarkers = {};
if (sequence == SEQ_000) then
table.insert(possibleMarkers, MRKR_PFARAHR);
return MRKR_PFARAHR;
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_VKOROLON);
end
return unpack(possibleMarkers)
return MRKR_VKOROLON;
end
end