mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-21 20:27:47 +00:00
callClientFunction now returns ALL results. Fixed some scripts, finished fixing up Gridania opening script.
This commit is contained in:
parent
6e12668176
commit
b345521f79
11 changed files with 80 additions and 19 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
require ("global")
|
||||||
|
|
||||||
|
function init(npc)
|
||||||
|
return true, true, 10, 0, 1, true, false, false, false, false, false, false, false, 0;
|
||||||
|
end
|
|
@ -16,7 +16,7 @@ function init(npc)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventStarted(player, npc, triggerName)
|
function onEventStarted(player, npc, triggerName)
|
||||||
callClientFunction(player, "eventPushChoiceAreaOrQuest", 0xc13, 0xc1a, 0xdba,0, false, 0));
|
callClientFunction(player, "eventPushChoiceAreaOrQuest", 0xc13, 0xc1a, 0xdba,0, false, 0);
|
||||||
|
|
||||||
player:EndEvent();
|
player:EndEvent();
|
||||||
end
|
end
|
|
@ -4,6 +4,6 @@
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onEventStarted(player, actor, questId)
|
function onEventStarted(player, actor, questId)
|
||||||
player:SendRequestedInfo("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
|
player:SendDataPacket("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
|
||||||
-- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
|
-- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,10 +13,10 @@ function onEventStarted(player, actor, trigger, questId, mapCode)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (mapCode == nil) then
|
if (mapCode == nil) then
|
||||||
player:SendRequestedInfo("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase());
|
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), 0);
|
||||||
player:EndEvent();
|
player:EndEvent();
|
||||||
else
|
else
|
||||||
player:SendRequestedInfo("requestedData", "qtmap", quest:GetQuestId());
|
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId());
|
||||||
player:EndEvent();
|
player:EndEvent();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -39,10 +39,10 @@ function onTalkEvent(player, npc)
|
||||||
end
|
end
|
||||||
elseif (player:HasQuest(110005) == true) then
|
elseif (player:HasQuest(110005) == true) then
|
||||||
man0g0Quest = player:GetQuest("man0g0");
|
man0g0Quest = player:GetQuest("man0g0");
|
||||||
if (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_TUTORIAL1_DONE) and man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == false) then
|
if (man0g0Quest:GetQuestFlag(MAN0L0_FLAG_STARTED_TALK_TUT) == true and man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == false) then
|
||||||
papalymo = GetWorldManager():GetActorInWorldByUniqueId("papalymo");
|
papalymo = GetWorldManager():GetActorInWorldByUniqueId("papalymo");
|
||||||
papalymo:SetQuestGraphic(player, 0x2);
|
papalymo:SetQuestGraphic(player, 0x2);
|
||||||
elseif (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == true) then
|
elseif (man0g0Quest:GetQuestFlag(MAN0L0_FLAG_STARTED_TALK_TUT) == true and man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == true) then
|
||||||
yda = GetWorldManager():GetActorInWorldByUniqueId("yda");
|
yda = GetWorldManager():GetActorInWorldByUniqueId("yda");
|
||||||
yda:SetQuestGraphic(player, 0x2);
|
yda:SetQuestGraphic(player, 0x2);
|
||||||
end
|
end
|
||||||
|
|
|
@ -60,8 +60,7 @@ end
|
||||||
|
|
||||||
function callClientFunction(player, functionName, ...)
|
function callClientFunction(player, functionName, ...)
|
||||||
player:RunEventFunction(functionName, ...);
|
player:RunEventFunction(functionName, ...);
|
||||||
result = coroutine.yield("_WAIT_EVENT", player);
|
return coroutine.yield("_WAIT_EVENT", player);
|
||||||
return result;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function wait(seconds)
|
function wait(seconds)
|
||||||
|
|
19
data/scripts/quests/etc/etc3g0.lua
Normal file
19
data/scripts/quests/etc/etc3g0.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--Quest Flags
|
||||||
|
TALKED_1 = 0;
|
||||||
|
TALKED_2 = 1;
|
||||||
|
TALKED_3 = 2;
|
||||||
|
TALKED_4 = 4;
|
||||||
|
TALKED_5 = 8;
|
||||||
|
|
||||||
|
function checkNextPhase(player)
|
||||||
|
ownedQuest = player:GetQuest("Etc3g0");
|
||||||
|
if (
|
||||||
|
ownedQuest:GetQuestFlag(TALKED_1) == false and
|
||||||
|
ownedQuest:GetQuestFlag(TALKED_2) == false and
|
||||||
|
ownedQuest:GetQuestFlag(TALKED_3) == false and
|
||||||
|
ownedQuest:GetQuestFlag(TALKED_4) == false and
|
||||||
|
ownedQuest:GetQuestFlag(TALKED_5) == false
|
||||||
|
) then
|
||||||
|
ownedQuest:NextPhase(243);
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,7 +1,3 @@
|
||||||
--Quest Flags
|
--Quest Flags
|
||||||
MAN0G0_FLAG_TUTORIAL1_DONE = 0;
|
MAN0L0_FLAG_STARTED_TALK_TUT = 0;
|
||||||
MAN0G0_FLAG_TUTORIAL2_DONE = 1;
|
MAN0G0_FLAG_MINITUT_DONE1 = 1;
|
||||||
|
|
||||||
MAN0G0_FLAG_MINITUT_DONE1 = 4;
|
|
||||||
MAN0G0_FLAG_MINITUT_DONE2 = 8;
|
|
||||||
MAN0G0_FLAG_MINITUT_DONE3 = 16;
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ function onEventStarted(player, npc, triggerName)
|
||||||
man0g0Quest:SetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1, true);
|
man0g0Quest:SetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1, true);
|
||||||
man0g0Quest:SaveData();
|
man0g0Quest:SaveData();
|
||||||
npc:SetQuestGraphic(player, 0x0);
|
npc:SetQuestGraphic(player, 0x0);
|
||||||
player:GetDirector():OnTalked(npc);
|
player:GetDirector("OpeningDirector"):onTalkEvent(player, npc);
|
||||||
else
|
else
|
||||||
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processEvent000_2", nil, nil, nil);
|
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processEvent000_2", nil, nil, nil);
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,13 +14,13 @@ function onEventStarted(player, npc, triggerName)
|
||||||
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrNomal002", nil, nil, nil);
|
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrNomal002", nil, nil, nil);
|
||||||
elseif (triggerName == "talkDefault") then
|
elseif (triggerName == "talkDefault") then
|
||||||
--Is doing talk tutorial?
|
--Is doing talk tutorial?
|
||||||
if (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_TUTORIAL1_DONE) == false) then
|
if (man0g0Quest:GetQuestFlag(MAN0L0_FLAG_STARTED_TALK_TUT) == false) then
|
||||||
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrNomal003", nil, nil, nil);
|
callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrNomal003", nil, nil, nil);
|
||||||
player:SetEventStatus(npc, "pushDefault", false, 0x2);
|
player:SetEventStatus(npc, "pushDefault", false, 0x2);
|
||||||
npc:SetQuestGraphic(player, 0x0);
|
npc:SetQuestGraphic(player, 0x0);
|
||||||
player:GetDirector("OpeningDirector"):onTalkEvent(player, npc);
|
man0g0Quest:SetQuestFlag(MAN0L0_FLAG_STARTED_TALK_TUT, true);
|
||||||
man0g0Quest:SetQuestFlag(MAN0G0_FLAG_TUTORIAL1_DONE, true);
|
|
||||||
man0g0Quest:SaveData();
|
man0g0Quest:SaveData();
|
||||||
|
player:GetDirector("OpeningDirector"):onTalkEvent(player, npc);
|
||||||
--Was she talked to after papalymo?
|
--Was she talked to after papalymo?
|
||||||
else
|
else
|
||||||
if (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == true) then
|
if (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == true) then
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
require ("global")
|
||||||
|
require ("quests/etc/etc3g0")
|
||||||
|
|
||||||
|
function onSpawn(player, npc)
|
||||||
|
|
||||||
|
if (player:HasQuest("Etc3g0") == false and player:GetQuest("Etc3g0"):GetQuestFlag(TALKED_4)) then
|
||||||
|
npc:SetQuestGraphic(player, 0x2);
|
||||||
|
else
|
||||||
|
npc:SetQuestGraphic(player, 0x0);
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventStarted(player, npc)
|
||||||
|
defaultFst = GetStaticActor("DftFst");
|
||||||
|
quest = GetStaticActor("Etc3g0");
|
||||||
|
|
||||||
|
unknown, result = callClientFunction(player, "switchEvent", defaultFst, quest, nil, nil, 1, 1, 0x3f1);
|
||||||
|
|
||||||
|
if (result == 1) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithKinnison_001", -1, -1);
|
||||||
|
elseif (result == 2) then
|
||||||
|
if (player:HasQuest("Etc3g0") == false) then
|
||||||
|
offerQuestResult = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart");
|
||||||
|
if (offerQuestResult == 1) then
|
||||||
|
player:AddQuest("Etc3g0");
|
||||||
|
npc:SetQuestGraphic(player, 0x0);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ownedQuest = player:GetQuest("Etc3g0");
|
||||||
|
if (ownedQuest:GetPhase() == 1) then
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEventClear");
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
|
||||||
|
player:CompleteQuest("Etc3g0");
|
||||||
|
else
|
||||||
|
callClientFunction(player, "delegateEvent", player, quest, "processEventOffersAfter");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
player:endEvent();
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue