mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
Started mass overhaul of quests and related components like small talk. Fixed some scripts. More fixes required.
This commit is contained in:
parent
df49eefadb
commit
2279ee7017
33 changed files with 1241 additions and 279 deletions
|
@ -8,7 +8,7 @@ Fired when you try to abandon a quest
|
|||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName, questId)
|
||||
function onEventStarted(player, command, eventType, eventName, questId)
|
||||
|
||||
player:AbandonQuest(questId);
|
||||
player:EndEvent();
|
||||
|
|
|
@ -32,6 +32,7 @@ local npcLsHandlers = {
|
|||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName, npcLsId)
|
||||
player:OnNpcLS(npcLsId);
|
||||
|
||||
if (npcLsHandlers[npcLsId] ~= nil) then
|
||||
npcLsHandlers[npcLsId](player);
|
||||
|
|
|
@ -1,23 +1,30 @@
|
|||
--[[
|
||||
|
||||
RequestQuestJournalCommand Script
|
||||
|
||||
Functions: None
|
||||
|
||||
Notes:
|
||||
|
||||
Fires when the player looks at a quest's journal entry and the map section. Check the quest sheet and quest_marker sheet
|
||||
for valid entries for your quest.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, trigger, questId, mapCode)
|
||||
|
||||
quest = player:GetQuest(questId);
|
||||
function onEventStarted(player, command, eventType, eventName, questId, mapCode)
|
||||
local quest = player:GetQuest(questId);
|
||||
|
||||
if (quest == nil) then
|
||||
player:EndEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
if (mapCode == nil) then
|
||||
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase());
|
||||
player:EndEvent();
|
||||
else
|
||||
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId());
|
||||
player:EndEvent();
|
||||
if (quest ~= nil) then
|
||||
if (mapCode == nil) then
|
||||
-- Get Quest Journal Data
|
||||
local journalInfo = quest:GetJournalInformation();
|
||||
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetSequence(), unpack(journalInfo));
|
||||
else
|
||||
-- Get Quest Map Data
|
||||
local mapMarkers = quest:GetJournalMapMarkerList();
|
||||
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId(), unpack(mapMarkers));
|
||||
end
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
|
|
@ -52,7 +52,7 @@ teleportMenuToAetheryte = {
|
|||
}
|
||||
}
|
||||
|
||||
function onEventStarted(player, actor, triggerName, isTeleport)
|
||||
function onEventStarted(player, actor, eventType, eventName, isTeleport)
|
||||
|
||||
local worldMaster = GetWorldMaster();
|
||||
|
||||
|
|
21
Data/scripts/commands/gm/addquest.lua
Normal file
21
Data/scripts/commands/gm/addquest.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description = "Adds a quest by <id>.",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, glId)
|
||||
if player then
|
||||
local glIdAsNumber = tonumber(glId);
|
||||
|
||||
if (glIdAsNumber == nil) then
|
||||
player:AddQuest(glId);
|
||||
else
|
||||
player:AddQuest(glIdAsNumber);
|
||||
end
|
||||
else
|
||||
print(sender.."unable to add guildleve, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
29
Data/scripts/commands/gm/getinfo.lua
Normal file
29
Data/scripts/commands/gm/getinfo.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Gets the info about the current target
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player)
|
||||
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[Info] ";
|
||||
|
||||
local targetActor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
|
||||
if not targetActor then
|
||||
player:SendMessage(messageID, sender, "No target selected");
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation));
|
||||
player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.actorId));
|
||||
player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId()));
|
||||
player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));
|
||||
end
|
|
@ -21,7 +21,7 @@ function main(thisDirector)
|
|||
if (members ~= nil and #members ~= 0) then
|
||||
player = members[0];
|
||||
player:SendGameMessage(GetWorldMaster(), 50036, 0x20, thisDirector.guildleveId, player, 0); --"You have started the leve..."
|
||||
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, false));
|
||||
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.plateId, guildleveData.borderId, false));
|
||||
end
|
||||
|
||||
wait(3);
|
||||
|
@ -46,9 +46,4 @@ function main(thisDirector)
|
|||
wait(3);
|
||||
thisDirector:UpdateAimNumNow(0, 3);
|
||||
|
||||
end
|
||||
|
||||
function attentionMessage(player, textId, ...)
|
||||
player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...);
|
||||
player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...);
|
||||
end
|
||||
end
|
|
@ -132,13 +132,13 @@ CLASSID_THM = 22;
|
|||
CLASSID_CNJ = 23;
|
||||
|
||||
-- SPAWNS
|
||||
SPAWN_NO_ANIM = 0x00;
|
||||
SPAWN_NO_ANIM1 = 0x00;
|
||||
SPAWN_ANIM1 = 0x02;
|
||||
SPAWN_RETAINER = 0x03;
|
||||
SPAWN_POPMOB = 0x4;
|
||||
SPAWN_UKN1 = 0x5;
|
||||
SPAWN_UKN2 = 0x7;
|
||||
SPAWN_LOADING1 = 0x0F;
|
||||
SPAWN_NO_ANIM = 0x0F;
|
||||
SPAWN_LOADING2 = 0x10;
|
||||
SPAWN_INSTANCE_ERROR = 0x12;
|
||||
SPAWN_CHOCOBO_GET = 0x13;
|
||||
|
@ -146,8 +146,13 @@ SPAWN_CHOCOBO_RENTAL = 0x14;
|
|||
SPAWN_CUTTER_SANDS = 0x17;
|
||||
SPAWN_NIGHTMARE = 0x18;
|
||||
|
||||
--UTILS
|
||||
-- Common Helper Functions
|
||||
function attentionMessage(player, textId, ...)
|
||||
player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...);
|
||||
player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...);
|
||||
end
|
||||
|
||||
-- Core Event Functions
|
||||
function kickEventContinue(player, actor, trigger, ...)
|
||||
player:kickEvent(actor, trigger, ...);
|
||||
return coroutine.yield("_WAIT_EVENT", player);
|
||||
|
|
|
@ -14,11 +14,11 @@ function glPlateIconIDToAnimID(iconId)
|
|||
return iconId - 20020;
|
||||
end
|
||||
|
||||
function getGLStartAnimationFromSheet(border, plate, isBoost)
|
||||
return getGLStartAnimation(glBorderIconIDToAnimID(border), glPlateIconIDToAnimID(plate), isBoost);
|
||||
function getGLStartAnimationFromSheet(plate, border, isBoost)
|
||||
return getGLStartAnimation(glPlateIconIDToAnimID(plate), glBorderIconIDToAnimID(border), isBoost);
|
||||
end
|
||||
|
||||
function getGLStartAnimation(border, plate, isBoost)
|
||||
function getGLStartAnimation(plate, border, isBoost)
|
||||
borderBits = border;
|
||||
plateBits = bit32.lshift(plate, 7);
|
||||
|
||||
|
|
0
Data/scripts/guildtask.lua
Normal file
0
Data/scripts/guildtask.lua
Normal file
33
Data/scripts/quests/dft/DftFst.lua
Normal file
33
Data/scripts/quests/dft/DftFst.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
Name: Small Talk
|
||||
Code: DftFst
|
||||
Id: 110542
|
||||
|
||||
Contains all default lines for talkable npcs in the Forest Region (aka Black Shroud).
|
||||
* NOTE: This quest is active for all players at all times.
|
||||
]]
|
||||
|
||||
-- [ActorClassId] = "client_function_name"
|
||||
local defaultTalkFst = {
|
||||
[1000821] = "defaultTalkWithNellaure_001", -- Nellaure
|
||||
[1001081] = "defaultTalkWithKhumamoshroca_001", -- Khuma Moshroca
|
||||
[1001103] = "defaultTalkWithMestonnaux_001", -- Mestonnaux
|
||||
[1001396] = "defaultTalkWithLefwyne_001", -- Lefwyne
|
||||
[1001430] = "defaultTalkWithKinnison_001", -- Kinnison
|
||||
[1001437] = "defaultTalkWithSybell_001", -- Sybell
|
||||
}
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local clientFunc = defaultTalkFst[npc:GetActorClassId()];
|
||||
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function IsQuestENPC(player, quest, npc)
|
||||
return defaultTalkFst[npc:GetActorClassId()] ~= nil;
|
||||
end
|
26
Data/scripts/quests/dft/DftSea.lua
Normal file
26
Data/scripts/quests/dft/DftSea.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
Name: Small Talk
|
||||
Code: DftSea
|
||||
Id: 110540
|
||||
|
||||
Contains all default lines for talkable npcs in the Sea Region (aka La Noscea).
|
||||
* NOTE: This quest is active for all players at all times.
|
||||
]]
|
||||
|
||||
-- [ActorClassId] = "client_function_name"
|
||||
local defaultTalkSea = {
|
||||
[1234] = "defaultTalkWithLefchild_001" -- Lefchild
|
||||
}
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local clientFunc = defaultTalkSea[npc.GetActorClassId()];
|
||||
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function IsQuestENPC(player, quest, npc)
|
||||
return defaultTalkSea[npc.GetActorClassId()] ~= nil;
|
||||
end
|
29
Data/scripts/quests/dft/DftWil.lua
Normal file
29
Data/scripts/quests/dft/DftWil.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
Name: Small Talk
|
||||
Code: DftWil
|
||||
Id: 110543
|
||||
|
||||
Contains all default lines for talkable npcs in the Wilderness Region (aka Thanalan).
|
||||
* NOTE: This quest is active for all players at all times.
|
||||
]]
|
||||
|
||||
-- [ActorClassId] = "client_function_name"
|
||||
local defaultTalkWil = {
|
||||
[1000841] = "defaultTalkWithMomodi_001", -- Momodi
|
||||
[1000994] = "defaultTalkWithLefchild_001" -- Lefchild
|
||||
}
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local clientFunc = defaultTalkWil[npc:GetActorClassId()];
|
||||
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function IsQuestENPC(player, quest, npc)
|
||||
return defaultTalkWil[npc:GetActorClassId()] ~= nil;
|
||||
end
|
|
@ -1,61 +1,149 @@
|
|||
-- Level requirement is 5 on any class. Set to 1 for testing
|
||||
-- TODO: Reward handling
|
||||
require ("global")
|
||||
|
||||
--Actor Scripts
|
||||
--unique/fst0Town01a/PopulaceStandard/kinnison
|
||||
--unique/fst0Town01a/PopulaceStandard/mestonnaux
|
||||
--unique/fst0Town01a/PopulaceStandard/sybell
|
||||
--unique/fst0Town01a/PopulaceStandard/khuma_moshroca
|
||||
--unique/fst0Town01a/PopulaceStandard/lefwyne
|
||||
--unique/fst0Town01a/PopulaceStandard/nellaure
|
||||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
--Quest Flags
|
||||
FLAG_TALKED_MESTONNAUX = 0;
|
||||
FLAG_TALKED_SYBELL = 1;
|
||||
FLAG_TALKED_NELLAURE = 2;
|
||||
FLAG_TALKED_KHUMA_MOSHROCA = 4;
|
||||
FLAG_TALKED_LEFWYNE = 8;
|
||||
Name: Seeing the Seers
|
||||
Code: Etc3g0
|
||||
Id: 110674
|
||||
Prereq: Level 5, Any Class
|
||||
|
||||
function checkNextPhase(player)
|
||||
ownedQuest = player:GetQuest("Etc3g0");
|
||||
if (
|
||||
ownedQuest:GetQuestFlag(FLAG_TALKED_MESTONNAUX) == true and
|
||||
ownedQuest:GetQuestFlag(FLAG_TALKED_SYBELL) == true and
|
||||
ownedQuest:GetQuestFlag(FLAG_TALKED_NELLAURE) == true and
|
||||
ownedQuest:GetQuestFlag(FLAG_TALKED_KHUMA_MOSHROCA) == true and
|
||||
ownedQuest:GetQuestFlag(FLAG_TALKED_LEFWYNE) == true
|
||||
) then
|
||||
ownedQuest:NextPhase(243);
|
||||
end
|
||||
]]
|
||||
|
||||
-- Sequence Numbers
|
||||
SEQ_000 = 0; -- Talk to all the seers.
|
||||
SEQ_001 = 1; -- Return to Kinnison.
|
||||
|
||||
-- Actor Class Ids
|
||||
KINNISON = 1001430;
|
||||
SYBELL = 1001437;
|
||||
KHUMA_MOSHROCA = 1001081;
|
||||
NELLAURE = 1000821;
|
||||
MESTONNAUX = 1001103;
|
||||
LEFWYNE = 1001396;
|
||||
|
||||
-- Quest Markers
|
||||
MRKR_KINNISON = 11080001
|
||||
MRKR_SYBELL = 11080002
|
||||
MRKR_KHUMA_MOSHROCA = 11080003
|
||||
MRKR_NELLAURE = 11080004
|
||||
MRKR_MESTONNAUX = 11080005
|
||||
MRKR_LEFWYNE = 11080006
|
||||
|
||||
-- Quest Flags
|
||||
FLAG_TALKED_MESTONNAUX = 0;
|
||||
FLAG_TALKED_SYBELL = 1;
|
||||
FLAG_TALKED_NELLAURE = 2;
|
||||
FLAG_TALKED_KHUMA_MOSHROCA = 3;
|
||||
FLAG_TALKED_LEFWYNE = 4;
|
||||
|
||||
--offerQuestResult = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart");
|
||||
|
||||
function onStart(player, quest)
|
||||
quest:StartSequence(SEQ_000);
|
||||
end
|
||||
|
||||
|
||||
function canAcceptQuest(player)
|
||||
return (player:HasQuest("Etc3g0") == false and player:IsQuestCompleted("Etc3g0") == false and player:GetHighestLevel() >= 1);
|
||||
function onFinish(player, quest)
|
||||
end
|
||||
|
||||
function isObjectivesComplete(player, quest)
|
||||
return (quest:GetPhase() == 243);
|
||||
end
|
||||
|
||||
|
||||
function onAbandonQuest(player, quest)
|
||||
kinnison = GetWorldManager():GetActorInWorldByUniqueId("kinnison");
|
||||
mestonnaux = GetWorldManager():GetActorInWorldByUniqueId("mestonnaux");
|
||||
sybell = GetWorldManager():GetActorInWorldByUniqueId("sybell");
|
||||
khuma_moshroca = GetWorldManager():GetActorInWorldByUniqueId("khuma_moshroca");
|
||||
lefwyne = GetWorldManager():GetActorInWorldByUniqueId("lefwyne");
|
||||
nellaure = GetWorldManager():GetActorInWorldByUniqueId("nellaure");
|
||||
function onSequence(player, quest, sequence)
|
||||
quest:ClearENpcs();
|
||||
|
||||
if (kinnison ~= nil and canAcceptQuest(player)) then
|
||||
kinnison:SetQuestGraphic(player, 0x2);
|
||||
if (sequence == SEQ_000) then
|
||||
quest:AddENpc(SYBELL, qflag(quest, FLAG_TALKED_SYBELL));
|
||||
quest:AddENpc(KHUMA_MOSHROCA, qflag(quest, FLAG_TALKED_KHUMA_MOSHROCA));
|
||||
quest:AddENpc(NELLAURE, qflag(quest, FLAG_TALKED_NELLAURE));
|
||||
quest:AddENpc(MESTONNAUX, qflag(quest, FLAG_TALKED_MESTONNAUX));
|
||||
quest:AddENpc(LEFWYNE, qflag(quest, FLAG_TALKED_LEFWYNE));
|
||||
elseif (sequence == SEQ_001) then
|
||||
quest:AddENpc(KINNISON);
|
||||
end
|
||||
|
||||
if (mestonnaux ~= nil) then mestonnaux:SetQuestGraphic(player, 0x0); end
|
||||
if (sybell ~= nil) then sybell:SetQuestGraphic(player, 0x0); end
|
||||
if (khuma_moshroca ~= nil) then khuma_moshroca:SetQuestGraphic(player, 0x0); end
|
||||
if (lefwyne ~= nil) then lefwyne:SetQuestGraphic(player, 0x0); end
|
||||
if (nellaure ~= nil) then nellaure:SetQuestGraphic(player, 0x0); end
|
||||
|
||||
end
|
||||
|
||||
function qflag(quest, flag)
|
||||
return quest:GetFlag(flag) and QFLAG_ALL or QFLAG_NONE;
|
||||
end
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local npcClassId = npc.GetActorClassId();
|
||||
local seq = quest:GetSequence();
|
||||
|
||||
if (seq == SEQ_000) then
|
||||
if (npcClassId == SYBELL) then
|
||||
if (not quest:GetFlag(FLAG_TALKED_SYBELL)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeak");
|
||||
quest:SetFlag(FLAG_TALKED_SYBELL);
|
||||
--quest:UpdateENpc(SYBELL, QFLAG_NONE);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeakAfter");
|
||||
end
|
||||
elseif (npcClassId == KHUMA_MOSHROCA) then
|
||||
if (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeak");
|
||||
quest:SetFlag(FLAG_TALKED_KHUMA_MOSHROCA);
|
||||
--quest:UpdateENpc(KHUMA_MOSHROCA, QFLAG_NONE);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeakAfter");
|
||||
end
|
||||
elseif (npcClassId == NELLAURE) then
|
||||
if (not quest:GetFlag(FLAG_TALKED_NELLAURE)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeak");
|
||||
quest:SetFlag(FLAG_TALKED_NELLAURE);
|
||||
--quest:UpdateENpc(NELLAURE, QFLAG_NONE);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeakAfter");
|
||||
end
|
||||
elseif (npcClassId == MESTONNAUX) then
|
||||
if (not quest:GetFlag(FLAG_TALKED_MESTONNAUX)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeak");
|
||||
quest:SetFlag(FLAG_TALKED_MESTONNAUX);
|
||||
--quest:UpdateENpc(MESTONNAUX, QFLAG_NONE);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeakAfter");
|
||||
end
|
||||
elseif (npcClassId == LEFWYNE) then
|
||||
if (not quest:GetFlag(FLAG_TALKED_LEFWYNE)) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeak");
|
||||
quest:SetFlag(FLAG_TALKED_LEFWYNE);
|
||||
--quest:UpdateENpc(LEFWYNE, QFLAG_NONE);
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeakAfter");
|
||||
end
|
||||
end
|
||||
|
||||
-- Check condition to go to the next sequence
|
||||
if (seq000_checkCondition(quest)) then
|
||||
quest:StartSequence(SEQ_001);
|
||||
end
|
||||
elseif (seq == SEQ_001) then
|
||||
--Quest Complete
|
||||
if (npcClassId == KINNISON) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEventClear");
|
||||
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9);
|
||||
end
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
-- Check if all seers are talked to
|
||||
function seq000_checkCondition(quest)
|
||||
return (quest:GetFlag(FLAG_TALKED_SYBELL) and
|
||||
quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA) and
|
||||
quest:GetFlag(FLAG_TALKED_NELLAURE) and
|
||||
quest:GetFlag(FLAG_TALKED_MESTONNAUX) and
|
||||
quest:GetFlag(FLAG_TALKED_LEFWYNE));
|
||||
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
|
||||
return MRKR_SYBELL, MRKR_KHUMA_MOSHROCA, MRKR_NELLAURE, MRKR_MESTONNAUX, MRKR_LEFWYNE;
|
||||
elseif (seq == SEQ_001) then
|
||||
return MRKR_KINNISON;
|
||||
end
|
||||
end
|
|
@ -1,7 +1,221 @@
|
|||
-- Sequence Numbers
|
||||
SEQ_000 = 0; -- On the boat interior; contains the basics tutorial.
|
||||
SEQ_005 = 5; -- Combat on the top of the boat.
|
||||
SEQ_010 = 10; -- In Limsa Lominsa's port.
|
||||
|
||||
--Quest Flags
|
||||
MAN0L0_FLAG_STARTED_TALK_TUT = 0;
|
||||
-- Quest Flags
|
||||
seq000_Flag_MainTut0 = false;
|
||||
seq000_Flag_MiniTut1 = false;
|
||||
seq000_Flag_MiniTut2 = false;
|
||||
seq000_Flag_MiniTut3 = false;
|
||||
|
||||
MAN0L0_FLAG_MINITUT_DONE1 = 4;
|
||||
MAN0L0_FLAG_MINITUT_DONE2 = 8;
|
||||
MAN0L0_FLAG_MINITUT_DONE3 = 16;
|
||||
-- Map Markers
|
||||
local seq000_Markers = {
|
||||
11000203, -- Rostnsthal
|
||||
11000204, -- Voluptuous Vixen
|
||||
11000205, -- Baby-faced Adventurer
|
||||
};
|
||||
|
||||
-- Actors in this quest
|
||||
NPC_WELLTRAVELED_MERCHANT = 0;
|
||||
NPC_TIPSY_ADVENTURER = 0;
|
||||
NPC_CULTIVATED_TENDER = 0;
|
||||
NPC_ANXIOUS_ADVENTURER = 0;
|
||||
NPC_BABYFACED_ADVENTURER = 0;
|
||||
NPC_AUSTERE_ADVENTURER = 0;
|
||||
NPC_UNDIGNIFIED_ADVENTURER = 0;
|
||||
NPC_SHADOWY_TRAVELER = 0;
|
||||
NPC_ASTUTE_MERCHANT = 0;
|
||||
NPC_VOLUPTUOUS_VIXEN = 0;
|
||||
NPC_INDIFFERENT_PASSERBY = 0;
|
||||
NPC_PRATTLING_ADVENTURER = 0;
|
||||
NPC_GRINNING_ADVENTURER = 0;
|
||||
NPC_ROSTNSTHAL = 0;
|
||||
NPC_EXIT_TRIGGER = 0;
|
||||
|
||||
function onStart(player, quest)
|
||||
quest::StartSequence(SEQ_000);
|
||||
end
|
||||
|
||||
function onFinish(player, quest)
|
||||
end
|
||||
|
||||
function onSequence(player, quest, seqNum)
|
||||
quest::ClearENpcs();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
-- Setup states incase we loaded in.
|
||||
local rostnsthalQuestFlag = QFLAG_NONE;
|
||||
local rostnsthalCanPush = true;
|
||||
local rostnsthalCanTalk = false;
|
||||
if (seq000_Flag_MainTut0 == true) then
|
||||
rostnsthalCanTalk = true;
|
||||
rostnsthalCanPush = false;
|
||||
if (seq000_Flag_MiniTut1 == false) then
|
||||
rostnsthalQuestFlag = QFLAG_BOTH;
|
||||
end
|
||||
else
|
||||
rostnsthalCanTalk = false;
|
||||
rostnsthalCanPush = true;
|
||||
end
|
||||
|
||||
quest::AddENpc
|
||||
quest::AddENpc(NPC_WELLTRAVELED_MERCHANT);
|
||||
quest::AddENpc(NPC_TIPSY_ADVENTURER);
|
||||
quest::AddENpc(NPC_CULTIVATED_TENDER);
|
||||
quest::AddENpc(NPC_ANXIOUS_ADVENTURER);
|
||||
quest::AddENpc(NPC_BABYFACED_ADVENTURER);
|
||||
quest::AddENpc(NPC_AUSTERE_ADVENTURER);
|
||||
quest::AddENpc(NPC_UNDIGNIFIED_ADVENTURER);
|
||||
quest::AddENpc(NPC_SHADOWY_TRAVELER);
|
||||
quest::AddENpc(NPC_ASTUTE_MERCHANT);
|
||||
quest::AddENpc(NPC_VOLUPTUOUS_VIXEN);
|
||||
quest::AddENpc(NPC_INDIFFERENT_PASSERBY);
|
||||
quest::AddENpc(NPC_PRATTLING_ADVENTURER);
|
||||
quest::AddENpc(NPC_GRINNING_ADVENTURER);
|
||||
quest::AddENpc(NPC_ROSTNSTHAL, rostnsthalQuestFlag, rostnsthalCanTalk, false, rostnsthalCanPush);
|
||||
quest::AddENpc(NPC_EXIT_TRIGGER);
|
||||
elseif (sequence == SEQ_005) then
|
||||
elseif (sequence == SEQ_010) then
|
||||
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_005) then
|
||||
sequence005_onTalk(player, quest, npc, classId);
|
||||
elseif (sequence == SEQ_010) then
|
||||
sequence010_onTalk(player, quest, npc, classId);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function seq000_onTalk(player, quest, npc, classId)
|
||||
if (classId == NPC_WELLTRAVELED_MERCHANT) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_4", nil, nil, nil);
|
||||
elseif (classId == NPC_TIPSY_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_5", nil, nil, nil);
|
||||
elseif (classId == NPC_CULTIVATED_TENDER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_6", nil, nil, nil);
|
||||
elseif (classId == NPC_ANXIOUS_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_7", nil, nil, nil);
|
||||
elseif (classId == NPC_BABYFACED_ADVENTURER) then
|
||||
if (seq000_Flag_MiniTut3 == false) then
|
||||
callClientFunction(player, "delegateEvent", player, man0l0Quest, "processTtrMini003", nil, nil, nil);
|
||||
quest::UpdateENpc(FLAG, QFLAG_NONE);
|
||||
seq000_Flag_MiniTut3 = true;
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_8", nil, nil, nil);
|
||||
end
|
||||
elseif (classId == NPC_AUSTERE_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_9", nil, nil, nil);
|
||||
elseif (classId == NPC_UNDIGNIFIED_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_10", nil, nil, nil);
|
||||
elseif (classId == NPC_SHADOWY_TRAVELER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_11", nil, nil, nil);
|
||||
elseif (classId == NPC_ASTUTE_MERCHANT) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_12", nil, nil, nil);
|
||||
elseif (classId == NPC_VOLUPTUOUS_VIXEN) then
|
||||
if (seq000_Flag_MiniTut2 == false) then
|
||||
callClientFunction(player, "delegateEvent", player, man0l0Quest, "processTtrMini002", nil, nil, nil);
|
||||
quest::UpdateENpc(classId, FLAG, QFLAG_NONE);
|
||||
seq000_Flag_MiniTut2 = true;
|
||||
else
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_13", nil, nil, nil);
|
||||
end
|
||||
elseif (classId == NPC_INDIFFERENT_PASSERBY) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_14", nil, nil, nil);
|
||||
elseif (classId == NPC_PRATTLING_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_15", nil, nil, nil);
|
||||
elseif (classId == NPC_LANKY_TRAVELER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_16", nil, nil, nil);
|
||||
elseif (classId == NPC_GRINNING_ADVENTURER) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_17", nil, nil, nil);
|
||||
elseif (classId == NPC_ROSTNSTHAL) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001", nil, nil, nil);
|
||||
if (seq000_Flag_MiniTut1 == false) then
|
||||
quest::UpdateENpc(classId, FLAG, QFLAG_NONE);
|
||||
seq000_Flag_MiniTut1 = true;
|
||||
end
|
||||
elseif (classId == NPC_EXIT_TRIGGER) then
|
||||
doExitDoor(player, quest, npc);
|
||||
return;
|
||||
end
|
||||
player:EndEvent();
|
||||
|
||||
if (seq000_Flag_MiniTut1 == true && seq000_Flag_MiniTut2 == true && seq000_Flag_MiniTut3 == true) then
|
||||
quest::UpdateENpc(NPC_EXIT_TRIGGER, FLAG, QFLAG_BOTH);
|
||||
quest::UpdateENpc(NPC_EXIT_TRIGGER, CANPUSH, true);
|
||||
end
|
||||
end
|
||||
|
||||
function sequence005_onTalk(player, quest, npc, classId)
|
||||
end
|
||||
|
||||
function sequence010_onTalk(player, quest, npc, classId)
|
||||
end
|
||||
|
||||
function onEmote(player, quest, npc, emote)
|
||||
end
|
||||
|
||||
function onPush(player, quest, npc)
|
||||
local sequence = quest::getSequence();
|
||||
local classId = npc::GetActorClassId();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
if (classId == NPC_EXIT_TRIGGER) then
|
||||
doExitDoor(player, quest, npc);
|
||||
return;
|
||||
elseif (classId == NPC_ROSTNSTHAL) then
|
||||
callClientFunction(player, "delegateEvent", player, man0l0Quest, "processTtrNomal002", nil, nil, nil);
|
||||
quest::UpdateENpc(NPC_ROSTNSTHAL, CANPUSH, false);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function onNotice(player, quest, npc)
|
||||
end
|
||||
|
||||
function getJournalInformation(player, quest)
|
||||
return {};
|
||||
end
|
||||
|
||||
function getJournalMapMarkerList(player, quest)
|
||||
local sequence = quest::getSequence();
|
||||
|
||||
if (sequence == SEQ_000) then
|
||||
return seq000_Markers;
|
||||
end
|
||||
end
|
||||
|
||||
function doExitDoor(player, quest, npc)
|
||||
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventNewRectAsk", nil);
|
||||
if (choice == 1) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2", nil, nil, nil, nil);
|
||||
player:EndEvent();
|
||||
|
||||
quest::StartSequence(SEQ_005);
|
||||
|
||||
contentArea = player:GetZone():CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0l01", "SimpleContent30002", "Quest/QuestDirectorMan0l001");
|
||||
|
||||
if (contentArea == nil) then
|
||||
return;
|
||||
end
|
||||
|
||||
director = contentArea:GetContentDirector();
|
||||
player:AddDirector(director);
|
||||
director:StartDirector(false);
|
||||
|
||||
player:KickEvent(director, "noticeEvent", true);
|
||||
player:SetLoginDirector(director);
|
||||
|
||||
GetWorldManager():DoZoneChangeContent(player, contentArea, -5, 16.35, 6, 0.5, 16);
|
||||
return;
|
||||
else
|
||||
player::EndEvent();
|
||||
end
|
||||
end
|
36
Data/scripts/quests/man/man2l0.lua
Normal file
36
Data/scripts/quests/man/man2l0.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
require("global.lua")
|
||||
|
||||
function onStart(player, quest)
|
||||
quest:StartSequence(SEQ_000);
|
||||
end
|
||||
|
||||
function onFinish(player, quest)
|
||||
end
|
||||
|
||||
function onSequence(player, quest, seqNum)
|
||||
quest:ClearENpcs();
|
||||
end
|
||||
|
||||
function onTalk(player, quest, npc)
|
||||
local sequence = quest:getSequence();
|
||||
local classId = npc:GetActorClassId();
|
||||
|
||||
|
||||
end
|
||||
|
||||
function onEmote(player, quest, npc, emote)
|
||||
end
|
||||
|
||||
function onPush(player, quest, npc)
|
||||
end
|
||||
|
||||
function onNotice(player, quest, npc)
|
||||
end
|
||||
|
||||
function getJournalInformation(player, quest)
|
||||
return {};
|
||||
end
|
||||
|
||||
function getJournalMapMarkerList(player, quest)
|
||||
return 11000105, 11000106;
|
||||
end
|
86
Data/scripts/quests/quest_template.lua
Normal file
86
Data/scripts/quests/quest_template.lua
Normal file
|
@ -0,0 +1,86 @@
|
|||
-- Sequence Numbers
|
||||
--[[
|
||||
The current section of the quest the player is on. Quests are divided into "sequences" with a different
|
||||
objective for each one. Depending on the sequence # the journal log will have text appeneded to it.
|
||||
Check xtx/quest for valid sequence values.
|
||||
]]
|
||||
SEQ_000 = 0;
|
||||
SEQ_005 = 5;
|
||||
SEQ_010 = 10;
|
||||
|
||||
-- Quest Variables
|
||||
--[[
|
||||
Locally stored variables, up to the script writer to make them up but use these to track things the player
|
||||
has done.
|
||||
]]
|
||||
local questFlag1 = false;
|
||||
local questFlag2 = false;
|
||||
local questFlag3 = false;
|
||||
local killCounter1 = 0;
|
||||
local killCounter2 = 0;
|
||||
local killCounter3 = 0;
|
||||
|
||||
-- Map Markers
|
||||
--[[
|
||||
A list of markers to show when the player opens the journal and clicks "View Map". References the
|
||||
quest_marker sheet.
|
||||
]]
|
||||
local seq000_Markers = {
|
||||
};
|
||||
|
||||
-- Actors in this quest
|
||||
--[[
|
||||
A list of actor class ids that the quest will use. Good for adding it to the ENPC list and checking against
|
||||
them when events are triggered.
|
||||
]]
|
||||
NPC_SOMEACTOR = 0;
|
||||
|
||||
-- Called when a quest is started. Initialize any global variables across all phases here and always start
|
||||
-- the first sequence (usually SEQ_000).
|
||||
function onStart(player, quest)
|
||||
quest::StartSequence(SEQ_000);
|
||||
end
|
||||
|
||||
-- Called when the quest is finished, either from abandonment or completion. Clean up quest items or w.each
|
||||
-- here.
|
||||
function onFinish(player, quest)
|
||||
end
|
||||
|
||||
-- Called when a sequence starts, either from the quest progressing to the next sequence, or from the
|
||||
-- player loading in with an already in progress quest. This class should add all appropriate ENPCs and
|
||||
-- configure them to the current quest state (flags, counters, etc).
|
||||
function onSequence(player, quest, seqNum)
|
||||
end
|
||||
|
||||
-- Called when an ENPC is talked to; only ENPCs that are currently added to the quest will trigger this.
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
end
|
||||
|
||||
-- Called when an ENPC is emoted to; only ENPCs that are currently added to the quest will trigger this.
|
||||
function onEmote(player, quest, npc, emote, eventName)
|
||||
end
|
||||
|
||||
|
||||
-- Called when an ENPC is pushed; only ENPCs that are currently added to the quest will trigger this.
|
||||
function onPush(player, quest, npc, eventName)
|
||||
end
|
||||
|
||||
-- Called when an ENPC is kicked; only ENPCs that are currently added to the quest will trigger this.
|
||||
function onNotice(player, quest, npc, eventName)
|
||||
end
|
||||
|
||||
-- Called when the player clicks on an NPC Linkshell. Check the id and send a message if there is one.
|
||||
function onNpcLS(player, npcLSId)
|
||||
end
|
||||
|
||||
-- This is called by the RequestQuestJournalCommand to retrieve any extra information about the quest.
|
||||
-- Check xtx/quest for valid values.
|
||||
function getJournalInformation(player, quest)
|
||||
return {};
|
||||
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)
|
||||
return {};
|
||||
end
|
29
Data/scripts/quests/trl/Trl0g1.lua
Normal file
29
Data/scripts/quests/trl/Trl0g1.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
Name: Getting Started (Mother Miounne)
|
||||
Code: Trl0g1
|
||||
Id: 110141
|
||||
|
||||
Enables the "Getting Started" option on Miounne.
|
||||
* NOTE: This quest is active for all players at all times.
|
||||
]]
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventMiounneStart");
|
||||
|
||||
if (choice == 1) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent225");
|
||||
elseif (choice == 2) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent230");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function IsQuestENPC(player, quest, npc)
|
||||
return npc:GetActorClassId()] == 1000230;
|
||||
end
|
29
Data/scripts/quests/trl/Trl0l1.lua
Normal file
29
Data/scripts/quests/trl/Trl0l1.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
Name: Getting Started (Baderon)
|
||||
Code: Trl0l1
|
||||
Id: 110140
|
||||
|
||||
Enables the "Getting Started" option on Baderon.
|
||||
* NOTE: This quest is active for all players at all times.
|
||||
]]
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventBaderonStart");
|
||||
|
||||
if (choice == 1) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent640");
|
||||
elseif (choice == 2) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent650");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function IsQuestENPC(player, quest, npc)
|
||||
return npc:GetActorClassId()] == 1000137;
|
||||
end
|
29
Data/scripts/quests/trl/Trl0u1.lua
Normal file
29
Data/scripts/quests/trl/Trl0u1.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
Quest Script
|
||||
|
||||
Name: Getting Started (Momodi)
|
||||
Code: Trl0u1
|
||||
Id: 110142
|
||||
|
||||
Enables the "Getting Started" option on Momodi.
|
||||
* NOTE: This quest is active for all players at all times.
|
||||
]]
|
||||
|
||||
function onTalk(player, quest, npc, eventName)
|
||||
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventMomodiStart");
|
||||
|
||||
if (choice == 1) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent235");
|
||||
elseif (choice == 2) then
|
||||
callClientFunction(player, "delegateEvent", player, quest, "processEvent240");
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function IsQuestENPC(player, quest, npc)
|
||||
return npc:GetActorClassId() == 1000841;
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue