mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-24 11:28:22 +02:00
Changed how Quest ENPCs work. They should now automatically update themselves whenever data is update for immediate effect changes. Fixed wrong map qflag value. Fixed quest gm command. Fixed Director actorId clobbering areaMasters.
This commit is contained in:
parent
b11007b263
commit
8b3431e557
8 changed files with 180 additions and 179 deletions
|
@ -63,9 +63,6 @@ function onFinish(player, quest)
|
|||
end
|
||||
|
||||
function onSequence(player, quest, sequence)
|
||||
quest:ClearENpcs();
|
||||
quest:ClearData();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
-- Setup states incase we loaded in.
|
||||
local rostnsthalFlag = quest:GetFlag(FLAG_SEQ000_MINITUT1) and QFLAG_NONE or QFLAG_PLATE;
|
||||
|
@ -73,7 +70,7 @@ function onSequence(player, quest, sequence)
|
|||
local babyfaceFlag = quest:GetFlag(FLAG_SEQ000_MINITUT3) and QFLAG_NONE or QFLAG_PLATE;
|
||||
local rostnsthalCanPush = not quest:GetFlag(FLAG_SEQ000_MINITUT0);
|
||||
local exitCanPush = quest:GetFlags() == 0xF;
|
||||
local exitFlag = quest:GetFlags() == 0xF and QFLAG_PLATE or QFLAG_NONE;
|
||||
local exitFlag = quest:GetFlags() == 0xF and QFLAG_MAP or QFLAG_NONE;
|
||||
|
||||
quest:AddENpc(WELLTRAVELED_MERCHANT);
|
||||
quest:AddENpc(TIPSY_ADVENTURER);
|
||||
|
@ -90,7 +87,7 @@ function onSequence(player, quest, sequence)
|
|||
quest:AddENpc(LANKY_TRAVELER);
|
||||
quest:AddENpc(GRINNING_ADVENTURER);
|
||||
quest:AddENpc(ROSTNSTHAL, rostnsthalFlag, true, rostnsthalCanPush);
|
||||
quest:AddENpc(EXIT_TRIGGER, exitFlag, false, false, exitCanPush);
|
||||
quest:AddENpc(EXIT_TRIGGER, exitFlag, false, exitCanPush);
|
||||
elseif (sequence == SEQ_005) then
|
||||
elseif (sequence == SEQ_010) then
|
||||
quest:AddENpc(HOB);
|
||||
|
@ -102,7 +99,7 @@ function onSequence(player, quest, sequence)
|
|||
quest:AddENpc(WELLTRAVELED_MERCHANT);
|
||||
quest:AddENpc(VOLUPTUOUS_VIXEN);
|
||||
quest:AddENpc(LANKY_TRAVELER);
|
||||
quest:AddENpc(PRIVAREA_PAST_EXIT, QFLAG_NONE, false, false, true);
|
||||
quest:AddENpc(PRIVAREA_PAST_EXIT, QFLAG_NONE, false, true);
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -115,6 +112,8 @@ function onTalk(player, quest, npc)
|
|||
elseif (sequence == SEQ_010) then
|
||||
seq010_onTalk(player, quest, npc, classId);
|
||||
end
|
||||
|
||||
quest:UpdateENPCs();
|
||||
end
|
||||
|
||||
function onPush(player, quest, npc)
|
||||
|
@ -138,6 +137,8 @@ function onPush(player, quest, npc)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
quest:UpdateENPCs();
|
||||
end
|
||||
|
||||
function onNotice(player, quest, target)
|
||||
|
@ -147,7 +148,8 @@ function onNotice(player, quest, target)
|
|||
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal001withHQ");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
player:EndEvent();
|
||||
quest:UpdateENPCs();
|
||||
end
|
||||
|
||||
function seq000_onTalk(player, quest, npc, classId)
|
||||
|
@ -162,7 +164,6 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||
elseif (classId == BABYFACED_ADVENTURER) then
|
||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT3)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini003");
|
||||
quest:UpdateENpc(BABYFACED_ADVENTURER, ENPC_PROP_QFLAG, QFLAG_NONE);
|
||||
quest:SetFlag(FLAG_SEQ000_MINITUT3);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_8");
|
||||
|
@ -178,7 +179,6 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||
elseif (classId == VOLUPTUOUS_VIXEN) then
|
||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT2)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini002");
|
||||
quest:UpdateENpc(VOLUPTUOUS_VIXEN, ENPC_PROP_QFLAG, QFLAG_NONE);
|
||||
quest:SetFlag(FLAG_SEQ000_MINITUT2);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_13");
|
||||
|
@ -195,25 +195,15 @@ function seq000_onTalk(player, quest, npc, classId)
|
|||
-- Handle the talk tutorial after the push one.
|
||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT0)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal003");
|
||||
quest:SetFlag(FLAG_SEQ000_MINITUT0);
|
||||
quest:UpdateENpc(ROSTNSTHAL, ENPC_PROP_CAN_PUSH, false);
|
||||
quest:UpdateENpc(ROSTNSTHAL, ENPC_PROP_QFLAG, QFLAG_PLATE);
|
||||
quest:UpdateENpc(VOLUPTUOUS_VIXEN, ENPC_PROP_QFLAG, QFLAG_PLATE);
|
||||
quest:UpdateENpc(BABYFACED_ADVENTURER, ENPC_PROP_QFLAG, QFLAG_PLATE);
|
||||
quest:SetFlag(FLAG_SEQ000_MINITUT0);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001");
|
||||
if (not quest:GetFlag(FLAG_SEQ000_MINITUT1)) then
|
||||
quest:UpdateENpc(ROSTNSTHAL, ENPC_PROP_QFLAG, QFLAG_NONE);
|
||||
quest:SetFlag(FLAG_SEQ000_MINITUT1);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (quest:GetFlags() == 0xF) then
|
||||
quest:UpdateENpc(EXIT_TRIGGER, ENPC_PROP_CAN_PUSH, true);
|
||||
quest:UpdateENpc(EXIT_TRIGGER, ENPC_PROP_QFLAG, QFLAG_MAP);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
|
@ -233,7 +223,7 @@ function seq010_onTalk(player, quest, npc, classId)
|
|||
elseif (classId == HOB) then
|
||||
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEvent020_9");
|
||||
if (choice == 1) then
|
||||
quest:completeAndReplace(110002);
|
||||
player:ReplaceQuest(quest, "Man0l1");
|
||||
return;
|
||||
end
|
||||
elseif (classId == GERT) then
|
||||
|
|
|
@ -41,92 +41,20 @@ end
|
|||
function onSequence(player, quest, sequence)
|
||||
quest:ClearENpcs();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
-- Setup states incase we loaded in.
|
||||
local rostnsthalFlag = quest:GetFlag(FLAG_SEQ000_MINITUT1) and QFLAG_NONE or QFLAG_PLATE;
|
||||
local vixenFlag = quest:GetFlag(FLAG_SEQ000_MINITUT2) and QFLAG_NONE or QFLAG_PLATE;
|
||||
local babyfaceFlag = quest:GetFlag(FLAG_SEQ000_MINITUT3) and QFLAG_NONE or QFLAG_PLATE;
|
||||
local rostnsthalCanPush = not quest:GetFlag(FLAG_SEQ000_MINITUT0);
|
||||
local exitCanPush = quest:GetFlags() == 0xF;
|
||||
local exitFlag = quest:GetFlags() == 0xF and QFLAG_PLATE or QFLAG_NONE;
|
||||
|
||||
quest:AddENpc(WELLTRAVELED_MERCHANT);
|
||||
quest:AddENpc(TIPSY_ADVENTURER);
|
||||
quest:AddENpc(CULTIVATED_TENDER);
|
||||
quest:AddENpc(ANXIOUS_ADVENTURER);
|
||||
quest:AddENpc(BABYFACED_ADVENTURER, babyfaceFlag);
|
||||
quest:AddENpc(AUSTERE_ADVENTURER);
|
||||
quest:AddENpc(UNDIGNIFIED_ADVENTURER);
|
||||
quest:AddENpc(SHADOWY_TRAVELER);
|
||||
quest:AddENpc(ASTUTE_MERCHANT);
|
||||
quest:AddENpc(VOLUPTUOUS_VIXEN, vixenFlag);
|
||||
quest:AddENpc(INDIFFERENT_PASSERBY);
|
||||
quest:AddENpc(PRATTLING_ADVENTURER);
|
||||
quest:AddENpc(LANKY_TRAVELER);
|
||||
quest:AddENpc(GRINNING_ADVENTURER);
|
||||
quest:AddENpc(ROSTNSTHAL, rostnsthalFlag, true, rostnsthalCanPush);
|
||||
quest:AddENpc(EXIT_TRIGGER, exitFlag, false, false, exitCanPush);
|
||||
elseif (sequence == SEQ_005) then
|
||||
elseif (sequence == SEQ_010) then
|
||||
quest:AddENpc(HOB);
|
||||
quest:AddENpc(GERT);
|
||||
quest:AddENpc(LORHZANT);
|
||||
quest:AddENpc(MUSCLEBOUND_DECKHAND);
|
||||
quest:AddENpc(PEARLYTOOTHED_PORTER);
|
||||
quest:AddENpc(UNDIGNIFIED_ADVENTURER);
|
||||
quest:AddENpc(WELLTRAVELED_MERCHANT);
|
||||
quest:AddENpc(VOLUPTUOUS_VIXEN);
|
||||
quest:AddENpc(LANKY_TRAVELER);
|
||||
quest:AddENpc(PRIVAREA_PAST_EXIT, QFLAG_NONE, false, false, true);
|
||||
end
|
||||
end
|
||||
|
||||
function onTalk(player, quest, npc)
|
||||
local sequence = quest:getSequence();
|
||||
local classId = npc:GetActorClassId();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
seq000_onTalk(player, quest, npc, classId);
|
||||
elseif (sequence == SEQ_010) then
|
||||
seq010_onTalk(player, quest, npc, classId);
|
||||
end
|
||||
end
|
||||
|
||||
function onPush(player, quest, npc)
|
||||
local sequence = quest:getSequence();
|
||||
local classId = npc:GetActorClassId();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
|
||||
elseif (sequence == SEQ_010) then
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function onNotice(player, quest, target)
|
||||
local sequence = quest:getSequence();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrNomal001withHQ");
|
||||
end
|
||||
end
|
||||
|
||||
function seq000_onTalk(player, quest, npc, classId)
|
||||
if (classId == WELLTRAVELED_MERCHANT) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_4");
|
||||
elseif (classId == TIPSY_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_5");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function getJournalMapMarkerList(player, quest)
|
||||
local sequence = quest:getSequence();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
-- return MRKR_ROSTNSTHAL, MRKR_BABYFACED_ADVENTURER, MRKR_VOLUPTUOUS_VIXEN;
|
||||
elseif (sequence == SEQ_010) then
|
||||
-- return MRKR_HOB;
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue