diff --git a/Data/scripts/base/chara/npc/populace/PopulaceCompanyShop.lua b/Data/scripts/base/chara/npc/populace/PopulaceCompanyShop.lua new file mode 100644 index 00000000..7f6dd5a2 --- /dev/null +++ b/Data/scripts/base/chara/npc/populace/PopulaceCompanyShop.lua @@ -0,0 +1,510 @@ +--[[ + +PopulaceCompanyShop Script + + +Functions: + +eventTalkStepCantUse() -- When player tries to buy from another GC's shop +eventTalkPreJoin() -- Dialog for the shop +eventTalkPreJoinQuest() -- Tutorial dialog for the shop? +eventTalkJoined(???) -- Dialog for the shop, they salute. Orphaned parameter? + +eventTalkFestival() -- Festival Day Event Dialog +eventTalkFestival2() -- Festival Day Event Follow-up Dialog + +eventTalkMainMenu(???, ???) -- Shop menu for picking GC items +eventShopMenuOpen() -- Sets up shop menu. Calls getSpecialEventWork, value 8 shows GC firework & 11 a Patriot's Choker +eventShopMenuAsk() -- Opens up the shop menu. +eventShopMenuClose() + +eventGuideChocoboWhistle(???) -- Tutorial dialog after purchasing Chocobo issuance slip. Orphaned parameter? +eventGuideTownTransport(index) -- Tutorial dialog after purchasing an aetherpass. Index is item ID. +eventAskChocoboCustomize(index, price) -- Chocobo Barding purchase dialog. Index is item ID. +eventChocoboCustomize() -- Follow-up dialog if you purchase Chocobo Barding. + +getGrandCompanyNumber() -- Returns GC value of the NPC +getShopItemStartIndex(index) -- Gets starting index value based on GC shop +getShopItemEndIndex(index) -- Gets ending index value based on GC shop +getShopSellingItemMax(???) -- +getShopSellingItemDetail(player, ???, ???) + +eventTalkStepBreak() -- Returns NPC to their starting direction +--]] + +require ("global") +require ("shop") + +function init(npc) + return false, false, 0, 0; +end + +gcOfficer = { +[1500202] = 1, -- Limsa Shop +[1500203] = 2, -- Grid Shop +[1500201] = 3, -- Flame Shop +} + +shopInfo = { -- [index] = { itemID, itemQuality, itemQuantity, itemCost, gcRank, city, special, itemCategory } +[100001] = {3010403, 1, 10, 20, 0, 1, 0, 1}, +[100002] = {3010402, 1, 10, 30, 0, 1, 0, 1}, +[100003] = {3020202, 1, 1, 50, 0, 1, 0, 1}, +[100004] = {3020406, 1, 20, 10, 0, 1, 0, 1}, +[100005] = {3020403, 1, 10, 15, 0, 1, 0, 1}, +[100006] = {3020402, 1, 5, 60, 0, 1, 0, 1}, +[100007] = {3020404, 1, 5, 100, 0, 1, 0, 1}, +[100008] = {3020528, 1, 5, 50, 0, 1, 0, 1}, +[100009] = {3020516, 1, 5, 50, 0, 1, 0, 1}, +[100010] = {3020411, 1, 1, 15, 0, 1, 0, 1}, +[100011] = {3020412, 1, 1, 200, 0, 1, 0, 1}, +[100012] = {3020509, 1, 1, 200, 0, 1, 0, 1}, +[100013] = {3020510, 1, 1, 200, 0, 1, 0, 1}, +[100014] = {10013001, 1, 20, 5, 0, 1, 0, 1}, +[100015] = {10013002, 1, 20, 25, 0, 1, 0, 1}, +[100016] = {10013003, 1, 20, 45, 0, 1, 0, 1}, +[100017] = {10013004, 1, 20, 100, 0, 1, 0, 1}, +[100018] = {10013005, 1, 20, 150, 0, 1, 0, 1}, +[100019] = {3910402, 1, 99, 85, 0, 1, 0, 1}, +[100020] = {3910103, 1, 99, 120, 0, 1, 0, 1}, +[100021] = {3910203, 1, 99, 120, 0, 1, 0, 1}, +[100022] = {3910305, 1, 99, 85, 0, 1, 0, 1}, +[100023] = {3920004, 1, 999, 50, 0, 1, 0, 1}, +[100024] = {3920006, 1, 999, 70, 0, 1, 0, 1}, +[100025] = {3920003, 1, 999, 115, 0, 1, 0, 1}, +[100026] = {3910005, 1, 99, 75, 0, 1, 0, 1}, +[100027] = {3910006, 1, 99, 90, 0, 1, 0, 1}, +[100028] = {3940011, 1, 20, 20, 0, 1, 0, 1}, +[100029] = {3940010, 1, 20, 30, 0, 1, 0, 1}, +[100030] = {3020504, 1, 1, 400, 15, 1, 0, 1}, +[100031] = {3020505, 1, 1, 400, 15, 1, 0, 1}, +[100032] = {3020506, 1, 1, 300, 31, 1, 0, 1}, +[101001] = {4040010, 1, 1, 500, 0, 1, 0, 2}, +[101002] = {4040110, 1, 1, 1000, 0, 1, 0, 2}, +[101003] = {4040205, 1, 1, 1400, 0, 1, 0, 2}, +[101004] = {4040305, 1, 1, 3000, 0, 1, 0, 2}, +[101005] = {4040204, 1, 1, 4000, 0, 1, 0, 2}, +[101006] = {4080304, 1, 1, 950, 0, 1, 0, 2}, +[101007] = {4080211, 1, 1, 1000, 0, 1, 0, 2}, +[101008] = {4080106, 1, 1, 2000, 0, 1, 0, 2}, +[101009] = {4080303, 1, 1, 4000, 0, 1, 0, 2}, +[101010] = {5020010, 1, 1, 900, 0, 1, 0, 2}, +[101011] = {5020209, 1, 1, 1000, 0, 1, 0, 2}, +[101012] = {5020213, 1, 1, 1600, 0, 1, 0, 2}, +[101013] = {5020305, 1, 1, 4000, 0, 1, 0, 2}, +[101014] = {8030350, 1, 1, 750, 0, 1, 0, 2}, +[101015] = {8030447, 1, 1, 750, 0, 1, 0, 2}, +[101016] = {8031223, 1, 1, 750, 0, 1, 0, 2}, +[101017] = {8032008, 1, 1, 750, 0, 1, 0, 2}, +[101018] = {9050029, 1, 1, 900, 0, 1, 0, 2}, +[101019] = {9050044, 1, 1, 1900, 0, 1, 0, 2}, +[101020] = {9040032, 1, 1, 950, 0, 1, 0, 2}, +[101021] = {9040025, 1, 1, 1500, 0, 1, 0, 2}, +[101022] = {8013201, 1, 1, 1000, 11, 1, 0, 2}, +[101023] = {8032601, 1, 1, 1000, 11, 1, 0, 2}, +[101024] = {8071301, 1, 1, 1000, 11, 1, 0, 2}, +[101025] = {8081701, 1, 1, 1000, 11, 1, 0, 2}, +[101026] = {8050620, 1, 1, 1200, 11, 1, 0, 2}, +[101027] = {8050243, 1, 1, 1200, 11, 1, 0, 2}, +[101028] = {8050344, 1, 1, 1200, 11, 1, 0, 2}, +[101029] = {8050028, 1, 1, 1200, 11, 1, 0, 2}, +[101030] = {8090706, 1, 1, 1200, 11, 1, 0, 2}, +[101031] = {4030205, 1, 1, 2500, 13, 1, 0, 2}, +[101032] = {4020306, 1, 1, 2500, 13, 1, 0, 2}, +[101033] = {4040014, 1, 1, 2500, 13, 1, 0, 2}, +[101034] = {4080408, 1, 1, 2500, 13, 1, 0, 2}, +[101035] = {4070310, 1, 1, 2500, 13, 1, 0, 2}, +[101036] = {5030307, 1, 1, 2500, 13, 1, 0, 2}, +[101037] = {5020112, 1, 1, 2500, 13, 1, 0, 2}, +[101038] = {4100205, 1, 1, 2000, 13, 1, 0, 2}, +[101039] = {8011609, 1, 1, 3000, 15, 1, 0, 2}, +[101040] = {8032311, 1, 1, 3000, 15, 1, 0, 2}, +[101041] = {8071017, 1, 1, 3000, 15, 1, 0, 2}, +[101042] = {8050132, 1, 1, 3000, 15, 1, 0, 2}, +[101043] = {8081123, 1, 1, 3000, 15, 1, 0, 2}, +[101044] = {4030117, 1, 1, 4500, 17, 1, 0, 2}, +[101045] = {4020210, 1, 1, 4500, 17, 1, 0, 2}, +[101046] = {4040406, 1, 1, 4500, 17, 1, 0, 2}, +[101047] = {4080107, 1, 1, 4500, 17, 1, 0, 2}, +[101048] = {4070108, 1, 1, 4500, 17, 1, 0, 2}, +[101049] = {5030111, 1, 1, 4500, 17, 1, 0, 2}, +[101050] = {5020013, 1, 1, 4500, 17, 1, 0, 2}, +[101051] = {4100405, 1, 1, 4000, 17, 1, 0, 2}, +[101052] = {8011610, 1, 1, 5000, 21, 1, 0, 2}, +[101053] = {8032312, 1, 1, 5000, 21, 1, 0, 2}, +[101054] = {8071018, 1, 1, 5000, 21, 1, 0, 2}, +[101055] = {8050133, 1, 1, 5000, 21, 1, 0, 2}, +[101056] = {8050769, 1, 1, 5000, 21, 1, 0, 2}, +[101057] = {8081124, 1, 1, 5000, 21, 1, 0, 2}, +[101058] = {8080565, 1, 1, 5000, 21, 1, 0, 2}, +[101059] = {8090609, 1, 1, 5000, 21, 1, 0, 2}, +[101060] = {9050021, 1, 1, 1000, 21, 1, 0, 2}, +[101061] = {9050022, 1, 1, 1000, 21, 1, 0, 2}, +[101062] = {9010025, 1, 1, 1000, 21, 1, 0, 2}, +[101063] = {4100804, 1, 1, 5500, 23, 1, 0, 2}, +[101064] = {8013614, 1, 1, 5500, 23, 1, 0, 2}, +[101065] = {8032820, 1, 1, 5500, 23, 1, 0, 2}, +[101066] = {8051516, 1, 1, 5500, 23, 1, 0, 2}, +[101067] = {8071520, 1, 1, 5500, 23, 1, 0, 2}, +[101068] = {9030060, 1, 1, 5500, 23, 1, 0, 2}, +[101069] = {9050067, 1, 1, 5500, 23, 1, 0, 2}, +[101070] = {8013615, 1, 1, 6000, 25, 1, 0, 2}, +[101071] = {8013616, 1, 1, 6000, 25, 1, 0, 2}, +[101072] = {8032821, 1, 1, 6000, 25, 1, 0, 2}, +[101073] = {8071521, 1, 1, 6000, 25, 1, 0, 2}, +[101074] = {8081914, 1, 1, 6000, 25, 1, 0, 2}, +[101075] = {9040065, 1, 1, 6000, 25, 1, 0, 2}, +[101076] = {9010061, 1, 1, 6000, 25, 1, 0, 2}, +[101077] = {4100805, 1, 1, 6500, 27, 1, 0, 2}, +[101078] = {4020408, 1, 1, 6500, 27, 1, 0, 2}, +[101079] = {4040508, 1, 1, 6500, 27, 1, 0, 2}, +[101080] = {4080508, 1, 1, 6500, 27, 1, 0, 2}, +[101081] = {4070408, 1, 1, 6500, 27, 1, 0, 2}, +[101082] = {5030408, 1, 1, 6500, 27, 1, 0, 2}, +[101083] = {5020408, 1, 1, 6500, 27, 1, 0, 2}, +[101084] = {4030604, 1, 1, 25000, 31, 1, 0, 2}, +[101085] = {4020404, 1, 1, 25000, 31, 1, 0, 2}, +[101086] = {4040504, 1, 1, 25000, 31, 1, 0, 2}, +[101087] = {4080504, 1, 1, 25000, 31, 1, 0, 2}, +[101088] = {4070404, 1, 1, 25000, 31, 1, 0, 2}, +[101089] = {5030404, 1, 1, 25000, 31, 1, 0, 2}, +[101090] = {5020404, 1, 1, 25000, 31, 1, 0, 2}, +[101091] = {8013204, 1, 1, 6000, 31, 1, 0, 2}, +[101092] = {8032604, 1, 1, 6000, 31, 1, 0, 2}, +[101093] = {8071304, 1, 1, 6000, 31, 1, 0, 2}, +[101094] = {8081704, 1, 1, 6000, 31, 1, 0, 2}, +[102001] = {3020601, 1, 20, 5, 0, 1, 8, 3}, +[102002] = {9040018, 1, 1, 1000, 11, 1, 11, 3}, +[103001] = {2001004, 1, 1, 3000, 11, 1, 0, 4}, +[103002] = {2001014, 1, 1, 3000, 15, 1, 0, 4}, +[103003] = {2001017, 1, 1, 2000, 21, 1, 0, 4}, +[103004] = {2001018, 1, 1, 3000, 21, 1, 0, 4}, +[103005] = {2001019, 1, 1, 4000, 21, 1, 0, 4}, +[103006] = {2001026, 1, 1, 25000, 27, 1, 0, 4}, +[200001] = {3010403, 1, 10, 20, 0, 2, 0, 1}, +[200002] = {3010402, 1, 10, 30, 0, 2, 0, 1}, +[200003] = {3020203, 1, 1, 50, 0, 2, 0, 1}, +[200004] = {3020406, 1, 20, 10, 0, 2, 0, 1}, +[200005] = {3020403, 1, 10, 15, 0, 2, 0, 1}, +[200006] = {3020402, 1, 5, 60, 0, 2, 0, 1}, +[200007] = {3020404, 1, 5, 100, 0, 2, 0, 1}, +[200008] = {3020528, 1, 5, 50, 0, 2, 0, 1}, +[200009] = {3020516, 1, 5, 50, 0, 2, 0, 1}, +[200010] = {3020411, 1, 1, 15, 0, 2, 0, 1}, +[200011] = {3020412, 1, 1, 200, 0, 2, 0, 1}, +[200012] = {3020509, 1, 1, 200, 0, 2, 0, 1}, +[200013] = {3020510, 1, 1, 200, 0, 2, 0, 1}, +[200014] = {10013001, 1, 20, 5, 0, 2, 0, 1}, +[200015] = {10013002, 1, 20, 25, 0, 2, 0, 1}, +[200016] = {10013003, 1, 20, 45, 0, 2, 0, 1}, +[200017] = {10013004, 1, 20, 100, 0, 2, 0, 1}, +[200018] = {10013005, 1, 20, 150, 0, 2, 0, 1}, +[200019] = {3910402, 1, 99, 85, 0, 2, 0, 1}, +[200020] = {3910103, 1, 99, 120, 0, 2, 0, 1}, +[200021] = {3910203, 1, 99, 120, 0, 2, 0, 1}, +[200022] = {3910305, 1, 99, 85, 0, 2, 0, 1}, +[200023] = {3920004, 1, 999, 50, 0, 2, 0, 1}, +[200024] = {3920006, 1, 999, 70, 0, 2, 0, 1}, +[200025] = {3920003, 1, 999, 115, 0, 2, 0, 1}, +[200026] = {3910005, 1, 99, 75, 0, 2, 0, 1}, +[200027] = {3910006, 1, 99, 90, 0, 2, 0, 1}, +[200028] = {3940011, 1, 20, 20, 0, 2, 0, 1}, +[200029] = {3940010, 1, 20, 30, 0, 2, 0, 1}, +[200030] = {3020504, 1, 1, 400, 15, 2, 0, 1}, +[200031] = {3020505, 1, 1, 400, 15, 2, 0, 1}, +[200032] = {3020506, 1, 1, 300, 31, 2, 0, 1}, +[201001] = {5030107, 1, 1, 350, 0, 2, 0, 2}, +[201002] = {5030207, 1, 1, 750, 0, 2, 0, 2}, +[201003] = {5030206, 1, 1, 1000, 0, 2, 0, 2}, +[201004] = {5030029, 1, 1, 1500, 0, 2, 0, 2}, +[201005] = {5030031, 1, 1, 2400, 0, 2, 0, 2}, +[201006] = {5030209, 1, 1, 3000, 0, 2, 0, 2}, +[201007] = {5030028, 1, 1, 4000, 0, 2, 0, 2}, +[201008] = {4020109, 1, 1, 800, 0, 2, 0, 2}, +[201009] = {4020106, 1, 1, 1000, 0, 2, 0, 2}, +[201010] = {4020008, 1, 1, 2200, 0, 2, 0, 2}, +[201011] = {4020305, 1, 1, 4000, 0, 2, 0, 2}, +[201012] = {4100005, 1, 1, 1000, 0, 2, 0, 2}, +[201013] = {4100109, 1, 1, 4000, 0, 2, 0, 2}, +[201014] = {8030035, 1, 1, 750, 0, 2, 0, 2}, +[201015] = {8030919, 1, 1, 750, 0, 2, 0, 2}, +[201016] = {8031821, 1, 1, 750, 0, 2, 0, 2}, +[201017] = {8032220, 1, 1, 750, 0, 2, 0, 2}, +[201018] = {9050029, 1, 1, 900, 0, 2, 0, 2}, +[201019] = {9050044, 1, 1, 1900, 0, 2, 0, 2}, +[201020] = {9040035, 1, 1, 950, 0, 2, 0, 2}, +[201021] = {9040025, 1, 1, 1500, 0, 2, 0, 2}, +[201022] = {8013202, 1, 1, 1000, 11, 2, 0, 2}, +[201023] = {8032602, 1, 1, 1000, 11, 2, 0, 2}, +[201024] = {8071302, 1, 1, 1000, 11, 2, 0, 2}, +[201025] = {8081702, 1, 1, 1000, 11, 2, 0, 2}, +[201026] = {8050148, 1, 1, 1200, 11, 2, 0, 2}, +[201027] = {8050244, 1, 1, 1200, 11, 2, 0, 2}, +[201028] = {8051222, 1, 1, 1200, 11, 2, 0, 2}, +[201029] = {8050029, 1, 1, 1200, 11, 2, 0, 2}, +[201030] = {8090707, 1, 1, 1200, 11, 2, 0, 2}, +[201031] = {4030710, 1, 1, 2500, 13, 2, 0, 2}, +[201032] = {4020211, 1, 1, 2500, 13, 2, 0, 2}, +[201033] = {4040407, 1, 1, 2500, 13, 2, 0, 2}, +[201034] = {4080213, 1, 1, 2500, 13, 2, 0, 2}, +[201035] = {4070215, 1, 1, 2500, 13, 2, 0, 2}, +[201036] = {5030113, 1, 1, 2500, 13, 2, 0, 2}, +[201037] = {5020014, 1, 1, 2500, 13, 2, 0, 2}, +[201038] = {4100608, 1, 1, 2000, 13, 2, 0, 2}, +[201039] = {8010566, 1, 1, 3000, 15, 2, 0, 2}, +[201040] = {8030625, 1, 1, 3000, 15, 2, 0, 2}, +[201041] = {8070724, 1, 1, 3000, 15, 2, 0, 2}, +[201042] = {8050618, 1, 1, 3000, 15, 2, 0, 2}, +[201043] = {8080715, 1, 1, 3000, 15, 2, 0, 2}, +[201044] = {4030016, 1, 1, 4500, 17, 2, 0, 2}, +[201045] = {4020012, 1, 1, 4500, 17, 2, 0, 2}, +[201046] = {4040111, 1, 1, 4500, 17, 2, 0, 2}, +[201047] = {4080010, 1, 1, 4500, 17, 2, 0, 2}, +[201048] = {4070013, 1, 1, 4500, 17, 2, 0, 2}, +[201049] = {5030308, 1, 1, 4500, 17, 2, 0, 2}, +[201050] = {5020113, 1, 1, 4500, 17, 2, 0, 2}, +[201051] = {4100507, 1, 1, 4000, 17, 2, 0, 2}, +[201052] = {8010567, 1, 1, 5000, 21, 2, 0, 2}, +[201053] = {8030626, 1, 1, 5000, 21, 2, 0, 2}, +[201054] = {8070725, 1, 1, 5000, 21, 2, 0, 2}, +[201055] = {8050619, 1, 1, 5000, 21, 2, 0, 2}, +[201056] = {8050768, 1, 1, 5000, 21, 2, 0, 2}, +[201057] = {8080716, 1, 1, 5000, 21, 2, 0, 2}, +[201058] = {8080564, 1, 1, 5000, 21, 2, 0, 2}, +[201059] = {8090506, 1, 1, 5000, 21, 2, 0, 2}, +[201060] = {9050025, 1, 1, 1000, 21, 2, 0, 2}, +[201061] = {9050026, 1, 1, 1000, 21, 2, 0, 2}, +[201062] = {9010025, 1, 1, 1000, 21, 2, 0, 2}, +[201063] = {4100806, 1, 1, 5500, 23, 2, 0, 2}, +[201064] = {8013617, 1, 1, 5500, 23, 2, 0, 2}, +[201065] = {8032822, 1, 1, 5500, 23, 2, 0, 2}, +[201066] = {8051517, 1, 1, 5500, 23, 2, 0, 2}, +[201067] = {8071522, 1, 1, 5500, 23, 2, 0, 2}, +[201068] = {9030061, 1, 1, 5500, 23, 2, 0, 2}, +[201069] = {9050068, 1, 1, 5500, 23, 2, 0, 2}, +[201070] = {8013618, 1, 1, 6000, 25, 2, 0, 2}, +[201071] = {8013619, 1, 1, 6000, 25, 2, 0, 2}, +[201072] = {8032823, 1, 1, 6000, 25, 2, 0, 2}, +[201073] = {8071523, 1, 1, 6000, 25, 2, 0, 2}, +[201074] = {8081915, 1, 1, 6000, 25, 2, 0, 2}, +[201075] = {9040066, 1, 1, 6000, 25, 2, 0, 2}, +[201076] = {9010062, 1, 1, 6000, 25, 2, 0, 2}, +[201077] = {4100807, 1, 1, 6500, 27, 2, 0, 2}, +[201078] = {4020409, 1, 1, 6500, 27, 2, 0, 2}, +[201079] = {4040509, 1, 1, 6500, 27, 2, 0, 2}, +[201080] = {4080509, 1, 1, 6500, 27, 2, 0, 2}, +[201081] = {4070409, 1, 1, 6500, 27, 2, 0, 2}, +[201082] = {5030409, 1, 1, 6500, 27, 2, 0, 2}, +[201083] = {5020409, 1, 1, 6500, 27, 2, 0, 2}, +[201084] = {4030605, 1, 1, 25000, 31, 2, 0, 2}, +[201085] = {4020405, 1, 1, 25000, 31, 2, 0, 2}, +[201086] = {4040505, 1, 1, 25000, 31, 2, 0, 2}, +[201087] = {4080505, 1, 1, 25000, 31, 2, 0, 2}, +[201088] = {4070405, 1, 1, 25000, 31, 2, 0, 2}, +[201089] = {5030405, 1, 1, 25000, 31, 2, 0, 2}, +[201090] = {5020405, 1, 1, 25000, 31, 2, 0, 2}, +[201091] = {8013205, 1, 1, 6000, 31, 2, 0, 2}, +[201092] = {8032605, 1, 1, 6000, 31, 2, 0, 2}, +[201093] = {8071305, 1, 1, 6000, 31, 2, 0, 2}, +[201094] = {8081705, 1, 1, 6000, 31, 2, 0, 2}, +[202001] = {3020603, 1, 20, 5, 0, 2, 8, 3}, +[202002] = {9040018, 1, 1, 1000, 11, 2, 11, 3}, +[203001] = {2001005, 1, 1, 3000, 11, 2, 0, 4}, +[203002] = {2001015, 1, 1, 3000, 15, 2, 0, 4}, +[203003] = {2001020, 1, 1, 2000, 21, 2, 0, 4}, +[203004] = {2001021, 1, 1, 3000, 21, 2, 0, 4}, +[203005] = {2001022, 1, 1, 4000, 21, 2, 0, 4}, +[203006] = {2001026, 1, 1, 25000, 27, 2, 0, 4}, +[300001] = {3010403, 1, 10, 20, 0, 3, 0, 1}, +[300002] = {3010402, 1, 10, 30, 0, 3, 0, 1}, +[300003] = {3020204, 1, 1, 50, 0, 3, 0, 1}, +[300004] = {3020406, 1, 20, 10, 0, 3, 0, 1}, +[300005] = {3020403, 1, 10, 15, 0, 3, 0, 1}, +[300006] = {3020402, 1, 5, 60, 0, 3, 0, 1}, +[300007] = {3020404, 1, 5, 100, 0, 3, 0, 1}, +[300008] = {3020528, 1, 5, 50, 0, 3, 0, 1}, +[300009] = {3020516, 1, 5, 50, 0, 3, 0, 1}, +[300010] = {3020411, 1, 1, 15, 0, 3, 0, 1}, +[300011] = {3020412, 1, 1, 200, 0, 3, 0, 1}, +[300012] = {3020509, 1, 1, 200, 0, 3, 0, 1}, +[300013] = {3020510, 1, 1, 200, 0, 3, 0, 1}, +[300014] = {10013001, 1, 20, 5, 0, 3, 0, 1}, +[300015] = {10013002, 1, 20, 25, 0, 3, 0, 1}, +[300016] = {10013003, 1, 20, 45, 0, 3, 0, 1}, +[300017] = {10013004, 1, 20, 100, 0, 3, 0, 1}, +[300018] = {10013005, 1, 20, 150, 0, 3, 0, 1}, +[300019] = {3910402, 1, 99, 85, 0, 3, 0, 1}, +[300020] = {3910103, 1, 99, 120, 0, 3, 0, 1}, +[300021] = {3910203, 1, 99, 120, 0, 3, 0, 1}, +[300022] = {3910305, 1, 99, 85, 0, 3, 0, 1}, +[300023] = {3920004, 1, 999, 50, 0, 3, 0, 1}, +[300024] = {3920006, 1, 999, 70, 0, 3, 0, 1}, +[300025] = {3920003, 1, 999, 115, 0, 3, 0, 1}, +[300026] = {3910005, 1, 99, 75, 0, 3, 0, 1}, +[300027] = {3910006, 1, 99, 90, 0, 3, 0, 1}, +[300028] = {3940011, 1, 20, 20, 0, 3, 0, 1}, +[300029] = {3940010, 1, 20, 30, 0, 3, 0, 1}, +[300030] = {3020504, 1, 1, 400, 15, 3, 0, 1}, +[300031] = {3020505, 1, 1, 400, 15, 3, 0, 1}, +[300032] = {3020506, 1, 1, 300, 31, 3, 0, 1}, +[301001] = {4030006, 1, 1, 400, 0, 3, 0, 2}, +[301002] = {4030015, 1, 1, 1000, 0, 3, 0, 2}, +[301003] = {4030405, 1, 1, 1600, 0, 3, 0, 2}, +[301004] = {4030506, 1, 1, 3200, 0, 3, 0, 2}, +[301005] = {4030505, 1, 1, 4000, 0, 3, 0, 2}, +[301006] = {4070011, 1, 1, 550, 0, 3, 0, 2}, +[301007] = {4070105, 1, 1, 1000, 0, 3, 0, 2}, +[301008] = {4070212, 1, 1, 1500, 0, 3, 0, 2}, +[301009] = {4070211, 1, 1, 4000, 0, 3, 0, 2}, +[301010] = {4100710, 1, 1, 450, 0, 3, 0, 2}, +[301011] = {4100403, 1, 1, 1000, 0, 3, 0, 2}, +[301012] = {4100404, 1, 1, 1900, 0, 3, 0, 2}, +[301013] = {4100306, 1, 1, 4000, 0, 3, 0, 2}, +[301014] = {8030248, 1, 1, 750, 0, 3, 0, 2}, +[301015] = {8030548, 1, 1, 750, 0, 3, 0, 2}, +[301016] = {8031021, 1, 1, 750, 0, 3, 0, 2}, +[301017] = {8031513, 1, 1, 750, 0, 3, 0, 2}, +[301018] = {9050029, 1, 1, 900, 0, 3, 0, 2}, +[301019] = {9050044, 1, 1, 1900, 0, 3, 0, 2}, +[301020] = {9040036, 1, 1, 950, 0, 3, 0, 2}, +[301021] = {9040025, 1, 1, 1500, 0, 3, 0, 2}, +[301022] = {8013203, 1, 1, 1000, 11, 3, 0, 2}, +[301023] = {8032603, 1, 1, 1000, 11, 3, 0, 2}, +[301024] = {8071303, 1, 1, 1000, 11, 3, 0, 2}, +[301025] = {8081703, 1, 1, 1000, 11, 3, 0, 2}, +[301026] = {8050520, 1, 1, 1200, 11, 3, 0, 2}, +[301027] = {8051024, 1, 1, 1200, 11, 3, 0, 2}, +[301028] = {8050345, 1, 1, 1200, 11, 3, 0, 2}, +[301029] = {8050449, 1, 1, 1200, 11, 3, 0, 2}, +[301030] = {8090708, 1, 1, 1200, 11, 3, 0, 2}, +[301031] = {4030305, 1, 1, 2500, 13, 3, 0, 2}, +[301032] = {4020011, 1, 1, 2500, 13, 3, 0, 2}, +[301033] = {4040208, 1, 1, 2500, 13, 3, 0, 2}, +[301034] = {4080306, 1, 1, 2500, 13, 3, 0, 2}, +[301035] = {4070012, 1, 1, 2500, 13, 3, 0, 2}, +[301036] = {5030037, 1, 1, 2500, 13, 3, 0, 2}, +[301037] = {5020217, 1, 1, 2500, 13, 3, 0, 2}, +[301038] = {4100112, 1, 1, 2000, 13, 3, 0, 2}, +[301039] = {8011522, 1, 1, 3000, 15, 3, 0, 2}, +[301040] = {8030744, 1, 1, 3000, 15, 3, 0, 2}, +[301041] = {8070361, 1, 1, 3000, 15, 3, 0, 2}, +[301042] = {8050766, 1, 1, 3000, 15, 3, 0, 2}, +[301043] = {8080562, 1, 1, 3000, 15, 3, 0, 2}, +[301044] = {4030408, 1, 1, 4500, 17, 3, 0, 2}, +[301045] = {4020113, 1, 1, 4500, 17, 3, 0, 2}, +[301046] = {4040306, 1, 1, 4500, 17, 3, 0, 2}, +[301047] = {4080409, 1, 1, 4500, 17, 3, 0, 2}, +[301048] = {4070311, 1, 1, 4500, 17, 3, 0, 2}, +[301049] = {5030210, 1, 1, 4500, 17, 3, 0, 2}, +[301050] = {5020307, 1, 1, 4500, 17, 3, 0, 2}, +[301051] = {4100712, 1, 1, 4000, 17, 3, 0, 2}, +[301052] = {8011523, 1, 1, 5000, 21, 3, 0, 2}, +[301053] = {8030745, 1, 1, 5000, 21, 3, 0, 2}, +[301054] = {8070362, 1, 1, 5000, 21, 3, 0, 2}, +[301055] = {8050811, 1, 1, 5000, 21, 3, 0, 2}, +[301056] = {8050767, 1, 1, 5000, 21, 3, 0, 2}, +[301057] = {8080015, 1, 1, 5000, 21, 3, 0, 2}, +[301058] = {8080563, 1, 1, 5000, 21, 3, 0, 2}, +[301059] = {8090709, 1, 1, 5000, 21, 3, 0, 2}, +[301060] = {9050023, 1, 1, 1000, 21, 3, 0, 2}, +[301061] = {9050024, 1, 1, 1000, 21, 3, 0, 2}, +[301062] = {9010025, 1, 1, 1000, 21, 3, 0, 2}, +[301063] = {4100808, 1, 1, 5500, 23, 3, 0, 2}, +[301064] = {8013620, 1, 1, 5500, 23, 3, 0, 2}, +[301065] = {8032824, 1, 1, 5500, 23, 3, 0, 2}, +[301066] = {8051518, 1, 1, 5500, 23, 3, 0, 2}, +[301067] = {8071524, 1, 1, 5500, 23, 3, 0, 2}, +[301068] = {9030062, 1, 1, 5500, 23, 3, 0, 2}, +[301069] = {9050069, 1, 1, 5500, 23, 3, 0, 2}, +[301070] = {8013621, 1, 1, 6000, 25, 3, 0, 2}, +[301071] = {8013622, 1, 1, 6000, 25, 3, 0, 2}, +[301072] = {8032825, 1, 1, 6000, 25, 3, 0, 2}, +[301073] = {8071525, 1, 1, 6000, 25, 3, 0, 2}, +[301074] = {8081916, 1, 1, 6000, 25, 3, 0, 2}, +[301075] = {9040067, 1, 1, 6000, 25, 3, 0, 2}, +[301076] = {9010063, 1, 1, 6000, 25, 3, 0, 2}, +[301077] = {4100809, 1, 1, 6500, 27, 3, 0, 2}, +[301078] = {4020410, 1, 1, 6500, 27, 3, 0, 2}, +[301079] = {4040510, 1, 1, 6500, 27, 3, 0, 2}, +[301080] = {4080510, 1, 1, 6500, 27, 3, 0, 2}, +[301081] = {4070410, 1, 1, 6500, 27, 3, 0, 2}, +[301082] = {5030410, 1, 1, 6500, 27, 3, 0, 2}, +[301083] = {5020410, 1, 1, 6500, 27, 3, 0, 2}, +[301084] = {4030606, 1, 1, 25000, 31, 3, 0, 2}, +[301085] = {4020406, 1, 1, 25000, 31, 3, 0, 2}, +[301086] = {4040506, 1, 1, 25000, 31, 3, 0, 2}, +[301087] = {4080506, 1, 1, 25000, 31, 3, 0, 2}, +[301088] = {4070406, 1, 1, 25000, 31, 3, 0, 2}, +[301089] = {5030406, 1, 1, 25000, 31, 3, 0, 2}, +[301090] = {5020406, 1, 1, 25000, 31, 3, 0, 2}, +[301091] = {8013206, 1, 1, 6000, 31, 3, 0, 2}, +[301092] = {8032606, 1, 1, 6000, 31, 3, 0, 2}, +[301093] = {8071306, 1, 1, 6000, 31, 3, 0, 2}, +[301094] = {8081706, 1, 1, 6000, 31, 3, 0, 2}, +[302001] = {3020602, 1, 20, 5, 0, 3, 8, 3}, +[302002] = {9040018, 1, 1, 1000, 11, 3, 11, 3}, +[303001] = {2001006, 1, 1, 3000, 11, 3, 0, 4}, +[303002] = {2001016, 1, 1, 3000, 15, 3, 0, 4}, +[303003] = {2001023, 1, 1, 2000, 21, 3, 0, 4}, +[303004] = {2001024, 1, 1, 3000, 21, 3, 0, 4}, +[303005] = {2001025, 1, 1, 4000, 21, 3, 0, 4}, +[303006] = {2001026, 1, 1, 25000, 27, 3, 0, 4}, +} + +function onEventStarted(player, npc, triggerName) + skipGCcheck = 0; -- 0 No, 1 Yes + playerGC = player.gcCurrent; + playerGCSeal = 1000200 + playerGC; + playerCurrentRank = 13; + npcId = npc:GetActorClassId(); + + if (playerGC == gcOfficer[npcId] or skipGCcheck == 1) then + callClientFunction(player, "eventTalkPreJoin"); + --player:SendMessage(0x20, "", "[Info]: Client takes awhile to load GC shops"); + while (true) do + + eventTalkChoice = callClientFunction(player, "eventTalkMainMenu", 8, 11); + --player:SendMessage(0x20, "", "eventTalkMainMenu: " .. tostring(eventTalkChoice)); + + if (eventTalkChoice == 1) then + t1, t2, t3 = callClientFunction(player, "eventShopMenuOpen"); + + --player:SendMessage(0x20, "", "eventShopMenuOpen: " .. tostring(t1) .. ", ".. tostring(t2) .. ", ".. tostring(t3)); + + while (true) do + -- TODO: ADD RANK CHECK, CITY CHECK, AND ITEM-RANGE CHECK + + buyResult, buyIndex = callClientFunction(player, "eventShopMenuAsk"); + + if (buyIndex == -1) then + callClientFunction(player, "eventShopMenuClose"); + break; + else + -- [index] = { itemID, itemQuality, itemQuantity, itemCost gcRank, city, special, itemCategory } + if (shopInfo[buyIndex][8] == 4) then + location = INVENTORY_KEYITEMS; + else + location = INVENTORY_NORMAL; + end + end + + purchaseItem(player, location, shopInfo[buyIndex][1], shopInfo[buyIndex][3], shopInfo[buyIndex][2], shopInfo[buyIndex][4], playerGCSeal); + end + + --player:SendMessage(0x20, "", "Player picked an item at gcSealShopIndex " .. tostring(buyResult) .. ", ".. tostring(buyIndex)); + + elseif (eventTalkChoice == -1) then + break; + end + end + else + callClientFunction(player, "eventTalkStepCantUse"); + end + callClientFunction(player, "eventTalkStepBreak"); + player:endEvent(); +end + + + + + + diff --git a/Data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua b/Data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua index 3fd8e34a..eb03c6f8 100644 --- a/Data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua +++ b/Data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua @@ -4,10 +4,10 @@ PopulaceCompanyWarp Script Functions: -eventTalkWelcome(player) - Start Text +eventTalkWelcome(player) - Start Text eventAskMainMenu(player, index) - Shows teleport menu, hides the teleport location at index value to prevent warping to the spot you're at eventAfterWarpOtherZone(player) - Fades out for warp -eventTalkStepBreak() - Ends talk +eventTalkStepBreak() - Holds the client up for whatever reason? --]] require ("global") @@ -82,39 +82,49 @@ function onEventStarted(player, npc, triggerName) npcId = npc:GetActorClassId(); city = warpNpc[npcId][2]; - - if city == 1 then + if (city == 1) then if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then passCheck = 1; else - if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end + if (passCheck == 0) then callClientFunction(player, "eventTalkWelcome", player); end end; - elseif city == 2 then - if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then + elseif (city == 2) then + -- if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then + passCheck = 1; + -- else + -- if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end + --end; + elseif (city == 3) then + if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah)) then passCheck = 1; else - if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end - end; - elseif city == 3 then - if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah) then - passCheck = 1; - else - if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end + if (passCheck == 0) then callClientFunction(player, "eventTalkWelcome", player); end end end - if passCheck == 1 then + + if (passCheck == 1) then choice = callClientFunction(player, "eventAskMainMenu", player, warpNpc[npcId][1]); - if choice == 0 then - --callClientFunction(player, "playereventTalkStepBreak"); + + if (choice ~= 0) then + player:EndEvent(); + + callClientFunction(player, "eventAfterWarpOtherZone", player); + + local player_zone = player:GetPos()[5]; + spawnType = 0x0A; + if (player_zone == aethernet[city][choice].zone) then + + GetWorldManager():DoPlayerMoveInZone(player, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r, spawnType); + else + GetWorldManager():DoZoneChange(player, aethernet[city][choice].zone, nil, 0, spawnType, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r); + end; else - -- callClientFunction(player, "eventAfterWarpOtherZone", player); -- Commented out for now to prevent double fade-to-black for warp - player:EndEvent(); - GetWorldManager():DoZoneChange(player, aethernet[city][choice].zone, nil, 0, 15, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r); + player:EndEvent(); end end - player:EndEvent(); + end diff --git a/Data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua b/Data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua new file mode 100644 index 00000000..6c03a449 --- /dev/null +++ b/Data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua @@ -0,0 +1,107 @@ +--[[ + +PopulaceGuildShop Script + +In 1.20, the devs removed Guild Marks as acquirable. In 1.21, this class was set up to allow exchanging them for +a variety of materia/crystals/gil, as well as refunding traits purchased with marks. Traits used to be purchased +to slot in, where-as with late-XIV they are just automatically unlocked once the appropriate level is met. + +Functions: + +cashbackTalkCommand(arg1 through arg10) -- Dialog for refunding purchased skills prior to Job update. Args are xtx_command values for command names. +cashbackTalk(nil, refundAmount, arg3 through arg10) -- Dialog for refunding treaties to guild marks. Arg3 through 10 use xtx_itemName values. +selectMode(nil, npcId, isShowExchange, guildCurrency, unk) -- Menus for exchanging leftover marks, undoing class points, and learning about guild. Unk seems related to point resetting + +maskShopListIndex(shopPack?, isSomething) -- Presumably hides an item in the shop list. Needs to be called after openShopBuy or errors client. +guildExplain(npcId, player) -- Guild Mark tutorial dialog. selectMode calls this on its own + +--]] + +require ("global") +require ("shop") + +function init(npc) + return false, false, 0, 0; +end + +guildShopInfo = { -- [actor id] = { saySheetId, guildmarkCurrency } +[1000157] = {9, 1000103}, -- Marauder, S'raemha +[1000158] = {24, 1000120}, -- Culinarian, Noline +[1000162] = {18, 1000114}, -- Blacksmith, Qhas Chalahko +[1000164] = {16, 1000123}, -- Fishermen, Faucillien +[1000459] = {21, 1000117}, -- Leatherworker, Gallia +[1000460] = {13, 1000111}, -- Conjurer, Hetzkin +[1000461] = {15, 1000122}, -- Botanist, Kipopo +[1000462] = {11, 1000107}, -- Lancer, Clarembald +[1000464] = {10, 1000106}, -- Archer, Cassandra +[1000466] = {17, 1000113}, -- Carpenter, Frances +[1000631] = {8, 1000102}, -- Gladiator, Coynach +[1000632] = {7, 1000101}, -- Pugilist, Moruith +[1000633] = {12, 1000110}, -- Thaumaturge, Nyunoeya +[1000634] = {23, 1000119}, -- Alchemist, Kylene +[1000635] = {20, 1000116}, -- Goldsmith, Hnaufrid +[1000636] = {22, 1000118}, -- Weaver, Lafla Morfla +[1000637] = {14, 1000121}, -- Miner, Shilgen +[1001461] = {19, 1000115}, -- Armorer, Notrelchamps +} + + + +function onEventStarted(player, npc) + + local npcId = npc:GetActorClassId(); + local saySheetId = guildShopInfo[npcId][1]; + local shopCurrency = guildShopInfo[npcId][2]; + local gilCurrency = 1000001; + local keepersHymn = 3020410; + local shopPack = 0; + + callClientFunction(player, "welcomeTalk", nil, saySheetId, player); + + while (true) do + local choice = callClientFunction(player, "selectMode", nil, npcId, true, shopCurrency, 100); + + if (choice == 3) then -- Undo Point Allotment + -- TODO: Add point reset handling + elseif (choice == 4) then -- Leave menu selected + player:EndEvent(); + break; + elseif (choice == nil) then -- Escape key hit to leave menu + player:EndEvent(); + break + elseif (choice >= 102 and choice <= 120) then -- Exchange marks for Materia + shopPack = choice + 18; -- Index offset + if (choice == 119) then + shopPack = shopPack + 1; + elseif (choice == 120) then -- Exchange marks for Crystals + shopPack = 144; + end; + processGuildShop(player, shopPack, shopCurrency); + elseif (choice == 121) then -- Exchange marks for Gil. 1 mark = 4 gil + local markAmount = player:GetItemPackage(INVENTORY_CURRENCY):GetItemQuantity(shopCurrency); + purchaseItem(player, INVENTORY_CURRENCY, gilCurrency, markAmount*4, 1, markAmount, shopCurrency); + + end + end + + player:EndEvent() +end + + + +function processGuildShop(player, choice, currency) + + callClientFunction(player, "openShopBuy", player, choice, currency); + --callClientFunction(player, "maskShopListIndex", 137, true); + + while (true) do + buyResult, quantity = callClientFunction(player, "selectShopBuy", player); + + if (buyResult == 0) then + callClientFunction(player, "closeShopBuy", player); + break; + else + player:SendMessage(0x20, "", string.format("Player purchased %s item(s) at index %s in shopPack %s.", quantity, buyResult, choice)); + end + end +end diff --git a/Data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua b/Data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua new file mode 100644 index 00000000..11d40f56 --- /dev/null +++ b/Data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua @@ -0,0 +1,655 @@ +--[[ + +PopulaceShopSalesman Script + +Functions: + +welcomeTalk(sheetId, player) - Start Message +selectMode(askMode) - Shows buy/sell modes. If askmode > 0 show guild tutorial. If askmode == -7/-8/-9 show nothing. Else show affinity/condition tutorials. +selectModeOfClassVendor() - Opens categories for class weapons and gear +selectModeOfMultiWeaponVendor(consumptionmenuId) - Opens categories for weapons/tools (war/magic/land/hand). Arg consumptionmenuId appends location of item repair person. -1: Ul'dah, -2: Gridania, -3: Limsa +selectModeOfMultiArmorVendor(consumptionmenuId) - Opens categories for armor in different slots. Arg consumptionmenuId appends location of item repair person. -1: Ul'dah, -2: Gridania, -3: Limsa + +openShopBuy(player, shopPack, CurrencyItemId) - ShopPack: Items to appear in window. CurrencyItemId: What is being used to buy these items. +selectShopBuy(player) - Call after openShopBuy() to open widget +closeShopBuy(player) - Closes the buy window + +openShopSell(player) - Call this to open sell window +selectShopSell(player) - Call after openShopSell() +closeShopSell(player) - Closes the sell window + +confirmSellingItem(itemId, quality, quantity, gil) - Simple Sell confirmation window + +selectFacility(?, sheetId, 3) - Opens the facility chooser. +confirmUseFacility(player, cost) - Facility cost confirm + +informSellPrice(1, chosenItem, price) - Shows sell confirm window. ChosenItem must be correct. + +startTutorial(nil, menuId) - Opens up a tutorial menu for each guild type based on menuId + +finishTalkTurn() - Done at the end. + +--]] + +require ("global") +require ("shop") + +shopInfo = { +--[[ + [actorclass id] = + { + welcomeText - Dialog for the NPC to speak when interacting + menuId, - Displays certain menu/dialog. 29-36 = DoH Facilities menus. -1 Ul'dah, -2 Gridania, -3 Limsa. -7/-8/-9/nil show nothing + shopMode, - Type of shop. 0 = Single shop pack, 1 = Class vendor, 2 = Weapon vendor, 3 = Armor vendor, 4 = Hamlet vendor + shopPack{s}, - The item table index to send the client containing the list of items to display, shopmode 2/3 have a static list + } +--]] +[1000159] = {34, 36, 0, 1016}, +[1000163] = {49, 31, 0, 1017}, +[1000165] = {74, -8, 0, 1019}, +[1001458] = {44, 30, 0, 1018}, +[1500142] = {266, -1, 0, 5001}, +[1500143] = {267, -1, 0, 5002}, +[1500144] = {268, -1, 0, 5003}, +[1500145] = {269, -1, 0, 5004}, +[1500146] = {269, -1, 0, 5005}, +[1500147] = {270, -1, 0, 5006}, +[1500150] = {266, -8, 0, 5001}, +[1500151] = {267, -8, 0, 5002}, +[1500152] = {268, -8, 0, 5003}, +[1500153] = {269, -8, 0, 5004}, +[1500154] = {269, -8, 0, 5005}, +[1500155] = {270, -8, 0, 5006}, +[1500158] = {266, -8, 0, 5001}, +[1500159] = {267, -8, 0, 5002}, +[1500160] = {268, -8, 0, 5003}, +[1500161] = {269, -8, 0, 5004}, +[1500162] = {269, -8, 0, 5005}, +[1500163] = {270, -8, 0, 5006}, +[1500401] = {317, -8, 0, 1013}, +[1500405] = {320, -8, 0, 1013}, +[1500407] = {321, -8, 0, 1012}, +[1500411] = {322, -8, 0, 2017}, +[1500414] = {324, -8, 0, 1012}, +[1500419] = {327, -8, 0, 1012}, +[1500422] = {332, -8, 0, 1013}, +[1500423] = {331, -8, 0, 2017}, +[1500429] = {328, -8, 0, 2017}, +[1500430] = {281, -8, 4, 5122}, +[1500431] = {281, -8, 4, 5118}, +[1500432] = {281, -8, 4, 5120}, +[1600001] = {6, -8, 0, 1006}, +[1600002] = {7, -8, 0, 1007}, +[1600003] = {8, -8, 0, 1008}, +[1600004] = {9, -8, 0, 1009}, +[1600005] = {10, -8, 0, 1010}, +[1600006] = {11, -8, 0, 1011}, +[1600007] = {12, -8, 0, 1012}, +[1600008] = {13, -8, 0, 1013}, +[1600009] = {14, -8, 0, 1014}, +[1600010] = {15, -8, 0, 1015}, +[1600011] = {1, -8, 0, 1001}, +[1600012] = {2, -8, 0, 1002}, +[1600013] = {3, -8, 0, 1003}, +[1600014] = {4, -8, 0, 1004}, +[1600016] = {5, -8, 0, 1005}, +[1600017] = {39, 29, 0, 2020}, +[1600018] = {59, 33, 0, 2021}, +[1600019] = {75, -8, 0, 2022}, +[1600020] = {77, -8, 0, 2010}, +[1600021] = {78, -8, 0, 2011}, +[1600022] = {79, -8, 0, 2012}, +[1600023] = {80, -8, 0, 2013}, +[1600024] = {81, -8, 0, 2014}, +[1600025] = {82, -8, 0, 2015}, +[1600026] = {83, -8, 0, 2016}, +[1600027] = {84, -8, 0, 2017}, +[1600028] = {85, -8, 0, 2018}, +[1600029] = {86, -8, 0, 2019}, +[1600030] = {87, -8, 0, 2001}, +[1600031] = {88, -8, 0, 2003}, +[1600032] = {89, -8, 0, 2002}, +[1600033] = {90, -8, 0, 2004}, +[1600034] = {91, -8, 0, 2005}, +[1600035] = {92, -8, 0, 2006}, +[1600036] = {93, -8, 0, 2007}, +[1600037] = {94, -8, 0, 2008}, +[1600039] = {69, 35, 0, 3020}, +[1600040] = {54, 32, 0, 3019}, +[1600041] = {64, 34, 0, 3021}, +[1600042] = {76, -8, 0, 3022}, +[1600043] = {96, -8, 0, 3009}, +[1600044] = {97, -8, 0, 3010}, +[1600045] = {98, -8, 0, 3011}, +[1600046] = {99, -8, 0, 3012}, +[1600047] = {100, -8, 0, 3013}, +[1600048] = {101, -8, 0, 3014}, +[1600049] = {102, -8, 0, 3016}, +[1600050] = {103, -8, 0, 3015}, +[1600051] = {104, -8, 0, 3017}, +[1600052] = {105, -8, 0, 3004}, +[1600053] = {106, -8, 0, 3007}, +[1600054] = {107, -8, 0, 3018}, +[1600055] = {108, -8, 0, 3006}, +[1600056] = {109, -8, 0, 3005}, +[1600057] = {110, -8, 0, 3002}, +[1600058] = {111, -8, 0, 3003}, +[1600059] = {112, -8, 0, 3001}, +[1600061] = {95, -8, 0, 2009}, +[1600062] = {113, -8, 0, 3008}, +[1600063] = {114, -8, 0, 4001}, +[1600064] = {235, -8, 0, 2023}, +[1600065] = {236, -8, 0, 1020}, +[1600066] = {237, -8, 0, 3023}, +[1600067] = {238, -8, 0, 5007}, +[1600068] = {239, -8, 0, 5007}, +[1600069] = {240, -1, 0, 5007}, +[1600070] = {241, -8, 0, 5008}, +[1600071] = {242, -8, 0, 5008}, +[1600072] = {243, -8, 0, 5008}, +[1600073] = {244, -8, 1, 5009}, +[1600074] = {245, -8, 1, 5015}, +[1600075] = {246, -8, 1, 5021}, +[1600076] = {247, -8, 1, 5027}, +[1600077] = {248, -8, 1, 5033}, +[1600078] = {249, -8, 1, 5039}, +[1600079] = {250, -8, 1, 5045}, +[1600080] = {251, -8, 1, 5051}, +[1600081] = {252, -8, 1, 5057}, +[1600082] = {253, -8, 1, 5063}, +[1600083] = {254, -8, 1, 5069}, +[1600084] = {255, -8, 1, 5075}, +[1600085] = {256, -8, 1, 5081}, +[1600086] = {257, -8, 1, 5087}, +[1600087] = {258, -8, 1, 5093}, +[1600088] = {259, -8, 1, 5099}, +[1600089] = {260, -8, 1, 5105}, +[1600090] = {261, -8, 1, 5111}, +[1600092] = {263, -8, 0, 2024}, +[1600093] = {264, -8, 0, 1021}, +[1600094] = {265, -8, 0, 3024}, +[1600095] = {281, -8, 0, 1005}, +[1600096] = {281, -8, 0, 2009}, +[1600097] = {281, -8, 0, 4001}, +[1600098] = {281, -8, 0, 4002}, +[1600099] = {281, -8, 0, 2009}, +[1600100] = {281, -2, 2, 0}, +[1600101] = {281, -8, 0, 2009}, +[1600103] = {281, -8, 0, 3008}, +[1600104] = {281, -8, 0, 3008}, +[1600107] = {281, -8, 3, 0}, +[1600108] = {281, -8, 0, 3008}, +[1600109] = {281, -3, 2, 0}, +[1600110] = {281, -8, 0, 4001}, +[1600111] = {281, -8, 0, 2009}, +[1600112] = {281, -8, 0, 4002}, +[1600113] = {281, -8, 0, 4001}, +[1600117] = {281, -8, 0, 2009}, +[1600119] = {281, -2, 3, 0}, +[1600120] = {281, -8, 0, 3008}, +[1600121] = {281, -8, 0, 2009}, +[1600122] = {281, -8, 0, 3008}, +[1600125] = {281, -8, 0, 1005}, +[1600126] = {281, -8, 0, 3008}, +[1600129] = {281, -1, 3, 0}, +[1600130] = {281, -8, 0, 4001}, +[1600133] = {281, -1, 2, 0}, +[1600137] = {281, -8, 0, 1005}, +[1600142] = {281, -8, 0, 1005}, + +} + + +shopRange = { --shopRangeStart, shopRangeEnd +[101] = {101001, 101010}; +[102] = {102001, 102010}; +[103] = {103001, 103010}; +[104] = {104001, 104010}; +[105] = {105001, 105010}; +[106] = {106001, 106010}; +[107] = {107001, 107010}; +[108] = {108001, 108017}; +[109] = {109001, 109015}; +[110] = {110001, 110018}; +[111] = {111001, 111018}; +[112] = {112001, 112018}; +[113] = {113001, 113019}; +[114] = {114001, 114015}; +[115] = {115001, 115015}; +[116] = {116001, 116010}; +[117] = {117001, 117010}; +[118] = {118001, 118010}; +[120] = {120001, 120012}; +[121] = {121001, 121012}; +[122] = {122001, 122012}; +[123] = {123001, 123012}; +[124] = {124001, 124012}; +[125] = {125001, 125012}; +[126] = {126001, 126012}; +[127] = {127001, 127012}; +[128] = {128001, 128012}; +[129] = {129001, 129016}; +[130] = {130001, 130012}; +[131] = {131001, 131012}; +[132] = {132001, 132012}; +[133] = {133001, 133012}; +[134] = {134001, 134016}; +[135] = {135001, 135012}; +[136] = {136001, 136012}; +[137] = {137001, 137012}; +[138] = {138001, 138012}; +[139] = {139001, 139012}; +[140] = {140001, 140012}; +[141] = {141001, 141012}; +[142] = {142001, 142012}; +[143] = {143001, 143016}; +[144] = {144001, 144018}; +[145] = {1071001, 1071002}; +[146] = {1072001, 1072006}; +[1001] = {1001001, 1001008}; +[1002] = {1002001, 1002008}; +[1003] = {1003001, 1003007}; +[1004] = {1004001, 1004002}; +[1005] = {1005001, 1005017}; +[1006] = {1006001, 1006006}; +[1007] = {1007001, 1007010}; +[1008] = {1008001, 1008009}; +[1009] = {1009001, 1009012}; +[1010] = {1010001, 1010014}; +[1011] = {1011001, 1011010}; +[1012] = {1012001, 1012007}; +[1013] = {1013001, 1013011}; +[1014] = {1014001, 1014006}; +[1015] = {1015001, 1015007}; +[1016] = {1016001, 1016016}; +[1017] = {1018001, 1018010}; +[1018] = {1017001, 1017013}; +[1019] = {1019001, 1019005}; +[1020] = {1066001, 1066004}; +[1021] = {1069001, 1069005}; +[2001] = {1020001, 1020008}; +[2002] = {1021001, 1021006}; +[2003] = {1022001, 1022007}; +[2004] = {1023001, 1023008}; +[2005] = {1024001, 1024003}; +[2006] = {1025001, 1025008}; +[2007] = {1026001, 1026006}; +[2008] = {1027001, 1027004}; +[2009] = {1028001, 1028016}; +[2010] = {1029001, 1029009}; +[2011] = {1030001, 1030008}; +[2012] = {1031001, 1031010}; +[2013] = {1032001, 1032010}; +[2014] = {1033001, 1033012}; +[2015] = {1034001, 1034015}; +[2016] = {1035001, 1035013}; +[2017] = {1036001, 1036006}; +[2018] = {1037001, 1037006}; +[2019] = {1038001, 1038008}; +[2020] = {1039001, 1039009}; +[2021] = {1040001, 1040010}; +[2022] = {1041001, 1041005}; +[2023] = {1065001, 1065006}; +[2024] = {1068001, 1068006}; +[3001] = {1042001, 1042008}; +[3002] = {1043001, 1043008}; +[3003] = {1044001, 1044008}; +[3004] = {1045001, 1045008}; +[3005] = {1046001, 1046010}; +[3006] = {1047001, 1047008}; +[3007] = {1048001, 1048006}; +[3008] = {1049001, 1049016}; +[3009] = {1050001, 1050013}; +[3010] = {1051001, 1051008}; +[3011] = {1052001, 1052009}; +[3012] = {1053001, 1053010}; +[3013] = {1054001, 1054006}; +[3014] = {1055001, 1055013}; +[3015] = {1056001, 1056005}; +[3016] = {1057001, 1057008}; +[3017] = {1058001, 1058011}; +[3018] = {1059001, 1059007}; +[3019] = {1060001, 1060011}; +[3020] = {1061001, 1061014}; +[3021] = {1062001, 1062016}; +[3022] = {1063001, 1063004}; +[3023] = {1067001, 1067008}; +[3024] = {1070001, 1070004}; +[4001] = {1064001, 1064011}; +[4002] = {1064001, 1064011}; +[5001] = {2001001, 2001018}; +[5002] = {2002001, 2002006}; +[5003] = {2003001, 2003010}; +[5004] = {2004001, 2004009}; +[5005] = {2005001, 2005010}; +[5006] = {2006001, 2006012}; +[5007] = {2007001, 2007010}; +[5008] = {2008001, 2008016}; +[5009] = {2009001, 2009007}; +[5010] = {2009101, 2009104}; +[5011] = {2009201, 2009204}; +[5012] = {2009301, 2009304}; +[5013] = {2009401, 2009404}; +[5014] = {2009501, 2009504}; +[5015] = {2010001, 2010004}; +[5016] = {2010101, 2010104}; +[5017] = {2010201, 2010204}; +[5018] = {2010301, 2010304}; +[5019] = {2010401, 2010404}; +[5020] = {2010501, 2010504}; +[5021] = {2011001, 2011004}; +[5022] = {2011101, 2011104}; +[5023] = {2011201, 2011204}; +[5024] = {2011301, 2011304}; +[5025] = {2011401, 2011404}; +[5026] = {2011501, 2011504}; +[5027] = {2012001, 2012007}; +[5028] = {2012101, 2012104}; +[5029] = {2012201, 2012204}; +[5030] = {2012301, 2012304}; +[5031] = {2012401, 2012404}; +[5032] = {2012501, 2012504}; +[5033] = {2013001, 2013004}; +[5034] = {2013101, 2013104}; +[5035] = {2013201, 2013204}; +[5036] = {2013301, 2013304}; +[5037] = {2013401, 2013404}; +[5038] = {2013501, 2013504}; +[5039] = {2014001, 2014007}; +[5040] = {2014101, 2014104}; +[5041] = {2014201, 2014204}; +[5042] = {2014301, 2014304}; +[5043] = {2014401, 2014404}; +[5044] = {2014501, 2014504}; +[5045] = {2015001, 2015007}; +[5046] = {2015101, 2015104}; +[5047] = {2015201, 2015204}; +[5048] = {2015301, 2015304}; +[5049] = {2015401, 2015404}; +[5050] = {2015501, 2015504}; +[5051] = {2016001, 2016006}; +[5052] = {2016101, 2016104}; +[5053] = {2016201, 2016204}; +[5054] = {2016301, 2016304}; +[5055] = {2016401, 2016404}; +[5056] = {2016501, 2016504}; +[5057] = {2017001, 2017006}; +[5058] = {2017101, 2017104}; +[5059] = {2017201, 2017204}; +[5060] = {2017301, 2017304}; +[5061] = {2017401, 2017404}; +[5062] = {2017501, 2017504}; +[5063] = {2018001, 2018006}; +[5064] = {2018101, 2018104}; +[5065] = {2018201, 2018204}; +[5066] = {2018301, 2018304}; +[5067] = {2018401, 2018404}; +[5068] = {2018501, 2018504}; +[5069] = {2019001, 2019006}; +[5070] = {2019101, 2019104}; +[5071] = {2019201, 2019204}; +[5072] = {2019301, 2019304}; +[5073] = {2019401, 2019404}; +[5074] = {2019501, 2019504}; +[5075] = {2020001, 2020006}; +[5076] = {2020101, 2020104}; +[5077] = {2020201, 2020204}; +[5078] = {2020301, 2020304}; +[5079] = {2020401, 2020404}; +[5080] = {2020501, 2020504}; +[5081] = {2021001, 2021006}; +[5082] = {2021101, 2021104}; +[5083] = {2021201, 2021204}; +[5084] = {2021301, 2021304}; +[5085] = {2021401, 2021404}; +[5086] = {2021501, 2021504}; +[5087] = {2022001, 2022006}; +[5088] = {2022101, 2022104}; +[5089] = {2022201, 2022204}; +[5090] = {2022301, 2022304}; +[5091] = {2022401, 2022404}; +[5092] = {2022501, 2022504}; +[5093] = {2023001, 2023006}; +[5094] = {2023101, 2023104}; +[5095] = {2023201, 2023204}; +[5096] = {2023301, 2023304}; +[5097] = {2023401, 2023404}; +[5098] = {2023501, 2023504}; +[5099] = {2024001, 2024006}; +[5100] = {2024101, 2024104}; +[5101] = {2024201, 2024204}; +[5102] = {2024301, 2024304}; +[5103] = {2024401, 2024404}; +[5104] = {2024501, 2024504}; +[5105] = {2025001, 2025006}; +[5106] = {2025101, 2025104}; +[5107] = {2025201, 2025204}; +[5108] = {2025301, 2025304}; +[5109] = {2025401, 2025404}; +[5110] = {2025501, 2025504}; +[5111] = {2026001, 2026006}; +[5112] = {2026101, 2026104}; +[5113] = {2026201, 2026204}; +[5114] = {2026301, 2026304}; +[5115] = {2026401, 2026404}; +[5116] = {2026501, 2026504}; +[5117] = {2026601, 2026606}; +[5118] = {2026701, 2026708}; +[5119] = {2026801, 2026808}; +[5120] = {2026901, 2026908}; +[5121] = {2027001, 2027008}; +[5122] = {2027101, 2027110}; +[5123] = {2027201, 2027211}; +} + + +function init(npc) + return false, false, 0, 0; +end + +function onEventStarted(player, npc, triggerName) + + npcId = npc:GetActorClassId(); + + if shopInfo[npcId] == nil then + errorMsg = string.format("This PopulaceShopSalesman actor has no shop set. Actor Class Id: %s", npcId); + player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", errorMsg ); + player:EndEvent(); + return; + end; + + local shopCurrency = 1000001; + local welcomeText = 1; + local menuId = shopInfo[npcId][2]; + local shopCategory = shopInfo[npcId][3]; + + local itemShop = 0; + local classShop = 1; + local weaponShop = 2; + local armorShop = 3; + local hamletShop = 4; + + local weaponShopPack = {5001,5002,5007,5008}; + local armorShopPack = {5004,5005,5006,5003}; + + local menuBuy = 1; + local menuBuyCount = 1; -- For Shops with multiple buying categories + local menuSell = 2; + local menuFacility = 3; + local menuTutorial = 4; + local menuClose = -3; + local menuHasFacility = false; + local menuHasTutorial = false; + + local shopPack = shopInfo[npcId][4]; -- Starting value for the shopPack of the current NPC Actor + local chosenShopPackage = 0; -- Var to send to openShopMenu() once desired shopPack is determined + local choice; + + callClientFunction(player, "welcomeTalk", shopInfo[npcId][welcomeText], player); + + while (true) do + + if (shopCategory == itemShop) then + choice = callClientFunction(player, "selectMode", menuId); + menuHasFacility = true; + menuHasTutorial = true; + elseif (shopCategory == classShop) then + choice = callClientFunction(player, "selectModeOfClassVendor"); + menuBuyCount = 6; + menuSell = 0; + elseif (shopCategory == weaponShop) then + choice = callClientFunction(player, "selectModeOfMultiWeaponVendor", menuId); + menuBuyCount = 4; + menuSell = 0; + elseif (shopCategory == armorShop) then + choice = callClientFunction(player, "selectModeOfMultiArmorVendor", menuId); + menuBuyCount = 4; + menuSell = 0; + elseif (shopCategory == hamletShop) then + choice = callClientFunction(player, "selectMode", menuId); + + local hamletRegion = shopPack; + local hamletPackAleport = {5117, 5122, 5123}; + local hamletPackHyrstmill = {5117, 5118, 5119}; + local hamletPackGoldenBazaar = {5117, 5120, 5121}; + local hamletLevel = 3; -- Defaulting to highest value for now + + if hamletRegion == 5122 then -- Aleport + -- hamletLevel = GetHamletStatus(idAleport); + shopPack = hamletPackAleport[hamletLevel] or 5117; + elseif hamletRegion == 5118 then -- Hyrstmill + -- hamletLevel = GetHamletStatus(idHyrstmill); + shopPack = hamletPackHyrstmill[hamletLevel] or 5117; + elseif hamletRegion == 5120 then -- The Golden Bazaar + -- hamletLevel = GetHamletStatus(idGoldenBazaar); + shopPack = hamletPackGoldenBazaar[hamletLevel] or 5117; + end + end + + + if choice and (choice >= menuBuy and choice <= menuBuyCount) then + --player:SendMessage(0x20,"", "Menu option: "..choice); + + if (shopCategory == weaponShop) then + chosenShopPackage = weaponShopPack[choice]; + elseif (shopCategory == armorShop) then + chosenShopPackage = armorShopPack[choice]; + else + chosenShopPackage = ((shopPack-1) + choice); + end + + openShopMenu( + player, + menuId, + chosenShopPackage, + shopRange[chosenShopPackage][1], + shopRange[chosenShopPackage][2], + shopCurrency + ); + + elseif (choice == menuSell) then + openSellMenu(player); + + elseif (choice == menuFacility) and (menuHasFacility == true) then + if menuId > 0 then + local classFacility = (shopInfo[npcId][1] + 1) or 35; + facilityChoice = callClientFunction(player, "selectFacility", nil, classFacility, 3); + + if facilityChoice == 1 then + callClientFunction(player, "confirmUseFacility", player, 200); + elseif facilityChoice == 2 then + callClientFunction(player, "confirmUseFacility", player, 400); + elseif facilityChoice == 3 then + callClientFunction(player, "confirmUseFacility", player, 1000); + end + end + elseif (choice == menuTutorial) and (menuHasTutorial == true) then + callClientFunction(player, "startTutorial", nil, menuId); + end + + if (choice == menuClose or choice == nil) then + break; + end + end + + callClientFunction(player, "finishTalkTurn", player); + player:EndEvent(); + +end + + + +function openShopMenu(player, menuId, shopPack, itemRangeStart, itemRangeEnd, shopCurrency) + + callClientFunction(player, "openShopBuy", player, shopPack, shopCurrency); + + player:SendMessage(0x20, "", "shopPack: "..shopPack.." Range: "..itemRangeStart.."-"..itemRangeEnd); + + while (true) do + buyResult, quantity = callClientFunction(player, "selectShopBuy", player); + + if (buyResult == 0) then + callClientFunction(player, "closeShopBuy", player); + break; + else + if itemRangeStart and itemRangeEnd then + itemChosen = (itemRangeStart - 1) + buyResult; + + if (((itemRangeStart-1) + itemChosen) < itemRangeStart) or (itemChosen > itemRangeEnd) then + player:SendMessage(0x20, "", "[ERROR] Client selected item exceeds the valid range."); + callClientFunction(player, "finishTalkTurn", player); + player:EndEvent(); + return; + else + player:SendMessage(0x20, "", "Item chosen: " .. itemChosen .. " Quantity: ".. quantity); + + --[[ + TO-DO: Request item information from server table and throw result to purchaseItem() + + requestItem = GetItemShopInfoThing(itemChosen); + purchaseItem(player, INVENTORY_NORMAL, requestItem.id, quantity, requestItem.quality, requestItem.price, shopCurrency); + --]] + end + end + + end + end + +end + + + +function openSellMenu(player) + callClientFunction(player, "openShopSell", player); + + while (true) do + sellResult, sellQuantity, sellState, unknown, sellItemSlot = callClientFunction(player, "selectShopSell", player); + + if (sellResult == nil) then + callClientFunction(player, "closeShopSell", player); + break; + else + if sellState == 1 then + itemToSell = player:GetItemPackage(INVENTORY_NORMAL):GetItemAtSlot(sellItemSlot-1); + gItemSellId = itemToSell.itemId; + gItemQuality = itemToSell.quality; + gItemPrice = GetItemGamedata(gItemSellId); + gItemPrice = gItemPrice.sellPrice; + + + if gItemQuality == 2 then -- +1 + gItemPrice = (math.floor(gItemPrice * 1.10)); + elseif gItemQuality == 3 then -- +2 + gItemPrice = (math.floor(gItemPrice * 1.25)); + elseif gItemQuality == 4 then -- +3 + gItemPrice = (math.floor(gItemPrice * 1.50)); + end + + callClientFunction(player, "informSellPrice", 1, sellItemSlot, gItemPrice); + + elseif sellState == nil then + sellItem(player, gItemSellId, sellQuantity, gItemQuality, gItemPrice, sellItemSlot-1, shopCurrency); + end + end + end +end \ No newline at end of file diff --git a/Data/scripts/commands/ChocoboRideCommand.lua b/Data/scripts/commands/ChocoboRideCommand.lua index f28bd8f1..7d89da2c 100644 --- a/Data/scripts/commands/ChocoboRideCommand.lua +++ b/Data/scripts/commands/ChocoboRideCommand.lua @@ -6,6 +6,8 @@ Handles mounting and dismounting the Chocobo and Goobbue --]] +require ("global") + function onEventStarted(player, actor, triggerName, isGoobbue) if (player:GetState() == 0) then @@ -13,11 +15,11 @@ function onEventStarted(player, actor, triggerName, isGoobbue) worldMaster = GetWorldMaster(); if (isGoobbue ~= true) then - player:ChangeMusic(83); + player:ChangeMusic(83, MUSIC_FADEIN); player:SendGameMessage(player, worldMaster, 26001, 0x20); player:SetMountState(1); else - player:ChangeMusic(98); + player:ChangeMusic(98, MUSIC_FADEIN); player:SendGameMessage(player, worldMaster, 26019, 0x20); player:SetMountState(2); end @@ -25,7 +27,7 @@ function onEventStarted(player, actor, triggerName, isGoobbue) player:ChangeSpeed(0.0, 3.6, 9.0, 9.0); player:ChangeState(15); else - player:ChangeMusic(player:GetZone().bgmDay); + player:ChangeMusic(player:GetZone().bgmDay, MUSIC_FADEIN); worldMaster = GetWorldMaster(); diff --git a/Data/scripts/commands/TeleportCommand.lua b/Data/scripts/commands/TeleportCommand.lua index e7c7a3bb..cbc254ef 100644 --- a/Data/scripts/commands/TeleportCommand.lua +++ b/Data/scripts/commands/TeleportCommand.lua @@ -49,8 +49,7 @@ teleportMenuToAetheryte = { [5] = { [1] = 1280121, [2] = 1280122 - }, - + } } zoneIdToRegionChoice = @@ -73,7 +72,7 @@ function onEventStarted(player, actor, eventType, eventName, isTeleport) local favoredLocation = {1280003, 1280005, 1280062}; local currentRegion = zoneIdToRegionChoice[player:GetPos()[5]] or 0; local isCity = {[1280001] = true, [1280061] = true, [1280031] = true}; - local isRegion = true; + local isFavoredDesination = false; local destination = 0; @@ -103,7 +102,7 @@ function onEventStarted(player, actor, eventType, eventName, isTeleport) elseif (regionChoice == 6) then -- Favored Destinations selected. -- Dummy info. Favored would be half price after factoring in same region cost or not. animaCost = {2, 3, 3, favoredLocation[1], favoredLocation[2], favoredLocation[3]}; - isRegion = false; + isFavoredDesination = true; end @@ -126,12 +125,12 @@ function onEventStarted(player, actor, eventType, eventName, isTeleport) player:PlayAnimation(0x4000FFA); - if (isRegion == true) then + if (isFavoredDesination == true) then + destination = aetheryteTeleportPositions[favoredLocation[aetheryteChoice]]; + player:SendGameMessage(worldMaster, 34101, 0x20, 2, favoredLocation[aetheryteChoice], animaCost[aetheryteChoice], currentAnima); + else destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]]; player:SendGameMessage(worldMaster, 34101, 0x20, 2, teleportMenuToAetheryte[regionChoice][aetheryteChoice], animaCost[aetheryteChoice], currentAnima); - else - destination = aetheryteTeleportPositions[favoredLocation[aetheryteChoice]]; - player:SendGameMessage(worldMaster, 34101, 0x20, 2, favoredLocation[aetheryteChoice], animaCost[aetheryteChoice], currentAnima); end confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false); diff --git a/Data/scripts/commands/gm/music.lua b/Data/scripts/commands/gm/music.lua index 3e04c912..0a761b14 100644 --- a/Data/scripts/commands/gm/music.lua +++ b/Data/scripts/commands/gm/music.lua @@ -1,14 +1,17 @@ properties = { permissions = 0, - parameters = "s", + parameters = "ss", description = [[ Plays music to player. !music +!music ]], } -function onTrigger(player, argc, music) +function onTrigger(player, argc, music, transition) music = tonumber(music) or 0; - player:ChangeMusic(music); + transition = tonumber(transition) or nil; + player:SendMessage(0x20, "", tostring(argc).." "..tostring(music).." "..tostring(transition)); + player:ChangeMusic(music, transition); end; \ No newline at end of file diff --git a/Data/scripts/commands/gm/setappearance.lua b/Data/scripts/commands/gm/setappearance.lua index 88ee7869..526307a8 100644 --- a/Data/scripts/commands/gm/setappearance.lua +++ b/Data/scripts/commands/gm/setappearance.lua @@ -15,10 +15,12 @@ function onTrigger(player, argc, appearanceId) local sender = "[setappearance] "; app = tonumber(appearanceId) or 0; - player:SendMessage(messageID, sender, string.format("appearance %u", app)); + --player:SendMessage(messageID, sender, string.format("appearance %u", app)); - if player and player.target then - player.target.ChangeNpcAppearance(app); + targetActor = GetWorldManager():GetActorInWorld(player.currentTarget) + + if targetActor then + targetActor.ChangeNpcAppearance(app); player:SendMessage(messageID, sender, string.format("appearance %u", app)); end; diff --git a/Data/scripts/global.lua b/Data/scripts/global.lua index 3e096e24..4b18889c 100644 --- a/Data/scripts/global.lua +++ b/Data/scripts/global.lua @@ -164,6 +164,14 @@ QFLAG_NONE = 0; QFLAG_MAP = 1; QFLAG_PLATE = 2; +-- MUSIC +MUSIC_IMMEDIATE = 1; +MUSIC_CROSSFADE = 2; +MUSIC_LAYER = 3; +MUSIC_FADEIN = 4; +MUSIC_NORMAL_CHANNEL = 5; +MUSIC_BATTLE_CHANNEL = 6; + -- Common Helper Functions function attentionMessage(player, textId, ...) player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...); diff --git a/Data/scripts/quests/dft/DftWil.lua b/Data/scripts/quests/dft/DftWil.lua index 84616a6a..3375c7d1 100644 --- a/Data/scripts/quests/dft/DftWil.lua +++ b/Data/scripts/quests/dft/DftWil.lua @@ -4,9 +4,9 @@ require ("global") Quest Script -Name: Small Talk -Code: DftWil -Id: 110543 +Name: Small Talk +Code: DftWil +Id: 110543 Contains all default lines for talkable npcs in the Wilderness Region (aka Thanalan). * NOTE: This quest is active for all players at all times. @@ -14,12 +14,14 @@ 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 - [1000293] = "defaultTalkWithDeaustie_001", -- Deaustie - defaultTalkWithDeaustie_002 (flavor for being on WVR?) + [1000293] = "defaultTalkWithDeaustie_001", -- Deaustie - defaultTalkWithDeaustie_002 (her dialog after unlocking WVR?) [1000374] = "defaultTalkWithRorojaru_001", -- Rorojaru [1000597] = "defaultTalkWithNogeloix_001", -- Nogeloix + [1000635] = "defaultTalkWithHnaufrid_001", -- Hnaufrid - Will not fire since he isn't PplStd [1000638] = "defaultTalkWithHawazizowazi_001", -- Hawazi Zowazi [1000639] = "defaultTalkWithIsabella_001", -- Isabella [1000640] = "defaultTalkWithCiceroix_001", -- Ciceroix @@ -31,6 +33,8 @@ local defaultTalkWil = { [1000646] = "defaultTalkWithRinhmaimhov_001", -- Rinh Maimhov [1000647] = "defaultTalkWithLyngwaek_001", -- Lyngwaek [1000648] = "defaultTalkWithWawaton_001", -- Wawaton + [1000649] = "defaultTalkWithDyalwann_001", -- <<>> - D'yalwann - Empty function. No wiki info, likely unused. Has book prop. + [1000650] = "defaultTalkWithSedemode_001", -- <<>> - Sedemode - Empty function. No wiki info, likely unused. [1000651] = "defaultTalkWithPopori_001", -- Popori [1000652] = "defaultTalkWithMamaza_001", -- Mamaza [1000653] = "defaultTalkWithNhagiamariyo_001", -- Nhagi Amariyo @@ -42,24 +46,29 @@ local defaultTalkWil = { [1000665] = "defaultTalkWithRosalind_001", -- Rosalind [1000666] = "defaultTalkWithOcoco_001", -- Ococo [1000668] = "defaultTalkWithUbokhn_001", -- U'bokhn - [1000780] = "defaultTalkWithKiora_001", -- Kiora - [1000781] = "defaultTalkWithOpondhao_001", -- O'pondhao - [1000782] = "defaultTalkWithBertram_001", -- Bertram - [1000783] = "defaultTalkWithMinerva_001", -- Minvera - [1000784] = "defaultTalkWithZoengterbin_001", -- Zoengterbin - defaultTalkWithZoengterbin_002 / defaultTalkWithZoengterbin_003 (informs about LNC guild) - [1000785] = "defaultTalkWithStyrmoeya_001", -- Styrmoeya - [1000786] = "defaultTalkWithYhahamariyo_001", -- Yhah Amariyo - [1000787] = "defaultTalkWithHildie_001", -- Hildie - [1000788] = "defaultTalkWithLettice_001", -- Lettice - [1000789] = "defaultTalkWithTyon_001", -- Tyon - defaultTalkWithTyon_002 / defaultTalkWithTyon_003 (informs about BTN guild) + [1000672] = "defaultTalkWithBlandhem_001", -- <<>> - Blandhem (Camp Black Brush: X:56.089 Y:199.983 Z:-462.182 rough estimate) + [1000673] = "defaultTalkWithChechedoba_001", -- <<>> - Chechedoba (Camp Black Brush: X:8.436 Y:199.973 Z:-484.073 rough estimate) + [1000674] = "defaultTalkWithZllayan_001", -- <<>> - Z'llayan (Camp Drybone) + [1000780] = "defaultTalkWithKiora_001", -- Kiora - defaultTalkWithKiora_002 / 003 (informs about MRD guild) + [1000781] = "defaultTalkWithOpondhao_001", -- O'pondhao - defaultTalkWithOpondhao_002 / 003 (informs about FSH guild) + [1000782] = "defaultTalkWithBertram_001", -- Bertram - defaultTalkWithBertram_002 / 003 (informs about CUL guild) + [1000783] = "defaultTalkWithMinerva_001", -- Minvera - defaultTalkWithMinerva_002 / 003 / 004 (informs about BSM guild. Extra dialog also if you're on a DoW/M?) + [1000784] = "defaultTalkWithZoengterbin_001", -- Zoengterbin - defaultTalkWithZoengterbin_002 / 003 (informs about LNC guild) + [1000785] = "defaultTalkWithStyrmoeya_001", -- Styrmoeya - defaultTalkWithStyrmoeya_002 / 003 (informs about ARC guild) + [1000786] = "defaultTalkWithYhahamariyo_001", -- Yhah Amariyo - defaultTalkWithYhahamariyo_002 / 003 (informs about CNJ guild) + [1000787] = "defaultTalkWithHildie_001", -- Hildie - defaultTalkWithHildie_002 / 003 (informs about CRP guild) + [1000788] = "defaultTalkWithLettice_001", -- Lettice - defaultTalkWithLettice_002 / 003 (informs about LTW guild) + [1000789] = "defaultTalkWithTyon_001", -- Tyon - defaultTalkWithTyon_002 / 003 (informs about BTN guild) [1000840] = "defaultTalkWithRururaji_001", -- Rururaji - Presumably dialog pre-Chocobo update. Will not fire due to actor class change since then. [1000841] = "defaultTalkWithMomodi_001", -- Momodi - [1000846] = "defaultTalkWithYayake_001", -- Yayake + [1000846] = "defaultTalkWithYayake_001", -- Yayake - defaultTalkWithYayake_002 (her dialog after unlocking THM?) [1000847] = "defaultTalkWithIllofii_001", -- I'llofii [1000861] = "defaultTalkWithLinette_001", -- Linette [1000862] = "defaultTalkWithGagaruna_001", -- Gagaruna [1000863] = "defaultTalkWithLulutsu_001", -- Lulutsu - [1000864] = "defaultTalkWithInn_Desk", -- Otopa Pottopa + [1000864] = "defaultTalkWithInn_Desk", -- Otopa Pottopa - defaultTalkWithOtopapottopa_001 (pre-Inn unlock?) + [1000865] = "defaultTalkWithThaisie_001", -- Thaisie - Mentions retainers, but will not fire since she's not PplStd. + [1000887] = "defaultTalkWithZssapa_001", -- <<>> - 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 [1000916] = "defaultTalkWithAspipi_001", -- Aspipi [1000917] = "defaultTalkWithGloiucen_001", -- Gloiucen @@ -89,6 +98,10 @@ local defaultTalkWil = { [1001143] = "defaultTalkWithTotono_001", -- Totono [1001144] = "defaultTalkWithFyrilsunn_001", -- Fyrilsunn [1001145] = "defaultTalkWithSinette_001", -- Sinette + [1001146] = "defaultTalkWithZirnbyrt_001", -- <<>> - 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", -- <<>> - Vhaso Tayuun - (Entry Denier? No wiki info) + [1001148] = "defaultTalkWithPulbeiyalbei_001", -- <<>> - Pulbei Yalbei - (Entry Denier? No wiki info) + [1001149] = "defaultTalkWithGembert_001", -- <<>> - Gembert - Entry Denier Guard (South Thanalan: X:1707.143 Y:238.150 Z:1617.570 Rough estimate. Guards unused dun06) [1001165] = "defaultTalkWithMumukiya_001", -- Mumukiya [1001166] = "defaultTalkWithYuyubesu_001", -- Yuyubesu [1001167] = "defaultTalkWithChachai_001", -- Chachai @@ -106,6 +119,34 @@ local defaultTalkWil = { [1001256] = "defaultTalkWithMaginfred_001", -- Gunnulf [1001257] = "defaultTalkWithOrisic_001", -- Heibert [1001260] = "defaultTalkWithKlamahni_001", -- I'paghlo + [1001295] = "defaultTalkWithChamberlain_001", -- <<>> - Chamberlain (Entry Denier? No wiki info) + [1001296] = "defaultTalkWithWyntkelt_001", -- <<>> - Wyntkelt (Entry Denier? No wiki info) + [1001297] = "defaultTalkWithAudrye_001", -- <<>> - Audrye (Entry Denier? No wiki info) + [1001314] = "defaultTalkWithFromelaut_001", -- <<>> - Fromelaut (Eastern Thanalan: The Golden Bazaar) + [1001315] = "defaultTalkWithZilili_001", -- <<>> - Zilili (Eastern Thanalan: The Golden Bazaar) - Dialog doesn't match wiki, but wiki dialog isn't addressed by any function. Changed in an update perhaps. + [1001316] = "defaultTalkWithPapala_001", -- <<>> - Papala (Eastern Thanalan: The Golden Bazaar: 1099.540039, 312.674, -1145.719971) + [1001317] = "defaultTalkWithSasapano_001", -- <<>> - Sasapano (Eastern Thanalan: The Golden Bazaar: 1134.599976, 312.193, -1128.23999) + [1001318] = "defaultTalkWithBibiroku_001", -- <<>> - Bibiroku (Eastern Thanalan: The Golden Bazaar) + [1001319] = "defaultTalkWithBernier_001", -- <<>> - Bernier (Eastern Thanalan: The Golden Bazaar) + [1001320] = "defaultTalkWithJajaba_001", -- <<>> - Jajaba (Eastern Thanalan: The Golden Bazaar) + [1001321] = "defaultTalkWithJujuya_001", -- <<>> - Jujuya (Eastern Thanalan: The Golden Bazaar) + [1001322] = "defaultTalkWithKikinori_001", -- <<>> - Kikinori (Western Thanalan: The Silver Bazaar) + [1001323] = "defaultTalkWithCelie_001", -- <<>> - Celie (Western Thanalan: The Silver Bazaar) + [1001324] = "defaultTalkWithAgzurungzu_001", -- <<>> - Agzu Rungzu (Western Thanalan: The Silver Bazaar) + [1001325] = "defaultTalkWithDarimbeh_001", -- <<>> - D'arimbeh (Western Thanalan: The Silver Bazaar) + [1001326] = "defaultTalkWithIudprost_001", -- <<>> - Iudprost (Western Thanalan: The Silver Bazaar) + [1001327] = "defaultTalkWithTatafu_001", -- <<>> - Tatafu (Western Thanalan: The Silver Bazaar) + [1001328] = "defaultTalkWithAthalwolf_001", -- <<>> - Athalwolf (Western Thanalan: The Silver Bazaar) + [1001329] = "defaultTalkWithPadakusondaku_001", -- <<>> - Padaku Sondaku (Western Thanalan: The Silver Bazaar) + [1001330] = "defaultTalkWithBellinda_001", -- <<>> - Bellinda (Eastern Thanalan, Little Ala Mhigo) + [1001331] = "defaultTalkWithRonthfohc_001", -- <<>> - Ronthfohc (Eastern Thanalan, Little Ala Mhigo) + [1001332] = "defaultTalkWithBerahthraben_001", -- <<>> - Berahthraben (Eastern Thanalan, Little Ala Mhigo) + [1001333] = "defaultTalkWithOtho_001", -- <<>> - Otho (Eastern Thanalan, Little Ala Mhigo) + [1001334] = "defaultTalkWithRadulf_001", -- <<>> - Radulf (Eastern Thanalan, Little Ala Mhigo: 1131.75, 251.29, 206.339996) + [1001335] = "defaultTalkWithHonmeme_001", -- <<>> - Honmeme (Eastern Thanalan, Little Ala Mhigo) + [1001336] = "defaultTalkWithCatriona_001", -- <<>> - Catriona (Eastern Thanalan, Little Ala Mhigo) + [1001337] = "defaultTalkWithGrifiud_001", -- <<>> - Grifiud (Eastern Thanalan, Little Ala Mhigo) + [1001392] = "defaultTalkWithNomomo_001", -- <<>> - Nomomo (Camp Black Brush: X:24.274 Y:200.003 Z:-473.548 rough estimate) - If arg1=true, says different dialog. [1001415] = "defaultTalkWithAnthoinette_001", -- Anthoinette [1001416] = "defaultTalkWithWisemoon_001", -- Wise Moon [1001417] = "defaultTalkWithApachonaccho_001", -- Apacho Naccho @@ -116,6 +157,7 @@ local defaultTalkWil = { [1001422] = "defaultTalkWithMilgogo_001", -- Milgogo [1001423] = "defaultTalkWithMumutano_001", -- Mumutano [1001424] = "defaultTalkWithGegeissa_001", -- Gegeissa + [1001425] = "defaultTalkWithGdatnan_001", -- G'datnan [1001426] = "defaultTalkWithHehena_001", -- Hehena [1001427] = "defaultTalkWithGuillaunaux_001", -- Guillaunaux [1001428] = "defaultTalkWithYuyuhase_001", -- Yuyuhase @@ -128,6 +170,11 @@ local defaultTalkWil = { [1001443] = "defaultTalkWithJudithe_001", -- Judithe [1001444] = "defaultTalkWithRobyn_001", -- Robyn [1001445] = "defaultTalkWithSingleton_001", -- Singleton + [1001446] = "defaultTalkWithFiachre_001", -- <<>> - Fiachre (Western Thanalan Ferry Docks) + [1001447] = "defaultTalkWithTaylor_001", -- <<>> - Taylor (Western Thanalan Ferry Docks: -2195.070068, 14.495, -417.200012) + [1001448] = "defaultTalkWithWalhbert_001", -- <<>> - Walhbert (Western Thanalan Ferry Docks) + [1001449] = "defaultTalkWithSpiralingpath_001", -- <<>> - Spiraling Path (Western Thanalan Ferry Docks) + [1001450] = "defaultTalkWithSasapiku_001", -- <<>> - Sasapiku (Western Thanalan Ferry Docks) [1001451] = "defaultTalkWithDoll001_001", -- Mammet (Eshtaime's Lapidaries [GSM]) [1001452] = "defaultTalkWithDoll002_001", -- Mammet (Eshtaime's Lapidaries [GSM] #2) [1001453] = "defaultTalkWithDoll003_001", -- Mammet (Sunsilk Tapestries [WVR]) @@ -144,29 +191,81 @@ local defaultTalkWil = { [1001476] = "defaultTalkWithCrhabye_001", -- C'rhabye [1001471] = "downTownTalk", -- Kokobi [1001472] = "defaultTalkWithMimishu_001", -- Mimishu + [1001503] = "defaultTalkWithGerland_001", -- <<>> - Gerland (Western Thanalan Ferry Docks) [1001565] = "defaultTalkWithEleanor_001", -- Eleanor + [1001596] = "defaultTalkWithAbelard_001", -- <<>> - Abelard (Western Thanalan: The Coffer & Coffin: -1726, 56.625, -317 + [1001597] = "defaultTalkWithHaipoeipo_001", -- <<>> - Haipo Eipo (Western Thanalan: The Coffer & Coffin) + [1001598] = "defaultTalkWithBartholomew_001", -- <<>> - Bartholomew (Western Thanalan: The Coffer & Coffin) + [1001599] = "defaultTalkWithKokofubu_001", -- <<>> - Kokofubu (Eastern Thanalan: Mythril Pit T-8) + [1001600] = "defaultTalkWithBertouaint_001", -- <<>> - Bertouaint (Eastern Thanalan: Mythril Pit T-8) + [1001601] = "defaultTalkWithAldebrand_001", -- <<>> - Aldebrand (Eastern Thanalan: Mythril Pit T-8) + [1001602] = "defaultTalkWithPyhajawantal_001", -- <<>> - Pyha Jawantal (Eastern Thanalan: Mythril Pit T-8) + [1001624] = "talkIdayCap", -- <<>> - Flame Lieutenant Somber Meadow (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version + [1001625] = "talkIday1", -- <<>> - Flame Sergeant Mimio Mio (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version + [1001626] = "talkIday2", -- <<>> - Flame Private Sisimuza Tetemuza (Foundation Day 2011 Dialog) - OLD EVENT NPC: Replaced by 2012 version + [1001630] = "defaultTalkWithChocobo_001", -- <<>> - Chocobo (Western Thanalan: The Coffer & Coffin) - Stands beside Haipo Eipo + [1001685] = "defaultTalkWithAdalbert_001", -- <<>> - Flame Sergeant Cotter (Ul'dah: Merchant Strip: -0.92 196.100 126.32) - Double check caps. + [1001699] = "defaultTalkWithJandonaut_001", -- <<>> - Flame Sergeant Fouillel (Southern Thanalan: Camp Broken Water: 1704 296.001 999) [1001712] = "defaultTalkWithGuillestet_001", -- Guillestet [1001713] = "defaultTalkWithHCidjaa_001", -- H'cidjaa + [1001714] = "defaultTalkWithAutgar_001", -- <<>> - Autgar (Ul'dah: Airship Landing) + [1001715] = "defaultTalkWithAhldbyrt_001", -- <<>> - Ahldbyrt (Ul'dah: Airship Landing) + [1001716] = "defaultTalkWithNeymiFunomi_001", -- <<>> - Neymi Funomi (Ul'dah: Airship Landing) [1001717] = "defaultTalkWithGoodife_001", -- Goodife [1001726] = "defaultTalkWithAistan_001", -- Aistan + [1001727] = "defaultTalkWithMateria_001", -- <<>> - Mutamix Bubblypots (Central Thanalan: 243.858002, 247.8, -1030.136963) - Check feet clipping @ pos + [1001728] = "defaultTalkWithSWYNBROES_001", -- <<>> - Swynbroes (Central Thanalan: 242.641006, 247.6, -1024.494019) + [1001729] = "defaultTalkWithKokosamu_001", -- <<>> - Kokosamu (Central Thanalan: 255.651001, 248.5, -1030.152954) - Check feet clipping @ pos + [1001730] = "defaultTalkWithF_HOBHAS_001", -- <<>> - F'hobhas (Central Thanalan: 258.665009, 248, -1021.666992) + [1001753] = "defaultTalkWithPelhiEpocan_001", -- <<>> - Pelhi Epocan (Ul'dah: Airship Landing) + [1001754] = "defaultTalkWithViolenne_001", -- <<>> - Violenne (Ul'dah: Airship Landing) [1001770] = "defaultTalkWithEara_001", -- Eara [1001771] = "defaultTalkWithLiaime_001", -- Liaime + [1001834] = "defaultTalkWithLUDOLD_001", -- <<>> - Flame Commander Ashdale - (Eastern Thanalan: 1410, 256, 187) + [1001840] = "defaultTalkWithPAHJAZHWAN_001", -- <<>> - Pahja Zhwan - (Ul'dah: Miner's Guild: -113.190002 194.2 324.25) - Double check caps. + [1001894] = "defaultTalkWithDonner_001", -- <<>> - Flame Private Greave - (North Thanalan: Bluefog) + [1001911] = "defaultTalkWithLolomaya_001", -- <<>> - Lolomaya - (North Thanalan: Camp Bluefog) Has unused argument. Dialog doesn't match wiki, but dftwil doesn't call it anywhere. Update change perhaps. + [1001925] = "defaultTalkWithHortwann_001", -- <<>> - Flame Private Hanskalsyn - (North Thanalan: Camp Bluefog) [1001932] = "defaultTalkWithSIBOLD_001", -- Sibold [1001953] = "defaultTalkWithBerndan_001", -- Berndan - [1002047] = "defaultTalkWithInn_Desk_2", -- Kopuru Fupuru - Inn NPC. + [1002047] = "defaultTalkWithInn_Desk_2", -- Kopuru Fupuru - Inn NPC. - defaultTalkWithKopuruFupuru_001 (pre-Inn unlock?) [1002101] = "defaultTalkWithDuraltharal_001", -- Dural Tharal + [1002116] = "defaultTalkWithHAVAK_ALVAK_001", -- <<>> - Havak Alvak (Ul'dah: Milvaneth Sacrarium) + [1060028] = "defaultTalkWithCURIOUS_001", -- <<>> - Curious Gorge (Western Thanalan: -1116.040039, 53.2, 285.48999)? - defaultTalkWithCURIOUS_002 + [1060029] = "defaultTalkWithSarra_001", -- <<>> - Sarra (Location unknown) defaultTalkWithSarra_002 / 003 + [1060032] = "defaultTalkWithWidargeli_001", -- <<>> - Widargelt (Eastern Thanalan: Little Ala Mhigo: 1213.670044, 251.439, 107.290001) - defaultTalkWithWidargeli_002 + [1060033] = "defaultTalkWithErik_001", -- <<>> - Erik (Ul'dah: -32.75 192.1 45.810001) - defaultTalkWithErik_002 + [1060035] = "defaultTalkWithLalai_001", -- <<>> - Lalai (Ul'dah: Milvaneth Sacrarium: 18.16, 206, 283.670013) defaultTalkWithLalai_002 / 003 / 004 / 005 / 006 / 007 / 101 + [1060036] = "defaultTalkWithKazagg_001", -- <<>> - Kazagg Chah (Western Thalanan: -1506.540039, 10.241, -233.970001) defaultTalkWithKazagg_002 / 003 / 004 / 005 / 006 / 007 + [1060037] = "defaultTalkWithHateli_001", -- <<>> - Dozol Meloc (Western Thanalan: -1513.660034, 10.617, -235.220001) defaultTalkWithHateli_002 / 003 / 004 / 005 / 006 / 007 + [1060038] = "defaultTalkWithDaza_001", -- <<>> - 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. + [1500059] = "defaultTalkWithLdhakya_001", -- <<>> - L'dhakya (Western Thanalan Ferry Docks) + [1500109] = "defaultTalkWithSylviel_001", -- <<>> - Sylviel (Western Thanalan Ferry Docks) + [1500110] = "defaultTalkWithSamigamduhla_001", -- <<>> - Sami Gamduhla (Western Thanalan Ferry Docks) [1500126] = "tribeTalk", -- Vavaki [1500129] = "defaultTalkWithYayatoki_001", -- Yayatoki - [1700039] = "defaultTalkWithBATERICH_100" -- Baterich - ---[[ Fix Later - [1002110] = "processEventSOMBER", arg1, -- Flame Lieutenant Somber Meadow - uses Spl000 staticactor not dftWil - [1002111] = "processEventMIMIO", -- Flame Sergeant Mimio Mio - uses Spl000 staticactor not dftWil - [1002112] = "processEventSISIMUZA", -- Flame Private Sisimuza Tetemuza - uses Spl000 staticactor not dftWil ---]] + [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?" + +--[[ Need sourcing + [???] = "defaultTalkCaravanChocoboUld_001" -- Presumably used on the Caravan Chocobo escorts? Does a little animation. + [???] = "defaultTalkWithExit01" -- "Leave this place?" - For quest locations like that four-bedroom room perhaps? + [???] = "defaultTalkWithMarketNpc" -- NPC in the middle of the market wards that lets you port around I'm guessing? + [???] = "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 + + + } @@ -174,28 +273,35 @@ local defaultTalkWil = { function onTalk(player, quest, npc, eventName) local npcId = npc:GetActorClassId(); - local clientFunc = defaultTalkWil[npcId]; + local clientFunc = defaultTalkWil[npcId]; if (npcId == 1002047) then -- Kopuru Fupuru - Inn NPC - local choice = callClientFunction(player, "delegateEvent", player, quest, clientFunc); - - if (choice == 1) then - GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 0.048, 0, -5.737, 0); - elseif (choice == 2) then - if (player:GetHomePointInn() ~= 3) then - player:SetHomePointInn(3); - player:SendGameMessage(GetWorldMaster(), 60019, 0x20, 3071); --Secondary homepoint set to the Hourglass - else - player:SendGameMessage(GetWorldMaster(), 51140, 0x20); --This inn is already your Secondary Homepoint - end - end + defaultTalkWithInn(player, quest, clientFunc); else callClientFunction(player, "delegateEvent", player, quest, clientFunc); end - player:EndEvent(); + player:EndEvent(); end function IsQuestENPC(player, quest, npc) - return defaultTalkWil[npc:GetActorClassId()] ~= nil; + return defaultTalkWil[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, 0.048, 0, -5.737, 0); + elseif (choice == 2) then + if (player:GetHomePointInn() ~= 3) then + player:SetHomePointInn(3); + player:SendGameMessage(GetWorldMaster(), 60019, 0x20, 3071); --Secondary homepoint set to the Hourglass + else + player:SendGameMessage(GetWorldMaster(), 51140, 0x20); --This inn is already your Secondary Homepoint + end + end end \ No newline at end of file diff --git a/Data/scripts/shop.lua b/Data/scripts/shop.lua new file mode 100644 index 00000000..d0df39b8 --- /dev/null +++ b/Data/scripts/shop.lua @@ -0,0 +1,55 @@ +--[[ + +Shop Buy/Sell Functions + +--]] + +function purchaseItem(player, location, itemId, quantity, quality, price, currency) + + local worldMaster = GetWorldMaster(); + local invCheck = -1; + + if (player:GetItemPackage(INVENTORY_CURRENCY):HasItem(currency, price)) then + invCheck = player:GetItemPackage(location):AddItem(itemId, quantity, quality); + + if (invCheck == INV_ERROR_FULL) then + -- Your inventory is full. + player:SendGameMessage(player, worldMaster, 60022, MESSAGE_TYPE_SYSTEM); + elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then + -- You cannot have more than one in your possession at any given time. + player:SendGameMessage(player, worldMaster, 40279, MESSAGE_TYPE_SYSTEM, itemId, quality); + elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then + player:SendMessage(0x20, "", "[DEBUG] Server Error on adding item."); + elseif (invCheck == INV_ERROR_SUCCESS) then + player:GetItemPackage(INVENTORY_CURRENCY):removeItem(currency, price); + + if (currency == 1000001) then -- If Gil + -- You purchase for gil. + player:SendGameMessage(player, worldMaster, 25061, MESSAGE_TYPE_SYSTEM, itemId, quality, quantity, price); + + elseif (currency == 1000201 or currency == 1000202 or currency == 1000203) then -- If Grand Company seal + -- You exchange for . + player:SendGameMessage(player, worldMaster, 25275, MESSAGE_TYPE_SYSTEM, itemId, quality, quantity, price, player.gcCurrent); + + elseif (currency >= 1000101 and currency <= 1000123) then -- If Guild mark + -- You trade for . + player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, currency, 1, itemId, 1, price, quantity); + end + end + else + -- You do not have enough gil. (Should never see this) + player:SendGameMessage(player, worldMaster, 25065, MESSAGE_TYPE_SYSTEM); + end + return +end + + +function sellItem(player, itemId, quantity, quality, itemPrice, slot, currency) + local worldMaster = GetWorldMaster(); + local cost = quantity * itemPrice; + + player:GetItemPackage(INVENTORY_CURRENCY):AddItem(currency, cost); + player:GetItemPackage(INVENTORY_NORMAL):RemoveItemAtSlot(slot, quantity); + -- You sell for gil. + player:SendGameMessage(player, worldMaster, 25075, MESSAGE_TYPE_SYSTEM, itemId, quality, quantity, cost); +end \ No newline at end of file diff --git a/Map Server/Actors/Chara/Player/Player.cs b/Map Server/Actors/Chara/Player/Player.cs index 53867d3e..caf49ba0 100644 --- a/Map Server/Actors/Chara/Player/Player.cs +++ b/Map Server/Actors/Chara/Player/Player.cs @@ -920,6 +920,14 @@ namespace Meteor.Map.Actors QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1)); } + public void ChangeMusic(ushort musicId, ushort musicTrackMode) + { + QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, musicTrackMode)); + } + + + + public void SendMountAppearance() { if (mountState == 1)