diff --git a/Data/scripts/base/chara/npc/object/MarketEntrance.lua b/Data/scripts/base/chara/npc/object/MarketEntrance.lua index 5c0269b6..e157a777 100644 --- a/Data/scripts/base/chara/npc/object/MarketEntrance.lua +++ b/Data/scripts/base/chara/npc/object/MarketEntrance.lua @@ -4,20 +4,149 @@ MarketEntrance Script Functions: -eventPushChoiceAreaOrQuest(gcLeaderPlaceName[Fronds, etc], showMarketWards/Houses (must be 0xc1a), gcHQPlaceName, anotherPlaceName, showItemSearchCounter, stopSearchingItemId) - -eventPushStepPrvMarket(?, ?, ?) - +Parameters mostly rely on the xtx_placeName sheet for its strings. + +eventPushChoiceAreaOrQuest( + exitPlaceName[Fronds, etc], - Retail only showed it when inside a Market Ward/Office Set to 0 to hide the menu. + showMarketWards/Houses - If > 0, client script adds nation-specific Mercentile Houses as well. + gcHQPlaceName, - Set to the placeName id for the Grand Company office of that city + questAreaName, - Set to the placeName id of applicable quest instance, ex. Sailors Ward. + showItemSearchCounter, - If true, shows the Item Search menu + itemSearchId - If > 0 & showItemSearchCounter = true, displays the item name with a "Stop Searching" +) +eventPushStepPrvMarket( + staringWard, - Sets the starting placeName id + wardCount, - Valid number 1-20. Sets the amount of market ward entries. Client continues sequentially from startingWard id. + excludeWard - Hides the ward in the list that matches the id. Use on the ward you're currently in. +) + + +MarketEntrance City TriggerBox details +Limsa - !warp 230 -416.5 40 446 ActorClass Id = 1090238 + bgObj Id - [0xB3B] 2875 + Layout Id - [0x79 ] 121 (0x29d90001) + Condition - in + reactName - dwti - Not a typo compared to the other cities +Gridania - !warp 206 -192.57 23.48 -1407.58 ActorClass Id = 1090264 + + bgObj Id - [0xCFA] 3322 + Layout Id - [0x141] 321 (0x29b00001) + Condition - in + reactName - dtwi +Ul'dah - !warp 175 -235 189 50.5 ActorClass Id = 1500394 + bgObj Id - [0x102F] 4143 + Layout Id - [0x1A5] 421 (0x615a0001) + Condition - in + reactName - dtwi --]] require ("global") -local MARKETWARD_ENTRANCE = {-201.0, 0.0, -160.0, 1.5}; - function init(npc) return false, false, 0, 0; end + +CITY_INFO = { -- wardPlaceName, exitPlaceName, gcHQPlaceName, questAreaName, wardListStart, wardListCount + {1093, 1087, 1512, 1091, 1261, 20}, -- Limsa + {2099, 2091, 2526, 2095, 2261, 20}, -- Gridania + {3098, 3091, 3514, 3095, 3261, 20}, -- Ul'dah +} + +-- TO-DO: Add some X/Z pos jitter to Entrances/Exits when called +MARKETWARD_ENTRANCE = { + {134, 160, 0, 135}, -- Limsa Market + {160, 160, 0, 138}, -- Gridania Market + {180, 160, 0, 185} -- Ul'dah Market +} + +MARKETWARD_EXIT = { + {230, -420, 41, 435, -3.14}, -- Educated guess for Limsa, need video reference to confirm + {206, -180, 22, -1408, 1.5}, + {175, -210, 190, 25, 0.65} +} + +GC_ENTRANCE = { + [1512] = {232, 160, 0, -155}, -- Maelstrom Command + [2526] = {234, 160, 0, -155}, -- Adders' Nest + [3514] = {233, 160, 0, -155} -- Hall of Flames +} + +city = { + [1090238] = 1, -- Limsa Market Ward Entrance + [1090264] = 2, -- Gridania Market Ward Entrance + [1090265] = 3, -- Ul'dah Market Ward Entrance + [1500392] = 1, -- Limsa : M'septha + [1500393] = 2, -- Gridania : Torsefers + [1500394] = 3, -- Ul'dah : Edine +} + + + function onEventStarted(player, npc, triggerName) - callClientFunction(player, "eventPushChoiceAreaOrQuest", 0xc13, 0xc1a, 0xdba, 0, true, 1); + + local npcCity = city[npc:GetActorClassId()] or 1; + local wardPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese + local exitPlaceName = CITY_INFO[npcCity][2]; -- Central Limsa Lominsa / Heartstream / The Fronds + local gcHQPlaceName = CITY_INFO[npcCity][3]; -- Maelstrom Command / Adders' Nest / Hall of Flames + local questAreaName = 0; --CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward + local wardListStart = CITY_INFO[npcCity][5]; -- Starting id for the market wards + local wardListCount = CITY_INFO[npcCity][6]; -- Amount of wards in the list + local showItemSearchCounter = false; + local itemSearchId = 11000125; + + local worldMaster = GetWorldMaster(); + local pos = player:GetPos(); + local currZone = pos[4]; + + if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then + exitPlaceName = 0; -- If in city, hide city menu option + elseif (currZone == 232 or currZone == 234 or currZone == 233) then + gcHQPlaceName = 0; -- If in GC Office, hide office menu option + end + + choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); + + while (true) do + + if choice == wardPlaceName then -- Market Wards + wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0); + + if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then + player:SendGameMessage(player, worldMaster, 60004, 0x20, wardSelect); + warp = MARKETWARD_ENTRANCE[npcCity]; + playerRot = math.random(-3.14, 3.14); + wait(1); + GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], playerRot); + player:SendDataPacket("attention", worldMaster, "", 60003, wardSelect); + -- Temp: Pop-up display after Ward zone-in. Client should automate this with PrivateArea's properly setup + + break; + end + + elseif (choice == 1519 or choice == 2534 or choice == 3533) then -- Mercentile Wards + player:SendMessage(0x20, "", "[MarketEntrance] DEBUG: "..choice); + elseif (choice == 1512 or choice == 2526 or choice == 3514) then -- GC Office + warp = GC_ENTRANCE[choice]; + player:SendGameMessage(player, worldMaster, 60004, 0x20, choice); + wait(1); + GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], math.pi); + break; + elseif (choice == 1087 or choice == 2091 or choice == 3091) then -- Exiting to City + player:SendGameMessage(player, worldMaster, 60004, 0x20, choice); + warp = MARKETWARD_EXIT[npcCity]; + wait(1); + GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]); + break; + elseif (choice == 0 or choice == -3) then -- Menu Closed + break; + end + + choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); + + end + player:EndEvent(); + end \ No newline at end of file diff --git a/Data/scripts/commands/CraftCommand.lua b/Data/scripts/commands/CraftCommand.lua index 033385f4..5204b809 100644 --- a/Data/scripts/commands/CraftCommand.lua +++ b/Data/scripts/commands/CraftCommand.lua @@ -413,7 +413,6 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ) local qltyDiff = math.random(0,2); if progress >= 100 then - player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8); -- "You create <#3 quantity> <#1 item> <#2 quality>." callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor); @@ -467,5 +466,5 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ) end end - return -1; -end \ No newline at end of file + return -1; +end diff --git a/Data/scripts/commands/DummyCommand.lua b/Data/scripts/commands/DummyCommand.lua index 6728b587..856bbe1f 100644 --- a/Data/scripts/commands/DummyCommand.lua +++ b/Data/scripts/commands/DummyCommand.lua @@ -125,8 +125,6 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg --callClientFunction(player, "delegateCommand", harvestJudge, "turnToTarget", commandActor, harvestType, nodeGrade); player:ChangeState(50); - - if harvestType == commandMine then player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, nodeGrade); @@ -154,8 +152,7 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg -- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining chosenCommand, currentPower = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike - if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end - + if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end if chosenCommand == 22702 then -- Cancel. harvestAttempts = harvestAttempts - 1; @@ -170,14 +167,11 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg break; elseif chosenCommand == 22703 then -- Strike. - player:PlayAnimation(minerAnim[math.random(1,3)]); - + player:PlayAnimation(minerAnim[math.random(1,3)]); nodeRemainder = nodeRemainder - 20; if nodeRemainder < 0 then nodeRemainder = 0; - end - - + end --player:SendGameMessage(harvestJudge, 25, MESSAGE_TYPE_SYSTEM, item, 4, 1); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType); @@ -199,7 +193,6 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg wait(2); break; end - elseif chosenCommand == 22710 then -- "Strike" Tutorial. SendTutorial(player, harvestJudge, 2); end @@ -246,5 +239,4 @@ function SendTutorial(player, harvestJudge, id) wait(3); player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM); end - end \ No newline at end of file diff --git a/Data/scripts/unique/sea0Town01a/PopulaceShopSalesman/jossy.lua b/Data/scripts/unique/sea0Town01a/PopulaceShopSalesman/jossy.lua deleted file mode 100644 index b0781436..00000000 --- a/Data/scripts/unique/sea0Town01a/PopulaceShopSalesman/jossy.lua +++ /dev/null @@ -1,6 +0,0 @@ - -shopInfo = { -welcomeText = 94, -shopPack = 0x67, -shopCurrancy = nil -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/jemimi.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/jemimi.lua deleted file mode 100644 index ba2cb149..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/jemimi.lua +++ /dev/null @@ -1,6 +0,0 @@ - -shopInfo = { -welcomeText = 69, -shopPack = 3020, -tutorialId = 35 -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/norbettaux.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/norbettaux.lua deleted file mode 100644 index 50d75a8f..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/norbettaux.lua +++ /dev/null @@ -1,6 +0,0 @@ - -shopInfo = { -welcomeText = 64, -shopPack = 3021, -tutorialId = 34 -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/nortmoen.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/nortmoen.lua deleted file mode 100644 index 118e0824..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/nortmoen.lua +++ /dev/null @@ -1,6 +0,0 @@ - -shopInfo = { -welcomeText = 76, -shopPack = 3022, -tutorialId = 39 -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/pamisolaux.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/pamisolaux.lua deleted file mode 100644 index eac22408..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/pamisolaux.lua +++ /dev/null @@ -1,6 +0,0 @@ - -shopInfo = { -welcomeText = 54, -shopPack = 3019, -tutorialId = 32 -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/waeksatz.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/waeksatz.lua deleted file mode 100644 index d83094e0..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/waeksatz.lua +++ /dev/null @@ -1,5 +0,0 @@ - -shopInfo = { -welcomeText = 265, -shopPack = 3024 -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/wnhalki.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/wnhalki.lua deleted file mode 100644 index a5842c11..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/wnhalki.lua +++ /dev/null @@ -1,5 +0,0 @@ - -shopInfo = { -welcomeText = 111, -shopPack = 3003 -} \ No newline at end of file diff --git a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/zagylswerd.lua b/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/zagylswerd.lua deleted file mode 100644 index f03d0eb1..00000000 --- a/Data/scripts/unique/wil0Town01a/PopulaceShopSalesman/zagylswerd.lua +++ /dev/null @@ -1,5 +0,0 @@ - -shopInfo = { -welcomeText = 110, -shopPack = 3002 -} \ No newline at end of file diff --git a/Data/sql/gamedata_recipes.sql b/Data/sql/gamedata_recipes.sql index 44e7249e..ad731d30 100644 --- a/Data/sql/gamedata_recipes.sql +++ b/Data/sql/gamedata_recipes.sql @@ -17,7 +17,10 @@ CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET lati USE `ffxiv_server`; -- Dumping structure for table ffxiv_server.gamedata_recipes +<<<<<<< HEAD DROP TABLE IF EXISTS `gamedata_recipes`; +======= +>>>>>>> develop CREATE TABLE IF NOT EXISTS `gamedata_recipes` ( `id` int(4) NOT NULL AUTO_INCREMENT, `craftedItem` int(11) NOT NULL, @@ -46,6 +49,7 @@ CREATE TABLE IF NOT EXISTS `gamedata_recipes` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; +<<<<<<< HEAD -- Dumping data for table ffxiv_server.gamedata_recipes: ~5,410 rows (approximately) /*!40000 ALTER TABLE `gamedata_recipes` DISABLE KEYS */; INSERT INTO `gamedata_recipes` (`id`, `craftedItem`, `craftedQuantity`, `job`, `level`, `dated`, `kind`, `crystal0ID`, `crystal0Quantity`, `crystal1ID`, `crystal1Quantity`, `facilities`, `material0`, `material1`, `material2`, `material3`, `material4`, `material5`, `material6`, `material7`, `subSkill0Job`, `subSkill0Level`, `subSkill1Job`, `subSkill1Level`) VALUES @@ -5435,6 +5439,9 @@ INSERT INTO `gamedata_recipes` (`id`, `craftedItem`, `craftedQuantity`, `job`, ` (5384, 3010023, 2, 'H', 6, 0, 'CC', 1000009, 2, 0, 0, NULL, 3011012, 3011016, 3011501, 3010018, 3011515, 3011517, 0, 0, NULL, NULL, NULL, NULL); /*!40000 ALTER TABLE `gamedata_recipes` ENABLE KEYS */; +======= +-- Data exporting was unselected. +>>>>>>> develop /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/Map Server/Actors/Chara/Player/Player.cs b/Map Server/Actors/Chara/Player/Player.cs index 2e084317..3d932e9a 100644 --- a/Map Server/Actors/Chara/Player/Player.cs +++ b/Map Server/Actors/Chara/Player/Player.cs @@ -2732,7 +2732,7 @@ namespace Meteor.Map.Actors private void EquipAbilitiesAtLevel(byte classId, short level, List actionList = null) { //If there's any abilites that unlocks at this level, equip them. - List commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, GetLevel()); + List commandIds = Server.GetWorldManager().GetBattleCommandIdByLevel(classId, level); foreach (ushort commandId in commandIds) { EquipAbilityInFirstOpenSlot(classId, commandId, false); diff --git a/Map Server/Actors/EventList.cs b/Map Server/Actors/EventList.cs index 041ee53f..e654f779 100644 --- a/Map Server/Actors/EventList.cs +++ b/Map Server/Actors/EventList.cs @@ -79,8 +79,10 @@ namespace Meteor.Map.actors public class PushBoxEventCondition { + public uint bgObj; + public uint layout; public string conditionName = ""; - public float size = 30.0f; + public string reactName = ""; public bool outwards = false; public bool silent = true; } diff --git a/Map Server/Packets/Send/Actor/Events/SetPushEventConditionWithTriggerBox.cs b/Map Server/Packets/Send/Actor/Events/SetPushEventConditionWithTriggerBox.cs index 96b07236..f0644d21 100644 --- a/Map Server/Packets/Send/Actor/Events/SetPushEventConditionWithTriggerBox.cs +++ b/Map Server/Packets/Send/Actor/Events/SetPushEventConditionWithTriggerBox.cs @@ -26,7 +26,7 @@ using System.Text; using Meteor.Common; -namespace Meteor.Map.packets.send.actor.events +namespace Meteor.Map.packets.send.actor.events { class SetPushEventConditionWithTriggerBox { @@ -41,18 +41,20 @@ namespace Meteor.Map.packets.send.actor.events { using (BinaryWriter binWriter = new BinaryWriter(mem)) { - binWriter.Write((UInt32)condition.size); - binWriter.Write((UInt32)0x1A5); - binWriter.Write((UInt32)4); - binWriter.Seek(8, SeekOrigin.Current); + binWriter.Write((UInt32)condition.bgObj); // bgObj + binWriter.Write((UInt32)condition.layout); // Layout + binWriter.Write((UInt32)4); // Actor? Always 4 in 1.23 + binWriter.Seek(8, SeekOrigin.Current); // Unknowns binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x0)); //If == 0x10, Inverted Bounding Box binWriter.Write((Byte)3); binWriter.Write((Byte)(condition.silent ? 0x1 : 0x0)); //Silent Trigger; - binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName)); + binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(condition.conditionName)); + binWriter.Seek(55, SeekOrigin.Begin); + binWriter.Write((Byte)0); // Unknown + binWriter.Write(Encoding.ASCII.GetBytes(condition.reactName), 0, Encoding.ASCII.GetByteCount(condition.reactName) >= 0x04 ? 0x04 : Encoding.ASCII.GetByteCount(condition.reactName)); } } - return new SubPacket(OPCODE, sourceActorId, data); } } -} +} \ No newline at end of file