diff --git a/Data/scripts/base/chara/npc/object/ObjectInnDoor.lua b/Data/scripts/base/chara/npc/object/ObjectInnDoor.lua index 24b7161b..e3c82af4 100644 --- a/Data/scripts/base/chara/npc/object/ObjectInnDoor.lua +++ b/Data/scripts/base/chara/npc/object/ObjectInnDoor.lua @@ -4,7 +4,7 @@ function init(npc) return false, false, 0, 0; end -function onEventStarted(player, npc, triggerName) +function onEventStarted(player, npc, eventType, eventName) defaultFst = GetStaticActor("DftFst"); choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil); diff --git a/Data/scripts/commands/gm/quest.lua b/Data/scripts/commands/gm/quest.lua index eab846ef..569bf821 100644 --- a/Data/scripts/commands/gm/quest.lua +++ b/Data/scripts/commands/gm/quest.lua @@ -5,166 +5,207 @@ properties = { parameters = "ssss", description = [[ -Add/Remove Quests, modify and . -!quest add/remove | -!quest phase | -!quest flag true/false | +Add/Remove/Complete Quests, modify and . +!quest <#> | +!quest <#> | +!quest <#> true/false | ]], } -function onTrigger(player, argc, command, var1, var2, var3) +function onTrigger(player, argc, quest, command, var1, var2) local messageID = MESSAGE_TYPE_SYSTEM_ERROR; local sender = "[quest] "; local message = "Error"; + local questId = tonumber(quest); - print(tostring(argc)); - if player then - if argc == 2 then - if command == "add" or command == "give" or command == "+" then - if tonumber(var1) then - if player:HasQuest(tonumber(var1)) == false then - player:AddQuest(tonumber(var1)); - message = ("adding quest "..var1); - else - message = ("already have quest "..var1); - end - else - if player:HasQuest(var1) == false then - player:AddQuest(var1); - message = ("adding quest "..var1); - else - message = ("already have quest "..var1); - end - end - - elseif command == "remove" or command == "delete" or command == "-" then - if tonumber(var1) and player:HasQuest(tonumber(var1)) == true then - player:RemoveQuest(tonumber(var1)); - message = ("removing quest "..var1); - else - if player:HasQuest(var1) == true then - q2 = GetStaticActor(var1); - - if q2 ~= nil then - q3 = q2.Id; - message = ("removing quest "..var1); - printf(q3); - q4 = bit32.band(q3, 0xA0F00000); - printf(q4); - - player:RemoveQuest(quest.Name); - end - else - message = ("remove error: either incorrect ID or quest "..var1.." isn't active on character"); - end - end - elseif command == "info" then - if tonumber(var1) then - if player:HasQuest(tonumber(var1)) then - quest = player:GetQuest(tonumber(var1)); - - local flagStr = ""; - for i=0,31,1 do - if (quest:GetData():GetFlag(i)) then - flagStr = flagStr .. "O"; - else - flagStr = flagStr .. "X"; - end - if (i == 15) then - flagStr = flagStr .. "\n"; - end - end - - local data = quest:GetData(); - - message = string.format("\nInfo for quest %s [%d]\n", quest.Name, quest:GetQuestId()); - message = message .. string.format("Current Sequence: %d\n", quest:getSequence()); - message = message .. string.format("Flags: \n%s\n", flagStr) - message = message .. string.format("Counters: %d,%d,%d,%d", data:getCounter(0), data:getCounter(1), data:getCounter(2), data:getCounter(3)); - else - message = ("Quest not active: "..var1); - end - else - message = ("error: invalid parameters used"); - end + if (type(questId) == "number") then + if (questId < 110001 or questId > 110001 + 2048) and player then + player:SendMessage(messageID, sender, "Invalid questId entered"); + player:SendMessage(messageID, sender, argc); + return; + else + if (command == "add" or command == "give" or command == "+") then + message = addQuest(player, questId); + elseif (command == "remove" or command == "delete" or command == "-") then + message = removeQuest(player, questId); + elseif (command == "complete" or command == "completed" or command == "finish") then + message = setQuestCompletion(player, argc, questId, var1); + elseif (command == "info") then + message = getQuestInfo(player, questId); + elseif (command == "seq" or command == "sequence") then + message = setQuestSequence(player, questId, tonumber(var1)); + elseif (command == "flag") then + message = setQuestFlag(player, questId, var1, var2); + elseif (command == "counter" or command == "count") then + message = setQuestCounter(player, questId, var1, var2); else - message = ("error: command "..command.." not recognized"); - end - elseif argc == 3 then - if command == "seq" or command == "sequence" then - if (tonumber(var1) and tonumber(var2)) ~= nil then - if player:HasQuest(tonumber(var1)) == true then - player:GetQuest(tonumber(var1)):StartSequence(tonumber(var2)); - message = ("changing sequence of quest "..var1.." to "..var2); - else - message = ("sequence error: either incorrect ID or quest "..var1.." isn't active on character"); - end - else - message = ("error: invalid parameters used"); - end - else - message = ("error: command "..command.." not recognized"); - end; - - elseif argc == 4 then - if command == "flag" then - if tonumber(var1) and (tonumber(var2) >= 0 and tonumber(var2) <= 32) then - questvar = tonumber(var1); - flagvar = (tonumber(var2)); - boolvar = 0; - - if var3 == "true" or var3 == "1" or var3 == "on" or var3 == "O" then - boolvar = true; - elseif var3 == "false" or var3 == "0" or var3 == "off" or var3 == "X" then - boolvar = false; - elseif var3 == "flip" or var3 == "toggle" then - if player:HasQuest(questvar) == true then - boolvar = not player:GetQuest(questvar):GetData():GetFlag(flagvar); - end - else - message = ("error: flag: boolean not recognized"); - print(sender..message); - return; - end - - var4 = player:GetQuest(questvar):GetData():GetFlag(flagvar); - - if var4 ~= boolvar then - if (boolvar == true) then - player:GetQuest(questvar):GetData():SetFlag(flagvar); - else - player:GetQuest(questvar):GetData():ClearFlag(flagvar); - end - player:GetQuest(questvar):UpdateENPCs(); - player:GetQuest(questvar):GetData():Save(); - if boolvar == true then - message = ("changing flag "..tonumber(var2).." to true on quest "..questvar); - else - message = ("changing flag "..tonumber(var2).." to false on quest "..questvar); - end - else - message = ("error: flag "..flagvar.." is already set to that state on quest "..questvar); - end - else - message = ("error: command "..command.." not recognized"); - end - elseif command == "counter" then - if tonumber(var1) and (tonumber(var2) >= 0 and tonumber(var2) <= 4) then - questvar = tonumber(var1); - index = (tonumber(var2)); - - player:GetQuest(questvar):GetData():SetCounter(index, tonumber(var3)); - player:GetQuest(questvar):UpdateENPCs(); - player:GetQuest(questvar):GetData():Save(); - message = ("changing counter "..tonumber(var2).." to "..var3); - else - message = ("error: command "..command.." not recognized"); - end - end + message = ("Error: Command "..command.." not recognized"); + end end + else + message = ("Error: Quest id must be a valid number.") end player:SendMessage(messageID, sender, message); - print(sender..message); -end \ No newline at end of file +end + + + +function addQuest(player, questId) + if (not (player:HasQuest(questId))) then + player:AddQuest(questId); + return string.format("Adding quest "..player:GetQuest(questId).name.." ["..questId.."]"); + else + return string.format("Already have quest "..player:GetQuest(questId).name.." ["..questId.."]"); + end +end + +function removeQuest(player, questId) + if (player:HasQuest(questId)) then + local questName = player:GetQuest(questId).name; + player:RemoveQuest(questId); + return string.format("Removing quest "..questName.." ["..questId.."]"); + else + return string.format("Error: Either incorrect ID or quest "..questId.." isn't active on character."); + end +end + +function setQuestCompletion(player, argc, questId, flag) + + if (argc == 2) then -- No flag entered -> Return state of the quest's completion. + return string.format("Quest %d completion is set to: %s", questId, tostring(player:IsQuestCompleted(questId))); + else + local boolFlag = false; + + if (flag == "true" or flag == "1" or flag == "on" or flag == "O") then + boolFlag = true; + elseif (flag == "false" or flag == "0" or flag == "off" or flag == "X") then + boolFlag = false; + elseif flag == "flip" or flag == "toggle" then + boolFlag = not player:IsQuestCompleted(questId); + else -- A catch for bad inputs + return string.format("Error: Invalid flag entered"); + end + + player:SetQuestComplete(questId, boolFlag); + return string.format("Quest %d completion set to: %s", questId, tostring(player:IsQuestCompleted(questId))); + + end +end + +function setQuestSequence(player, questId, sequence) + if (type(sequence) == "number") then + if (player:HasQuest(questId)) then + local seq = math.floor(tonumber(sequence)); + if (seq >= 0 and seq <= 65535) then + player:GetQuest(questId):StartSequence(seq); + return string.format("Changing sequence of quest "..player:GetQuest(questId).name.." ["..questId.."] to "..seq); + else + return string.format("Error: Sequence value must be within 0-65535."); + end + else + return string.format("Sequence error: either incorrect ID or quest "..questId.." isn't active on character"); + end + else + return string.format("Error: Sequence value must be a valid number."); + end +end + +function setQuestFlag(player, questId, flagNum, flagCmd) + local questvar = questId; + local flagvar = tonumber(flagNum); + local boolvar = 0; + + if (player:HasQuest(questvar)) then + if (flagvar >= 0 and flagvar <= 31) then + + if flagCmd == "true" or flagCmd == "1" or flagCmd == "on" or flagCmd == "O" then + boolvar = true; + elseif flagCmd == "false" or flagCmd == "0" or flagCmd == "off" or flagCmd == "X" then + boolvar = false; + elseif flagCmd == "flip" or flagCmd == "toggle" then + boolvar = not player:GetQuest(questvar):GetData():GetFlag(flagvar); + else + return "Error: Flag: Boolean not recognized." + end + + currentFlagState = player:GetQuest(questvar):GetData():GetFlag(flagvar); + + if (currentFlagState ~= boolvar) then + + if (boolvar == true) then + player:GetQuest(questvar):GetData():SetFlag(flagvar); + else + player:GetQuest(questvar):GetData():ClearFlag(flagvar); + end + player:GetQuest(questvar):UpdateENPCs(); + player:GetQuest(questvar):GetData():Save(); + if boolvar == true then + return string.format("Changing flag "..tonumber(flagNum).." to true on quest "..questvar); + else + return string.format("Changing flag "..tonumber(flagNum).." to false on quest "..questvar); + end + else + return string.format("Error: Flag "..flagvar.." is already set to that state on quest "..questvar); + end + else + return string.format("Error: Flag "..flagNum.." is not within the valid range of 0-31."); + end + else + return string.format("Error: Either incorrect ID or quest "..tostring(questId).." isn't active on character."); + end + +end + +function setQuestCounter(player, questId, counterSlot, counterValue) + local cSlot = tonumber(counterSlot) or nil; + local cVal = tonumber(counterValue) or nil; + + if (cSlot ~= nil and cSlot >= 0 and cSlot <= 3) then + if (cVal ~= nil and cVal >= 0 and cVal <= 255) then + player:GetQuest(questId):GetData():SetCounter(cSlot, cVal); + player:GetQuest(questId):UpdateENPCs(); + player:GetQuest(questId):GetData():Save(); + + return string.format("Changing counter "..cSlot.." to "..cVal); + else + return string.format("Error: Invalid counter value. Must be between 0-255."); + end + else + return string.format("Error: Invalid counter index. Must be between 0-3."); + end +end + + +function getQuestInfo(player, questId) + if player:HasQuest(questId) then + quest = player:GetQuest(questId); + + local msg = ""; + local flagStr = ""; + + for i=0,31,1 do + if (quest:GetData():GetFlag(i)) then + flagStr = flagStr .. "O"; + else + flagStr = flagStr .. "X"; + end + if (i == 15) then + flagStr = flagStr .. "\n"; + end + end + + local data = quest:GetData(); + + msg = string.format("Info for quest %s [%d]\n", quest.Name, quest:GetQuestId()); + msg = msg .. string.format("Flags \\\\ Current Sequence: %d\n", quest:getSequence()); + msg = msg .. string.format("%s\n", flagStr) + msg = msg .. string.format("Counters: %d,%d,%d,%d", data:getCounter(0), data:getCounter(1), data:getCounter(2), data:getCounter(3)); + return msg; + else + return string.format("Quest not active: "..questId); + end +end + + diff --git a/Data/scripts/quests/dft/DftFst.lua b/Data/scripts/quests/dft/DftFst.lua index a16dccbf..429128ca 100644 --- a/Data/scripts/quests/dft/DftFst.lua +++ b/Data/scripts/quests/dft/DftFst.lua @@ -4,9 +4,9 @@ require ("global") Quest Script -Name: Small Talk -Code: DftFst -Id: 110542 +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. @@ -19,13 +19,21 @@ local defaultTalkFst = { [1000068] = "defaultTalkWithKain_001", -- Kain (Gridania: LTW Guild) [1000069] = "defaultTalkWithJolline_001", -- Jolline (Gridania: LNC Guild) [1000071] = "defaultTalkWithBertennant_001", -- Bertennant (Gridania: Blue Badger Gate) + [1000072] = "defaultTalkWithMitainie_001", -- <<>> Mitainie (Gridania: White Wolf Gate) [1000074] = "defaultTalkWithOnguen_001", -- Onguen (Gridania: BTN Guild) [1000230] = "defaultTalkWithMiounne_001", -- Miounne (Gridania: Adv. Guild) [1000231] = "defaultTalkWithHereward_001", -- Hereward (Gridania: LTW Guild) + [1000234] = "defaultTalkWithSolieine_001", -- <<>> Soileine [function typo] (Gridania: CNJ Guild) Has Parley actor id: 1700030 [1000236] = "defaultTalkWithOpyltyl_001", -- Opyltyl (Gridania: BTN Guild) + [1000238] = "defaultTalkWithPowle_001", -- <<>> Powle (Gridania: Acorn Orchard) - Has many actorclass IDs, this is the first one. + [1000239] = "defaultTalkWithSansa_001", -- <<>> Sansa (Gridania: Acorn Orchard) [1000242] = "defaultTalkWithWillelda_001", -- Willelda (Gridania: LNC Guild) defaultTalkWithWillelda_002 - After signing up to the guild? [1000243] = "defaultTalkWithBurchard_001", -- Burchard (Gridania: LNC Guild) [1000326] = "defaultTalkWithCicely_001", -- Cicely (Gridania: BTN Guild) + [1000409] = "defaultTalkWithNicoliaux_001", -- <<>> Nicoliaux (Gridania: Acorn Orchard) [has multiple map markers, one might be regular idle location?] + [1000410] = "defaultTalkWithAunillie_001", -- <<>> Aunillie (Gridania: Acorn Orchard) + [1000411] = "defaultTalkWithElyn_001", -- <<>> Elyn (Gridania: Acorn Orchard) + [1000412] = "defaultTalkWithRyd_001", -- <<>> Ryd (Gridania: Acorn Orchard) [1000427] = "defaultTalkWithAnene_001", -- Anene (Gridania: Adv. Guild) defaultTalkWithAnene_002 / 003 (PGL informant) [1000428] = "defaultTalkWithSylbyrt_001", -- Sylbyrt (Gridania: Adv. Guild) defaultTalkWithSylbyrt_002 / 003 (MRD informant) [1000429] = "defaultTalkWithHongavunga_001", -- Honga Vunga (Gridania: Adv. Guild) defaultTalkWithHongavunga_002 / 003 (WVR informant) @@ -33,19 +41,21 @@ local defaultTalkFst = { [1000431] = "defaultTalkWithLtandhaa_001", -- L'tandhaa (Gridania: Adv. Guild) defaultTalkWithLtandhaa_002 / 003 (ALC informant) [1000432] = "defaultTalkWithPofufu_001", -- Pofufu (Gridania: Adv. Guild) defaultTalkWithPofufu_002 / 003 (MIN informant) [1000433] = "defaultTalkWithDrividot_001", -- Drividot (Gridania: Adv. Guild) defaultTalkWithDrividot_002 / 003 (FSH informant) - [1000435] = "defaultTalkWithBasewin_001", -- Basewin (Gridania: Adv. Guild) defaultTalkWithBasewin_002 / 003 (BSM informant) + [1000434] = "defaultTalkWithOdilie_001", -- Odilie (Gridania: Adv. Guild) defaultTalkWithOdilie_002 / 003 (CUL informant) + [1000435] = "defaultTalkWithBasewin_001", -- Basewin (Gridania: Adv. Guild) defaultTalkWithBasewin_002 / 003 (BSM informant) [1000436] = "defaultTalkWithSeikfrae_001", -- Seikfrae (Gridania: Adv. Guild) defaultTalkWithSeikfrae_002 / 003 (GLD informant) [1000437] = "defaultTalkWithEdasshym_001", -- E'dasshym (Gridania: Adv. Guild) defaultTalkWithEdasshym_002 / 003 (THM informant) - --[1000456] = "", -- Tierney (Gridania: Adv. Guild) Guildleve NPC - Will not fire, not PplStd. - --[1000457] = "", -- Gontrant (Gridania: Adv. Guild) Guildleve NPC - Will not fire, not PplStd. - [1000458] = "defaultTalkWithInn_Desk", -- V'korolon (Gridania: Adv. Guild) - defaultTalkWithVkorolon_001 - Pre-Inn unlocked dialog - --[1000459] = "", -- Gallia (Gridania: LTW Guild) Guildmark NPC - Will not fire, not PplStd. - --[1000461] = "", -- Kipopo (Gridania: BTN Guild) Guildmark NPC - Will not fire, not PplStd. - --[1000462] = "", -- Clarembald (Gridania: LNC Guild) Guildmark NPC - Will not fire, not PplStd. + [1000458] = "defaultTalkWithVkorolon_001", -- V'korolon (Gridania: Adv. Guild) - Inn NPC. defaultTalkWithInn_Desk used when Inn unlocked + --[1000460] = "defaultTalkWithHetzkin_001", -- Hetzkin (Gridania: CNJ Guild) Guildmark NPC - Will not fire, not PplStd. [1000463] = "defaultTalkWithNonolato_001", -- Nonolato (Gridania: ARC Guild) - --[1000464] = "", -- Cassandra (Gridania: ARC Guild) Guildmark NPC - Will not fire, not PplStd. [1000465] = "defaultTalkWithAnaidjaa_001", -- A'naidjaa (Gridania: CRP Guild) - --[1000466] = "", -- Frances (Gridania: CRP Guild) Guildmark NPC - Will not fire, not PplStd. + [1000504] = "defaultTalkWithTelent_001", -- <<>> Telent (Gridania: CNJ Guild) - Has map marker, but whole-numbered. + [1000509] = "defaultTalkWithKinborow_001", -- <<>> Kinborow (Gridania: CNJ Guild) + [1000510] = "defaultTalkWithZerig_001", -- <<>> Zerig (Gridania: CNJ Guild) - Has map marker, but whole-numbered. + [1000511] = "defaultTalkWithConcessa_001", -- <<>> Concessa (Gridania: CNJ Guild) + [1000512] = "defaultTalkWithMaroile_001", -- <<>> Maroile (Gridania: CNJ Guild) + [1000513] = "defaultTalkWithGugula_001", -- <<>> Gugula (Gridania: CNJ Guild) + [1000556] = "defaultTalkWithWybir_001", -- <<>> Wybir (South Shroud: Quarrymill) [1000565] = "defaultTalkWithCeinguled_001", -- Ceinguled (Gridania: LNC Guild) [1000566] = "defaultTalkWithFrancis_001", -- Francis (Gridania: LNC Guild) arg1=1, npc recognizes you're in the LNC guild [1000567] = "defaultTalkWithDhemdaeg_001", -- Dhemdaeg (Gridania: LNC Guild) @@ -61,168 +71,138 @@ local defaultTalkFst = { [1000627] = "defaultTalkWithAerstsyn_001", -- Aerstsyn (Gridania: LNC Guild) [1000629] = "defaultTalkWithEburhart_001", -- Eburhart (Gridania: BTN Guild) [1000630] = "defaultTalkWithNoes_001", -- Noes (Gridania: Apkallus Falls) + [1000669] = "defaultTalkWithJajajbygo_001", -- <<>> Jajajbygo (Central Shroud: Camp Benchbranch) If Arg1 = 20 (SpecialEventWork correlation?), extra dialog about Atomos + [1000670] = "defaultTalkWithPepeli_001", -- <<>> Pepeli (Central Shroud: Camp Benchbranch) If Arg1 = 20 (SpecialEventWork correlation?), extra dialog about 7U Era starting [1000671] = "defaultTalkWithMiraudont_001", -- Miraudont (North Shroud: Camp Emerald Moss) arg1=true - Mentions Atomos [1000681] = "defaultTalkWithNuala_001", -- Nuala (Gridania: LNC Guild) [1000701] = "defaultTalkWithZuzupoja_001", -- Zuzupoja (Gridania: CRP Guild) - [1000821] = "defaultTalkWithNellaure_001", -- Nellaure (Gridania: CRP Guild) + [1000737] = "defaultTalkWithBiddy_001", -- <<>> Biddy (Gridania: CNJ Guild) - Has map marker, but whole-numbered. + [1000821] = "defaultTalkWithNellaure_001", -- Nellaure (Gridania: CRP Guild) [1000822] = "defaultTalkWithCaplan_001", -- Caplan (Gridania: CRP Guild) [1000823] = "defaultTalkWithUlmhylt_001", -- Ulmhylt (Gridania: CRP Guild) [1000829] = "defaultTalkWithOdhinek_001", -- O'dhinek (Gridania: ARC Guild) [1000830] = "defaultTalkWithGeorjeaux_001", -- Georjeaux (Gridania: ARC Guild) defaultTalkWithGeorjeaux_002 - Dialog when you're part of the guild? [1000831] = "defaultTalkWithAlaire_001", -- Alaire (Gridania: ARC Guild) [1000832] = "defaultTalkWithMianne_001", -- Mianne (Gridania: ARC Guild) + [1000837] = "defaultTalkWithRdjongo_001", -- <<>> R'djongo (Gridania: Stillglade Fane) + [1000839] = "defaultTalkWithKhujazhwan_001", -- <<>> Khuja Zhwan (Gridania: Stillglade Fane) [1000951] = "defaultTalkWithLonsygg_001", -- Lonsygg (Gridania: Blue Badger Gate) + [1000978] = "defaultTalkWithGylbart_001", -- <<>> Gylbart (South Shroud: Quarrymill) + [1001071] = "defaultTalkWithTnbulea_001", -- <<>> T'nbulea (Gridania: CNJ Guild) + [1001072] = "defaultTalkWithFoforyo_001", -- <<>> Foforyo (Gridania: CNJ Guild) [1001077] = "defaultTalkWithBeli_001", -- Beli (Gridania: LTW Guild) [1001078] = "defaultTalkWithMaddeline_001", -- Maddeline (Gridania: LTW Guild) [1001079] = "defaultTalkWithDyrstbrod_001", -- Dyrstbrod (Gridania: LTW Guild) [1001080] = "defaultTalkWithTatagoi_001", -- Tatagoi (Gridania: LTW Guild) - [1001081] = "defaultTalkWithKhumamoshroca_001", -- Khuma Moshroca (Gridania: LTW Guild) + [1001081] = "defaultTalkWithKhumamoshroca_001", -- Khuma Moshroca (Gridania: LTW Guild) [1001082] = "defaultTalkWithLuilda_001", -- Luilda (Gridania: LTW Guild) [1001101] = "defaultTalkWithVnabyano_001", -- V'nabyano (Gridania: BTN Guild) [1001102] = "defaultTalkWithSandre_001", -- Sandre (Gridania: BTN Guild) - [1001103] = "defaultTalkWithMestonnaux_001", -- Mestonnaux (Gridania: BTN Guild) + [1001103] = "defaultTalkWithMestonnaux_001", -- Mestonnaux (Gridania: BTN Guild) + [1001150] = "defaultTalkWithBloisirant_001", -- <<>> Bloisirant (South Shroud: Silent Arbor) Instance queue NPC for Toto-Rak - Will not fire, not PplStd. + [1001151] = "defaultTalkWithBidelia_001", -- <<>> Bidelia - Entry Denier Guard? + [1001152] = "defaultTalkWithDadaneja_001", -- <<>> Dadaneja - Entry Denier Guard (West Shroud) - Guards fst_f0_dun06 + [1001153] = "defaultTalkWithRimomo_001", -- <<>> Rimomo - Entry Denier Guard (North Shroud: 25,7) - Guards fst_f0_dun05 [1001175] = "defaultTalkWithChloe_001", -- Chloe (Gridania: ARC Guild) - --[1001183] = "", -- Emoni (Gridania: Adv. Guild) Linkshell NPC - Will not fire, not PplStd. - --[1001184] = "", -- Gyles (Gridania: Adv. Guild) Retainer NPC - Will not fire, not PplStd. [1001188] = "defaultTalkWithGuildleveClientG_001", -- Maisenta (Gridania) [1001189] = "defaultTalkWithGuildleveClientG_002", -- Pukiki (Gridania) - [1001396] = "defaultTalkWithLefwyne_001", -- Lefwyne (Gridania: Shaded Bower) - [1001430] = "defaultTalkWithKinnison_001", -- Kinnison - Two args (nil errors client). If either >= 0, dialog mentions you've met Kan-E-Senna. Position inaccurate? + [1001190] = "defaultTalkWithGuildleveClientG_003", -- <<>> Eugenaire (Gridania: White Wolf Gate) + [1001294] = "defaultTalkWithIolaine_001", -- <<>> Iolaine - Entry Denier Guard (West Shroud) - Also guards fst_f0_dun06 + [1001338] = "defaultTalkWithLivith_001", -- <<>> Livith (North Shroud: Hyrstmill) + [1001339] = "defaultTalkWithProscen_001", -- <<>> Proscen (North Shroud: Hyrstmill) + [1001340] = "defaultTalkWithTanguistl_001", -- <<>> Tanguistl (North Shroud: Hyrstmill) + [1001341] = "defaultTalkWithComoere_001", -- <<>> Comoere (North Shroud: Hyrstmill) [dialog doesn't match wiki, but matching dialog isn't called in any function] + [1001342] = "defaultTalkWithLougblaet_001", -- <<>> Lougblaet (North Shroud: Hyrstmill) + [1001343] = "defaultTalkWithFamushidumushi_001", -- <<>> Famushi Dumushi (North Shroud: Hyrstmill) + [1001344] = "defaultTalkWithDrystan_001", -- <<>> Drystan (North Shroud: Hyrstmill) + [1001345] = "defaultTalkWithEadbert_001", -- <<>> Eadbert (North Shroud: Hyrstmill) + [1001346] = "defaultTalkWithKeketo_001", -- <<>> Keketo (South Shroud: Quarrymill) + [1001347] = "defaultTalkWithRadianttear_001", -- <<>> Radiant Tear (South Shroud: Quarrymill) + [1001348] = "defaultTalkWithMyles_001", -- <<>> Myles (South Shroud: Quarrymill) + [1001349] = "defaultTalkWithNathaniel_001", -- <<>> Nathaniel (South Shroud: Quarrymill) + [1001350] = "defaultTalkWithEvrardoux_001", -- <<>> Evrardoux (South Shroud: Quarrymill) + [1001351] = "defaultTalkWithTsehpanipahr_001", -- <<>> Tseh Panipahr (South Shroud: Quarrymill) + [1001352] = "defaultTalkWithEthelinda_001", -- <<>> Ethelinda (South Shroud: Quarrymill) + [1001353] = "defaultTalkWithHedheue_001", -- <<>> Hedheue (South Shroud: Quarrymill) + [1001396] = "defaultTalkWithLefwyne_001", -- Lefwyne (Gridania: Shaded Bower) + [1001430] = "defaultTalkWithKinnison_001", -- Kinnison (Gridania: Stillglade Fane) Two args (nil errors client). If either >= 0, mentions you've met Kan-E-Senna (joined a GC). Position inaccurate. [1001431] = "defaultTalkWithGenna_001", -- Genna (Gridania: Mih Khetto's Amphitheatre) [1001432] = "defaultTalkWithMathye_001", -- Mathye (Gridania: Blue Badger Gate) [1001433] = "defaultTalkWithUlta_001", -- Ulta (Gridania: Blue Badger Gate) - [1000434] = "defaultTalkWithOdilie_001", -- Odilie (Gridania: Adv. Guild) defaultTalkWithOdilie_002 / 003 (CUL informant) + [1001434] = "defaultTalkWithNicia_001", -- <<>> Nicia (Gridania: White Wolf Gate) + [1001435] = "defaultTalkWithBlandie_001", -- <<>> Blandie (Gridania: White Wolf Gate) [1001436] = "defaultTalkWithOwyne_001", -- Owyne (Gridania: Aetheryte Plaza) - [1001437] = "defaultTalkWithSybell_001", -- Sybell (Gridania: Aetheryte Plaza) + [1001437] = "defaultTalkWithSybell_001", -- Sybell (Gridania: Aetheryte Plaza) [1001459] = "defaultTalkWithFlavielle_001", -- Flavielle (Gridania: Adv. Guild) defaultTalkWithFlavielle_002 / 003 (ARM informant) [1001469] = "downTownTalk", -- Eldid (Gridania: Wards Entrance) + [1001470] = "defaultTalkWithYlessa_001", -- Ylessa + [1001570] = "defaultTalkWithRayao_001", -- <<>> Raya-O-Senna (North Shroud: Emerald Moss) WHM Job NPC, defaultTalkWithRayao_002 + [1001571] = "defaultTalkWithAruhnsenna_001", -- <<>> A-Ruhn-Senna (Inside Toto-Rak instance) [1001582] = "defaultTalkWithSwaenhylt_001", -- Swaenhylt (Gridania) [1001583] = "defaultTalkWithMarcette_001", -- Marcette (Gridania: The Knot) - [1001470] = "defaultTalkWithYlessa_001", -- Ylessa + [1001610] = "defaultTalkWithChamberliaux_001", -- <<>> Chamberliaux (South Shroud: Buscarron's Fold) + [1001611] = "defaultTalkWithFraemhar_001", -- <<>> Fraemhar (East Shroud: Hawthorne Hut) + [1001612] = "defaultTalkWithLora_001", -- <<>> Lora (East Shroud: Hawthorne Hut) + [1001613] = "defaultTalkWithXbhowaqi_001", -- <<>> X'bhowaqi (South Shroud: Buscarron's Fold) + [1001614] = "defaultTalkWithWawaramu_001", -- <<>> Wawaramu (South Shroud: Buscarron's Fold) + [1001615] = "defaultTalkWithArnott_001", -- <<>> Arnott (East Shroud: Hawthorne Hut) + [1001620] = "talkIdayCap", -- <<>> Serpent Lieutenant Marette (Gridania: The Knot) - Foundation Day 2011 - OLD EVENT NPC: Replaced by 2012 version + [1001621] = "talkIday1", -- <<>> Serpent Sergeant Frilaix (Gridania: The Knot) - Foundation Day 2011 - OLD EVENT NPC: Replaced by 2012 version + [1001622] = "talkIday2", -- <<>> Serpent Private Tristelle (Gridania: The Knot) - Foundation Day 2011 - OLD EVENT NPC: Replaced by 2012 version + [1001628] = "defaultTalkWithAilith_001", -- <<>> Ailith (South Shroud: Quarrymill) + [1001636] = "defaultTalkWithLhomujuuk_001", -- <<>> Lho Mujuuk (South Shroud: Silent Arbor) - Hangs outside Toto-Rak entrance + [1001637] = "defaultTalkWithSholnoralno_001", -- <<>> Sholno Ralno (South Shroud: Silent Arbor) - Hangs outside Toto-Rak entrance + [1001638] = "defaultTalkWithTuatkk_001", -- <<>> Tuatkk (South Shroud: Silent Arbor) - Hangs outside Toto-Rak entrance + [1001642] = "defaultTalkWithRonanKognan_001", -- <<>> Ronan Kognan (Gridania: 5,5) - Has a variety of functions, listed under onTalk() [1001706] = "defaultTalkWithMemama_001", -- Memama (Gridania: Adv. Guild) [1001707] = "defaultTalkWithPfarahr_001", -- Pfarahr (Gridania: Adv. Guild) [1001708] = "defaultTalkWithBeaudonet_001", -- Beaudonet (Gridania: Adv. Guild) [1001709] = "defaultTalkWithFryswyde_001", -- Fryswyde (Gridania: Adv. Guild) [1001710] = "defaultTalkWithWillielmus_001", -- Willielmus (Gridania: Adv. Guild) + [1001711] = "defaultTalkWithQZamqo_001", -- <<>> Q'zamqo (Gridania: Airship Landing) [1001806] = "defaultTalkEnie_001", -- Enie (Gridania: BTN Guild) + [1001835] = "defaultTalkWithVorsaile_001", -- <<>> Serpent Commander Heuloix (North Shroud: Emerald Moss) + [1001836] = "defaultTalkWithPukwapika_001", -- <<>> Pukwa Pika (West Shroud: Turning Leaf) - Involved in "A Feast of Fools", Thornmarch fight + [1001837] = "defaultTalkWithPurumoogle_001", -- <<>> Frightened Moogle (West Shroud: Turning Leaf) - Hangs out beside Pukwa Pika + [1001838] = "defaultTalkWithPirimoogle_001", -- <<>> Fretful Moogle (West Shroud: Turning Leaf) - Hangs out beside Pukwa Pika + [1001936] = "defaultTalkWithPukno_001", -- <<>> Pukno Poki - defaultTalkWithPukno_002 - Used after unlocking BRD? + [1001937] = "defaultTalkWithMoogleA_001", -- <<>> Pukni Pakk (North Shroud: Emerald Moss) - Hangs with WHM Job NPC - defaultTalkWithMoogleA_002 - Post-WHM dialog? + [1001938] = "defaultTalkWithMppgleB_001", -- <<>> Kupcha Kupa (North Shroud: Emerald Moss) - Hangs with WHM Job NPC - defaultTalkWithMppgleB_002 - Post-WHM dialog? [1001951] = "defaultTalkWithAnselm_001", -- Anselm (Gridania: Adv. Guild) + [1001957] = "defaultTalkWithPukumoogle_001", -- <<>> Plush Moogle (West Shroud: Crimson Bark) --[1002090] = "defaultTalkWithStewart_001", -- Serpent Private Hodder (Gridania: Adv. Guild) defaultTalkWithStewart_002 (Post-Raid dialog?) - Will not fire, not PplStd. --[1002091] = "defaultTalkWithTrisselle_001", -- Serpent Private Daurement (Gridania: Adv. Guild) defaultTalkWithTrisselle_002 (No idea for context) - Will not fire, not PplStd. [1002106] = "processEventELNAURE", -- Serpent Lieutenant Marette (Gridania: The Knot) - Foundation Day 2012 - Spl000 staticactor [1002107] = "processEventARISMONT", -- Serpent Sergeant Frilaix (Gridania: The Knot) - Foundation Day 2012 - Spl000 staticactor [1002108] = "processEventMERLIE", -- Serpent Private Tristelle (Gridania: The Knot) - Foundation Day 2012 - Spl000 staticactor + [1060039] = "defaultTalkWithJehantel_001", -- <<>> Jehantel (South Shroud: Tranquil Paths) BRD Job NPC - defaultTalkWithJehantel_002 + [1060043] = "defaultTalkWithLegendBsm_001", -- <<>> Gerolt (East Shroud: Hawthorne Hut) - Arg1 controls which line of dialog he plays, otherwise nothing shows --[1060022] = "defaultTalkLouisoix_001", -- Louisoix (Gridania: Apkallus Falls) - Will not fire, not PplStd. + [1200121] = "bookTalk", -- <<>> Dusty Tomes (Gridania: CNJ Guild) - Will not fire since it isn't PplStd. Identical dialog regardless. [1500055] = "defaultTalkWithLionnellais_001", -- Lionnellais (Gridania: Adv. Guild) - Will not fire, not PplStd. Pre-airship dialog? [1500056] = "defaultTalkWithHida_001", -- Hida (Gridania: Adv. Guild) - Will not fire, not PplStd. Pre-airship dialog? - --[1500061] = "", -- Fruhdhem (Gridania) Chocobo Taxi - Will not fire, not PplStd. + [1500060] = "defaultTalkWithHonoroit_001", -- <<>> Honoroit (Central Shroud) - Hangs around (-200, 5, -810), has an untargetable chocobo carriage behind + --[1500061] = "defaultTalkWithFhrudhem_001", -- Fruhdhem [function typo] (Gridania) Chocobo Taxi - Will not fire, not PplStd. [1500127] = "tribeTalk", -- Prosperlain (Gridania) - --[1500294] = "", -- Gagaroon (Gridania: Rosewood Stalls) Black Market - Will not fire, not PplStd. [1700001] = "defaultTalkWithPenelope_001", -- Penelope (Gridania: Adv. Guild) - [1700038] = "defaultTalkWithAUBRENARD_100", -- Aubrenard (Gridania: Shaded Bower) + [1700038] = "defaultTalkWithAUBRENARD_100" -- Aubrenard (Gridania: Shaded Bower) + } --[[ TO:DO - Map the remainder of these +defaultTalkWithAstrelle_001 -- "Astrelle" actor/name exists (1000736), but function calls blank dialog. Unused? Perhaps Quest-only actor? +defQuest1g0_Bush -- Empty function, unused? Perhaps Quest-only actor? +defQuest1g1_Bush -- Empty function, unused? Perhaps Quest-only actor? + + +defaultTalkWithYonariumnari_001 -- "Yonari Umnari" actor/name exists (1000838), but cannot find existence of the npc or dialog on the internet. +defaultTalkWithMoogle010_001 -- No idea what moogles these are tied too. +defaultTalkWithMoogle002_001 -defaultTalkWithPowle_001 -defaultTalkWithSansa_001 -defaultTalkWithNicoliaux_001 -defaultTalkWithAunillie_001 -defaultTalkWithElyn_001 -defaultTalkWithRyd_001 -defaultTalkWithSolieine_001 -defaultTalkWithHetzkin_001 -defaultTalkWithTelent_001 -defaultTalkWithKhujazhwan_001 -defaultTalkWithZerig_001 -defaultTalkWithYonariumnari_001 -defaultTalkWithGugula_001 -defaultTalkWithRdjongo_001 -defaultTalkWithAstrelle_001 -defaultTalkWithBiddy_001 -defaultTalkWithConcessa_001 -defaultTalkWithMaroile_001 -defaultTalkWithKinborow_001 -defaultTalkWithTnbulea_001 -defaultTalkWithFoforyo_001 -defaultTalkWithFhrudhem_001 -defaultTalkWithMitainie_001 -defaultTalkWithNicia_001 -defaultTalkWithBlandie_001 -defaultTalkWithLivith_001 -defaultTalkWithProscen_001 -defaultTalkWithTanguistl_001 -defaultTalkWithComoere_001 -defaultTalkWithLougblaet_001 -defaultTalkWithFamushidumushi_001 -defaultTalkWithDrystan_001 -defaultTalkWithEadbert_001 -defaultTalkWithWybir_001 -defaultTalkWithKeketo_001 -defaultTalkWithRadianttear_001 -defaultTalkWithMyles_001 -defaultTalkWithNathaniel_001 -defaultTalkWithEvrardoux_001 -defaultTalkWithTsehpanipahr_001 -defaultTalkWithEthelinda_001 -defaultTalkWithHedheue_001 -defaultTalkWithJajajbygo_001 arg1 arg2 -defaultTalkWithPepeli_001 arg1 -defaultTalkWithBidelia_001 -defaultTalkWithRimomo_001 -defaultTalkWithDadaneja_001 -defaultTalkWithIolaine_001 -defaultTalkWithBloisirant_001 -defaultTalkWithGylbart_001 -defaultTalkWithHonoroit_001 -defaultTalkWithGuildleveClientG_003 -defQuest1g0_Bush -defQuest1g1_Bush -defaultTalkWithChamberliaux_001 -defaultTalkWithFraemhar_001 -defaultTalkWithXbhowaqi_001 -defaultTalkWithLora_001 -defaultTalkWithWawaramu_001 -defaultTalkWithArnott_001 -defaultTalkWithLhomujuuk_001 -defaultTalkWithSholnoralno_001 -defaultTalkWithTuatkk_001 -defaultTalkWithAruhnsenna_001 -defaultTalkWithMoogle010_001 -defaultTalkWithMoogle002_001 -defaultTalkWithAilith_001 -defaultTalkWithQZamqo_001 -defaultTalkWithRonanKognan_001 -defaultTalkWithRonanKognan_002 arg1 arg2 -defaultTalkWithRonanKognan_Hint_00 arg1 -defaultTalkWithRonanKognan_Hint_01 arg1 -defaultTalkWithRonanKognan_Hint_02 arg1 -defaultTalkWithRonanKognan_Hint_03 arg1 -defaultTalkWithRonanKognan_Hint_04 arg1 -defaultTalkWithVorsaile_001 arg1 defaultTalkCaravanChocoboGri_001 -bookTalk -talkIdayCap -talkIday1 -talkIday2 -defaultTalkWithPukwapika_001 -defaultTalkWithPurumoogle_001 -defaultTalkWithPirimoogle_001 -defaultTalkWithPukumoogle_001 -defaultTalkWithJehantel_001 -defaultTalkWithJehantel_002 -defaultTalkWithPukno_001 -defaultTalkWithPukno_002 -defaultTalkWithRayao_001 -defaultTalkWithRayao_002 -defaultTalkWithMoogleA_001 -defaultTalkWithMoogleA_002 -defaultTalkWithMppgleB_001 -defaultTalkWithMppgleB_002 -defaultTalkWithInn_Desk defaultTalkWithInn_ExitDoor defaultTalkWithExit01 -defaultTalkWithLegendBsm_001 arg1 defaultTalkWithMarketNpc defaultTalkWithHamletGuardGri_001 --]] @@ -231,26 +211,72 @@ defaultTalkWithHamletGuardGri_001 function onTalk(player, quest, npc, eventName) local npcId = npc:GetActorClassId(); - local clientFunc = defaultTalkFst[npcId]; + local clientFunc = defaultTalkFst[npcId]; if (npcId == 1000430) then -- Nonco Menanco callClientFunction(player, "delegateEvent", player, quest, clientFunc, 21); + elseif (npcId == 1000458) then -- V'korolon (Inn NPC) + if (player:IsQuestCompleted(110828)) then -- "Waste Not Want Not" completed. + defaultTalkWithInn(player, quest, "defaultTalkWithInn_Desk"); + else + callClientFunction(player, "delegateEvent", player, quest, clientFunc); + end + elseif (npcId == 1000669) then -- Jajajbygo + callClientFunction(player, "delegateEvent", player, quest, clientFunc, 20); + elseif (npcId == 1000670) then -- Pepeli + callClientFunction(player, "delegateEvent", player, quest, clientFunc, 20); elseif (npcId == 1001430) then -- Kinnison callClientFunction(player, "delegateEvent", player, quest, clientFunc, -1,-1); + elseif (npcId == 1001642) then -- Ronan Kognan + callClientFunction(player, "delegateEvent", player, quest, clientFunc) -- Called if no deaspected crystals on player? + --[[ + defaultTalkWithRonanKognan_002(bool1, bool2) -- Called if any deaspected crystals on player? bool1=Has enough deaspected for buying helmet bool2=already has helmet dialog + defaultTalkWithRonanKognan_Hint_00 -- Lore dialog likely called in order as you make transactions with the npc? + defaultTalkWithRonanKognan_Hint_01 + defaultTalkWithRonanKognan_Hint_02 + defaultTalkWithRonanKognan_Hint_03 + defaultTalkWithRonanKognan_Hint_04 + --]] + elseif (npcId == 1001936) then -- Pukno Poki + callClientFunction(player, "delegateEvent", player, quest, clientFunc); --defaultTalkWithPukno_002 -- Used after unlocking BRD? + elseif (npcId == 1060039) then -- Jehantel + callClientFunction(player, "delegateEvent", player, quest, clientFunc); --defaultTalkWithJehantel_002 -- Post-BRD unlock? + elseif (npcId == 1060043) then -- Gerolt + callClientFunction(player, "delegateEvent", player, quest, clientFunc, 1); elseif ((npcId >= 1002106) and (npcId <= 1002108)) then -- Foundation Day 2012 NPCs talkWithSpecial(player, npcId, clientFunc) else - callClientFunction(player, "delegateEvent", player, quest, clientFunc); + callClientFunction(player, "delegateEvent", player, quest, clientFunc); end - player:EndEvent(); + player:EndEvent(); end function IsQuestENPC(player, quest, npc) - return defaultTalkFst[npc:GetActorClassId()] ~= nil; + return defaultTalkFst[npc:GetActorClassId()] ~= nil; end + +function defaultTalkWithInn(player, quest, clientFunc) + local choice = callClientFunction(player, "delegateEvent", player, quest, clientFunc); + + if (choice == 1) then + GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 160.048, 0, 154.263, 0); + elseif (choice == 2) then + if (player:GetHomePointInn() ~= 2) then + player:SetHomePointInn(2); + player:SendGameMessage(GetWorldMaster(), 60019, 0x20, 2075); --Secondary homepoint set to the Roost + else + 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;