mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 14:04:41 +02:00
Finished quest state system idea
This commit is contained in:
parent
aae051d73f
commit
1523ae200b
21 changed files with 720 additions and 373 deletions
|
@ -41,8 +41,6 @@ FLAG_TALKED_LEFWYNE = 4;
|
|||
-- Quest Counters
|
||||
COUNTER_TALKED = 0;
|
||||
|
||||
--offerQuestResult = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart");
|
||||
|
||||
function onStart(player, quest)
|
||||
quest:StartSequence(SEQ_000);
|
||||
end
|
||||
|
@ -50,25 +48,39 @@ end
|
|||
function onFinish(player, quest)
|
||||
end
|
||||
|
||||
function onSequence(player, quest, sequence)
|
||||
function onStateChange(player, quest, sequence)
|
||||
if (sequence == 65536) then
|
||||
quest:SetENpc(KINNISON, QFLAG_PLATE);
|
||||
end
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
quest:AddENpc(KINNISON);
|
||||
quest:AddENpc(SYBELL, (not quest:GetFlag(FLAG_TALKED_SYBELL) and QFLAG_PLATE or QFLAG_NONE));
|
||||
quest:AddENpc(KHUMA_MOSHROCA, (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA) and QFLAG_PLATE or QFLAG_NONE));
|
||||
quest:AddENpc(NELLAURE, (not quest:GetFlag(FLAG_TALKED_NELLAURE) and QFLAG_PLATE or QFLAG_NONE));
|
||||
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));
|
||||
quest:SetENpc(KINNISON);
|
||||
quest:SetENpc(SYBELL, (not quest:GetFlag(FLAG_TALKED_SYBELL) and QFLAG_PLATE or QFLAG_NONE));
|
||||
quest:SetENpc(KHUMA_MOSHROCA, (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA) and QFLAG_PLATE or QFLAG_NONE));
|
||||
quest:SetENpc(NELLAURE, (not quest:GetFlag(FLAG_TALKED_NELLAURE) and QFLAG_PLATE or QFLAG_NONE));
|
||||
quest:SetENpc(MESTONNAUX, (not quest:GetFlag(FLAG_TALKED_MESTONNAUX) and QFLAG_PLATE or QFLAG_NONE));
|
||||
quest:SetENpc(LEFWYNE, (not quest:GetFlag(FLAG_TALKED_LEFWYNE) and QFLAG_PLATE or QFLAG_NONE));
|
||||
elseif (sequence == SEQ_001) then
|
||||
quest:AddENpc(KINNISON, QFLAG_PLATE);
|
||||
quest:SetENpc(KINNISON, QFLAG_PLATE);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local npcClassId = npc.GetActorClassId();
|
||||
local seq = quest:GetSequence();
|
||||
local incCounter = false;
|
||||
|
||||
-- Offer the quest
|
||||
if (npcClassId == KINNISON and not player:HasQuest(quest)) then
|
||||
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart");
|
||||
if (questAccepted) then
|
||||
player:AddQuest(quest);
|
||||
end
|
||||
player:EndEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
-- Quest Progress
|
||||
if (seq == SEQ_000) then
|
||||
if (npcClassId == KINNISON) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventOffersAfter");
|
||||
|
|
|
@ -40,13 +40,13 @@ end
|
|||
|
||||
|
||||
|
||||
function onSequence(player, quest, sequence)
|
||||
function onStateChange(player, quest, sequence)
|
||||
if (sequence == SEQ_000) then
|
||||
quest:AddENpc(VKOROLON);
|
||||
quest:AddENpc(PFARAHR, QFLAG_PLATE);
|
||||
quest:SetENpc(VKOROLON);
|
||||
quest:SetENpc(PFARAHR, QFLAG_PLATE);
|
||||
elseif (sequence == SEQ_001) then
|
||||
quest:AddENpc(VKOROLON, QFLAG_PLATE);
|
||||
quest:AddENpc(PFARAHR);
|
||||
quest:SetENpc(VKOROLON, QFLAG_PLATE);
|
||||
quest:SetENpc(PFARAHR);
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue