mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-21 20:27:47 +00:00
104 lines
No EOL
2.6 KiB
Lua
104 lines
No EOL
2.6 KiB
Lua
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 |