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

DftFst: Added a param handling to Kinnison on DftFst since it'd crash the client otherwise.

Etc3g0: Polished up the script, made it as authentic to retail as I could get it barring reward hand-out and starting the quest
Etc5g0: Ported the quest over from the old scripting setup.
Man0u1: Still very early wip.
This commit is contained in:
CuriousJorge 2022-02-10 19:35:04 -05:00
parent 4fe8f77887
commit acf953e909
4 changed files with 181 additions and 63 deletions

View file

@ -18,13 +18,22 @@ local defaultTalkFst = {
[1001081] = "defaultTalkWithKhumamoshroca_001", -- Khuma Moshroca [1001081] = "defaultTalkWithKhumamoshroca_001", -- Khuma Moshroca
[1001103] = "defaultTalkWithMestonnaux_001", -- Mestonnaux [1001103] = "defaultTalkWithMestonnaux_001", -- Mestonnaux
[1001396] = "defaultTalkWithLefwyne_001", -- Lefwyne [1001396] = "defaultTalkWithLefwyne_001", -- Lefwyne
[1001430] = "defaultTalkWithKinnison_001", -- Kinnison [1001430] = "defaultTalkWithKinnison_001", -- Kinnison - Two args (nil errors client). If either >= 0, dialog mentions you've met Kan-E-Senna.
[1001437] = "defaultTalkWithSybell_001", -- Sybell [1001437] = "defaultTalkWithSybell_001" -- Sybell
-- [1000458] = "defaultTalkWithInn_Desk"
} }
function onTalk(player, quest, npc, eventName) function onTalk(player, quest, npc, eventName)
local clientFunc = defaultTalkFst[npc:GetActorClassId()];
callClientFunction(player, "delegateEvent", player, quest, clientFunc); local npcId = npc:GetActorClassId();
local clientFunc = defaultTalkFst[npcId];
if (npcId == 1001430) then -- Kinnison
callClientFunction(player, "delegateEvent", player, quest, clientFunc, -1,-1);
else
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
end
player:EndEvent(); player:EndEvent();
end end

View file

@ -38,6 +38,9 @@ FLAG_TALKED_NELLAURE = 2;
FLAG_TALKED_KHUMA_MOSHROCA = 3; FLAG_TALKED_KHUMA_MOSHROCA = 3;
FLAG_TALKED_LEFWYNE = 4; FLAG_TALKED_LEFWYNE = 4;
-- Quest Counters
COUNTER_TALKED = 0;
--offerQuestResult = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart"); --offerQuestResult = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart");
function onStart(player, quest) function onStart(player, quest)
@ -48,33 +51,32 @@ function onFinish(player, quest)
end end
function onSequence(player, quest, sequence) function onSequence(player, quest, sequence)
quest:ClearENpcs();
if (sequence == SEQ_000) then if (sequence == SEQ_000) then
quest:AddENpc(SYBELL, qflag(quest, FLAG_TALKED_SYBELL)); quest:AddENpc(KINNISON);
quest:AddENpc(KHUMA_MOSHROCA, qflag(quest, FLAG_TALKED_KHUMA_MOSHROCA)); quest:AddENpc(SYBELL, (not quest:GetFlag(FLAG_TALKED_SYBELL) and QFLAG_PLATE or QFLAG_NONE));
quest:AddENpc(NELLAURE, qflag(quest, FLAG_TALKED_NELLAURE)); quest:AddENpc(KHUMA_MOSHROCA, (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA) and QFLAG_PLATE or QFLAG_NONE));
quest:AddENpc(MESTONNAUX, qflag(quest, FLAG_TALKED_MESTONNAUX)); quest:AddENpc(NELLAURE, (not quest:GetFlag(FLAG_TALKED_NELLAURE) and QFLAG_PLATE or QFLAG_NONE));
quest:AddENpc(LEFWYNE, qflag(quest, FLAG_TALKED_LEFWYNE)); quest:AddENpc(MESTONNAUX, (not quest:GetFlag(FLAG_TALKED_MESTONNAUX) and QFLAG_PLATE or QFLAG_NONE));
quest:AddENpc(LEFWYNE, (not quest:GetFlag(FLAG_TALKED_LEFWYNE) and QFLAG_PLATE or QFLAG_NONE));
elseif (sequence == SEQ_001) then elseif (sequence == SEQ_001) then
quest:AddENpc(KINNISON); quest:AddENpc(KINNISON, QFLAG_PLATE);
end end
end end
function qflag(quest, flag)
return quest:GetFlag(flag) and QFLAG_ALL or QFLAG_NONE;
end
function onTalk(player, quest, npc, eventName) function onTalk(player, quest, npc, eventName)
local npcClassId = npc.GetActorClassId(); local npcClassId = npc.GetActorClassId();
local seq = quest:GetSequence(); local seq = quest:GetSequence();
local incCounter = false;
if (seq == SEQ_000) then if (seq == SEQ_000) then
if (npcClassId == SYBELL) then if (npcClassId == KINNISON) then
callClientFunction(player, "delegateEvent", player, quest, "processEventOffersAfter");
elseif (npcClassId == SYBELL) then
if (not quest:GetFlag(FLAG_TALKED_SYBELL)) then if (not quest:GetFlag(FLAG_TALKED_SYBELL)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeak"); callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeak");
quest:SetFlag(FLAG_TALKED_SYBELL); quest:SetFlag(FLAG_TALKED_SYBELL);
--quest:UpdateENpc(SYBELL, QFLAG_NONE); incCounter = true;
else else
callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeakAfter"); callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeakAfter");
end end
@ -82,7 +84,7 @@ function onTalk(player, quest, npc, eventName)
if (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA)) then if (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeak"); callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeak");
quest:SetFlag(FLAG_TALKED_KHUMA_MOSHROCA); quest:SetFlag(FLAG_TALKED_KHUMA_MOSHROCA);
--quest:UpdateENpc(KHUMA_MOSHROCA, QFLAG_NONE); incCounter = true;
else else
callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeakAfter"); callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeakAfter");
end end
@ -90,7 +92,7 @@ function onTalk(player, quest, npc, eventName)
if (not quest:GetFlag(FLAG_TALKED_NELLAURE)) then if (not quest:GetFlag(FLAG_TALKED_NELLAURE)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeak"); callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeak");
quest:SetFlag(FLAG_TALKED_NELLAURE); quest:SetFlag(FLAG_TALKED_NELLAURE);
--quest:UpdateENpc(NELLAURE, QFLAG_NONE); incCounter = true;
else else
callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeakAfter"); callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeakAfter");
end end
@ -98,7 +100,7 @@ function onTalk(player, quest, npc, eventName)
if (not quest:GetFlag(FLAG_TALKED_MESTONNAUX)) then if (not quest:GetFlag(FLAG_TALKED_MESTONNAUX)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeak"); callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeak");
quest:SetFlag(FLAG_TALKED_MESTONNAUX); quest:SetFlag(FLAG_TALKED_MESTONNAUX);
--quest:UpdateENpc(MESTONNAUX, QFLAG_NONE); incCounter = true;
else else
callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeakAfter"); callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeakAfter");
end end
@ -106,27 +108,40 @@ function onTalk(player, quest, npc, eventName)
if (not quest:GetFlag(FLAG_TALKED_LEFWYNE)) then if (not quest:GetFlag(FLAG_TALKED_LEFWYNE)) then
callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeak"); callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeak");
quest:SetFlag(FLAG_TALKED_LEFWYNE); quest:SetFlag(FLAG_TALKED_LEFWYNE);
--quest:UpdateENpc(LEFWYNE, QFLAG_NONE); incCounter = true;
else else
callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeakAfter"); callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeakAfter");
end end
end end
-- Check condition to go to the next sequence
if (seq000_checkCondition(quest)) then -- Increase objective counter & play relevant messages
quest:StartSequence(SEQ_001); if (incCounter == true) then
end quest:IncCounter(COUNTER_TALKED);
local counterAmount = quest:GetCounter(COUNTER_TALKED);
attentionMessage(player, 51061, 0, counterAmount, 5); -- You have heard word of the Seedseers. (... of 5)
if (seq000_checkCondition(quest)) then -- All Seers spoken to
attentionMessage(player, 25225, 110674); -- "Seeing the Seers" objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_PLATE issue
quest:StartSequence(SEQ_001);
end
end
elseif (seq == SEQ_001) then elseif (seq == SEQ_001) then
--Quest Complete --Quest Complete
if (npcClassId == KINNISON) then if (npcClassId == KINNISON) then
callClientFunction(player, "delegateEvent", player, quest, "processEventClear"); callClientFunction(player, "delegateEvent", player, quest, "processEventClear");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9); callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
player:CompleteQuest(quest:GetQuestId());
end end
end end
quest:UpdateENPCs();
player:EndEvent(); player:EndEvent();
end end
-- Check if all seers are talked to -- Check if all seers are talked to
function seq000_checkCondition(quest) function seq000_checkCondition(quest)
return (quest:GetFlag(FLAG_TALKED_SYBELL) and return (quest:GetFlag(FLAG_TALKED_SYBELL) and
@ -136,14 +151,20 @@ function seq000_checkCondition(quest)
quest:GetFlag(FLAG_TALKED_LEFWYNE)); quest:GetFlag(FLAG_TALKED_LEFWYNE));
end end
-- This is called by the RequestQuestJournalCommand when map markers are request.
-- Check quest_marker for valid values. This should return a table of map markers.
function getJournalMapMarkerList(player, quest)
local seq = quest:GetSequence();
if (seq == SEQ_000) then function getJournalMapMarkerList(player, quest)
return MRKR_SYBELL, MRKR_KHUMA_MOSHROCA, MRKR_NELLAURE, MRKR_MESTONNAUX, MRKR_LEFWYNE; local sequence = quest:getSequence();
elseif (seq == SEQ_001) then local possibleMarkers = {};
return MRKR_KINNISON;
end if (sequence == SEQ_000) then
if (not quest:GetFlag(FLAG_TALKED_SYBELL)) then table.insert(possibleMarkers, MRKR_SYBELL); end
if (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA)) then table.insert(possibleMarkers, MRKR_KHUMA_MOSHROCA); end
if (not quest:GetFlag(FLAG_TALKED_NELLAURE)) then table.insert(possibleMarkers, MRKR_NELLAURE); end
if (not quest:GetFlag(FLAG_TALKED_MESTONNAUX)) then table.insert(possibleMarkers, MRKR_MESTONNAUX); end
if (not quest:GetFlag(FLAG_TALKED_LEFWYNE)) then table.insert(possibleMarkers, MRKR_LEFWYNE); end
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_KINNISON);
end
return unpack(possibleMarkers)
end end

View file

@ -1,21 +1,103 @@
--Quest Flags require("global");
TALKED_PFARAHR = 0;
function canAcceptQuest(player) --[[
return (player:HasQuest("etc5g0") == false and player:IsQuestCompleted("Etc5g0") == false and player:GetHighestLevel() >= 1);
Quest Script
Name: Waste Not Want Not
Code: Etc5g0
Id: 110828
Prereq: Level 1 on any class. Second MSQ completed. (110002 Man0l1 / 110006 Man0g1 / 110010 Man0u1)
Notes: Rewards 200 gil
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to Pfarahr
SEQ_001 = 1; -- Return to V'korolon
-- Actor Class Ids
VKOROLON = 1000458;
PFARAHR = 1001707;
-- Quest Item
ITEM_WELL_WORN_BAG = 11000224;
-- Quest Markers
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 end
function isObjectivesComplete(player, quest) function onFinish(player, quest)
return (quest:GetPhase() == 2);
end end
function onAbandonQuest(player, quest)
vkorolon = GetWorldManager():GetActorInWorldByUniqueId("vkorolon");
pfarahr = GetWorldManager():GetActorInWorldByUniqueId("pfarahr"); function onSequence(player, quest, sequence)
if (vkorolon ~= nil and canAcceptQuest(player)) then if (sequence == SEQ_000) then
vkorolon:SetQuestGraphic(player, 0x2); quest:AddENpc(VKOROLON);
end quest:AddENpc(PFARAHR, QFLAG_PLATE);
if (pfarahr ~= nil) then elseif (sequence == SEQ_001) then
pfarahr:SetQuestGraphic(player, 0x0); quest:AddENpc(VKOROLON, QFLAG_PLATE);
end quest:AddENpc(PFARAHR);
end
end end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (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());
elseif (classId == PFARAHR) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function getJournalInformation(player, quest)
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);
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_VKOROLON);
end
return unpack(possibleMarkers)
end

View file

@ -15,6 +15,10 @@ Vid refs -
https://www.youtube.com/watch?v=WNRLrwZ3BJY&t=284s https://www.youtube.com/watch?v=WNRLrwZ3BJY&t=284s
https://www.youtube.com/watch?v=eZgcq-FMpfw&t=504s https://www.youtube.com/watch?v=eZgcq-FMpfw&t=504s
Coliseum fight - https://www.youtube.com/watch?v=Jcv9I2Bk46w
A LOT - https://www.youtube.com/watch?v=gySHO1Be9OM
]] ]]
@ -104,8 +108,8 @@ MRKR_MOMODI = 11001001;
MRKR_CAMP_BLACK_BRUSH = 11001002; MRKR_CAMP_BLACK_BRUSH = 11001002;
-- Quest Items -- Quest Items
VELODYNA_COSMOS = 0; -- Seq_000 : 2nd journal arg. >=5 doesn't have. ITEM_VELODYNA_COSMOS = 0; -- Seq_000 : 2nd journal arg. >=5 doesn't have.
COLISEUM_PASS = 0; -- Seq_015 : 3rd journal arg. >=5 doesn't have ITEM_COLISEUM_PASS = 0; -- Seq_015 : 3rd journal arg. >=5 doesn't have
-- Quest Flags -- Quest Flags
FLAG_SEQ000 = 0; FLAG_SEQ000 = 0;
@ -114,12 +118,7 @@ function onStart(player, quest)
quest:StartSequence(SEQ_000); quest:StartSequence(SEQ_000);
-- Immediately move to the Adventurer's Guild private area -- Immediately move to the Adventurer's Guild private area
callClientFunction(player, "delegateEvent", player, quest, "processEventMomodiStart"); callClientFunction(player, "delegateEvent", player, quest, "processEventMomodiStart");
GetWorldManager():DoZoneChange(player, 175, "PrivateAreaMasterPast", 4, 15, -75.242, 195.009, 74.572, -0.046);
--callClientFunction(player, "delegateEvent", player, quest, "processEvent000_1"); -- Describes what an Instance is
player:SendGameMessage(quest, 329, 0x20); player:SendGameMessage(quest, 329, 0x20);
player:SendGameMessage(quest, 330, 0x20); player:SendGameMessage(quest, 330, 0x20);
end end
@ -167,11 +166,18 @@ function onPush(player, quest, npc)
end end
function onNotice(player, quest, target)
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_1"); -- Describes what an Instance is
player:EndEvent();
quest:UpdateENPCs();
end
function seq000_onTalk(player, quest, npc, classId) function seq000_onTalk(player, quest, npc, classId)
if (classId == MOMODI) then if (classId == MOMODI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent010"); callClientFunction(player, "delegateEvent", player, quest, "processEvent010");
player:EndEvent(); player:EndEvent();
quest:StartSequence(SEQ_005); quest:StartSequence(SEQ_005);
GetWorldManager():DoZoneChange(player, 175, nil, 0, 15, player.positionX, player.positionY, player.positionZ, player.rotation); GetWorldManager():DoZoneChange(player, 175, nil, 0, 15, player.positionX, player.positionY, player.positionZ, player.rotation);
@ -209,7 +215,7 @@ end
function getJournalInformation(player, quest) function getJournalInformation(player, quest)
return 0, VELODYNA_COSMOS, COLISEUM_PASS; return 0, ITEM_VELODYNA_COSMOS, ITEM_COLISEUM_PASS;
end end