Merge branch 'Jorge/quest_system' into ioncannon/quest_system

This commit is contained in:
Filip Maj 2022-04-13 20:12:38 -04:00
commit 9a2f8ef89a
31 changed files with 1730 additions and 381 deletions

View file

@ -59,7 +59,7 @@ local defaultTalkSea = {
[1000164] = "defaultTalkWithFaucillien_001", -- Faucillien (Limsa Upper Decks: FSH Guild) - Will not fire, not PplStd
[1000165] = "defaultTalkWithLouviaune_001", -- Louviaune (Limsa Upper Decks: FSH Guild) - Will not fire, not PplStd
[1000166] = "defaultTalkWithUrsulie_001", -- Ursulie (Limsa Upper Decks: Adv. Guild) - Will not fire, not PplStd. Retainer NPC
[1000167] = "defaultTalkWithInn_Desk", -- Mytesyn (Limsa Upper Decks: Adv. Guild) defaultTalkWithMytesyn_001 (Pre-Inn dialog.)
[1000167] = "defaultTalkWithMytesyn_001", -- Mytesyn (Limsa Upper Decks: Adv. Guild) defaultTalkWithInn_Desk - used when Inn unlocked
[1000168] = "defaultTalkWithPrudentia_001", -- Prudentia (Limsa Upper Decks: CUL Guild)
[1000169] = "defaultTalkWithPulmia_001", -- Pulmia (Limsa Upper Decks: CUL Guild)
[1000170] = "defaultTalkWithRsushmo_001", -- R'sushmo (Limsa Upper Decks: CUL Guild)
@ -260,7 +260,11 @@ function onTalk(player, quest, npc, eventName)
local clientFunc = defaultTalkSea[npcId];
if (npcId == 1000167) then -- Mytesyn - Inn NPC
defaultTalkWithInn(player, quest, clientFunc);
if (player:IsQuestCompleted(110838)) then -- "The Ink Thief" completed.
defaultTalkWithInn(player, quest, "defaultTalkWithInn_Desk");
else
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
end
else
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
end

View file

@ -14,7 +14,6 @@ Contains all default lines for talkable npcs in the Wilderness Region (aka Thana
-- [ActorClassId] = "client_function_name"
local defaultTalkWil = {
[1000046] = "defaultTalkWithGogofu_001", -- Gogofu
[1000047] = "defaultTalkWithHahayo_001", -- Hahayo
[1000070] = "defaultTalkWithKukumuko_001", -- Kukumuko
@ -66,7 +65,7 @@ local defaultTalkWil = {
[1000861] = "defaultTalkWithLinette_001", -- Linette
[1000862] = "defaultTalkWithGagaruna_001", -- Gagaruna
[1000863] = "defaultTalkWithLulutsu_001", -- Lulutsu
[1000864] = "defaultTalkWithInn_Desk", -- Otopa Pottopa - defaultTalkWithOtopapottopa_001 (pre-Inn unlock?)
[1000864] = "defaultTalkWithOtopapottopa_001", -- Otopa Pottopa - defaultTalkWithInn_Desk - used when Inn unlocked
[1000865] = "defaultTalkWithThaisie_001", -- Thaisie - Mentions retainers, but will not fire since she's not PplStd.
[1000887] = "defaultTalkWithZssapa_001", -- <<<NOT IMPLEMENTED>>> - Z'ssapa (Central Thanalan: Black Brush: 92.779999 183.837 -1030.310059) alt actor ID: 1001217 (used in a quest presumably, different outfit from wiki image)
[1000915] = "defaultTalkWithCahernaut_001", -- Cahernaut
@ -98,8 +97,8 @@ local defaultTalkWil = {
[1001143] = "defaultTalkWithTotono_001", -- Totono
[1001144] = "defaultTalkWithFyrilsunn_001", -- Fyrilsunn
[1001145] = "defaultTalkWithSinette_001", -- Sinette
[1001146] = "defaultTalkWithZirnbyrt_001", -- <<<NOT IMPLEMENTED>>> - Zirnbyrt - Entry Denier Guard (East Thanalan: X:1831.565 Y:248.576 Z:448.872 Educated guess from wiki picture. Guards unused dun01)
[1001147] = "defaultTalkWithVhasotayuun_001", -- <<<NOT IMPLEMENTED>>> - Vhaso Tayuun - (Entry Denier? No wiki info)
[1001146] = "defaultTalkWithZirnbyrt_001", -- <<<NOT IMPLEMENTED>>> - Zirnbyrt - Entry Denier (East Thanalan: X:1831.565 Y:248.576 Z:448.872 Educated guess from wiki picture. Guards unused dun01)
[1001147] = "defaultTalkWithVhasotayuun_001", -- <<<NOT IMPLEMENTED>>> - Vhaso Tayuun - Entry Denier (East Thanalan: X:1818.940 Y:244.810 Z:-76.766 rough guess from vid. Guards unused dun03)
[1001148] = "defaultTalkWithPulbeiyalbei_001", -- <<<NOT IMPLEMENTED>>> - Pulbei Yalbei - (Entry Denier? No wiki info)
[1001149] = "defaultTalkWithGembert_001", -- <<<NOT IMPLEMENTED>>> - Gembert - Entry Denier Guard (South Thanalan: X:1707.143 Y:238.150 Z:1617.570 Rough estimate. Guards unused dun06)
[1001165] = "defaultTalkWithMumukiya_001", -- Mumukiya
@ -200,9 +199,9 @@ local defaultTalkWil = {
[1001600] = "defaultTalkWithBertouaint_001", -- <<<NOT IMPLEMENTED>>> - Bertouaint (Eastern Thanalan: Mythril Pit T-8)
[1001601] = "defaultTalkWithAldebrand_001", -- <<<NOT IMPLEMENTED>>> - Aldebrand (Eastern Thanalan: Mythril Pit T-8)
[1001602] = "defaultTalkWithPyhajawantal_001", -- <<<NOT IMPLEMENTED>>> - Pyha Jawantal (Eastern Thanalan: Mythril Pit T-8)
[1001624] = "talkIdayCap", -- <<<NOT IMPLEMENTED>>> - Flame Lieutenant Somber Meadow (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version
[1001625] = "talkIday1", -- <<<NOT IMPLEMENTED>>> - Flame Sergeant Mimio Mio (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version
[1001626] = "talkIday2", -- <<<NOT IMPLEMENTED>>> - Flame Private Sisimuza Tetemuza (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version
--[1001624] = "talkIdayCap", -- <<<NOT IMPLEMENTED>>> - Flame Lieutenant Somber Meadow (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version
--[1001625] = "talkIday1", -- <<<NOT IMPLEMENTED>>> - Flame Sergeant Mimio Mio (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version
--[1001626] = "talkIday2", -- <<<NOT IMPLEMENTED>>> - Flame Private Sisimuza Tetemuza (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version
[1001630] = "defaultTalkWithChocobo_001", -- <<<NOT IMPLEMENTED>>> - Chocobo (Western Thanalan: The Coffer & Coffin) - Stands beside Haipo Eipo
[1001685] = "defaultTalkWithAdalbert_001", -- <<<NOT IMPLEMENTED>>> - Flame Sergeant Cotter (Ul'dah: Merchant Strip: -0.92 196.100 126.32) - Double check caps.
[1001699] = "defaultTalkWithJandonaut_001", -- <<<NOT IMPLEMENTED>>> - Flame Sergeant Fouillel (Southern Thanalan: Camp Broken Water: 1704 296.001 999)
@ -228,8 +227,11 @@ local defaultTalkWil = {
[1001925] = "defaultTalkWithHortwann_001", -- <<<NOT IMPLEMENTED>>> - Flame Private Hanskalsyn - (North Thanalan: Camp Bluefog)
[1001932] = "defaultTalkWithSIBOLD_001", -- Sibold
[1001953] = "defaultTalkWithBerndan_001", -- Berndan
[1002047] = "defaultTalkWithInn_Desk_2", -- Kopuru Fupuru - Inn NPC. - defaultTalkWithKopuruFupuru_001 (pre-Inn unlock?)
[1002047] = "defaultTalkWithKopuruFupuru_001", -- Kopuru Fupuru - Inn NPC - defaultTalkWithInn_Desk_2 used when Inn unlocked
[1002101] = "defaultTalkWithDuraltharal_001", -- Dural Tharal
[1002110] = "processEventSOMBER", -- Flame Lieutenant Somber Meadow (Foundation Day 2012 Dialog) Spl000 staticactor
[1002111] = "processEventMIMIO", -- Flame Sergeant Mimio Mio (Foundation Day 2012 Dialog) Spl000 staticactor
[1002112] = "processEventSISIMUZA", -- Flame Private Sisimuza Tetemuza (Foundation Day 2012 Dialog) Spl000 staticactor
[1002116] = "defaultTalkWithHAVAK_ALVAK_001", -- <<<NOT IMPLEMENTED>>> - Havak Alvak (Ul'dah: Milvaneth Sacrarium)
[1060028] = "defaultTalkWithCURIOUS_001", -- <<<NOT IMPLEMENTED>>> - Curious Gorge (Western Thanalan: -1116.040039, 53.2, 285.48999)? - defaultTalkWithCURIOUS_002
[1060029] = "defaultTalkWithSarra_001", -- <<<NOT IMPLEMENTED>>> - Sarra (Location unknown) defaultTalkWithSarra_002 / 003
@ -240,16 +242,15 @@ local defaultTalkWil = {
[1060037] = "defaultTalkWithHateli_001", -- <<<NOT IMPLEMENTED>>> - Dozol Meloc (Western Thanalan: -1513.660034, 10.617, -235.220001) defaultTalkWithHateli_002 / 003 / 004 / 005 / 006 / 007
[1060038] = "defaultTalkWithDaza_001", -- <<<NOT IMPLEMENTED>>> - 269th Order Mendicant Da Za (Western Thanalan: Somewhere in the cave around -1567, 25, -170) - defaultTalkWithDaza_002 / 003 / 004 / 005 / 006 / 007
[1060042] = "defaultTalkWithJenlyns_001", -- Jenlyns - defaultTalkWithJenlyns_002 (PLD-unlocked specific dialog?)
[1200120] = "bookTalk", -- Dusty Tomes - - Will not fire since it isn't PplStd. Identical dialog regardless.
[1200120] = "bookTalk", -- Dusty Tomes - Will not fire since it isn't PplStd. Identical dialog regardless.
[1500059] = "defaultTalkWithLdhakya_001", -- <<<NOT IMPLEMENTED>>> - L'dhakya (Western Thanalan Ferry Docks)
[1500109] = "defaultTalkWithSylviel_001", -- <<<NOT IMPLEMENTED>>> - Sylviel (Western Thanalan Ferry Docks)
[1500110] = "defaultTalkWithSamigamduhla_001", -- <<<NOT IMPLEMENTED>>> - Sami Gamduhla (Western Thanalan Ferry Docks)
[1500126] = "tribeTalk", -- Vavaki
[1500129] = "defaultTalkWithYayatoki_001", -- Yayatoki
[1500230] = "defaultTalkCaravanChocoboUld_001", -- Pack Chocobo (needs verifying)
[1700039] = "defaultTalkWithBATERICH_100", -- Baterich
[1000001] = "defaultTalkWithHamletGuardUld_001" -- TEST TEST TEST
--[1090549] = "defaultTalkWithInn_ExitDoor" -- Ul'dah Inn Exit Door pushEvent - "Leave your room?"
--[1200336] = "defaultTalkWithInn_ExitDoor" -- Ul'dah Inn Exit Door talkEvent - "Leave your room?"
@ -260,23 +261,30 @@ local defaultTalkWil = {
[???] = "defaultTalkWithHamletGuardUld_001" --
--]]
-- [1002110] = "processEventSOMBER", arg1, -- Flame Lieutenant Somber Meadow (Foundation Day 2012 Dialog) Spl000 staticactor
-- [1002111] = "processEventMIMIO" -- Flame Sergeant Mimio Mio (Foundation Day 2012 Dialog) Spl000 staticactor
-- [1002112] = "processEventSISIMUZA" -- Flame Private Sisimuza Tetemuza (Foundation Day 2012 Dialog) Spl000 staticactor
}
function onTalk(player, quest, npc, eventName)
local npcId = npc:GetActorClassId();
local clientFunc = defaultTalkWil[npcId];
if (npcId == 1002047) then -- Kopuru Fupuru - Inn NPC
defaultTalkWithInn(player, quest, clientFunc);
if (npcId == 1000864) then -- Otopa Pottopa (Adv. Guild Inn NPC)
if (player:IsQuestCompleted(110848)) then -- "Ring of Deceit" completed.
callClientFunction(player, "delegateEvent", player, quest, "defaultTalkWithInn_Desk");
else
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
end
elseif (npcId == 1002047) then -- Kopuru Fupuru (Rear-Entrance Inn NPC)
if (player:IsQuestCompleted(110848)) then -- "Ring of Deceit" completed.
defaultTalkWithInn(player, quest, "defaultTalkWithInn_Desk_2");
else
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
end
elseif ((npcId >= 1002110) and (npcId <= 1002112)) then -- Foundation Day 2012 NPCs
talkWithSpecial(player, npcId, clientFunc)
else
callClientFunction(player, "delegateEvent", player, quest, clientFunc);
end
@ -284,13 +292,13 @@ function onTalk(player, quest, npc, eventName)
player:EndEvent();
end
function IsQuestENPC(player, quest, npc)
return defaultTalkWil[npc:GetActorClassId()] ~= nil;
end
function defaultTalkWithInn(player, quest, clientFunc)
local choice = callClientFunction(player, "delegateEvent", player, quest, clientFunc);
@ -304,4 +312,12 @@ function defaultTalkWithInn(player, quest, clientFunc)
player:SendGameMessage(GetWorldMaster(), 51140, 0x20); --This inn is already your Secondary Homepoint
end
end
end
function talkWithSpecial(player, npcId, clientFunc)
local splQuest = GetStaticActor("Spl000");
local magickedPrism = 0;
callClientFunction(player, "delegateEvent", player, splQuest, clientFunc, magickedPrism);
end

View file

@ -168,6 +168,7 @@ function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
local data = quest:GetData();
if (sequence == SEQ_000) then
if (not data:GetFlag(FLAG_TALKED_SYBELL)) then table.insert(possibleMarkers, MRKR_SYBELL); end

View file

@ -28,8 +28,6 @@ MRKR_PFARAHR = 11082001;
MRKR_VKOROLON = 11082002;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
player:SendGameMessage(GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, ITEM_WELL_WORN_BAG, 1);
end
function onFinish(player, quest)
@ -57,6 +55,10 @@ function onTalk(player, quest, npc)
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventVKOROLONStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
quest:StartSequence(SEQ_000);
wait(2);
attentionMessage(player, 25246, ITEM_WELL_WORN_BAG, 1);
end
player:EndEvent();
return;

View file

@ -0,0 +1,192 @@
require("global");
--[[
Quest Script
Name: In Plain Sight
Code: Etc5g1
Id: 110829
Prereq: Level 15. Etc5u1 (The Usual Suspect) completed.
Notes:
]]
-- Sequence Numbers
SEQ_000 = 0;
SEQ_010 = 10;
-- Actor Class Ids
OTOPA_POTTOPA = 1000864;
VKOROLON = 1000458;
THE_ROOST_BED = 1200379;
NICOLIAUX = 1002071; -- 1000409: Can't use his public area id, otherwise a ! shows on him there also
POWLE = 1000238;
AUNILLIE = 1000410;
GAUWYN_THE_GANNET = 1002065;
HILDIBRAND = 1002067;
NASHU_MHAKARACCA = 1001996;
PRIVATE_AREA_ENTRANCE = 1090086; -- Check that this ID is free to use before merge
PRIVATE_AREA_EXIT = 1290002;
-- DefaultTalk NPCs?
SANSA = 1000239;
ELYN = 1000411;
RYD = 1000412;
-- Quest Items
ITEM_WANTED_GAUWYN = 10011243;
-- Quest Markers
MRKR_ACORN_ORCHARD = 11082101;
MRKR_NICOLIAUX = 11082102;
MRKR_VKOROLON = 11082103;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
local hasQuestItem = player:GetItemPackage(INVENTORY_NORMAL):HasItem(ITEM_WANTED_GAUWYN);
if (hasQuestItem == false) then
quest:SetENpc(OTOPA_POTTOPA, QFLAG_NORM);
end
quest:SetENpc(THE_ROOST_BED, 5);
quest:SetENpc(VKOROLON, QFLAG_NORM); -- Always shows despite interaction
elseif (sequence == SEQ_000) then
quest:SetENpc(VKOROLON);
quest:SetENpc(NICOLIAUX, QFLAG_NORM);
quest:SetENpc(POWLE);
quest:SetENpc(AUNILLIE);
quest:SetENpc(GAUWYN_THE_GANNET);
quest:SetENpc(HILDIBRAND);
quest:SetENpc(NASHU_MHAKARACCA);
quest:SetENpc(PRIVATE_AREA_ENTRANCE, QFLAG_MAP, false, true, false, true);
elseif (sequence == SEQ_010) then
quest:SetENpc(VKOROLON, QFLAG_REWARD);
quest:SetENpc(NICOLIAUX);
quest:SetENpc(POWLE);
quest:SetENpc(AUNILLIE);
quest:SetENpc(GAUWYN_THE_GANNET);
quest:SetENpc(HILDIBRAND);
quest:SetENpc(NASHU_MHAKARACCA);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
if (classId == OTOPA_POTTOPA) then
local hasQuestItem = player:GetItemPackage(INVENTORY_NORMAL):HasItem(ITEM_WANTED_GAUWYN);
if (not hasQuestItem) then
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
giveWantedItem(player);
npc:SetQuestGraphic(player, QFLAG_NONE);
else
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart_2");
end
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 2075); -- Log out in The Roost w/ item.
elseif (classId == VKOROLON) then
-- This is retail accurate. No dialog functions called.
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 2075);
end
elseif (sequence >= SEQ_000) then
if (classId == VKOROLON) then
if (sequence == SEQ_010) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 500, 1, 1);
player:CompleteQuest(quest);
-- Log out in Mizzenmast Inn w/ item.
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 1070);
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1"); -- Educated guess
end
elseif (classId == NICOLIAUX) then
if (sequence == SEQ_010) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1"); -- Educated guess
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
attentionMessage(player, 25225, quest.GetQuestId()); -- objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_010);
end
elseif (classId == POWLE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_5");
elseif (classId == AUNILLIE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_6");
elseif (classId == GAUWYN_THE_GANNET) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
elseif (classId == HILDIBRAND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_3");
elseif (classId == NASHU_MHAKARACCA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_4");
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local npcClassId = npc.GetActorClassId();
player:EndEvent();
if (npcClassId == PRIVATE_AREA_ENTRANCE) then
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 5, -33.709, 7.810, -1272.337, -0.810);
end
end
function getJournalInformation(player, quest)
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_ACORN_ORCHARD; -- TO-DO: Check for private area and use MRKR_NICOLIAUX in place of this
elseif (sequence == SEQ_010) then
return MRKR_VKOROLON;
end
end
function giveWantedItem(player)
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_WANTED_GAUWYN, 1, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, GetWorldMaster(), 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, GetWorldMaster(), 40279, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
end
end

View file

@ -0,0 +1,104 @@
require("global");
--[[
Quest Script
Name: The Ink Thief
Code: Etc5l0
Id: 110838
Prereq: Level 1 on any class. Second MSQ completed. (110002 Man0l1 / 110006 Man0g1 / 110010 Man0u1)
Notes:
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to Sweetnix.
SEQ_001 = 1; -- Return to Mytesyn.
-- Actor Class Ids
MYTESYN = 1000167;
SWEETNIX = 1001573;
-- Quest Item
ITEM_INKWELL = 11000223;
-- Quest Markers
MRKR_SWEETNIX = 11072001;
MRKR_MYTESYN = 11072002;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(MYTESYN, QFLAG_NORM);
end
if (sequence == SEQ_000) then
quest:SetENpc(MYTESYN);
quest:SetENpc(SWEETNIX, QFLAG_NORM);
elseif (sequence == SEQ_001) then
quest:SetENpc(MYTESYN, QFLAG_REWARD);
quest:SetENpc(SWEETNIX);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local npcClassId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventMYTESYNStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
elseif (sequence == SEQ_000) then
if (npcClassId == MYTESYN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
elseif (npcClassId == SWEETNIX) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
attentionMessage(player, 25246, ITEM_INKWELL, 1);
attentionMessage(player, 25225, quest:GetQuestId());
quest:StartSequence(SEQ_001);
end
elseif (sequence == SEQ_001) then
if (npcClassId == MYTESYN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200,1 ,1)
player:CompleteQuest(quest);
elseif (npcClassId == SWEETNIX) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function getJournalInformation(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_001) then
return ITEM_INKWELL;
end
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_SWEETNIX;
elseif (sequence == SEQ_001) then
return MRKR_MYTESYN;
end
end

View file

@ -0,0 +1,166 @@
require("global");
--[[
Quest Script
Name: Private Eyes
Code: Etc5l1
Id: 110839
Prereq: Level 15. Man5g1 (In Plain Sight) complete. [110829]
Notes:
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to Bertrand
SEQ_010 = 10; -- Head to the meeting point.
-- Actor Class Ids
OTOPA_POTTOPA = 1000864;
MYTESYN = 1000167;
MIZZENMAST_BED = 1200378;
BERTRAND = 1001903; -- 1060004 also a valid ID, but doesn't look like the NPC appeared anywhere else?
ABRAHAM = 1002066;
PRIVATE_AREA_ENTRANCE = 1090087; -- Check that this ID is free to use before merge
PRIVATE_AREA_EXIT = 1290002;
CUTSCENE_PUSH_TRIGGER = 1090088; -- Check that this ID is free to use before merge
-- Prop Actor Ids (for documentation sake)
BRONZE_CHEST = 1080056; -- bgObj 20923 w/ body 1024
GLASS_DRINK = 1080057; -- bgObj 20901 w/ body 26624
RECTANGULAR_BOX = 1080058; -- bgObj 20951 w/ body 1024
-- Quest Items
ITEM_WANTED_GAUWYN = 10011243;
-- Quest Markers
MRKR_CAVE = 11072101;
MRKR_BERTRAND = 11072102;
MRKR_CUTSCENE = 11072103;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
local hasQuestItem = player:GetItemPackage(INVENTORY_NORMAL):HasItem(ITEM_WANTED_GAUWYN);
local otopaFlag = 0;
if (hasQuestItem == false) then
otopaFlag = 2;
end
quest:SetENpc(OTOPA_POTTOPA, otopaFlag);
quest:SetENpc(MYTESYN, QFLAG_NORM); -- Assuming this functions the same as it did in Etc5g1
quest:SetENpc(MIZZENMAST_BED, 5);
elseif (sequence == SEQ_000) then
quest:SetENpc(MYTESYN);
quest:SetENpc(PRIVATE_AREA_ENTRANCE, QFLAG_MAP, false, true, false, true);
quest:SetENpc(BERTRAND, QFLAG_NORM);
quest:SetENpc(ABRAHAM);
elseif (sequence == SEQ_010) then
quest:SetENpc(CUTSCENE_PUSH_TRIGGER, QFLAG_MAP,false, true, false, true);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
-- Am assuming this all functions the same as it did in Etc5g1
if (classId == OTOPA_POTTOPA) then
local hasQuestItem = player:GetItemPackage(INVENTORY_NORMAL):HasItem(ITEM_WANTED_GAUWYN);
if (not hasQuestItem) then
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
giveWantedItem(player);
npc:SetQuestGraphic(player, QFLAG_NONE);
else
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart_2");
end
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 1070); -- Log out in Mizzenmast Inn w/ item.
elseif (classId == MYTESYN) then
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 1070);
end
elseif (sequence == SEQ_000) then
if (classId == MYTESYN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
elseif (classId == BERTRAND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_010);
GetWorldManager():WarpToPublicArea(player);
elseif (classId == ABRAHAM) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local classId = npc.GetActorClassId();
if (classId == PRIVATE_AREA_ENTRANCE) then
choice = callClientFunction(player, "delegateEvent", player, quest, "instanceAreaJoinAskInBasaClass");
if (choice == 1) then
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 5, -220.948, 16.603, -92.863, -2.090);
end
elseif (classId == CUTSCENE_PUSH_TRIGGER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 500, 1, 1);
player:CompleteQuest(quest);
end
player:EndEvent();
end
function getJournalInformation(player, quest)
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_CAVE;
-- TO-DO: Check for private area and use MRKR_BERTRAND in place of this
elseif (sequence == SEQ_010) then
return MRKR_CUTSCENE;
end
end
function giveWantedItem(player)
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_WANTED_GAUWYN, 1, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, GetWorldMaster(), 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, GetWorldMaster(), 40279, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
end
end

View file

@ -0,0 +1,140 @@
require("global");
--[[
Quest Script
Name: Mysteries of the Red Moon
Code: Etc5l2
Id: 110840
Prereq: Level 20. Man5l1 (Private Eyes) complete. [110839]
Notes:
]]
-- Sequence Numbers
SEQ_000 = 0; -- Investigate the room.
SEQ_005 = 5; -- Head to the Arrzaneth Ossuary
-- Actor Class Ids
KOPURU_FUPURU = 1002047;
BOOK = 1200412;
INN_EXIT = 1090089;
CUTSCENE_PUSH_TRIGGER = 1090253; -- Already had from capture
-- Quest Markers
MRKR_KOPURU_FUPURU = 11072201;
MRKR_BOOK = 11072202;
MRKR_CUTSCENE = 11072203;
-- Quest Item
ITEM_HIDLIBRAND_DOSSIER = 10011252;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(KOPURU_FUPURU, QFLAG_NORM);
elseif (sequence == SEQ_000) then
quest:SetENpc(KOPURU_FUPURU, QFLAG_NORM);
quest:SetENpc(BOOK, QFLAG_NORM);
quest:SetENpc(INN_EXIT, QFLAG_MAP, false, true, false, true);
elseif (sequence == SEQ_005) then
quest:SetENpc(BOOK);
quest:SetENpc(KOPURU_FUPURU);
quest:SetENpc(INN_EXIT, QFLAG_MAP, false, true, false, true);
quest:SetENpc(CUTSCENE_PUSH_TRIGGER, QFLAG_MAP,false, true, false, true);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
-- Offer the quest
if (classId == KOPURU_FUPURU and sequence == SEQ_ACCEPT) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
player:EndEvent();
return;
-- Quest Progress
elseif (sequence == SEQ_000) then
if (classId == KOPURU_FUPURU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_KOPURU");
GetWorldManager():DoZoneChange(player, 181, "PrivateAreaMasterPast", 5, 15, 0,0,0, player.rotation);
elseif (classId == BOOK) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000");
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_005);
end
elseif (sequence == SEQ_005) then
if (classId == KOPURU_FUPURU) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_KOPURU");
GetWorldManager():DoZoneChange(player, 181, "PrivateAreaMasterPast", 5, 15, 0,0,0, player.rotation);
elseif (classId == BOOK) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent000_BOOK");
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local classId = npc.GetActorClassId();
if (classId == INN_EXIT) then
choice = callClientFunction(player, "delegateEvent", player, quest, "processEventExit");
if (choice == 1) then
player:EndEvent();
GetWorldManager():DoZoneChange(player, 209, "", 0, 15, -104.296, 203, 162.257, -0.4);
end
-- Quest Complete
elseif (classId == CUTSCENE_PUSH_TRIGGER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent005_NQ");
--TO-DO: Get the scaled EXP for this sqrwa figured out
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 1000, 1, 1, 9);
player:SendGameMessage(player, GetWorldMaster(), 51149, MESSAGE_TYPE_SYSTEM, ITEM_HIDLIBRAND_DOSSIER);
local itemCheck = giveWantedItem(player);
if (itemCheck == true) then
player:CompleteQuest(quest);
end
end
player:EndEvent();
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_KOPURU_FUPURU;
-- TO-DO: Check for private area and use MRKR_BOOK in place of this
elseif (sequence == SEQ_005) then
return MRKR_CUTSCENE;
end
end
function giveWantedItem(player)
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_HIDLIBRAND_DOSSIER, 1, 1);
if (invCheck == INV_ERROR_SUCCESS) then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_HIDLIBRAND_DOSSIER, 1);
return true;
end
end

View file

@ -0,0 +1,253 @@
require("global");
--[[
Quest Script
Name: Prophecy Inspection
Code: Etc5l3
Id: 110841
Prereq: Level 20. Man5l2 (Mysteries of the Red Moon) complete. [110840]
Notes:
]]
-- Sequence Numbers
SEQ_000 = 0; -- Head to the Coffer & Coffin
SEQ_005 = 5; -- Help out Alret
SEQ_010 = 10; -- Talk to Alret
-- Actor Class Ids
KOPURU_FUPURU = 1002047;
VKOROLON = 1000458;
MYTESYN = 1000167;
COFFER_AND_COFFIN_PUSH = 1090090;
BED_LIMSA = 1200378;
BED_GRIDANIA = 1200379;
BED_ULDAH = 1200380;
HILDIBRAND = 1001995;
NASHU_MHAKARACCA = 1001996;
ALRET = 1002114;
BOMB_BANE_1 = 1080090;
BOMB_BANE_2 = 1080091;
BOMB_BANE_3 = 1080092;
BOMB_BANE_4 = 1080093;
BOMB_BANE_5 = 1080094;
-- Quest Markers
MRKR_COFFIN = 11072204;
MRKR_BANE_1 = 11072205;
MRKR_BANE_2 = 11072206;
MRKR_BANE_3 = 11072207;
MRKR_BANE_4 = 11072208;
MRKR_BANE_5 = 11072209;
MRKR_ALRET = 11072210;
-- Quest Flags
FLAG_SEQ005_BANE_1 = 0;
FLAG_SEQ005_BANE_2 = 1;
FLAG_SEQ005_BANE_3 = 2;
FLAG_SEQ005_BANE_4 = 3;
FLAG_SEQ005_BANE_5 = 4;
-- Quest Counter
COUNTER_BANE = 0;
-- Quest Item
ITEM_HIDLIBRAND_DOSSIER = 10011252;
ITEM_BOMB_BANE = 11000230;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
local data = quest:GetData();
-- Quest not accepted: Set up actors to let you retrieve the item & initiate the log-in check at the Inn
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(KOPURU_FUPURU, QFLAG_NORM);
quest:SetENpc(VKOROLON, QFLAG_NORM);
quest:SetENpc(MYTESYN, QFLAG_NORM);
quest:SetENpc(BED_ULDAH, 5);
quest:SetENpc(BED_GRIDANIA, 5);
quest:SetENpc(BED_LIMSA, 5);
-- Quest started
elseif (sequence == SEQ_000) then
quest:SetENpc(COFFER_AND_COFFIN_PUSH, QFLAG_MAP, false, true, false, true);
elseif (sequence == SEQ_005) then
local bane1Flag = data:GetFlag(FLAG_SEQ005_BANE_1) and QFLAG_NONE or QFLAG_PLATE;
local bane2Flag = data:GetFlag(FLAG_SEQ005_BANE_2) and QFLAG_NONE or QFLAG_PLATE;
local bane3Flag = data:GetFlag(FLAG_SEQ005_BANE_3) and QFLAG_NONE or QFLAG_PLATE;
local bane4Flag = data:GetFlag(FLAG_SEQ005_BANE_4) and QFLAG_NONE or QFLAG_PLATE;
local bane5Flag = data:GetFlag(FLAG_SEQ005_BANE_5) and QFLAG_NONE or QFLAG_PLATE;
quest:SetENpc(COFFER_AND_COFFIN_PUSH, QFLAG_MAP, false, true, false, true);
quest:SetENpc(HILDIBRAND);
quest:SetENpc(NASHU_MHAKARACCA);
quest:SetENpc(ALRET);
quest:SetENpc(BOMB_BANE_1, bane1Flag);
quest:SetENpc(BOMB_BANE_2, bane2Flag);
quest:SetENpc(BOMB_BANE_3, bane3Flag);
quest:SetENpc(BOMB_BANE_4, bane4Flag);
quest:SetENpc(BOMB_BANE_5, bane5Flag);
-- Quest finished
elseif (sequence == SEQ_010) then
quest:SetENpc(HILDIBRAND);
quest:SetENpc(NASHU_MHAKARACCA);
quest:SetENpc(ALRET, QFLAG_REWARD);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
if (classId == KOPURU_FUPURU) then
callClientFunction(player, "delegateEvent", player, quest, "processEventKOPURUStart");
elseif (classId == VKOROLON) then
callClientFunction(player, "delegateEvent", player, quest, "processEventKOROLONStart");
elseif (classId == MYTESYN) then
callClientFunction(player, "delegateEvent", player, quest, "processEventMYTESYNStart");
end
giveDossierItem(player);
player:SendGameMessage(player, GetWorldMaster(), 51149, MESSAGE_TYPE_SYSTEM, ITEM_HIDLIBRAND_DOSSIER);
elseif (sequence == SEQ_005) then
local data = quest:GetData();
local incCounter = false;
if (classId == HILDIBRAND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005_1");
elseif (classId == NASHU_MHAKARACCA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005_2");
elseif (classId == ALRET) then
if (sequence == SEQ_005) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005_3");
end
elseif (classId == BOMB_BANE_1) then
if not (data:GetFlag(FLAG_SEQ005_BANE_1)) then
incCounter = true;
data:SetFlag(FLAG_SEQ005_BANE_1);
end
elseif (classId == BOMB_BANE_2) then
if not (data:GetFlag(FLAG_SEQ005_BANE_2)) then
incCounter = true;
data:SetFlag(FLAG_SEQ005_BANE_2);
end
elseif (classId == BOMB_BANE_3) then
if not (data:GetFlag(FLAG_SEQ005_BANE_3)) then
incCounter = true;
data:SetFlag(FLAG_SEQ005_BANE_3);
end
elseif (classId == BOMB_BANE_4) then
if not (data:GetFlag(FLAG_SEQ005_BANE_4)) then
incCounter = true;
data:SetFlag(FLAG_SEQ005_BANE_4);
end
elseif (classId == BOMB_BANE_5) then
if not (data:GetFlag(FLAG_SEQ005_BANE_5)) then
incCounter = true;
data:SetFlag(FLAG_SEQ005_BANE_5);
end
end
if (incCounter == true) then
counterAmount = data:IncCounter(COUNTER_BANE);
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005_4", counterAmount, 5);
wait(1);
if (counterAmount >= 5) then
attentionMessage(player, 25225, quest:GetQuestId()); -- "Seeing the Seers" objectives complete!
quest:GetData():ClearData();
quest:UpdateENPCs(); -- Band-aid for a QFLAG_PLATE issue
quest:StartSequence(SEQ_010);
end
end
elseif (sequence == SEQ_010) then
if (classId == HILDIBRAND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005_1");
elseif (classId == NASHU_MHAKARACCA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005_2");
elseif (classId == ALRET) then -- Finish the quest
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
--TO-DO: Get the scaled EXP for this sqrwa figured out
--TO-DO: Also confirm reward was issued before flagging quest as complete
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 1000, 1, 1, 9);
GetWorldManager():WarpToPublicArea(player);
player:CompleteQuest(quest);
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc.GetActorClassId();
if (classId == COFFER_AND_COFFIN_PUSH) then
if (sequence == SEQ_000) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_005");
player:EndEvent();
attentionMessage(player, 25246, ITEM_BOMB_BANE, 1);
quest:StartSequence(SEQ_005);
end
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 5, -1732.891, 56.119, -307.285, -2.785);
actor = player.CurrentArea:FindActorInZoneByUniqueID("etc5l3_nashu");
actor:ChangeState(ACTORSTATE_SITTING_ONFLOOR); -- Band-aid to get her sitting.
end
player:EndEvent();
end
function getJournalInformation(player, quest)
-- Bugged on the client's end and never shows?
return 0, ITEM_BOMB_BANE;
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local data = quest:GetData();
local possibleMarkers = {};
if (sequence == SEQ_000) then
return MRKR_COFFIN;
elseif (sequence == SEQ_005) then
local data = quest:GetData();
if (not data:GetFlag(FLAG_SEQ005_BANE_1)) then table.insert(possibleMarkers, MRKR_BANE_1); end
if (not data:GetFlag(FLAG_SEQ005_BANE_2)) then table.insert(possibleMarkers, MRKR_BANE_2); end
if (not data:GetFlag(FLAG_SEQ005_BANE_3)) then table.insert(possibleMarkers, MRKR_BANE_3); end
if (not data:GetFlag(FLAG_SEQ005_BANE_4)) then table.insert(possibleMarkers, MRKR_BANE_4); end
if (not data:GetFlag(FLAG_SEQ005_BANE_5)) then table.insert(possibleMarkers, MRKR_BANE_5); end
return unpack(possibleMarkers)
elseif (sequence == SEQ_010) then
return MRKR_ALRET;
end
end
function giveDossierItem(player)
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_HIDLIBRAND_DOSSIER, 1, 1);
if (invCheck == INV_ERROR_SUCCESS) then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_HIDLIBRAND_DOSSIER, 1);
return true;
end
end

View file

@ -0,0 +1,98 @@
require("global");
--[[
Quest Script
Name: Ring of Deceit
Code: Etc5u0
Id: 110848
Prereq: Level 1 on any class. Second MSQ completed. (110002 Man0l1 / 110006 Man0g1 / 110010 Man0u1)
Notes: Unlocks Ul'dah Inn exit from the rear entrance. Rewards 200 EXP
]]
-- Sequence Numbers
SEQ_000 = 0; -- Talk to Judithe
SEQ_001 = 1; -- Return to Otopa Pottopa
-- Actor Class Ids
OTOPA_POTTOPA = 1000864;
JUDITHE = 1001443;
-- Quest Markers
MRKR_JUDITHE = 11092001;
MRKR_OTOPA_POTTOPA = 11092002;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
quest:SetENpc(OTOPA_POTTOPA, QFLAG_NORM);
elseif (sequence == SEQ_000) then
quest:SetENpc(OTOPA_POTTOPA);
quest:SetENpc(JUDITHE, QFLAG_NORM);
elseif (sequence == SEQ_001) then
quest:SetENpc(OTOPA_POTTOPA, QFLAG_REWARD);
quest:SetENpc(JUDITHE);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
if (classId == OTOPA_POTTOPA) then
local questAccepted = callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
if (questAccepted == 1) then
player:AcceptQuest(quest);
end
end
elseif (sequence == SEQ_000) then
if (classId == OTOPA_POTTOPA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
elseif (classId == JUDITHE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
attentionMessage(player, 25225, 110848); -- <Quest name> objectives complete!
quest:StartSequence(SEQ_001);
end
elseif (sequence == SEQ_001) then
if (classId == JUDITHE) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
elseif (classId == OTOPA_POTTOPA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1); -- 200 exp rewarded
player:CompleteQuest(quest);
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function getJournalInformation(player, quest)
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
local possibleMarkers = {};
if (sequence == SEQ_000) then
table.insert(possibleMarkers, MRKR_JUDITHE);
elseif (sequence == SEQ_001) then
table.insert(possibleMarkers, MRKR_OTOPA_POTTOPA);
end
return unpack(possibleMarkers)
end

View file

@ -0,0 +1,174 @@
require("global");
--[[
Quest Script
Name: The Usual Suspect
Code: Etc5u1
Id: 110849
Prereq: Level 15. [110828 Etc5g0 / 110838 Etc5l0 / 110848 Etc5u0]
Notes: Rewards 500 exp
]]
-- Sequence Numbers
SEQ_000 = 0;
SEQ_010 = 10;
-- Actor Class Ids
OTOPA_POTTOPA = 1000864;
HOURGLASS_BED = 1200380;
GAUWYN_THE_GANNET = 1002065;
HILDIBRAND = 1001995;
NASHU_MHAKARACCA = 1001996;
PRIVATE_AREA_ENTRANCE = 1090085;
PRIVATE_AREA_EXIT = 1290002;
-- DefaultTalk NPCs?
UBOKHN = 1000668;
VANNES = 1001464;
XDHILOGO = 1001466;
DARIUSTEL = 1001467;
GUENCEN = 1001468;
-- Quest Items
ITEM_WANTED_GAUWYN = 10011243;
-- Quest Markers
MRKR_COLISEUM = 11092101;
MRKR_GAUWYN = 11092102;
MRKR_OTOPA_POTTOPA = 11092103;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
end
function onFinish(player, quest)
end
function onStateChange(player, quest, sequence)
if (sequence == SEQ_ACCEPT) then
local hasQuestItem = player:GetItemPackage(INVENTORY_NORMAL):HasItem(ITEM_WANTED_GAUWYN);
if (hasQuestItem == false) then
quest:SetENpc(OTOPA_POTTOPA, QFLAG_NORM);
end
quest:SetENpc(HOURGLASS_BED, 5);
end
if (sequence == SEQ_000) then
quest:SetENpc(OTOPA_POTTOPA);
quest:SetENpc(GAUWYN_THE_GANNET, QFLAG_NORM);
quest:SetENpc(HILDIBRAND);
quest:SetENpc(NASHU_MHAKARACCA);
--flagType, isTalkEnabled, isPushEnabled, isEmoteEnabled, isSpawned
quest:SetENpc(PRIVATE_AREA_ENTRANCE, QFLAG_MAP, false, true, false, true);
elseif (sequence == SEQ_010) then
quest:SetENpc(OTOPA_POTTOPA, QFLAG_REWARD);
quest:SetENpc(GAUWYN_THE_GANNET);
quest:SetENpc(HILDIBRAND);
quest:SetENpc(NASHU_MHAKARACCA);
end
end
function onTalk(player, quest, npc)
local sequence = quest:getSequence();
local classId = npc:GetActorClassId();
if (sequence == SEQ_ACCEPT) then
if (classId == OTOPA_POTTOPA) then
local hasQuestItem = player:GetItemPackage(INVENTORY_NORMAL):HasItem(ITEM_WANTED_GAUWYN);
if (not hasQuestItem) then
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart");
giveWantedItem(player);
npc:SetQuestGraphic(player, QFLAG_NONE);
else
callClientFunction(player, "delegateEvent", player, quest, "processEventOTOPAPOTTOPAStart_2");
end
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 3071);
end
elseif (sequence == SEQ_000) then
if (classId == OTOPA_POTTOPA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_000_1");
elseif (classId == GAUWYN_THE_GANNET) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010");
attentionMessage(player, 25225, quest.GetQuestId()); -- objectives complete!
quest:UpdateENPCs(); -- Band-aid for a QFLAG_NORM issue
quest:StartSequence(SEQ_010);
elseif (classId == HILDIBRAND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
elseif (classId == NASHU_MHAKARACCA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
end
elseif (sequence == SEQ_010) then
if (classId == HILDIBRAND) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_1");
elseif (classId == NASHU_MHAKARACCA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_2");
elseif (classId == GAUWYN_THE_GANNET) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_010_3");
elseif (classId == OTOPA_POTTOPA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent_020");
callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 500, 1, 1);
player:CompleteQuest(quest);
player:SendGameMessage(player, GetWorldMaster(), 51148, MESSAGE_TYPE_SYSTEM, 10011243, 2075); -- Log out in The Roost w/ item.
end
end
player:EndEvent()
quest:UpdateENPCs();
end
function onPush(player, quest, npc)
local npcClassId = npc.GetActorClassId();
player:EndEvent();
if (npcClassId == PRIVATE_AREA_ENTRANCE) then
--TO-DO: Fill in the # below for the privateArea when it's made
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 5, -206.712, 195.148, 151.064, 1.821);
end
end
function getJournalInformation(player, quest)
end
function getJournalMapMarkerList(player, quest)
local sequence = quest:getSequence();
if (sequence == SEQ_000) then
return MRKR_COLISEUM -- TO-DO: Add a check for that specific private area and have it return MRKR_GAUWYN?
elseif (sequence == SEQ_010) then
return MRKR_OTOPA_POTTOPA
end
end
function giveWantedItem(player)
local invCheck = player:getItemPackage(INVENTORY_NORMAL):addItem(ITEM_WANTED_GAUWYN, 1, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, GetWorldMaster(), 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, GetWorldMaster(), 40279, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM_ERROR, ITEM_WANTED_GAUWYN, 1);
end
end