1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 11:47:48 +00:00

The journal update msg shows even when completing quests now. Added Revenge on the Reavers, Till Death Do Us Part, Beryl Overboard, Have You Seen My Son, and Food for Thought.

This commit is contained in:
Filip Maj 2022-03-01 14:29:59 -05:00
parent 96f9119cca
commit f491c63b98
6 changed files with 663 additions and 2 deletions

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, emoteId, eventName)
local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence();
local data = quest:GetData();
local incCounter = false;
if (seq == SEQ_000 and emoteId == 123) 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

@ -201,8 +201,7 @@ namespace Meteor.Map.Actors.QuestNS
return;
// Send the message that the journal has been updated
if (currentSequence != SEQ_NOT_STARTED)
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId());
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId());
currentSequence = sequence;
questState.UpdateState();