Got Fade to White 99% scripted out. Got Path Companion data all setup and saving/loading. Fixed the BgKeepouts and they properly show their msgs. Added quests to MarketEntrances. Fixed MarketEntrances. Hooked cutscene book to the Patch Companion you use.

This commit is contained in:
Filip Maj 2022-04-12 01:06:12 -04:00
parent a5a039ce3d
commit ac22637b4f
11 changed files with 633 additions and 33 deletions

View file

@ -1,5 +1,19 @@
require ("global")
--[[
BgKeepout Script
Used to send a msg to the player that they cannot proceed passed this point. Invisible walls are
linked to this object.
]]
function init(npc)
return false, false, 0, 0;
end
end
function onEventStarted(player, npc, triggerName)
player:SendGameMessage(player, GetWorldMaster(), 60001, 0x20);
player:EndEvent();
end

View file

@ -82,15 +82,19 @@ city = {
[1500394] = 3, -- Ul'dah : Edine
}
ENTRANCE_LIMSA_DT = 1090238; -- Main Limsa Entrance
ENTRANCE_LIMSA_ALT = 1500392; -- M'septha Alternate
ENTRANCE_GRIDANIA_DT = 1090264; -- Main Grid Entrance
ENTRANCE_GRIDANIA_ALT = 1500393; -- Torsefers Alternate
ENTRANCE_ULDAH_DT = 1090265; -- Main Uldah Entrance
ENTRANCE_ULDAH_ALT = 1500394; -- Edine Alternate
function onEventStarted(player, npc, triggerName)
function onEventStarted(player, npc, eventType, eventName)
local npcCity = city[npc:GetActorClassId()] or 1;
local wardPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese
local marketPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese
local exitPlaceName = CITY_INFO[npcCity][2]; -- Central Limsa Lominsa / Heartstream / The Fronds
local gcHQPlaceName = CITY_INFO[npcCity][3]; -- Maelstrom Command / Adders' Nest / Hall of Flames
local questAreaName = 0; --CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward
local questPlaceName = CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward
local wardListStart = CITY_INFO[npcCity][5]; -- Starting id for the market wards
local wardListCount = CITY_INFO[npcCity][6]; -- Amount of wards in the list
local showItemSearchCounter = false;
@ -98,19 +102,30 @@ function onEventStarted(player, npc, triggerName)
local worldMaster = GetWorldMaster();
local pos = player:GetPos();
local currZone = pos[4];
local currZone = pos[5];
local currRegion = player.CurrentArea.RegionId;
local quests = player:GetQuestsForNpc(npc);
if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then
-- City entrance specific stuff
if (currRegion == 101 or currRegion == 103 or currRegion == 104) then
exitPlaceName = 0; -- If in city, hide city menu option
elseif (currZone == 232 or currZone == 234 or currZone == 233) then
gcHQPlaceName = 0; -- If in GC Office, hide office menu option
-- If no quests attached to this entrence, don't show quest area
if (#quests == 0) then
questPlaceName = 0;
end
end
-- If in GC Office, hide office menu option
if (currZone == 232 or currZone == 234 or currZone == 233) then
gcHQPlaceName = 0;
end
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId);
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, marketPlaceName, gcHQPlaceName, questPlaceName, showItemSearchCounter, itemSearchId);
while (true) do
if choice == wardPlaceName then -- Market Wards
if choice == marketPlaceName then -- Market Wards
wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0);
if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then
@ -139,11 +154,14 @@ function onEventStarted(player, npc, triggerName)
wait(1);
GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]);
break;
elseif (choice == 2095 or choice == 3095) then -- Quest
quests[1]:OnPush(player, npc, eventName);
return;
elseif (choice == 0 or choice == -3) then -- Menu Closed
break;
end
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId);
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, marketPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId);
end

View file

@ -15,10 +15,37 @@ function init(npc)
end
function onEventStarted(player, npc, triggerName)
choice = callClientFunction(player, "eventDoorMoveAsk");
local choice = callClientFunction(player, "eventDoorMoveAsk");
if (choice == 1) then
local activeQuests = player:GetQuestsForNpc(npc);
-- Either let the player choose the quest or start it if it's the only one.
local chosenQuest;
if (#activeQuests > 1) then
local currentPage = 0;
local numPages = math.floor((#activeQuests-1)/4) + 1;
while (true) do
local page, index = callClientFunction(player, "switchEvent", activeQuests[currentPage * 4 + 1], activeQuests[currentPage * 4 + 2], possibleQuests[currentPage * 4 + 3], possibleQuests[currentPage * 4 + 4], currentPage + 1, numPages, 0x3F1);
if (page == 0) then
chosenQuest = activeQuests[(currentPage * 4) + index];
break;
elseif (page > 0) then
currentPage = page - 1;
else
player:EndEvent();
return;
end
end
elseif (#activeQuests == 1) then
chosenQuest = activeQuests[1];
end
if (chosenQuest ~= nil) then
chosenQuest:OnPush(player, npc, eventName);
return;
end
end
player:EndEvent();

View file

@ -0,0 +1,376 @@
require("global");
--[[
Quest Script
Name: Fade to White
Code: Man200
Id: 110013
Prereq: Etc2l0 or Etc2g0 or Etc2u0. Level 18, any class.
]]
-- Sequence Numbers
SEQ_000 = 0; -- Go to the event door
SEQ_005 = 5; -- Talk to Minfilia to use the echo on her.
SEQ_010 = 10; -- Talk to Minfilia to join the Path of the Twelve.
SEQ_020 = 20; -- Path companion selection sequence.
SEQ_025 = 25; -- Wait for the linkpearl message.
SEQ_027 = 27; -- Pray return to the Waking Sands
-- Quest Actors
MINFILIA = 1000843;
TATARU = 1001046;
SATZFLOH = 1001228;
PERCEVAINS = 1001229;
UNA_TAYUUN = 1001230;
ROUGH_SPOKEN_FELLOW = 1001274;
RED_SHOED_RASCAL = 1001275;
ABSTRACTED_GLADIATOR = 1001276;
CHAPEAUED_CHAP = 1001277;
BARRATROUS_BUCCANEER = 1001278;
SOFTHEARTED_SEPTUAGEN = 1001279;
INDIGO_EYED_ARCHER = 1001280;
LOAM_SCENETED_LADY = 1001281;
UNCOMFORTABLE_BRUTE = 1001282;
SAHJA_ZHWAN = 1001373;
NENEKANI = 1001374;
GODFREY = 1001375;
FENANA = 1001376;
NONORU = 1001377;
SERANELIEN = 1001378;
SNPC_START = 1070001;
SNPC_END = 1070166;
MARKET_ENTRENCE = 1090265;
EVENT_DOOR_EXIT = 1090160;
EVENT_DOOR_OFFICE_W = 1090161;
EVENT_DOOR_OFFICE_E = 1090162;
MOMODI = 1000841;
-- Quest Markers
MRKR_STEP1 = 11001301;
MRKR_STEP2 = 11001302;
MRKR_STEP3 = 11001303;
MRKR_STEP4 = 11001304;
MRKR_STEP5 = 11001305;
MRKR_STEP6 = 11001306;
-- Quest Flags
FLAG_VISITED = 0;
FLAG_TALKED_TATARU = 1;
FLAG_DUTY_COMPLETE = 2;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
local data = quest:GetData();
-- Sequence changing ENpcs
if (sequence == SEQ_000) then
quest:SetENpc(EVENT_DOOR_OFFICE_W, QFLAG_MAP, false, true);
quest:SetENpc(TATARU);
elseif (sequence == SEQ_005) then
quest:SetENpc(MINFILIA, QFLAG_PLATE);
quest:SetENpc(EVENT_DOOR_OFFICE_W, QFLAG_MAP, false, true);
quest:SetENpc(EVENT_DOOR_OFFICE_E, QFLAG_NONE, false, true);
quest:SetENpc(TATARU);
elseif (sequence == SEQ_010) then
quest:SetENpc(MINFILIA, QFLAG_PLATE);
quest:SetENpc(EVENT_DOOR_OFFICE_W, QFLAG_MAP, false, true);
quest:SetENpc(EVENT_DOOR_OFFICE_E, QFLAG_NONE, false, true);
quest:SetENpc(TATARU);
elseif (sequence == SEQ_020) then
quest:SetENpc(TATARU, QFLAG_PLATE);
quest:SetENpc(MINFILIA);
elseif (sequence == SEQ_025) then
quest:SetENpc(TATARU);
elseif (sequence == SEQ_027) then
if (quest:GetData():GetFlag(FLAG_DUTY_COMPLETE)) then
quest:SetENpc(MOMODI, QFLAG_PLATE);
quest:SetENpc(TATARU);
else
quest:SetENpc(TATARU, QFLAG_PLATE);
quest:SetENpc(SNPC_START + player:GetSNpcSkin());
end
end
-- All the other ENpcs in the Waking Sands
quest:SetENpc(MARKET_ENTRENCE, QFLAG_NONE, false, true);
quest:SetENpc(EVENT_DOOR_EXIT, QFLAG_MAP, false, true);
quest:SetENpc(SATZFLOH);
quest:SetENpc(PERCEVAINS);
quest:SetENpc(UNA_TAYUUN);
quest:SetENpc(ROUGH_SPOKEN_FELLOW);
quest:SetENpc(RED_SHOED_RASCAL);
quest:SetENpc(ABSTRACTED_GLADIATOR);
quest:SetENpc(CHAPEAUED_CHAP);
quest:SetENpc(BARRATROUS_BUCCANEER);
quest:SetENpc(SOFTHEARTED_SEPTUAGEN);
quest:SetENpc(INDIGO_EYED_ARCHER);
quest:SetENpc(LOAM_SCENETED_LADY);
quest:SetENpc(UNCOMFORTABLE_BRUTE);
quest:SetENpc(SAHJA_ZHWAN);
quest:SetENpc(NENEKANI);
quest:SetENpc(GODFREY);
quest:SetENpc(FENANA);
quest:SetENpc(NONORU);
quest:SetENpc(SERANELIEN);
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_000) then
if (classId == TATARU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2");
end
elseif (sequence == SEQ_005) then
if (classId == MINFILIA) then
callClientFunction(player, "delegateEvent", player, quest, "pE20", "???", 1, 1, 1, player:GetInitialTown());
quest:StartSequence(SEQ_010);
elseif (classId == TATARU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2");
end
elseif (sequence == SEQ_010) then
if (classId == MINFILIA) then
local didJoinPoT = callClientFunction(player, "delegateEvent", player, quest, "pE25", "???", 1, 1, 1, player:GetInitialTown());
if (didJoinPoT == 1) then
player:EndEvent();
GetWorldManager():WarpToPosition(player, -142.75, 1, -160, -1.6);
quest:StartSequence(SEQ_020);
return;
end
elseif (classId == TATARU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_2");
end
elseif (sequence == SEQ_020) then
if (classId == TATARU) then
-- Selecting a Path Companion
local sNpcActorClassId, sNpcPersonality = callClientFunction(player, "delegateEvent", player, quest, "processSnpcSelect", "???", 1, 1, 1, player:GetInitialTown());
if (sNpcActorClassId != -1 and sNpcPersonality != -1) then
player:SetSNpc("???", sNpcActorClassId, sNpcPersonality);
player:AddNpcLs(6);
quest:StartSequence(SEQ_025);
end
player:EndEvent();
return;
end
elseif (sequence == SEQ_025) then
if (classId == TATARU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent040_2");
quest:NewNpcLsMsg(6);
end
elseif (sequence == SEQ_027) then
if (classId == MOMODI) then
callClientFunction(player, "delegateEvent", player, quest, "pE25", "???", 1, 1, 1, player:GetInitialTown());
elseif (classId == TATARU) then
if (not quest:GetData():GetFlag(FLAG_DUTY_COMPLETE)) then
startMan20001Content(player, quest);
return;
else
callClientFunction(player, "delegateEvent", player, quest, "pE050_2", player:GetSNpcNickname(), player:GetSNpcSkin(), player:GetSNpcPersonality(), player:GetSNpcCoordinate(), player:GetInitialTown());
end
elseif (classId > SNPC_START and classId < SNPC_END) then
local name = callClientFunction(player, "delegateEvent", player, quest, "pEN", player:GetSNpcPersonality());
if (not name == nil) then
player:SetSNpc(name, player:GetSNpcSkin(), player:GetSNpcPersonality());
--player:GetDirector("QuestEventMan20001"):SetData("NameSet", true);
end
end
end
-- Other ENpcs
if (sequence < SEQ_010) then
seq000_onTalkOtherNpcs(player, quest, npc);
else
seq010_onTalkOtherNpcs(player, quest, npc);
end
-- Regardless of sequence
if (classId == EVENT_DOOR_OFFICE) then
elseif (classId == EVENT_DOOR_EXIT) then
elseif (classId == NONORU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_8");
elseif (classId == CHAPEAUED_CHAP) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_9");
elseif (classId == ROUGH_SPOKEN_FELLOW) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_10");
elseif (classId == SATZFLOH) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_18");
elseif (classId == PERCEVAINS) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_19");
elseif (classId == UNA_TAYUUN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_20");
end
player:EndEvent();
quest:UpdateENPCs();
end
function seq000_onTalkOtherNpcs(player, quest, npc)
local classId = npc:GetActorClassId();
if (classId == SERANELIEN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_3");
elseif (classId == SAHJA_ZHWAN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_4");
elseif (classId == NENEKANI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_5");
elseif (classId == GODFREY) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_6");
elseif (classId == FENANA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_7");
elseif (classId == LOAM_SCENETED_LADY) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_11");
elseif (classId == SOFTHEARTED_SEPTUAGEN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_12");
elseif (classId == INDIGO_EYED_ARCHER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_13");
elseif (classId == BARRATROUS_BUCCANEER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_14");
elseif (classId == UNCOMFORTABLE_BRUTE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_15");
elseif (classId == RED_SHOED_RASCAL) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_16");
elseif (classId == ABSTRACTED_GLADIATOR) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_17");
end
end
function seq010_onTalkOtherNpcs(player, quest, npc)
local classId = npc:GetActorClassId();
if (classId == SERANELIEN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_3");
elseif (classId == SAHJA_ZHWAN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_4");
elseif (classId == NENEKANI) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_5");
elseif (classId == GODFREY) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_6");
elseif (classId == FENANA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_7");
elseif (classId == LOAM_SCENETED_LADY) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_8");
elseif (classId == SOFTHEARTED_SEPTUAGEN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_9");
elseif (classId == INDIGO_EYED_ARCHER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_10");
elseif (classId == BARRATROUS_BUCCANEER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_11");
elseif (classId == UNCOMFORTABLE_BRUTE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_12");
elseif (classId == RED_SHOED_RASCAL) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_13");
elseif (classId == ABSTRACTED_GLADIATOR) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent020_14");
end
end
function onPush(player, quest, npc)
local data = quest:GetData();
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (classId == MARKET_ENTRENCE) then
if (sequence == SEQ_000 and not data:GetFlag(FLAG_VISITED)) then
data:SetFlag(FLAG_VISITED);
callClientFunction(player, "delegateEvent", player, quest, "pE00", "???", 1, 1, 1, player:GetInitialTown());
elseif (sequence == SEQ_000 and not data:GetFlag(FLAG_VISITED)) then
end
player:EndEvent();
GetWorldManager():DoZoneChange(player, 181, nil, 0, 15, -205.25, 0, -160, 1.55);
return;
end
if (classId == EVENT_DOOR_EXIT) then
player:EndEvent();
GetWorldManager():DoZoneChange(player, 175, nil, 0, 15, -216.52, 190, 30.5, 2.32);
elseif (classId == EVENT_DOOR_OFFICE_W) then
if (sequence == SEQ_000) then
callClientFunction(player, "delegateEvent", player, quest, "pE10", "???", 1, 1, 1, player:GetInitialTown());
quest:StartSequence(SEQ_005);
end
player:EndEvent();
GetWorldManager():WarpToPosition(player, -126.2, 1.2, -160, 1.6);
return;
elseif (classId == EVENT_DOOR_OFFICE_E) then
player:EndEvent();
GetWorldManager():WarpToPosition(player, -142.75, 1, -160, -1.6);
return;
end
player:EndEvent();
quest:UpdateENPCs();
end
function onNpcLS(player, quest, from, msgStep)
local sequence = quest:getSequence();
if (from == 6) then
player:SendGameMessageLocalizedDisplayName(quest, 435, MESSAGE_TYPE_NPC_LINKSHELL, 1500054);
quest:EndOfNpcLsMsgs();
quest:StartSequence(SEQ_027);
end
player:EndEvent();
end
function getJournalInformation(player, quest)
if (quest:GetData():GetFlag(FLAG_DUTY_COMPLETE)) then
return 1, 0, 0, 0, 0, player:GetSNpcNickname();
end
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_STEP1;
elseif (sequence == SEQ_005) then
return MRKR_STEP2;
elseif (sequence == SEQ_010) then
return MRKR_STEP3;
elseif (sequence == SEQ_020) then
return MRKR_STEP4;
elseif (sequence == SEQ_025) then
return MRKR_STEP5;
elseif (sequence == SEQ_027) then
return MRKR_STEP6;
end
end
function startMan20001Content(player, quest)
local result = callClientFunction(player, "delegateEvent", player, quest, "contentsJoinAskInBasaClass");
if (result == 1) then
callClientFunction(player, "delegateEvent", player, quest, "pE050", player:GetSNpcNickname(), player:GetSNpcSkin(), player:GetSNpcPersonality(), player:GetSNpcCoordinate(), player:GetInitialTown());
-- DO NAMING DUTY HERE
-- For now just skip the sequence
player:EndEvent();
GetWorldManager():DoZoneChange(player, 230, nil, 0, 0, -639.325, 1, 403.967, 1.655);
local contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man20001", "SimpleContent30002", "Quest/QuestDirectorEventMan20001");
if (contentArea == nil) then
return;
end
director = contentArea:GetContentDirector();
player:AddDirector(director);
director:StartDirector(false);
GetWorldManager():DoZoneChangeContent(player, contentArea, -200, 0 -160, -1.6, 2);
return;
end
player:EndEvent();
end