diff --git a/data/scripts/base/chara/npc/populace/PopulaceCaravanAdviser.lua b/data/scripts/base/chara/npc/populace/PopulaceCaravanAdviser.lua new file mode 100644 index 00000000..9e1bee75 --- /dev/null +++ b/data/scripts/base/chara/npc/populace/PopulaceCaravanAdviser.lua @@ -0,0 +1,41 @@ +--[[ + +PopulaceCaravanAdviser Script + +Functions: + +adviserDeffault() - Not a typo. NPC dialog talking about a chocobo. Resets their sight on you, perhaps used on closing dialog? +adviserAsk() - Brings up a menu for caravan info, or purchasing gysahl greens +adviserAdvise() - NPC dialog discussing feeding chocobos +adviserSales(price) - Gysahl purchase dialog and prompt +adviserBuy() - Dialog to play after purchasing gysahl greens +adviserBuyNG() - NPC plays /shrug animation. + +--]] + +require ("global") + +function init(npc) + return false, false, 0, 0; +end + +function onEventStarted(player, npc, triggerName) + local gysahlPrice = 20; + local choice = callClientFunction(player, "adviserAsk"); + + if choice == 1 then + callClientFunction(player, "adviserAdvise"); + elseif choice == 2 then + local purchaseChoice = callClientFunction(player, "adviserSales", gysahlPrice); + + if purchaseChoice == 1 then + callClientFunction(player, "adviserBuy"); + elseif purchaseChoice == 2 then + callClientFunction(player, "adviserBuyNG"); + end + elseif choice == 3 then + callClientFunction(player, "adviserDeffault") + end + + player:EndEvent(); +end \ No newline at end of file diff --git a/data/scripts/base/chara/npc/populace/PopulaceCaravanGuide.lua b/data/scripts/base/chara/npc/populace/PopulaceCaravanGuide.lua new file mode 100644 index 00000000..efc47570 --- /dev/null +++ b/data/scripts/base/chara/npc/populace/PopulaceCaravanGuide.lua @@ -0,0 +1,68 @@ +--[[ + +PopulaceCaravanGuide Script + +This script handles the caravan guide class, which is for the actor who escorts the chocobos behind them during Caravan Security events. + + +Functions: + +caravanGuardCancel() - Menu prompt to abandon the caravan + +caravanGuardReward(cargo, nil, areaName, playerGC, killCount, areaName2) + - Reward dialog for completing the caravan + - cargo = 0 (none) through 9 (all) for varying degrees of success dialog + - If playerGC doesn't match the GC of the areaName region, NPC mentions you don't need their seals. + - killCount shows an extra dialog if 40-49 enemies were slain, and a different one at 50+ + +caravanGuardNotReward() - Dialog stating you didn't contribute to the event at all +caravanGuardFailReward(areaName, areaName2) - Failure dialog, NPC offers free gysahl green, then offers free teleport back to aetheryte +caravanGuardThanks(name1, name2, name3) - Dialog for joining the caravan. NPC names the three chocobos. Name IDs from xtx_displayName +caravanGuardOffer(areaName, areaName2, playerGC) - Dialog for who to talk to for joining the caravan. +caravanGuardAmple(areaName, areaName2) - Dialog for NPC taking a break? +caravanGuardSuccess() - Dialog when you reached destination? +caravanGuardFailure(areaName, areaName2) - Failure dialog for mentioned area. +caravanGuardIgnore() - Resets NPC state for player? Or used for players not flagged for the event. +caravanGuardBonusReward(nil, isBonus?) - NPC says variation on a piece of dialog from the boolean passed +caravanGuardNotBonusReward() - Inventory full flavour dialog + + +Notes: +Functions employing areaName/areaName2 add their value together in the client's script to get the area name. Said area values are... +1 = Wineport, 2 = Quarrymill, 3 = Silver Bazaar, 4 = Aleport, 5 = Hyrstmill, 6 = Golden Bazaar + +areaName will always be 1-3 for caravanGuardReward to function as expected for GC-related dialog +areaName2 will always be either 0 or 3. 0 for the lower level caravan area name, 3 for the higher level. + +populaceCaravanGuide sheet: +ID Dialog Comment +6 It is time. Come, let us ride. - Caravan begins. +12 We've arrived at last! Come and speak to me when you're ready to claim your reward. - Caravan completed. +23 We're under attack! The chocobos! Protect the chocobos! - Caravan aggros monsters +27 Gods, have we already come this far? At this pace, we stand to make good time. - Says between 50% & 90% of the way to desgination? Can be said more than once per run +28 Well fought, friend. I thank the gods you're with us. Come, onward! - Cleared monsters that caravan aggro'd + +TO-DO: +Document actors involved. Should be six of them. + +--]] + +require ("global") + +function init(npc) + return false, false, 0, 0; +end + +function onEventStarted(player, npc, triggerName) + local areaName = 1; + local areaName2 = 3; + local playerGC = 1; + local cargo = 9; + local killCount = 50; + callClientFunction(player, "caravanGuardOffer", areaName, areaName2, playerGC); + --callClientFunction(player, "caravanGuardReward", cargo, nil, areaName, playerGC, killCount, areaName2); + --player:SendGameMessageDisplayIDSender(npc, 6, MESSAGE_TYPE_SAY, npc.displayNameId); + + + player:EndEvent(); +end \ No newline at end of file diff --git a/data/scripts/base/chara/npc/populace/PopulaceCaravanManager.lua b/data/scripts/base/chara/npc/populace/PopulaceCaravanManager.lua new file mode 100644 index 00000000..c125228b --- /dev/null +++ b/data/scripts/base/chara/npc/populace/PopulaceCaravanManager.lua @@ -0,0 +1,49 @@ +--[[ + +PopulaceCaravanManager Script + +Functions: + +caravanGuardEntry(areaGC, hasRoomForGCSeals, areaName, difficulty, playerGC, playerCountRequired, levelRequired) + - Dialog for signing up for caravan. areaGC(1-3) & areaName(0 or 3) added together to get location name. + - If difficulty => 40 on areaGC 1-3 & areaName 0, NPC mentions it's be a tougher trip + +caravanGuardQuestion(areaName1, areaName2, escortMax, isSameGC?, playerGC?) - Ask about the caravan escort +caravanGuardJoinOK(areaName1, areaName2, playerGC) - Dialog for successfully joining the caravan +caravanGuardJoinNG(nil, maxEscorts, playerGC) - Dialog dictating how many escorts total filled the run. +caravanGuardAmple(nil, playerGC, playerGC) - Dialog for caravan escort being full. +caravanGuardOther(npcGC) - Dialog where NPC mentions you're not part of the given Grand Company parameter +caravanGuardSigh() - NPC does a shrug animation +caravanGuardHuh() - NPC does /huh +caravanGuardCancel(nil, playerGC) - Dialog for canceling caravan escort. + + +Notes: +Some NPC dialog address you differently if your GC rank is Chief Sergeant (id 27) or higher, but only in non-English languages. + +--]] + +require ("global") + +function init(npc) + return false, false, 0, 0; +end + +function onEventStarted(player, npc, triggerName) + local GC = 3; + local playerGC = 1; + local areaName = 0; + local level = 25; + local playerCount = 8; + local difficulty = 41; + local hasRoomForGCSeals = false; + local isSameGC = true; + local escortMax = 8; + areaName1 = 1; + areaName2 = 3; + + -- callClientFunction(player, "caravanGuardCancel", nil, 3); + + callClientFunction(player, "caravanGuardEntry", GC, hasRoomForGCSeals, areaName, difficulty, playerGC, playerCount, level); + player:EndEvent(); +end \ No newline at end of file diff --git a/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua b/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua new file mode 100644 index 00000000..d4a8c29b --- /dev/null +++ b/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua @@ -0,0 +1,84 @@ +--[[ + +PopulaceSpecialEventCryer Script + +Actor Class script to handle the 6 NPCs (technically 3, the actors were duped) involved in the Foundation Day 2011 & 2012 events. +In 2011 they appear to be used for recruitment information for their respective Grand Company. +In 2012, they were used for exchanging Over-aspected Crystals/Clusters for GC seals as part of the ongoing Atomos event. + +Functions: + +For 2011. +eventTalkStep0(joined) - NPC dialog about joining their cause to fight back Imperials. joined = 0 or 1. Function has hardcoded actor IDs, won't work with 2012 versions +eventTalkNotGCmenber(npcGC) - NPC dialog when you're not part of their grand company. + +For 2012. +eventTalkCrystalExchange(player, npcGC, hasCrystal) - NPC dialog explaining they want over-aspected crystals. Brings up crystal exchange prompt if hasCrystal = 1. +eventTalkCsOverflow(player, npcGC) - Error message that you can't hold the seals being offered. +eventTalkCrystalExchange2(player, npcGC) - NPC dialog for accepting exchange of crystals for seals + +--]] + +require ("global") + +function init(npc) + return false, false, 0, 0; +end + + +local gcRep = { + [1001619] = 1, -- Maelstrom Representative 2011 + [1002105] = 1, -- Maelstrom Representative 2012 + [1001623] = 2, -- Adder Representative 2011 + [1002109] = 2, -- Adder Representative 2012 + [1001627] = 3, -- Flame Representative 2011 + [1002113] = 3, -- Flame Representative 2012 +} + + +function onEventStarted(player, npc, triggerName) + local playerGC = player.gcCurrent; + local npcId = npc:GetActorClassId(); + local npcGC = gcRep[npcId]; + local npcGCSeal = 1000200 + npcGC; + local hasCrystal = 1; + local crystal = 3020537; + local cluster = 3020413; + local eventMode = 2012; + + + if eventMode == 2011 then + if playerGC == 0 then + callClientFunction(player, "eventTalkStep0", 0); + elseif playerGC == npcGC then + callClientFunction(player, "eventTalkStep0", 1); + else + callClientFunction(player, "eventTalkNotGCmenber", npcGC); + end + + elseif eventMode == 2012 then + choice = callClientFunction(player, "eventTalkCrystalExchange", player, npcGC, hasCrystal); + + if choice == 1 then + --callClientFunction(player, "eventTalkCsOverflow", player, npcGC); + player:SendMessage(0x20, "", "You pretend to hand over four over-aspected crystals."); + callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC); + + local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1); + if invCheck == INV_ERROR_SUCCESS then + player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, crystal, 1, npcGCSeal, 1, 4, 1000); + end + elseif choice == 2 then + player:SendMessage(0x20, "", "You pretend to hand over an over-aspected cluster."); + --callClientFunction(player, "eventTalkCsOverflow", player, npcGC); + callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC); + + local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1); + if invCheck == INV_ERROR_SUCCESS then + player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, cluster, 1, npcGCSeal, 1, 1, 3000); + end + end + end + + player:EndEvent(); +end \ No newline at end of file diff --git a/data/scripts/commands/PartyTargetCommand.lua b/data/scripts/commands/PartyTargetCommand.lua new file mode 100644 index 00000000..e5d77fe5 --- /dev/null +++ b/data/scripts/commands/PartyTargetCommand.lua @@ -0,0 +1,57 @@ +--[[ + +PartyTargetCommand Script + +Handles placing marks on targets + +--]] +require("global") + +markers = { -- [id] = {overheadIcon, textIcon} + [0] = {0, 0}, -- Clear + [1] = {1000, 304},-- Watch my HP! + [2] = {2000, 305},-- Watch my MP! + [3] = {3000, 306},-- Watch my TP! + [5] = {5000, 308},-- I need enhancing magic! + [6] = {6000, 309},-- I am enfeebled! + [7] = {7000, 310},-- Good! + [8] = {8000, 311},-- Bad! + + [100] = {-7000, 296}, -- Attack this target! + [101] = {-6000, 297}, -- Focus on this target! + [102] = {-5000, 298}, -- Stop this target! + [104] = {-4000, 299}, -- Do not attack this target! + [105] = {-3000, 300}, -- General mark Spade + [106] = {-2000, 301}, -- General mark Club + [107] = {-1000, 302}, -- General mark Diamond +} + + +function onEventStarted(player, actor, triggerName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6) + + workName = "charaWork.parameterTemp.targetInformation"; + uiFunc = "charaWork/stateForAll"; + + markerIndex = markers[commandValue][1] or 0; + iconIndex = markers[commandValue][2] or 0; + categoryKind = tonumber(category) or -1; + worldMaster = GetWorldMaster(); + + if categoryKind == -1 then + return + end + + player:SetWorkValue(player, workName, uiFunc, markerIndex); + + if iconIndex != 0 then + if categoryKind == 1 then + player:SendGameMessage(player, worldMaster, 30422, 0x20, player, iconIndex); + elseif categoryKind == 2 then + player:SendGameMessage(player, worldMaster, 30412, 0x20, player, iconIndex); + end + elseif iconIndex == 0 then + player:SendGameMessage(player, worldMaster, 30413, 0x20, player, 0); + end + + player:EndEvent(); +end \ No newline at end of file diff --git a/data/scripts/gcseals.lua b/data/scripts/gcseals.lua new file mode 100644 index 00000000..da6e1e40 --- /dev/null +++ b/data/scripts/gcseals.lua @@ -0,0 +1,66 @@ +--[[ + +Grand Company Seal Helper Functions + +--]] +require("global"); + +local companySeal = {1000201, 1000202, 1000203}; -- Storm, Serpent, Flame +local rankSealCap = { + [0] = 0, -- None + [11] = 10000, -- Private Third Class + [13] = 15000, -- Private Second Class + [15] = 20000, -- Private First Class + [17] = 25000, -- Corporal + [21] = 30000, -- Sergeant Third Class + [23] = 35000, -- Sergeant Second Class + [25] = 40000, -- Sergeant First Class + [27] = 45000, -- Chief Sergeant + [31] = 50000, -- Second Lieutenant + [33] = 50000, -- First Lieutenant + [35] = 50000, -- Captain + [41] = 60000, -- Second Commander + [43] = 60000, -- First Commander + [45] = 60000, -- High Commander + [51] = 70000, -- Rear Marshal + [53] = 70000, -- Vice Marshal + [55] = 70000, -- Marshal + [57] = 70000, -- Grand Marshal + [100] = 100000, -- Champion + [111] = 0, -- Chief Admiral/Elder Seedseer/General + [127] = 10000 -- Recruit +} + +function GetGCSeals(player, company) + company = tonumber(company); + + if company ~= nil and company > 0 and company < 4 then + return player:GetInventory(INVENTORY_CURRENCY):GetItemQuantity(companySeal[tonumber(company)]); + else + return -1; + end +end + +function AddGCSeals(player, company, amount) + amount = tonumber(amount); + company = tonumber(company); + + local gcRank = {player.gcRankLimsa, player.gcRankGridania, player.gcRankUldah}; + local currentAmount = GetGCSeals(player, company); + local maxAmount = rankSealCap[gcRank[company]]; + + if currentAmount ~= -1 then + if amount then + if currentAmount + amount <= maxAmount then + invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(companySeal[company], amount, 1); + if invCheck == INV_ERROR_SUCCESS then + return INV_ERROR_SUCCESS; + end + else + return INV_ERROR_FULL; + end + end + else + return INV_ERROR_SYSTEM_ERROR; + end +end \ No newline at end of file diff --git a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua index 15668acc..8cc5d507 100644 --- a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua +++ b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua @@ -1,7 +1,18 @@ require ("global") function onEventStarted(player, npc) - defaultFst = GetStaticActor("Spl000"); - callClientFunction(player, "delegateEvent", player, defaultFst, "processEventELNAURE", 1,1,1); - player:endEvent(); + Spl = GetStaticActor("Spl000"); + magickedPrism = 3020615; + + if not player:GetInventory(INVENTORY_NORMAL):HasItem(magickedPrism) then + callClientFunction(player, "delegateEvent", player, Spl, "processEventELNAURE", 2); + local invCheck = player:GetInventory(INVENTORY_NORMAL):AddItem(magickedPrism, 10, 1); + if invCheck == INV_ERROR_SUCCESS then + player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, magickedPrism, 10); + end + else + callClientFunction(player, "delegateEvent", player, Spl, "processEventELNAURE", 1); + end + + player:endEvent(); end \ No newline at end of file diff --git a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_private_tristelle.lua b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_private_tristelle.lua index 6413be1a..267063c0 100644 --- a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_private_tristelle.lua +++ b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_private_tristelle.lua @@ -1,7 +1,7 @@ require ("global") function onEventStarted(player, npc) - defaultFst = GetStaticActor("Spl000"); - callClientFunction(player, "delegateEvent", player, defaultFst, "processEventMERLIE", 1,1,1); + Spl = GetStaticActor("Spl000"); + callClientFunction(player, "delegateEvent", player, Spl, "processEventMERLIE"); player:endEvent(); end \ No newline at end of file diff --git a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_frilaix.lua b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_frilaix.lua index 60f377c2..fadd1fdd 100644 --- a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_frilaix.lua +++ b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_frilaix.lua @@ -1,7 +1,7 @@ require ("global") function onEventStarted(player, npc) - defaultFst = GetStaticActor("Spl000"); - callClientFunction(player, "delegateEvent", player, defaultFst, "processEventARISMONT", 1, 1, 1); + Spl = GetStaticActor("Spl000"); + callClientFunction(player, "delegateEvent", player, Spl, "processEventARISMONT"); player:endEvent(); end \ No newline at end of file diff --git a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_nelhah.lua b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_nelhah.lua deleted file mode 100644 index 20a0b514..00000000 --- a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_sergeant_nelhah.lua +++ /dev/null @@ -1,7 +0,0 @@ -require ("global") - -function onEventStarted(player, npc) - defaultFst = GetStaticActor("DftFst"); - callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithSerpent_sergeant_nelhah_001", nil, nil, nil); - player:endEvent(); -end \ No newline at end of file diff --git a/data/scripts/unique/sea0Town01a/PopulaceStandard/ansgor.lua b/data/scripts/unique/sea0Town01a/PopulaceStandard/ansgor.lua index 92289ab0..70234f8f 100644 --- a/data/scripts/unique/sea0Town01a/PopulaceStandard/ansgor.lua +++ b/data/scripts/unique/sea0Town01a/PopulaceStandard/ansgor.lua @@ -2,6 +2,6 @@ require ("global") function onEventStarted(player, npc) defaultSea = GetStaticActor("DftSea"); - callClientFunction(player, "delegateEvent", player, defaultSea, "defaultTalkWithAnsgor_001"); + callClientFunction(player, "delegateEvent", player, defaultSea, "defaultTalkWithANSGOR_100"); player:endEvent(); end \ No newline at end of file diff --git a/data/scripts/unique/wil0Town01/PopulaceStandard/flame_private_sisimuza_tetemuza.lua b/data/scripts/unique/wil0Town01/PopulaceStandard/flame_private_sisimuza_tetemuza.lua index e8960bd7..dd06fcaf 100644 --- a/data/scripts/unique/wil0Town01/PopulaceStandard/flame_private_sisimuza_tetemuza.lua +++ b/data/scripts/unique/wil0Town01/PopulaceStandard/flame_private_sisimuza_tetemuza.lua @@ -1,7 +1,7 @@ require ("global") function onEventStarted(player, npc) - defaultWil = GetStaticActor("DftWil"); - callClientFunction(player, "delegateEvent", player, defaultWil, "defaultTalkWithFlameprivatesisimuzatetemuza_001", nil, nil, nil); + Spl = GetStaticActor("Spl000"); + callClientFunction(player, "delegateEvent", player, Spl, "processEventSISIMUZA"); player:endEvent(); end \ No newline at end of file diff --git a/data/scripts/unique/wil0Town01/PopulaceStandard/flame_sergeant_mimio_mio.lua b/data/scripts/unique/wil0Town01/PopulaceStandard/flame_sergeant_mimio_mio.lua index e0c0dea5..c3ea9ab8 100644 --- a/data/scripts/unique/wil0Town01/PopulaceStandard/flame_sergeant_mimio_mio.lua +++ b/data/scripts/unique/wil0Town01/PopulaceStandard/flame_sergeant_mimio_mio.lua @@ -1,8 +1,8 @@ require ("global") function onEventStarted(player, npc) - defaultWil = GetStaticActor("DftWil"); - callClientFunction(player, "delegateEvent", player, defaultWil, "defaultTalkWithFlamesergeantmimiomio_001", nil, nil, nil); + Spl = GetStaticActor("Spl000"); + callClientFunction(player, "delegateEvent", player, Spl, "processEventMIMIO"); player:endEvent(); end diff --git a/data/scripts/unique/wil0Town01a/DoorStandard/ne_of_eshtaimes.lua b/data/scripts/unique/wil0Town01a/DoorStandard/ne_of_eshtaimes.lua index baa3b958..1cffd8b4 100644 --- a/data/scripts/unique/wil0Town01a/DoorStandard/ne_of_eshtaimes.lua +++ b/data/scripts/unique/wil0Town01a/DoorStandard/ne_of_eshtaimes.lua @@ -1,3 +1,3 @@ function init(npc) - return false, false, 0, 0, 0x1A5, 0xFC7; + return false, false, 0, 0, 0x1A5, 0xFD9; end \ No newline at end of file