diff --git a/FFXIVClassic Common Class Lib/Properties/AssemblyInfo.cs b/FFXIVClassic Common Class Lib/Properties/AssemblyInfo.cs index 79f8aa4e..0d9a897b 100644 --- a/FFXIVClassic Common Class Lib/Properties/AssemblyInfo.cs +++ b/FFXIVClassic Common Class Lib/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/FFXIVClassic Common Class Lib/Sql.cs b/FFXIVClassic Common Class Lib/Sql.cs index 2de92bc0..ace44be3 100644 --- a/FFXIVClassic Common Class Lib/Sql.cs +++ b/FFXIVClassic Common Class Lib/Sql.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MySql.Data.MySqlClient; -using NLog; -using System.Data; -using System.Data.Common; +using NLog; namespace FFXIVClassic.Common { diff --git a/FFXIVClassic Common Class Lib/SubPacket.cs b/FFXIVClassic Common Class Lib/SubPacket.cs index 585e5c6b..1f9e38cb 100644 --- a/FFXIVClassic Common Class Lib/SubPacket.cs +++ b/FFXIVClassic Common Class Lib/SubPacket.cs @@ -1,6 +1,5 @@ using System; using System.Runtime.InteropServices; -using FFXIVClassic.Common; using NLog; using NLog.Targets; diff --git a/FFXIVClassic Common Class Lib/Utils.cs b/FFXIVClassic Common Class Lib/Utils.cs index 3465b5ab..a0c05140 100644 --- a/FFXIVClassic Common Class Lib/Utils.cs +++ b/FFXIVClassic Common Class Lib/Utils.cs @@ -145,6 +145,12 @@ namespace FFXIVClassic.Common return input; } + public static ushort SwapEndian(ushort input) + { + return (ushort)(((input << 8) & 0xff00) | + ((input >> 8) & 0x00ff)); + } + public static uint MurmurHash2(string key, uint seed) { // 'm' and 'r' are mixing constants generated offline. diff --git a/FFXIVClassic Lobby Server/Database.cs b/FFXIVClassic Lobby Server/Database.cs index cd17e498..1ef82b66 100644 --- a/FFXIVClassic Lobby Server/Database.cs +++ b/FFXIVClassic Lobby Server/Database.cs @@ -2,9 +2,7 @@ using MySql.Data.MySqlClient; using System; using System.Collections.Generic; -using System.Linq; using FFXIVClassic_Lobby_Server.utils; -using FFXIVClassic.Common; namespace FFXIVClassic_Lobby_Server { diff --git a/FFXIVClassic Lobby Server/Program.cs b/FFXIVClassic Lobby Server/Program.cs index 2d14bb84..a5ce58fe 100644 --- a/FFXIVClassic Lobby Server/Program.cs +++ b/FFXIVClassic Lobby Server/Program.cs @@ -2,8 +2,6 @@ using System.Diagnostics; using System.Threading; using MySql.Data.MySqlClient; -using System.Reflection; -using FFXIVClassic.Common; using NLog; namespace FFXIVClassic_Lobby_Server { diff --git a/FFXIVClassic Lobby Server/Server.cs b/FFXIVClassic Lobby Server/Server.cs index 93cd8639..408ffa89 100644 --- a/FFXIVClassic Lobby Server/Server.cs +++ b/FFXIVClassic Lobby Server/Server.cs @@ -5,7 +5,6 @@ using System.Net.Sockets; using System.Threading; using FFXIVClassic.Common; -using NLog; namespace FFXIVClassic_Lobby_Server { diff --git a/FFXIVClassic Map Server/CommandProcessor.cs b/FFXIVClassic Map Server/CommandProcessor.cs index 447bfd57..93e80cd3 100644 --- a/FFXIVClassic Map Server/CommandProcessor.cs +++ b/FFXIVClassic Map Server/CommandProcessor.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; using System.IO; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.lua; using FFXIVClassic_Map_Server.Actors; diff --git a/FFXIVClassic Map Server/ConfigConstants.cs b/FFXIVClassic Map Server/ConfigConstants.cs index 908914cb..2c225430 100644 --- a/FFXIVClassic Map Server/ConfigConstants.cs +++ b/FFXIVClassic Map Server/ConfigConstants.cs @@ -1,9 +1,6 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; using System.IO; -using System.Net.Sockets; -using MoonSharp.Interpreter.Interop; using System.Linq; using System.Net; diff --git a/FFXIVClassic Map Server/Database.cs b/FFXIVClassic Map Server/Database.cs index a2a2d7f7..87c5e054 100644 --- a/FFXIVClassic Map Server/Database.cs +++ b/FFXIVClassic Map Server/Database.cs @@ -12,7 +12,6 @@ using FFXIVClassic_Map_Server.packets.receive.supportdesk; using FFXIVClassic_Map_Server.actors.chara.npc; using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.actors.chara; namespace FFXIVClassic_Map_Server { @@ -1111,14 +1110,14 @@ namespace FFXIVClassic_Map_Server } } - player.GetInventory(Inventory.NORMAL).InitList(GetInventory(player, 0, Inventory.NORMAL)); - player.GetInventory(Inventory.KEYITEMS).InitList(GetInventory(player, 0, Inventory.KEYITEMS)); - player.GetInventory(Inventory.CURRENCY_CRYSTALS).InitList(GetInventory(player, 0, Inventory.CURRENCY_CRYSTALS)); - player.GetInventory(Inventory.BAZAAR).InitList(GetInventory(player, 0, Inventory.BAZAAR)); - player.GetInventory(Inventory.MELDREQUEST).InitList(GetInventory(player, 0, Inventory.MELDREQUEST)); - player.GetInventory(Inventory.LOOT).InitList(GetInventory(player, 0, Inventory.LOOT)); + player.GetItemPackage(ItemPackage.NORMAL).InitList(GetItemPackage(player, 0, ItemPackage.NORMAL)); + player.GetItemPackage(ItemPackage.KEYITEMS).InitList(GetItemPackage(player, 0, ItemPackage.KEYITEMS)); + player.GetItemPackage(ItemPackage.CURRENCY_CRYSTALS).InitList(GetItemPackage(player, 0, ItemPackage.CURRENCY_CRYSTALS)); + player.GetItemPackage(ItemPackage.BAZAAR).InitList(GetBazaar(player)); + player.GetItemPackage(ItemPackage.MELDREQUEST).InitList(GetItemPackage(player, 0, ItemPackage.MELDREQUEST)); + player.GetItemPackage(ItemPackage.LOOT).InitList(GetItemPackage(player, 0, ItemPackage.LOOT)); - player.GetEquipment().SetEquipment(GetEquipment(player, player.charaWork.parameterSave.state_mainSkill[0])); + player.GetEquipment().SetList(GetEquipment(player, player.charaWork.parameterSave.state_mainSkill[0])); } catch (MySqlException e) { @@ -1135,7 +1134,7 @@ namespace FFXIVClassic_Map_Server public static InventoryItem[] GetEquipment(Player player, ushort classId) { InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()]; - + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) { try @@ -1159,7 +1158,7 @@ namespace FFXIVClassic_Map_Server { ushort equipSlot = reader.GetUInt16(0); ulong uniqueItemId = reader.GetUInt16(1); - InventoryItem item = player.GetInventory(Inventory.NORMAL).GetItemByUniqueId(uniqueItemId); + InventoryItem item = player.GetItemPackage(ItemPackage.NORMAL).GetItemByUniqueId(uniqueItemId); equipment[equipSlot] = item; } } @@ -1196,7 +1195,7 @@ namespace FFXIVClassic_Map_Server MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@characterId", player.actorId); - cmd.Parameters.AddWithValue("@classId", (equipSlot == Equipment.SLOT_UNDERSHIRT || equipSlot == Equipment.SLOT_UNDERGARMENT) ? 0 : player.charaWork.parameterSave.state_mainSkill[0]); + cmd.Parameters.AddWithValue("@classId", (equipSlot == Player.SLOT_UNDERSHIRT || equipSlot == Player.SLOT_UNDERGARMENT) ? 0 : player.charaWork.parameterSave.state_mainSkill[0]); cmd.Parameters.AddWithValue("@equipSlot", equipSlot); cmd.Parameters.AddWithValue("@uniqueItemId", uniqueItemId); @@ -1309,7 +1308,7 @@ namespace FFXIVClassic_Map_Server conn.Open(); MySqlCommand cmd; string query = ""; - + query = @" DELETE FROM characters_hotbar WHERE characterId = @charId AND classId = @classId AND hotbarSlot = @hotbarSlot @@ -1435,7 +1434,8 @@ namespace FFXIVClassic_Map_Server } return slot; } - public static List GetInventory(Player player, uint slotOffset, uint type) + + public static List GetItemPackage(Player player, uint slotOffset, uint type) { List items = new List(); @@ -1449,19 +1449,29 @@ namespace FFXIVClassic_Map_Server SELECT serverItemId, itemId, + server_items_modifiers.id AS modifierId, quantity, - itemType, quality, + durability, - spiritBind, + mainQuality, + subQuality1, + subQuality2, + subQuality3, + param1, + param2, + param3, + spiritbind, materia1, materia2, materia3, materia4, materia5 + FROM characters_inventory INNER JOIN server_items ON serverItemId = server_items.id - WHERE characterId = @charId AND inventoryType = @type"; + LEFT JOIN server_items_modifiers ON server_items.id = server_items_modifiers.id + WHERE characterId = @charId AND itemPackage = @type"; MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@charId", player.actorId); @@ -1476,21 +1486,15 @@ namespace FFXIVClassic_Map_Server uint itemId = reader.GetUInt32("itemId"); int quantity = reader.GetInt32("quantity"); - byte itemType = reader.GetByte("itemType"); byte qualityNumber = reader.GetByte("quality"); - int durability = reader.GetInt32("durability"); - ushort spiritBind = reader.GetUInt16("spiritBind"); + bool hasModifier = !reader.IsDBNull(reader.GetOrdinal("modifierId")); + InventoryItem.ItemModifier modifier = null; - byte materia1 = reader.GetByte("materia1"); - byte materia2 = reader.GetByte("materia2"); - byte materia3 = reader.GetByte("materia3"); - byte materia4 = reader.GetByte("materia4"); - byte materia5 = reader.GetByte("materia5"); + if (hasModifier) + modifier = new InventoryItem.ItemModifier(reader); - InventoryItem item = new InventoryItem(uniqueId, itemId, quantity, itemType, qualityNumber, durability, spiritBind, materia1, materia2, materia3, materia4, materia5); - item.slot = slot; - slot++; + InventoryItem item = new InventoryItem(uniqueId, Server.GetItemGamedata(itemId), quantity, qualityNumber, modifier); items.Add(item); } } @@ -1508,6 +1512,247 @@ namespace FFXIVClassic_Map_Server return items; } + public static bool CreateBazaarEntry(Player owner, InventoryItem reward, InventoryItem seek, int rewardAmount, int seekAmount, byte bazaarMode, int sellPrice = 0) + { + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) + { + try + { + conn.Open(); + + string query = @" + INSERT INTO characters_inventory_bazaar + (characterId, rewardId, seekId, rewardAmount, seekAmount, bazaarMode, sellPrice) + VALUES + (@characterId, @rewardId, @seekId, @rewardAmount, @seekAmount, @bazaarMode, @sellPrice); + "; + + MySqlCommand cmd = new MySqlCommand(query, conn); + cmd.Parameters.AddWithValue("@characterId", owner.actorId); + cmd.Parameters.AddWithValue("@rewardId", reward.uniqueId); + cmd.Parameters.AddWithValue("@seekId", seek.uniqueId); + cmd.Parameters.AddWithValue("@rewardAmount", rewardAmount); + cmd.Parameters.AddWithValue("@seekAmount", seekAmount); + cmd.Parameters.AddWithValue("@bazaarMode", bazaarMode); + cmd.Parameters.AddWithValue("@sellPrice", sellPrice); + cmd.ExecuteNonQuery(); + } + catch (MySqlException e) + { + Program.Log.Error(e.ToString()); + return false; + } + finally + { + conn.Dispose(); + } + } + + return true; + } + + public static void ClearBazaarEntry(Player owner, InventoryItem reward) + { + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) + { + try + { + conn.Open(); + + string query = @" + DELETE FROM characters_inventory_bazaar + WHERE characterId = @charId and rewardId = @rewardId; + "; + + MySqlCommand cmd = new MySqlCommand(query, conn); + cmd.Parameters.AddWithValue("@charId", owner.actorId); + cmd.Parameters.AddWithValue("@rewardId", reward.uniqueId); + cmd.ExecuteNonQuery(); + + } + catch (MySqlException e) + { + Program.Log.Error(e.ToString()); + } + finally + { + conn.Dispose(); + } + } + } + + public static List GetBazaar(Player player) + { + List rewardItems = new List(); + Dictionary seekItems = new Dictionary(); + + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) + { + try + { + conn.Open(); + + string query = @" + SELECT + rewardId, + seekId, + rewardAmount, + bazaarMode, + sellPrice, + itemId, + server_items_modifiers.id AS modifierId, + quantity, + quality, + + durability, + mainQuality, + subQuality1, + subQuality2, + subQuality3, + param1, + param2, + param3, + spiritbind, + materia1, + materia2, + materia3, + materia4, + materia5 + + FROM characters_inventory_bazaar + INNER JOIN server_items ON rewardId = server_items.id + LEFT JOIN server_items_modifiers ON server_items.id = server_items_modifiers.id + WHERE characterId = @charaId"; + + MySqlCommand cmd = new MySqlCommand(query, conn); + cmd.Parameters.AddWithValue("@charaId", player.actorId); + + using (MySqlDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + { + uint uniqueId = reader.GetUInt32("rewardId"); + uint itemId = reader.GetUInt32("itemId"); + int quantity = reader.GetInt32("quantity"); + + byte qualityNumber = reader.GetByte("quality"); + + bool hasModifier = !reader.IsDBNull(reader.GetOrdinal("modifierId")); + InventoryItem.ItemModifier modifier = null; + + if (hasModifier) + modifier = new InventoryItem.ItemModifier(reader); + + InventoryItem item = new InventoryItem(uniqueId, Server.GetItemGamedata(itemId), quantity, qualityNumber, modifier); + + byte bazaarMode = reader.GetByte("bazaarMode"); + + if (bazaarMode == InventoryItem.TYPE_SINGLE || bazaarMode == InventoryItem.TYPE_MULTI || bazaarMode == InventoryItem.TYPE_STACK) + { + uint price = (uint)reader.GetInt32("sellPrice"); + item.SetDealing(bazaarMode, (int)price); + } + else + { + uint seekId = reader.GetUInt32("seekId"); + item.SetDealingAttached(bazaarMode, seekId); + } + + rewardItems.Add(item); + } + } + + string query2 = @" + SELECT + seekId, + seekAmount, + sellPrice, + itemId, + server_items_modifiers.id AS modifierId, + quantity, + quality, + + durability, + mainQuality, + subQuality1, + subQuality2, + subQuality3, + param1, + param2, + param3, + spiritbind, + materia1, + materia2, + materia3, + materia4, + materia5 + + FROM characters_inventory_bazaar + INNER JOIN server_items ON seekId = server_items.id + LEFT JOIN server_items_modifiers ON server_items.id = server_items_modifiers.id + WHERE characterId = @charaId and bazaarMode != 11 and bazaarMode != 12 and bazaarMode != 13"; + + MySqlCommand cmd2 = new MySqlCommand(query2, conn); + cmd2.Parameters.AddWithValue("@charaId", player.actorId); + + using (MySqlDataReader reader = cmd2.ExecuteReader()) + { + while (reader.Read()) + { + uint uniqueId = reader.GetUInt32("seekId"); + uint itemId = reader.GetUInt32("itemId"); + int quantity = reader.GetInt32("quantity"); + + byte qualityNumber = reader.GetByte("quality"); + + bool hasModifier = !reader.IsDBNull(reader.GetOrdinal("modifierId")); + InventoryItem.ItemModifier modifier = null; + + if (hasModifier) + modifier = new InventoryItem.ItemModifier(reader); + + InventoryItem item = new InventoryItem(uniqueId, Server.GetItemGamedata(itemId), quantity, qualityNumber, modifier); + item.SetHasAttached(true); + seekItems.Add(uniqueId, item); + } + } + } + catch (MySqlException e) + { + Program.Log.Error(e.ToString()); + } + finally + { + conn.Dispose(); + } + } + + List items = new List(); + ushort slot = 0; + foreach (InventoryItem reward in rewardItems) + { + if (reward.dealingMode == InventoryItem.DEALINGMODE_PRICED) + { + reward.slot = slot++; + items.Add(reward); + } + else + { + if (seekItems.ContainsKey(reward.GetAttached())) + { + reward.slot = slot++; + items.Add(reward); + InventoryItem seek = seekItems[reward.GetAttached()]; + seek.slot = slot++; + items.Add(seek); + reward.SetAttachedIndex(7, seek.slot); + } + } + } + + return items; + } + public static List GetInventory(Retainer retainer, uint type) { List items = new List(); @@ -1522,22 +1767,32 @@ namespace FFXIVClassic_Map_Server SELECT serverItemId, itemId, + server_items_modifiers.id AS modifierId, quantity, - itemType, quality, + durability, - spiritBind, + mainQuality, + subQuality1, + subQuality2, + subQuality3, + param1, + param2, + param3, + spiritbind, materia1, materia2, materia3, materia4, materia5 + FROM retainers_inventory INNER JOIN server_items ON serverItemId = server_items.id - WHERE retainerId = @retainerId AND inventoryType = @type"; + LEFT JOIN server_items_modifiers ON server_items.id = server_items_modifiers.id + WHERE retainerId = @retainerId AND itemPackage = @type"; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@retainerId", retainer.getRetainerId()); + cmd.Parameters.AddWithValue("@retainerId", retainer.GetRetainerId()); cmd.Parameters.AddWithValue("@type", type); ushort slot = 0; @@ -1549,21 +1804,15 @@ namespace FFXIVClassic_Map_Server uint itemId = reader.GetUInt32("itemId"); int quantity = reader.GetInt32("quantity"); - byte itemType = reader.GetByte("itemType"); byte qualityNumber = reader.GetByte("quality"); - int durability = reader.GetInt32("durability"); - ushort spiritBind = reader.GetUInt16("spiritBind"); + bool hasModifier = !reader.IsDBNull(reader.GetOrdinal("modifierId")); + InventoryItem.ItemModifier modifier = null; - byte materia1 = reader.GetByte("materia1"); - byte materia2 = reader.GetByte("materia2"); - byte materia3 = reader.GetByte("materia3"); - byte materia4 = reader.GetByte("materia4"); - byte materia5 = reader.GetByte("materia5"); + if (hasModifier) + modifier = new InventoryItem.ItemModifier(reader); - InventoryItem item = new InventoryItem(uniqueId, itemId, quantity, itemType, qualityNumber, durability, spiritBind, materia1, materia2, materia3, materia4, materia5); - item.slot = slot; - slot++; + InventoryItem item = new InventoryItem(uniqueId, Server.GetItemGamedata(itemId), quantity, qualityNumber, modifier); items.Add(item); } } @@ -1581,7 +1830,7 @@ namespace FFXIVClassic_Map_Server return items; } - public static InventoryItem CreateItem(uint itemId, int quantity, byte quality, byte itemType, int durability) + public static InventoryItem CreateItem(uint itemId, int quantity, byte quality, InventoryItem.ItemModifier modifiers = null) { InventoryItem insertedItem = null; @@ -1594,22 +1843,34 @@ namespace FFXIVClassic_Map_Server string query = @" - INSERT INTO server_items - (itemId, quality, itemType, durability) + INSERT INTO server_items + (itemId, quantity, quality) VALUES - (@itemId, @quality, @itemType, @durability); + (@itemId, @quantity, @quality); + "; + + string query2 = @" + INSERT INTO server_items_modifiers + (id, durability) + VALUES + (@id, @durability); "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@itemId", itemId); + cmd.Parameters.AddWithValue("@quantity", quantity); cmd.Parameters.AddWithValue("@quality", quality); - cmd.Parameters.AddWithValue("@itemType", itemType); - cmd.Parameters.AddWithValue("@durability", durability); - cmd.ExecuteNonQuery(); - insertedItem = new InventoryItem((uint)cmd.LastInsertedId, itemId, quantity, itemType, quality, durability, 0, 0, 0, 0, 0, 0); + insertedItem = new InventoryItem((uint)cmd.LastInsertedId, Server.GetItemGamedata(itemId), quantity, quality, modifiers); + + if (modifiers != null) + { + MySqlCommand cmd2 = new MySqlCommand(query2, conn); + cmd2.Parameters.AddWithValue("@id", insertedItem.uniqueId); + cmd2.Parameters.AddWithValue("@durability", modifiers.durability); + cmd2.ExecuteNonQuery(); + } } catch (MySqlException e) { @@ -1625,7 +1886,7 @@ namespace FFXIVClassic_Map_Server } public static void AddItem(Player player, InventoryItem addedItem, uint type) - { + { using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) { try @@ -1634,19 +1895,18 @@ namespace FFXIVClassic_Map_Server string query = @" INSERT INTO characters_inventory - (characterId, inventoryType, serverItemId, quantity) + (characterId, itemPackage, serverItemId) VALUES - (@charId, @inventoryType, @serverItemId, @quantity) + (@charId, @itemPackage, @serverItemId) "; MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@serverItemId", addedItem.uniqueId); cmd.Parameters.AddWithValue("@charId", player.actorId); - cmd.Parameters.AddWithValue("@inventoryType", type); - cmd.Parameters.AddWithValue("@quantity", addedItem.quantity); + cmd.Parameters.AddWithValue("@itemPackage", type); - cmd.ExecuteNonQuery(); + cmd.ExecuteNonQuery(); } catch (MySqlException e) { @@ -1659,7 +1919,9 @@ namespace FFXIVClassic_Map_Server } } - public static void SetQuantity(Player player, ulong serverItemId, int quantity) + + + public static void SetQuantity(ulong serverItemId, int quantity) { using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) { @@ -1668,13 +1930,12 @@ namespace FFXIVClassic_Map_Server conn.Open(); string query = @" - UPDATE characters_inventory + UPDATE server_items SET quantity = @quantity - WHERE characterId = @charId and serverItemId = @serverItemId; + WHERE id = @serverItemId; "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); cmd.Parameters.AddWithValue("@serverItemId", serverItemId); cmd.Parameters.AddWithValue("@quantity", quantity); cmd.ExecuteNonQuery(); @@ -1720,7 +1981,6 @@ namespace FFXIVClassic_Map_Server conn.Dispose(); } } - } public static void AddItem(Retainer retainer, InventoryItem addedItem, uint type) @@ -1733,17 +1993,16 @@ namespace FFXIVClassic_Map_Server string query = @" INSERT INTO retainers_inventory - (retainerId, inventoryType, serverItemId, quantity) + (retainerId, itemPackage, serverItemId) VALUES - (@retainerId, @inventoryType, @serverItemId, @quantity) + (@retainerId, @itemPackage, @serverItemId) "; MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@serverItemId", addedItem.uniqueId); - cmd.Parameters.AddWithValue("@retainerId", retainer.getRetainerId()); - cmd.Parameters.AddWithValue("@inventoryType", type); - cmd.Parameters.AddWithValue("@quantity", addedItem.quantity); + cmd.Parameters.AddWithValue("@retainerId", retainer.GetRetainerId()); + cmd.Parameters.AddWithValue("@itemPackage", type); cmd.ExecuteNonQuery(); } @@ -1758,39 +2017,6 @@ namespace FFXIVClassic_Map_Server } } - public static void SetQuantity(Retainer retainer, ulong serverItemId, int quantity) - { - using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) - { - try - { - conn.Open(); - - string query = @" - UPDATE retainers_inventory - SET quantity = @quantity - WHERE retainerId = @retainerId and serverItemId = @serverItemId; - "; - - MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@retainerId", retainer.getRetainerId()); - cmd.Parameters.AddWithValue("@serverItemId", serverItemId); - cmd.Parameters.AddWithValue("@quantity", quantity); - cmd.ExecuteNonQuery(); - - } - catch (MySqlException e) - { - Program.Log.Error(e.ToString()); - } - finally - { - conn.Dispose(); - } - } - - } - public static void RemoveItem(Retainer retainer, ulong serverItemId) { using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) @@ -1805,7 +2031,7 @@ namespace FFXIVClassic_Map_Server "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@retainerId", retainer.getRetainerId()); + cmd.Parameters.AddWithValue("@retainerId", retainer.GetRetainerId()); cmd.Parameters.AddWithValue("@serverItemId", serverItemId); cmd.ExecuteNonQuery(); @@ -1908,6 +2134,45 @@ namespace FFXIVClassic_Map_Server return cheevosPacket.BuildPacket(player.actorId); } + + public static SubPacket GetAchievementProgress(Player player, uint achievementId) + { + uint progress = 0, progressFlags = 0; + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) + { + try + { + conn.Open(); + + string query = @" + SELECT progress, progressFlags + FROM characters_achievements + WHERE characterId = @charId AND achievementId = @achievementId"; + + MySqlCommand cmd = new MySqlCommand(query, conn); + cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@achievementId", achievementId); + using (MySqlDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + { + progress = reader.GetUInt32(0); + progressFlags = reader.GetUInt32(1); + } + } + } + catch (MySqlException e) + { + Program.Log.Error(e.ToString()); + } + finally + { + conn.Dispose(); + } + } + return SendAchievementRatePacket.BuildPacket(player.actorId, achievementId, progress, progressFlags); + } + public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest) { bool success = false; @@ -2645,7 +2910,7 @@ namespace FFXIVClassic_Map_Server MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@charaId", player.actorId); - cmd.Parameters.AddWithValue("@retainerIndex", retainerIndex-1); + cmd.Parameters.AddWithValue("@retainerIndex", retainerIndex - 1); using (MySqlDataReader reader = cmd.ExecuteReader()) { @@ -2677,5 +2942,85 @@ namespace FFXIVClassic_Map_Server } } + public static void PlayerCharacterUpdateClassLevel(Player player, byte classId, short level) + { + string query; + MySqlCommand cmd; + + string[] classNames = { + "", + "", + "pug", + "gla", + "mrd", + "", + "", + "arc", + "lnc", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "thm", + "cnj", + "", + "", + "", + "", + "", + "crp", + "bsm", + "arm", + "gsm", + "ltw", + "wvr", + "alc", + "cul", + "", + "", + "min", + "btn", + "fsh" + }; + + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) + { + try + { + conn.Open(); + + query = String.Format(@" + UPDATE characters_class_levels + SET + {0}=@level + WHERE + characterId = @characterId", classNames[classId]); + + cmd = new MySqlCommand(query, conn); + cmd.Parameters.AddWithValue("@level", level); + cmd.Parameters.AddWithValue("@characterId", player.actorId); + + cmd.ExecuteNonQuery(); + } + catch (MySqlException e) + { + Program.Log.Error(e.ToString()); + } + finally + { + conn.Dispose(); + } + } + } + } } diff --git a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj index 63fe6bca..fc0432bd 100644 --- a/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj +++ b/FFXIVClassic Map Server/FFXIVClassic Map Server.csproj @@ -139,8 +139,8 @@ - - + + @@ -150,23 +150,25 @@ + - - - - - - + + + + + + + @@ -195,6 +197,7 @@ + @@ -202,6 +205,7 @@ + @@ -237,9 +241,6 @@ - - - @@ -251,14 +252,17 @@ - + + + + + - @@ -361,6 +365,7 @@ + diff --git a/FFXIVClassic Map Server/PacketProcessor.cs b/FFXIVClassic Map Server/PacketProcessor.cs index e0ebcbdf..8360e652 100644 --- a/FFXIVClassic Map Server/PacketProcessor.cs +++ b/FFXIVClassic Map Server/PacketProcessor.cs @@ -1,9 +1,6 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; -using System.IO; -using System.Text; using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.packets.receive; using FFXIVClassic_Map_Server.packets.send; @@ -88,6 +85,11 @@ namespace FFXIVClassic_Map_Server PartySyncPacket partySyncPacket = new PartySyncPacket(subpacket.data); Server.GetWorldManager().PartyMemberListRecieved(partySyncPacket); break; + //World Server - Linkshell Creation Result + case 0x1025: + LinkshellResultPacket lsResult = new LinkshellResultPacket(subpacket.data); + LuaEngine.GetInstance().OnSignal("ls_result", lsResult.resultCode); + break; //Ping case 0x0001: //subpacket.DebugPrintSubPacket(); @@ -176,11 +178,6 @@ namespace FFXIVClassic_Map_Server Actor ownerActor = Server.GetStaticActors(eventStart.scriptOwnerActorID); - - session.GetActor().currentEventOwner = eventStart.scriptOwnerActorID; - session.GetActor().currentEventName = eventStart.triggerName; - - if (ownerActor == null) { //Is it your retainer? @@ -188,7 +185,7 @@ namespace FFXIVClassic_Map_Server ownerActor = session.GetActor().currentSpawnedRetainer; //Is it a instance actor? if (ownerActor == null) - ownerActor = session.GetActor().zone.FindActorInArea(session.GetActor().currentEventOwner); + ownerActor = session.GetActor().zone.FindActorInArea(eventStart.scriptOwnerActorID); if (ownerActor == null) { //Is it a Director? @@ -246,11 +243,27 @@ namespace FFXIVClassic_Map_Server if (paramRequest.paramName.Equals("charaWork/exp")) session.GetActor().SendCharaExpInfo(); break; + //Item Package Request + case 0x0131: + UpdateItemPackagePacket packageRequest = new UpdateItemPackagePacket(subpacket.data); + if (Server.GetWorldManager().GetActorInWorld(packageRequest.actorID) != null) + { + ((Character)Server.GetWorldManager().GetActorInWorld(packageRequest.actorID)).SendItemPackage(session.GetActor(), packageRequest.packageId); + break; + } + if (session.GetActor().GetSpawnedRetainer() != null && session.GetActor().GetSpawnedRetainer().actorId == packageRequest.actorID) + session.GetActor().GetSpawnedRetainer().SendItemPackage(session.GetActor(), packageRequest.packageId); + break; //Group Created Confirm case 0x0133: GroupCreatedPacket groupCreated = new GroupCreatedPacket(subpacket.data); Server.GetWorldManager().SendGroupInit(session, groupCreated.groupId); break; + //Achievement Progress Request + case 0x0135: + AchievementProgressRequestPacket progressRequest = new AchievementProgressRequestPacket(subpacket.data); + session.QueuePacket(Database.GetAchievementProgress(session.GetActor(), progressRequest.achievementId)); + break; /* RECRUITMENT */ //Start Recruiting case 0x01C3: diff --git a/FFXIVClassic Map Server/Program.cs b/FFXIVClassic Map Server/Program.cs index 1954b553..08549016 100644 --- a/FFXIVClassic Map Server/Program.cs +++ b/FFXIVClassic Map Server/Program.cs @@ -1,15 +1,7 @@ using System; using System.Diagnostics; -using System.Threading; -using System.Text; using MySql.Data.MySqlClient; -using System.Reflection; -using FFXIVClassic_Map_Server.dataobjects; -using FFXIVClassic.Common; using NLog; -using NLog.Targets; -using NLog.Targets.Wrappers; -using NLog.Config; namespace FFXIVClassic_Map_Server { diff --git a/FFXIVClassic Map Server/Server.cs b/FFXIVClassic Map Server/Server.cs index 97f201f5..3dcbf501 100644 --- a/FFXIVClassic Map Server/Server.cs +++ b/FFXIVClassic Map Server/Server.cs @@ -6,7 +6,6 @@ using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.lua; namespace FFXIVClassic_Map_Server { diff --git a/FFXIVClassic Map Server/WorldManager.cs b/FFXIVClassic Map Server/WorldManager.cs index e5ff47f4..f4ca38a6 100644 --- a/FFXIVClassic Map Server/WorldManager.cs +++ b/FFXIVClassic Map Server/WorldManager.cs @@ -1,30 +1,23 @@ -using FFXIVClassic_Map_Server; -using FFXIVClassic.Common; +using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.area; using FFXIVClassic_Map_Server.actors.chara.npc; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; -using FFXIVClassic_Map_Server.dataobjects.chara; using FFXIVClassic_Map_Server.lua; using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.packets.send.actor; -using FFXIVClassic_Map_Server.packets.send.login; using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.packets.send.group; using FFXIVClassic_Map_Server.packets.WorldPackets.Receive; using FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group; using System.Threading; -using System.Diagnostics; using FFXIVClassic_Map_Server.actors.director; using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.actors.chara; -using FFXIVClassic_Map_Server.Actors.Chara; +using FFXIVClassic_Map_Server.actors.chara.player; namespace FFXIVClassic_Map_Server { @@ -51,9 +44,12 @@ namespace FFXIVClassic_Map_Server private const int MILIS_LOOPTIME = 333; private Timer mZoneTimer; - //Content Groups + //Zone Server Groups public Dictionary mContentGroups = new Dictionary(); + public Dictionary mRelationGroups = new Dictionary(); + public Dictionary mTradeGroups = new Dictionary(); private Object groupLock = new Object(); + private Object tradeLock = new Object(); public ulong groupIndexId = 1; public WorldManager(Server server) @@ -1032,9 +1028,7 @@ namespace FFXIVClassic_Map_Server player.SendInstanceUpdate(); player.playerSession.LockUpdates(false); - - - + LuaEngine.GetInstance().CallLuaFunction(player, contentArea, "onZoneIn", true); } @@ -1185,6 +1179,484 @@ namespace FFXIVClassic_Map_Server } } + public RelationGroup CreateRelationGroup(Actor inviter, Actor invitee, ulong groupType) + { + lock (groupLock) + { + groupIndexId = groupIndexId | 0x0000000000000000; + + RelationGroup group = new RelationGroup(groupIndexId, inviter.actorId, invitee.actorId, 0, groupType); + mRelationGroups.Add(groupIndexId, group); + groupIndexId++; + + group.SendGroupPacketsAll(inviter.actorId, invitee.actorId); + + return group; + } + } + + public RelationGroup GetRelationGroup(uint actorId) + { + lock (groupLock) + { + foreach (RelationGroup relation in mRelationGroups.Values) + { + if (relation.GetHost() == actorId || relation.GetOther() == actorId) + return relation; + } + return null; + } + } + + public void DeleteRelationGroup(ulong groupid) + { + lock (groupLock) + { + if (mRelationGroups.ContainsKey(groupid)) + mRelationGroups.Remove(groupid); + } + } + + public TradeGroup CreateTradeGroup(Player inviter, Player invitee) + { + //Sanity Checks + if (inviter.Equals(invitee)) + { + inviter.SendGameMessage(GetActor(), 25043, 0x20, (object)invitee); //You cannot trade with yourself. + return null; + } + else if (GetTradeGroup(inviter.actorId) != null) + { + inviter.SendGameMessage(GetActor(), 25045, 0x20, (object)invitee); //You may only trade with one person at a time. + return null; + } + else if (GetTradeGroup(invitee.actorId) != null) + { + inviter.SendGameMessage(GetActor(), 25044, 0x20, (object)invitee); //Your target is unable to trade. + return null; + } + + //Create a trade group between these two players + lock (groupLock) + { + groupIndexId = groupIndexId | 0x0000000000000000; + + TradeGroup group = new TradeGroup(groupIndexId, inviter.actorId, invitee.actorId); + mTradeGroups.Add(groupIndexId, group); + groupIndexId++; + + group.SendGroupPacketsAll(inviter.actorId, invitee.actorId); + + inviter.SendGameMessage(GetActor(), 25101, 0x20, (object)invitee); //You request to trade with X + invitee.SendGameMessage(GetActor(), 25037, 0x20, (object)inviter); //X wishes to trade with you + + return group; + } + } + + public TradeGroup GetTradeGroup(uint actorId) + { + lock (groupLock) + { + foreach (TradeGroup group in mTradeGroups.Values) + { + if (group.GetHost() == actorId || group.GetOther() == actorId) + return (TradeGroup)group; + } + return null; + } + } + + public void DeleteTradeGroup(ulong groupid) + { + lock (groupLock) + { + if (mTradeGroups.ContainsKey(groupid)) + { + TradeGroup group = mTradeGroups[groupid]; + group.SendDeletePackets(group.GetHost(), group.GetOther()); + mTradeGroups.Remove(groupid); + } + } + } + + public void TradeTEST(Player player) + { + player.KickEventSpecial(Server.GetStaticActors("TradeExecuteCommand"), 0, "commandContent", null, null, null, 16, null, null, null, null, null); + } + + public void AcceptTrade(Player invitee) + { + TradeGroup group = GetTradeGroup(invitee.actorId); + + if (group == null) + { + invitee.SendMessage(0x20, "", "MASSIVE ERROR: No tradegroup found!!!"); + return; + } + + Player inviter = (Player)invitee.GetZone().FindActorInArea(group.GetHost()); + + //DeleteTradeGroup(group.groupIndex); + + inviter.StartTradeTransaction(invitee); + invitee.StartTradeTransaction(inviter); + + inviter.KickEventSpecial(Server.GetStaticActors("TradeExecuteCommand"), 0, "commandContent", null, null, null, 16, null, null, null, null, null); + invitee.KickEventSpecial(Server.GetStaticActors("TradeExecuteCommand"), 0, "commandContent", null, null, null, 16, null, null, null, null, null); + } + + public void CancelTradeTooFar(Player inviter) + { + TradeGroup group = GetTradeGroup(inviter.actorId); + + if (group == null) + { + inviter.SendMessage(0x20, "", "MASSIVE ERROR: No tradegroup found!!!"); + return; + } + + Player invitee = (Player)inviter.GetZone().FindActorInArea(group.GetOther()); + + inviter.SendGameMessage(GetActor(), 25042, 0x20); //You cancel the trade. + if (invitee != null) + invitee.SendGameMessage(GetActor(), 25042, 0x20); //The trade has been canceled. + + DeleteTradeGroup(group.groupIndex); + } + + public void CancelTrade(Player inviter) + { + TradeGroup group = GetTradeGroup(inviter.actorId); + + if (group == null) + { + inviter.SendMessage(0x20, "", "MASSIVE ERROR: No tradegroup found!!!"); + return; + } + + Player invitee = (Player)inviter.GetZone().FindActorInArea(group.GetOther()); + + inviter.SendGameMessage(GetActor(), 25041, 0x20); //You cancel the trade. + if (invitee != null) + invitee.SendGameMessage(GetActor(), 25040, 0x20); //The trade has been canceled. + + DeleteTradeGroup(group.groupIndex); + } + + public void RefuseTrade(Player invitee) + { + TradeGroup group = GetTradeGroup(invitee.actorId); + + if (group == null) + { + invitee.SendMessage(0x20, "", "MASSIVE ERROR: No tradegroup found!!!"); + return; + } + + Player inviter = (Player)invitee.GetZone().FindActorInArea(group.GetHost()); + + if (inviter != null) + inviter.SendGameMessage(GetActor(), 25038, 0x20); //Your trade request fails + + DeleteTradeGroup(group.groupIndex); + } + + public void CompleteTrade(Player p1, Player p2) + { + if (!p1.IsTradeAccepted() || !p2.IsTradeAccepted()) + return; + + TradeGroup group = GetTradeGroup(p1.actorId); + + if (group == null) + { + p1.SendMessage(0x20, "", "MASSIVE ERROR: No tradegroup found!!!"); + return; + } + + ReferencedItemPackage p1Offer = p1.GetTradeOfferings(); + ReferencedItemPackage p2Offer = p2.GetTradeOfferings(); + + int failCode = 0; + Player failurePlayerOffer = null; + Player failureCauser = null; + + //TODO Add full inventory check + + //Check items. If there is a failcode abort and set. + for (ushort i = 0; i < p1Offer.GetCapacity(); i++) + { + InventoryItem p1ItemToP2 = p1Offer.GetItemAtSlot(i); + InventoryItem p2ItemToP1 = p2Offer.GetItemAtSlot(i); + + int failCodeP1 = CheckIfCanTrade(p1, p2, p1ItemToP2); //P2's inv caused a failcode for P1 + int failCodeP2 = CheckIfCanTrade(p2, p1, p2ItemToP1); //P1's inv caused a failcode for P2 + + if (failCodeP1 != 0) + { + failCode = failCodeP1; + failurePlayerOffer = p1; + failureCauser = p2; + break; + } + + if (failCodeP2 != 0) + { + failCode = failCodeP2; + failurePlayerOffer = p2; + failureCauser = p1; + break; + } + } + + //Do we have a failcode? + switch (failCode) + { + case 1: + failurePlayerOffer.SendGameMessage(GetActor(), 25100, 0x20, (object)failureCauser); //Transaction failed. X inventory is either full or X can only hold one of the selected items. + failureCauser.SendGameMessage(GetActor(), 25100, 0x20, (object)failureCauser); //Transaction failed. X inventory is either full or X can only hold one of the selected items. + break; + case 2: + failurePlayerOffer.SendGameMessage(GetActor(), 25100, 0x20, (object)failureCauser); //Transaction failed. X inventory is either full or X can only hold one of the selected items. + failureCauser.SendGameMessage(GetActor(), 25103, 0x20); //Unable to complete transaction. You can only hold one of the selected items. + break; + case 3: + failurePlayerOffer.SendGameMessage(GetActor(), 25099, 0x20); //Unable to complete transaction. + failureCauser.SendGameMessage(GetActor(), 25104, 0x20); //Unable to complete transaction. You cannot receive the incoming payment. + break; + } + + //If all good, perform the swap. + if (failCode == 0) + { + lock (tradeLock) + { + for (ushort i = 0; i < p1Offer.GetCapacity(); i++) + { + InventoryItem p1ItemToP2 = p1Offer.GetItemAtSlot(i); + InventoryItem p2ItemToP1 = p2Offer.GetItemAtSlot(i); + + + //Transfer P1 -> P2 + if (p1ItemToP2 != null) + { + /* + if (p1ItemToP2.GetItemData().maxStack > 1) + { + p1.GetItemPackage(p1ItemToP2.itemPackage).RemoveItem(p1ItemToP2.itemId, p1ItemToP2.GetTradeQuantity(), p1ItemToP2.quality); + p2.GetItemPackage(p1ItemToP2.itemPackage).AddItem(p1ItemToP2.itemId, p1ItemToP2.GetTradeQuantity(), p1ItemToP2.quality); + } + else + { + p1.GetItemPackage(p1ItemToP2.itemPackage).RemoveItem(p1ItemToP2); + p2.GetItemPackage(p1ItemToP2.itemPackage).AddItem(p1ItemToP2); + } + */ + } + + //Transfer P2 -> P1 + if (p2ItemToP1 != null) + { + + /* + if (p2ItemToP1.GetItemData().maxStack > 1) + { + p2.GetItemPackage(p2ItemToP1.itemPackage).RemoveItem(p2ItemToP1.itemId, p2ItemToP1.GetTradeQuantity(), p2ItemToP1.quality); + p1.GetItemPackage(p2ItemToP1.itemPackage).AddItem(p2ItemToP1.itemId, p2ItemToP1.GetTradeQuantity(), p2ItemToP1.quality); + } + else + { + p2.GetItemPackage(p2ItemToP1.itemPackage).RemoveItem(p2ItemToP1); + p1.GetItemPackage(p2ItemToP1.itemPackage).AddItem(p2ItemToP1); + } + */ + } + + } + } + + p1.SendGameMessage(GetActor(), 25039, 0x20); //The trade is complete. + p2.SendGameMessage(GetActor(), 25039, 0x20); //The trade is complete. + } + + //Cleanup the trade and delete the tradegroup. + p1.FinishTradeTransaction(); + p2.FinishTradeTransaction(); + DeleteTradeGroup(group.groupIndex); + } + + private int CheckIfCanTrade(Player itemOwner, Player itemReceiver, InventoryItem item) + { + if (item == null) + return 0; + + //Check if their inventory can't hold all these things + if (false) + { + return 1; + } + //Check if they already have a unique + else if (item.GetItemData().isRare && itemReceiver.HasItem(item.itemId)) + { + return 2; + } + //Check if gil is max + else if (item.itemId == 100001 && item.dealingAttached3 + itemReceiver.GetCurrentGil() > item.GetItemData().maxStack) + { + return 3; + } + + return 0; + } + + public InventoryItem CreateItem(uint itemId, int amount, byte quality = 1, InventoryItem.ItemModifier modifiers = null) + { + return Database.CreateItem(itemId, amount, quality, modifiers); + } + + public bool BazaarBuyOperation(Player bazaar, Player buyer, InventoryItem itemToBuy, int quantity, int cost) + { + if (bazaar == null || buyer == null || itemToBuy == null) + return false; + + if (quantity <= 0) + return false; + + if (cost < 0) + return false; + + if (itemToBuy.GetBazaarMode() == InventoryItem.TYPE_SINGLE || itemToBuy.GetBazaarMode() == InventoryItem.TYPE_MULTI || itemToBuy.GetBazaarMode() == InventoryItem.TYPE_STACK) + { + itemToBuy.ChangeQuantity(-quantity); + buyer.AddItem(itemToBuy.itemId, quantity, itemToBuy.quality); + buyer.GetItemPackage(ItemPackage.CURRENCY_CRYSTALS).RemoveItem(1000001, cost); + } + + if (itemToBuy.quantity == 0) + Database.ClearBazaarEntry(bazaar, itemToBuy); + + bazaar.CheckBazaarFlags(); + + return true; + } + + public bool BazaarSellOperation(Player bazaar, Player buyer, InventoryItem reward, int rewardQuantity, InventoryItem seek, int seekQuantity) + { + if (bazaar == null || buyer == null || reward == null || seek == null) + return false; + + if (rewardQuantity <= 0 || seekQuantity <= 0) + return false; + + if (reward.GetBazaarMode() == InventoryItem.TYPE_SEEK_ITEM) + { + InventoryItem seekBazaar = bazaar.GetItemPackage(ItemPackage.BAZAAR).GetItemAttachedTo(reward); + bazaar.RemoveItem(reward, rewardQuantity); + bazaar.RemoveItem(seekBazaar, seekQuantity); + bazaar.AddItem(seekBazaar); + bazaar.AddItem(seek.itemId, seekQuantity, seek.quality); + + buyer.RemoveItem(seek, seekQuantity); + buyer.AddItem(reward); + } + + Database.ClearBazaarEntry(bazaar, reward); + + bazaar.CheckBazaarFlags(); + + return true; + } + + public void AddToBazaar(Player player, InventoryItem reward, InventoryItem seek, int rewardAmount, int seekAmount, byte bazaarMode) + { + bool succ = false; + + if (bazaarMode == InventoryItem.TYPE_SINGLE || bazaarMode == InventoryItem.TYPE_MULTI || bazaarMode == InventoryItem.TYPE_STACK) + succ = Database.CreateBazaarEntry(player, reward, seek, rewardAmount, 0, bazaarMode, seekAmount); + else + succ = Database.CreateBazaarEntry(player, reward, seek, rewardAmount, seekAmount, bazaarMode); + + if (succ) + { + if (bazaarMode != InventoryItem.TYPE_SINGLE && bazaarMode != InventoryItem.TYPE_MULTI && bazaarMode != InventoryItem.TYPE_STACK) + { + reward.SetDealingAttached(bazaarMode, seek.uniqueId); + seek.SetHasAttached(true); + player.GetItemPackage(ItemPackage.BAZAAR).StartSendUpdate(); + player.GetItemPackage(ItemPackage.BAZAAR).AddItem(reward); + player.GetItemPackage(ItemPackage.BAZAAR).AddItem(seek); + reward.SetAttachedIndex(ItemPackage.BAZAAR, seek.slot); + player.GetItemPackage(ItemPackage.BAZAAR).DoneSendUpdate(); + } + else + { + reward.SetDealing(bazaarMode, seekAmount); + player.GetItemPackage(ItemPackage.BAZAAR).StartSendUpdate(); + player.GetItemPackage(ItemPackage.BAZAAR).AddItem(reward); + player.GetItemPackage(ItemPackage.BAZAAR).DoneSendUpdate(); + } + + } + + player.CheckBazaarFlags(); + } + + + public void RemoveFromBazaar(Player player, InventoryItem rewardRef) + { + ushort attachedItemPackage = (ushort)((rewardRef.dealingAttached1 >> 16) & 0xFF); + ushort attachedSlot = (ushort) (rewardRef.dealingAttached1 & 0xFF); + + InventoryItem seekRef = rewardRef.IsSelling() ? null : player.GetItemPackage(attachedItemPackage).GetItemAtSlot(attachedSlot); + + Database.ClearBazaarEntry(player, rewardRef); + + player.GetItemPackage(ItemPackage.BAZAAR).RemoveItem(rewardRef); + + bool isSelling = rewardRef.IsSelling(); + rewardRef.SetNormal(); + + if (seekRef != null) + player.GetItemPackage(ItemPackage.BAZAAR).RemoveItem(seekRef); + + player.AddItem(rewardRef); + + if (!isSelling) + { + seekRef.SetNormal(); + player.AddItem(seekRef); + } + + player.CheckBazaarFlags(); + } + /* + public void TransactionBazaar(Player owner, Player other, InventoryItem reward, InventoryItem seek, int rewardAmount, int seekAmount) + { + Database.ClearBazaarEntry(owner, reward, seek); + + //Remove Bazaar Items from owner + owner.GetInventory(Inventory.BAZAAR).RemoveItem(reward); + owner.GetInventory(Inventory.BAZAAR).RemoveItem(seek); + + //Remove Seek item from other + if (seek.GetItemData().IsMoney()) + other.GetInventory(Inventory.CURRENCY_CRYSTALS).RemoveItem(seek.itemId, seekAmount); + else + other.GetInventory(Inventory.NORMAL).RemoveItem(seek.itemId, seekAmount); + + //Add reward to other, seek to owner + if (reward.GetItemData().IsMoney()) + other.GetInventory(Inventory.CURRENCY_CRYSTALS).AddItem(reward.itemId, rewardAmount); + else + other.GetInventory(Inventory.NORMAL).AddItem(reward); + + if (seek.GetItemData().IsMoney()) + owner.GetInventory(Inventory.CURRENCY_CRYSTALS).AddItem(seek.itemId, seekAmount); + else + other.GetInventory(Inventory.NORMAL).AddItem(seek); + }*/ + public bool SendGroupInit(Session session, ulong groupId) { if (mContentGroups.ContainsKey(groupId)) @@ -1192,6 +1664,11 @@ namespace FFXIVClassic_Map_Server mContentGroups[groupId].SendInitWorkValues(session); return true; } + else if (mTradeGroups.ContainsKey(groupId)) + { + mTradeGroups[groupId].SendInitWorkValues(session); + return true; + } return false; } diff --git a/FFXIVClassic Map Server/actors/Actor.cs b/FFXIVClassic Map Server/actors/Actor.cs index 0829204e..18e1b445 100644 --- a/FFXIVClassic Map Server/actors/Actor.cs +++ b/FFXIVClassic Map Server/actors/Actor.cs @@ -9,8 +9,6 @@ using System.Collections.Generic; using FFXIVClassic_Map_Server.actors.area; using System.Reflection; using System.ComponentModel; -using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.actors.chara; namespace FFXIVClassic_Map_Server.Actors diff --git a/FFXIVClassic Map Server/actors/area/Area.cs b/FFXIVClassic Map Server/actors/area/Area.cs index 1c16b1f5..69bdfda7 100644 --- a/FFXIVClassic Map Server/actors/area/Area.cs +++ b/FFXIVClassic Map Server/actors/area/Area.cs @@ -1,5 +1,4 @@ -using FFXIVClassic_Map_Server; -using FFXIVClassic.Common; +using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.area; using FFXIVClassic_Map_Server.actors.chara.npc; using FFXIVClassic_Map_Server.lua; diff --git a/FFXIVClassic Map Server/actors/area/PrivateArea.cs b/FFXIVClassic Map Server/actors/area/PrivateArea.cs index 1fe98393..680999ac 100644 --- a/FFXIVClassic Map Server/actors/area/PrivateArea.cs +++ b/FFXIVClassic Map Server/actors/area/PrivateArea.cs @@ -3,11 +3,7 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.lua; using FFXIVClassic_Map_Server.packets.send.actor; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.area { diff --git a/FFXIVClassic Map Server/actors/area/PrivateAreaContent.cs b/FFXIVClassic Map Server/actors/area/PrivateAreaContent.cs index d97b7efc..ba979387 100644 --- a/FFXIVClassic Map Server/actors/area/PrivateAreaContent.cs +++ b/FFXIVClassic Map Server/actors/area/PrivateAreaContent.cs @@ -1,16 +1,11 @@ using FFXIVClassic_Map_Server.actors.director; -using FFXIVClassic_Map_Server.actors.group; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.lua; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.area { - + class PrivateAreaContent : PrivateArea { private Director currentDirector; diff --git a/FFXIVClassic Map Server/actors/area/SpawnLocation.cs b/FFXIVClassic Map Server/actors/area/SpawnLocation.cs index 87c36f76..3321b4d2 100644 --- a/FFXIVClassic Map Server/actors/area/SpawnLocation.cs +++ b/FFXIVClassic Map Server/actors/area/SpawnLocation.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.area +namespace FFXIVClassic_Map_Server.actors.area { class SpawnLocation { diff --git a/FFXIVClassic Map Server/actors/area/Zone.cs b/FFXIVClassic Map Server/actors/area/Zone.cs index d198fff5..18c05389 100644 --- a/FFXIVClassic Map Server/actors/area/Zone.cs +++ b/FFXIVClassic Map Server/actors/area/Zone.cs @@ -1,17 +1,9 @@ -using FFXIVClassic_Map_Server; -using FFXIVClassic.Common; - -using FFXIVClassic_Map_Server.actors.chara.npc; +using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.lua; using FFXIVClassic_Map_Server.packets.send.actor; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; - using FFXIVClassic_Map_Server.actors.director; namespace FFXIVClassic_Map_Server.actors.area diff --git a/FFXIVClassic Map Server/actors/chara/Character.cs b/FFXIVClassic Map Server/actors/chara/Character.cs index 0be17a31..be3320a2 100644 --- a/FFXIVClassic Map Server/actors/chara/Character.cs +++ b/FFXIVClassic Map Server/actors/chara/Character.cs @@ -1,16 +1,17 @@  using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.area; +using FFXIVClassic_Map_Server.actors.chara.player; using FFXIVClassic_Map_Server.actors.group; using FFXIVClassic_Map_Server.Actors.Chara; +using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.packets.send.actor; +using FFXIVClassic_Map_Server.packets.send.actor.inventory; using FFXIVClassic_Map_Server.utils; using FFXIVClassic_Map_Server.actors.chara.ai; using System; using System.Collections.Generic; using FFXIVClassic_Map_Server.actors.chara; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.actors.chara.ai.state; using FFXIVClassic_Map_Server.actors.chara.ai.utils; using FFXIVClassic_Map_Server.actors.chara.npc; @@ -107,7 +108,7 @@ namespace FFXIVClassic_Map_Server.Actors public Group currentParty = null; public ContentGroup currentContentGroup = null; - + //public DateTime lastAiUpdate; public AIContainer aiContainer; @@ -131,8 +132,13 @@ namespace FFXIVClassic_Map_Server.Actors public float extraFloat; protected Dictionary tempVars = new Dictionary(); + + //Inventory + protected Dictionary itemPackages = new Dictionary(); + protected ReferencedItemPackage equipment; - public Character(uint actorID) : base(actorID) + public Character(uint actorID) + : base(actorID) { //Init timer array to "notimer" for (int i = 0; i < charaWork.statusShownTime.Length; i++) @@ -207,7 +213,7 @@ namespace FFXIVClassic_Map_Server.Actors } return propPacketUtil.Done(); } - + public void PlayAnimation(uint animId, bool onlySelf = false) { if (onlySelf) @@ -218,7 +224,7 @@ namespace FFXIVClassic_Map_Server.Actors else zone.BroadcastPacketAroundActor(this, PlayAnimationOnActorPacket.BuildPacket(actorId, animId)); } - + public void DoBattleAction(ushort commandId, uint animationId) { zone.BroadcastPacketAroundActor(this, CommandResultX00Packet.BuildPacket(actorId, animationId, commandId)); @@ -504,7 +510,7 @@ namespace FFXIVClassic_Map_Server.Actors } return false; } - + public virtual void Cast(uint spellId, uint targetId = 0) { if (aiContainer.CanChangeState()) @@ -1154,5 +1160,180 @@ namespace FFXIVClassic_Map_Server.Actors targetFind.FindWithinArea(this, ValidTarget.Party, TargetFindAOETarget.Self); return targetFind.GetTargets(); } + + #region Inventory + public void SendItemPackage(Player player, uint id) + { + if (!itemPackages.ContainsKey((ushort)id)) + return; + + player.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + itemPackages[(ushort)id].SendUpdate(player); + player.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + } + + public void AddItem(uint catalogID) + { + AddItem(catalogID, 1); + } + + public void AddItem(uint catalogID, int quantity) + { + AddItem(catalogID, quantity, 1); + } + + public void AddItem(uint catalogID, int quantity, byte quality) + { + ushort itemPackage = GetPackageForItem(catalogID); + if (itemPackages.ContainsKey(itemPackage)) + { + itemPackages[itemPackage].AddItem(catalogID, quantity, quality); + } + } + + public void AddItem(InventoryItem item) + { + ushort itemPackage = GetPackageForItem(item.GetItemData().catalogID); + if (itemPackages.ContainsKey(itemPackage)) + { + itemPackages[itemPackage].AddItem(item); + } + } + + public void SetItem(InventoryItem item, ushort itemPackage, ushort slot) + { + if (itemPackages.ContainsKey(itemPackage)) + { + itemPackages[itemPackage].SetItem(slot, item); + } + } + + public void MoveItem(InventoryItem item, ushort destinationPackage) + { + ushort sourcePackage = item.itemPackage; + + if (!itemPackages.ContainsKey(sourcePackage) && !itemPackages.ContainsKey(destinationPackage)) + return; + + itemPackages[sourcePackage].RemoveItem(item); + itemPackages[destinationPackage].AddItem(item); + } + + public void RemoveItem(uint catalogID) + { + RemoveItem(catalogID, 1); + } + + public void RemoveItem(uint catalogID, int quantity) + { + RemoveItem(catalogID, quantity, 1); + } + + public void RemoveItem(uint catalogID, int quantity, byte quality) + { + ushort itemPackage = GetPackageForItem(catalogID); + if (itemPackages.ContainsKey(itemPackage)) + { + itemPackages[itemPackage].RemoveItem(catalogID, quantity, quality); + } + } + + public void RemoveItemAtSlot(ushort itemPackage, ushort slot) + { + if (itemPackages.ContainsKey(itemPackage)) + { + itemPackages[itemPackage].RemoveItemAtSlot(slot); + } + } + + public void RemoveItem(InventoryItem item) + { + RemoveItem(item, 1); + } + + public void RemoveItem(InventoryItem item, int quantity) + { + if (itemPackages.ContainsKey(item.itemPackage)) + { + itemPackages[item.itemPackage].RemoveItem(item, quantity); + } + } + + public bool HasItem(uint catalogID) + { + return HasItem(catalogID, 1); + } + + public bool HasItem(uint catalogID, int minQuantity) + { + return HasItem(catalogID, minQuantity, 1); + } + + public bool HasItem(uint catalogID, int minQuantity, byte quality) + { + ushort itemPackage = GetPackageForItem(catalogID); + if (itemPackages.ContainsKey(itemPackage)) + { + return itemPackages[itemPackage].HasItem(catalogID, minQuantity, quality); + } + return false; + } + + public bool HasItem(InventoryItem item) + { + ushort itemPackage = GetPackageForItem(item.GetItemData().catalogID); + if (itemPackages.ContainsKey(itemPackage)) + { + //return itemPackages[itemPackage].HasItem(item); + return false; //TODO FIX + } + else + return false; + } + + + public InventoryItem GetItem(LuaUtils.ItemRefParam reference) + { + if (reference.actorId != actorId) + return null; + if (itemPackages.ContainsKey(reference.itemPackage)) + { + return itemPackages[reference.itemPackage].GetItemAtSlot(reference.slot); + } + return null; + } + + public ItemPackage GetItemPackage(ushort package) + { + if (itemPackages.ContainsKey(package)) + return itemPackages[package]; + else + return null; + } + + public ushort GetPackageForItem(uint catalogID) + { + ItemData data = Server.GetItemGamedata(catalogID); + + if (data == null) + return ItemPackage.NORMAL; + else + { + if (data.IsMoney()) + return ItemPackage.CURRENCY_CRYSTALS; + else if (data.IsImportant()) + return ItemPackage.KEYITEMS; + else + return ItemPackage.NORMAL; + } + } + + //public void removeItem(byUniqueId) + //public void removeItem(byUniqueId, quantity) + //public void removeItem(slot) + //public void removeItem(slot, quantity) + + #endregion + } } \ No newline at end of file diff --git a/FFXIVClassic Map Server/actors/chara/player/Inventory.cs b/FFXIVClassic Map Server/actors/chara/ItemPackage.cs similarity index 53% rename from FFXIVClassic Map Server/actors/chara/player/Inventory.cs rename to FFXIVClassic Map Server/actors/chara/ItemPackage.cs index a0d741d9..1309ea64 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Inventory.cs +++ b/FFXIVClassic Map Server/actors/chara/ItemPackage.cs @@ -1,625 +1,874 @@ -using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.chara.npc; -using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.dataobjects; -using FFXIVClassic_Map_Server.packets.send.actor.inventory; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; - -namespace FFXIVClassic_Map_Server.actors.chara.player -{ - class Inventory - { - public const ushort NORMAL = 0; //Max 0xC8 - public const ushort TRADE = 1; //Max 0x96 - public const ushort LOOT = 4; //Max 0xA - public const ushort MELDREQUEST = 5; //Max 0x04 - public const ushort BAZAAR = 7; //Max 0x0A - public const ushort CURRENCY_CRYSTALS = 99; //Max 0x140 - public const ushort KEYITEMS = 100; //Max 0x500 - public const ushort EQUIPMENT = 0x00FE; //Max 0x23 - public const ushort EQUIPMENT_OTHERPLAYER = 0x00F9; //Max 0x23 - - public enum INV_ERROR { - SUCCESS = 0, - INVENTORY_FULL, - ALREADY_HAS_UNIQUE, - SYSTEM_ERROR - }; - - private Character owner; - private ushort inventoryCapacity; - private ushort inventoryCode; - private bool isTemporary; - private InventoryItem[] list; - private bool[] isDirty; - - private int endOfListIndex = 0; - - public Inventory(Character ownerPlayer, ushort capacity, ushort code, bool temporary = false) - { - owner = ownerPlayer; - inventoryCapacity = capacity; - inventoryCode = code; - isTemporary = temporary; - list = new InventoryItem[capacity]; - isDirty = new bool[capacity]; - } - - #region Inventory Management - public void InitList(List itemsFromDB) - { - int i = 0; - foreach (InventoryItem item in itemsFromDB) - list[i++] = item; - endOfListIndex = i; - } - - public InventoryItem GetItemAtSlot(ushort slot) - { - if (slot < list.Length) - return list[slot]; - else - return null; - } - - public InventoryItem GetItemByUniqueId(ulong uniqueItemId) - { - for (int i = 0; i < endOfListIndex; i++) - { - InventoryItem item = list[i]; - - Debug.Assert(item != null, "Item slot was null!!!"); - - if (item.uniqueId == uniqueItemId) - return item; - } - return null; - } - - public InventoryItem GetItemByCatelogId(ulong catelogId) - { - for (int i = 0; i < endOfListIndex; i++) - { - InventoryItem item = list[i]; - - Debug.Assert(item != null, "Item slot was null!!!"); - - if (item.itemId == catelogId) - return item; - } - return null; - } - - - public int GetItemQuantity(uint itemId) - { - return GetItemQuantity(itemId, 1); - } - - public int GetItemQuantity(uint itemId, uint quality) - { - int count = 0; - - for (int i = endOfListIndex - 1; i >= 0; i--) - { - InventoryItem item = list[i]; - - if (item.itemId == itemId && item.quality == quality) - count += item.quantity; - - } - - return count; - } - - - public int AddItem(uint itemId) - { - return AddItem(itemId, 1, 1); - } - - public void AddItem(uint[] itemId) - { - for (int i = 0; i < itemId.Length; i++) - AddItem(itemId[i]); - } - - public int AddItem(uint itemId, int quantity) - { - return AddItem(itemId, quantity, 1); - } - - public int AddItem(uint itemId, int quantity, byte quality) - { - if (!IsSpaceForAdd(itemId, quantity, quality)) - return (int)INV_ERROR.INVENTORY_FULL; - - ItemData gItem = Server.GetItemGamedata(itemId); - - if (gItem == null) - { - Program.Log.Error("Inventory.AddItem: unable to find item %u", itemId); - return (int)INV_ERROR.SYSTEM_ERROR; - } - - //Check if item id exists - int quantityCount = quantity; - for (int i = 0; i < endOfListIndex; i++) - { - InventoryItem item = list[i]; - - Debug.Assert(item != null, "Item slot was null!!!"); - - if (item.itemId == itemId && item.quality == quality && item.quantity < gItem.maxStack) - { - int oldQuantity = item.quantity; - item.quantity = Math.Min(item.quantity + quantityCount, gItem.maxStack); - isDirty[i] = true; - quantityCount -= (gItem.maxStack - oldQuantity); - - DoDatabaseQuantity(item.uniqueId, item.quantity); - - if (quantityCount <= 0) - break; - } - } - - //If it's unique, abort - if (HasItem(itemId) && gItem.isRare) - return (int)INV_ERROR.ALREADY_HAS_UNIQUE; - - //New item that spilled over - while (quantityCount > 0) - { - InventoryItem addedItem = Database.CreateItem(itemId, Math.Min(quantityCount, gItem.maxStack), quality, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability); - addedItem.slot = (ushort)endOfListIndex; - isDirty[endOfListIndex] = true; - list[endOfListIndex++] = addedItem; - quantityCount -= gItem.maxStack; - - DoDatabaseAdd(addedItem); - } - - SendUpdatePackets(); - - return (int)INV_ERROR.SUCCESS; - } - - public void RemoveItem(uint itemId) - { - RemoveItem(itemId, 1); - } - - public void RemoveItem(uint itemId, int quantity) - { - RemoveItem(itemId, quantity, 1); - } - - public void RemoveItem(uint itemId, int quantity, int quality) - { - if (!HasItem(itemId, quantity, quality)) - return; - - List slotsToUpdate = new List(); - List itemsToRemove = new List(); - List slotsToRemove = new List(); - List AddItemPackets = new List(); - - //Remove as we go along - int quantityCount = quantity; - ushort lowestSlot = 0; - for (int i = endOfListIndex - 1; i >= 0; i--) - { - InventoryItem item = list[i]; - - Debug.Assert(item != null, "Item slot was null!!!"); - - if (item.itemId == itemId && item.quality == quality) - { - int oldQuantity = item.quantity; - //Stack nomnomed - if (item.quantity - quantityCount <= 0) - { - DoDatabaseRemove(list[i].uniqueId); - list[i] = null; - } - //Stack reduced - else - { - item.quantity -= quantityCount; - DoDatabaseQuantity(list[i].uniqueId, list[i].quantity); - } - - isDirty[i] = true; - - quantityCount -= oldQuantity; - lowestSlot = item.slot; - - if (quantityCount <= 0) - break; - } - } - - DoRealign(); - SendUpdatePackets(); - } - - public void RemoveItemByUniqueId(ulong itemDBId) - { - ushort slot = 0; - InventoryItem toDelete = null; - for (int i = endOfListIndex - 1; i >= 0; i--) - { - InventoryItem item = list[i]; - - Debug.Assert(item != null, "Item slot was null!!!"); - - if (item.uniqueId == itemDBId) - { - toDelete = item; - break; - } - slot++; - } - - if (toDelete == null) - return; - - DoDatabaseRemove(toDelete.uniqueId); - - list[slot] = null; - isDirty[slot] = true; - - DoRealign(); - SendUpdatePackets(); - } - - public void RemoveItemAtSlot(ushort slot) - { - if (slot >= endOfListIndex) - return; - - DoDatabaseRemove(list[slot].uniqueId); - - list[slot] = null; - isDirty[slot] = true; - - DoRealign(); - SendUpdatePackets(); - } - - public void RemoveItemAtSlot(ushort slot, int quantity) - { - if (slot >= endOfListIndex) - return; - - if (list[slot] != null) - { - list[slot].quantity -= quantity; - - if (list[slot].quantity <= 0) - { - DoDatabaseRemove(list[slot].uniqueId); - - list[slot] = null; - DoRealign(); - } - else - DoDatabaseQuantity(list[slot].uniqueId, list[slot].quantity); - - isDirty[slot] = true; - SendUpdatePackets(); - } - } - - public void ChangeDurability(uint slot, uint durabilityChange) - { - isDirty[slot] = true; - } - - public void ChangeSpiritBind(uint slot, uint spiritBindChange) - { - isDirty[slot] = true; - } - - public void ChangeMateria(uint slot, byte materiaSlot, byte materiaId) - { - isDirty[slot] = true; - } - #endregion - - #region Packet Functions - public void SendFullInventory(Player player) - { - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendInventoryPackets(player, 0); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - } - - private void SendInventoryPackets(Player player, InventoryItem item) - { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, item)); - } - - private void SendInventoryPackets(Player player, List items) - { - int currentIndex = 0; - - while (true) - { - if (items.Count - currentIndex >= 64) - player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); - else if (items.Count - currentIndex >= 32) - player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); - else if (items.Count - currentIndex >= 16) - player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); - else if (items.Count - currentIndex > 1) - player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); - else if (items.Count - currentIndex == 1) - { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); - currentIndex++; - } - else - break; - } - - } - - private void SendInventoryPackets(Player player, int startOffset) - { - int currentIndex = startOffset; - - List lst = new List(); - for (int i = 0; i < endOfListIndex; i++) - lst.Add(list[i]); - - while (true) - { - if (endOfListIndex - currentIndex >= 64) - player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); - else if (endOfListIndex - currentIndex >= 32) - player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); - else if (endOfListIndex - currentIndex >= 16) - player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); - else if (endOfListIndex - currentIndex > 1) - player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); - else if (endOfListIndex - currentIndex == 1) - { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex])); - currentIndex++; - } - else - break; - } - - } - - private void SendInventoryRemovePackets(Player player, ushort index) - { - player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, index)); - } - - private void SendInventoryRemovePackets(Player player, List indexes) - { - int currentIndex = 0; - - while (true) - { - if (indexes.Count - currentIndex >= 64) - player.QueuePacket(InventoryRemoveX64Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); - else if (indexes.Count - currentIndex >= 32) - player.QueuePacket(InventoryRemoveX32Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); - else if (indexes.Count - currentIndex >= 16) - player.QueuePacket(InventoryRemoveX16Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); - else if (indexes.Count - currentIndex > 1) - player.QueuePacket(InventoryRemoveX08Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); - else if (indexes.Count - currentIndex == 1) - { - player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, indexes[currentIndex])); - currentIndex++; - } - else - break; - } - - } - - public void RefreshItem(Player player, InventoryItem item) - { - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendInventoryPackets(player, item); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - } - - public void RefreshItem(Player player, params InventoryItem[] items) - { - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendInventoryPackets(player, items.ToList()); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - } - - public void RefreshItem(Player player, List items) - { - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendInventoryPackets(player, items); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - } - - #endregion - - #region Automatic Client and DB Updating - - private void DoDatabaseAdd(InventoryItem addedItem) - { - if (isTemporary) - return; - - if (owner is Player) - Database.AddItem((Player)owner, addedItem, inventoryCode); - else if (owner is Retainer) - Database.AddItem((Retainer)owner, addedItem, inventoryCode); - } - - private void DoDatabaseQuantity(ulong itemDBId, int quantity) - { - if (isTemporary) - return; - - if (owner is Player) - Database.SetQuantity((Player)owner, itemDBId, inventoryCode); - else if (owner is Retainer) - Database.SetQuantity((Retainer)owner, itemDBId, inventoryCode); - } - - private void DoDatabaseRemove(ulong itemDBId) - { - if (isTemporary) - return; - - if (owner is Player) - Database.RemoveItem((Player)owner, itemDBId); - else if (owner is Retainer) - Database.RemoveItem((Retainer)owner, itemDBId); - } - - private void SendUpdatePackets() - { - if (owner is Player) - { - SendUpdatePackets((Player)owner, true); - } - } - - public void SendUpdatePackets(Player player, bool doneImmediate = false) - { - List items = new List(); - List slotsToRemove = new List(); - - for (int i = 0; i < list.Length; i++) - { - if (i == endOfListIndex) - break; - if (isDirty[i]) - items.Add(list[i]); - } - - for (int i = endOfListIndex; i < list.Length; i++) - { - if (isDirty[i]) - slotsToRemove.Add((ushort)i); - } - - if (doneImmediate) - DoneSendUpdate(); - - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - //Send Updated Slots - SendInventoryPackets(player, items); - //Send Remove packets for tail end - SendInventoryRemovePackets(player, slotsToRemove); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); - } - - public void DoneSendUpdate() - { - Array.Clear(isDirty, 0, isDirty.Length); - } - - #endregion - - #region Inventory Utils - - public bool IsFull() - { - return endOfListIndex >= inventoryCapacity; - } - - public bool IsSpaceForAdd(uint itemId, int quantity, int quality) - { - int quantityCount = quantity; - for (int i = 0; i < endOfListIndex; i++) - { - InventoryItem item = list[i]; - ItemData gItem = Server.GetItemGamedata(item.itemId); - if (item.itemId == itemId && item.quality == quality && item.quantity < gItem.maxStack) - { - quantityCount -= (gItem.maxStack - item.quantity); - if (quantityCount <= 0) - break; - } - } - - return quantityCount <= 0 || (quantityCount > 0 && !IsFull()); - } - - public bool HasItem(uint itemId) - { - return HasItem(itemId, 1); - } - - public bool HasItem(uint itemId, int minQuantity) - { - return HasItem(itemId, minQuantity, 1); - } - - public bool HasItem(uint itemId, int minQuantity, int quality) - { - int count = 0; - - for (int i = endOfListIndex - 1; i >= 0; i--) - { - InventoryItem item = list[i]; - - Debug.Assert(item != null, "Item slot was null!!!"); - - if (item.itemId == itemId && item.quality == quality) - count += item.quantity; - - if (count >= minQuantity) - return true; - } - - return false; - } - - public int GetNextEmptySlot() - { - return endOfListIndex; - } - - private void DoRealign() - { - int lastNullSlot = -1; - - for (int i = 0; i < endOfListIndex; i++) - { - if (list[i] == null && lastNullSlot == -1) - { - lastNullSlot = i; - continue; - } - else if (list[i] != null && lastNullSlot != -1) - { - list[lastNullSlot] = list[i]; - list[lastNullSlot].slot = (ushort)lastNullSlot; - list[i] = null; - isDirty[lastNullSlot] = true; - isDirty[i] = true; - lastNullSlot++; - } - } - - if (lastNullSlot != -1) - endOfListIndex = lastNullSlot; - } - - #endregion - - } -} +using FFXIVClassic.Common; +using FFXIVClassic_Map_Server.actors.chara.npc; +using FFXIVClassic_Map_Server.Actors; +using FFXIVClassic_Map_Server.dataobjects; +using FFXIVClassic_Map_Server.packets.send.actor.inventory; +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace FFXIVClassic_Map_Server.actors.chara.player +{ + class ItemPackage + { + public const ushort NORMAL = 0; //Max 0xC8 + public const ushort UNKNOWN = 1; //Max 0x96 + public const ushort LOOT = 4; //Max 0xA + public const ushort MELDREQUEST = 5; //Max 0x04 + public const ushort BAZAAR = 7; //Max 0x0A + public const ushort CURRENCY_CRYSTALS = 99; //Max 0x140 + public const ushort KEYITEMS = 100; //Max 0x500 + public const ushort EQUIPMENT = 0x00FE; //Max 0x23 + public const ushort TRADE = 0x00FD; //Max 0x04 + public const ushort EQUIPMENT_OTHERPLAYER = 0x00F9; //Max 0x23 + + public const ushort MAXSIZE_NORMAL = 200; + public const ushort MAXSIZE_CURRANCY = 320; + public const ushort MAXSIZE_KEYITEMS = 500; + public const ushort MAXSIZE_LOOT = 10; + public const ushort MAXSIZE_TRADE = 4; + public const ushort MAXSIZE_MELDREQUEST = 4; + public const ushort MAXSIZE_BAZAAR = 10; + public const ushort MAXSIZE_EQUIPMENT = 35; + public const ushort MAXSIZE_EQUIPMENT_OTHERPLAYER = 0x23; + + public const int ERROR_SUCCESS = 0; + public const int ERROR_FULL = 1; + public const int ERROR_HAS_UNIQUE = 2; + public const int ERROR_SYSTEM = 3; + + private Character owner; + private ushort itemPackageCapacity; + private ushort itemPackageCode; + private bool isTemporary; + private InventoryItem[] list; + private bool[] isDirty; + private bool holdingUpdates = false; + + private int endOfListIndex = 0; + + public ItemPackage(Character ownerPlayer, ushort capacity, ushort code, bool temporary = false) + { + owner = ownerPlayer; + itemPackageCapacity = capacity; + itemPackageCode = code; + isTemporary = temporary; + list = new InventoryItem[capacity]; + isDirty = new bool[capacity]; + } + + #region Inventory Management + public void InitList(List itemsFromDB) + { + int i = 0; + foreach (InventoryItem item in itemsFromDB) + { + item.RefreshPositioning(owner, itemPackageCode, (ushort) i); + list[i++] = item; + } + endOfListIndex = i; + } + + public InventoryItem GetItemAtSlot(ushort slot) + { + if (slot < list.Length) + return list[slot]; + else + return null; + } + + public InventoryItem GetItemByUniqueId(ulong uniqueItemId) + { + for (int i = 0; i < endOfListIndex; i++) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.uniqueId == uniqueItemId) + return item; + } + return null; + } + + public InventoryItem GetItemByCatelogId(ulong catelogId) + { + for (int i = 0; i < endOfListIndex; i++) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.itemId == catelogId) + return item; + } + return null; + } + + public InventoryItem GetItemAttachedTo(InventoryItem attachedTo) + { + for (int i = 0; i < endOfListIndex; i++) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (attachedTo.GetAttached() == item.uniqueId) + return item; + } + return null; + } + + public int AddItem(uint itemId) + { + return AddItem(itemId, 1, 1); + } + + public int AddItem(uint itemId, int quantity) + { + return AddItem(itemId, quantity, 1); + } + + public int AddItems(uint[] itemIds, uint[] quantity = null, byte[] quality = null) + { + //Check if has space + if (!CanAdd(itemIds, quantity, quality)) + return ERROR_FULL; + + for (int i = 0; i < itemIds.Length; i++) + { + ItemData gItem = Server.GetItemGamedata(itemIds[i]); + + //If it's unique, abort + if (HasItem(itemIds[i]) && gItem.isExclusive) + return ERROR_HAS_UNIQUE; + + if (gItem == null) + { + Program.Log.Error("Inventory.AddItem: unable to find item %u", itemIds[i]); + return ERROR_SYSTEM; + } + + //Check if item id exists + uint setQuantity = quantity != null ? quantity[i] : 1; + int quantityCount = (int)setQuantity; + for (int j = 0; j < endOfListIndex; j++) + { + InventoryItem item = list[j]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + byte setQuality = quality != null ? quality[i] : (byte)1; + + if (item.itemId == itemIds[i] && item.quality == setQuality && item.quantity < gItem.maxStack) + { + int oldQuantity = item.quantity; + item.quantity = Math.Min(item.quantity + quantityCount, gItem.maxStack); + isDirty[j] = true; + quantityCount -= (gItem.maxStack - oldQuantity); + + DoDatabaseQuantity(item.uniqueId, item.quantity); + + if (quantityCount <= 0) + break; + } + } + + //New item that spilled over + while (quantityCount > 0) + { + InventoryItem.ItemModifier modifiers = null; + if (gItem.durability != 0) + { + modifiers = new InventoryItem.ItemModifier(); + modifiers.durability = (uint)gItem.durability; + } + + byte setQuality = quality != null ? quality[i] : (byte)1; + + InventoryItem addedItem = Database.CreateItem(itemIds[i], Math.Min(quantityCount, gItem.maxStack), setQuality, modifiers); + addedItem.RefreshPositioning(owner, itemPackageCode, (ushort)endOfListIndex); + isDirty[endOfListIndex] = true; + list[endOfListIndex++] = addedItem; + quantityCount -= gItem.maxStack; + + DoDatabaseAdd(addedItem); + } + } + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + + return ERROR_SUCCESS; + } + + public bool CanAdd(uint[] itemIds, uint[] quantity, byte[] quality) + { + int tempInvSize = GetCount(); + + for (int i = 0; i < itemIds.Length; i++) + { + ItemData gItem = Server.GetItemGamedata(itemIds[i]); + //Check if item id exists and fill up til maxstack + int quantityCount = (int) (quantity != null ? quantity[i] : 1); + for (int j = 0; j < endOfListIndex; j++) + { + InventoryItem item = list[j]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.itemId == itemIds[i] && item.quality == (quality != null ? quality[i] : 1) && item.quantity < gItem.maxStack) + { + quantityCount -= (gItem.maxStack - item.quantity); + if (quantityCount <= 0) + break; + } + } + + //New items that spilled over creating new stacks + while (quantityCount > 0) + { + quantityCount -= gItem.maxStack; + tempInvSize++; + } + + //If the new stacks push us over capacity, can't add these items + if (tempInvSize > itemPackageCapacity) + return false; + } + + return true; + } + + public int AddItem(InventoryItem itemRef) + { + //If it isn't a single item (ie: armor) just add like normal (not valid for BAZAAR) + if (itemPackageCode != BAZAAR && itemRef.GetItemData().maxStack > 1) + return AddItem(itemRef.itemId, itemRef.quantity, itemRef.quality); + + if (!IsSpaceForAdd(itemRef.itemId, itemRef.quantity, itemRef.quality)) + return ERROR_FULL; + + ItemData gItem = Server.GetItemGamedata(itemRef.itemId); + + if (gItem == null) + { + Program.Log.Error("Inventory.AddItem: unable to find item %u", itemRef.itemId); + return ERROR_SYSTEM; + } + + itemRef.RefreshPositioning(owner, itemPackageCode, (ushort)endOfListIndex); + + isDirty[endOfListIndex] = true; + list[endOfListIndex++] = itemRef; + DoDatabaseAdd(itemRef); + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + + return ERROR_SUCCESS; + } + + public int AddItem(uint itemId, int quantity, byte quality) + { + if (!IsSpaceForAdd(itemId, quantity, quality)) + return ERROR_FULL; + + ItemData gItem = Server.GetItemGamedata(itemId); + + //If it's unique, abort + if (HasItem(itemId) && gItem.isExclusive) + return ERROR_HAS_UNIQUE; + + if (gItem == null) + { + Program.Log.Error("Inventory.AddItem: unable to find item %u", itemId); + return ERROR_SYSTEM; + } + + //Check if item id exists + int quantityCount = quantity; + for (int i = 0; i < endOfListIndex; i++) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.itemId == itemId && item.quality == quality && item.quantity < gItem.maxStack) + { + int oldQuantity = item.quantity; + item.quantity = Math.Min(item.quantity + quantityCount, gItem.maxStack); + isDirty[i] = true; + quantityCount -= (gItem.maxStack - oldQuantity); + + DoDatabaseQuantity(item.uniqueId, item.quantity); + + if (quantityCount <= 0) + break; + } + } + + //New item that spilled over + while (quantityCount > 0) + { + InventoryItem.ItemModifier modifiers = null; + if (gItem.durability != 0) + { + modifiers = new InventoryItem.ItemModifier(); + modifiers.durability = (uint)gItem.durability; + } + + InventoryItem addedItem = Database.CreateItem(itemId, Math.Min(quantityCount, gItem.maxStack), quality, modifiers); + addedItem.RefreshPositioning(owner, itemPackageCode, (ushort)endOfListIndex); + isDirty[endOfListIndex] = true; + list[endOfListIndex++] = addedItem; + quantityCount -= gItem.maxStack; + + DoDatabaseAdd(addedItem); + } + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + + return ERROR_SUCCESS; + } + + public void SetItem(ushort slot, InventoryItem item) + { + list[slot] = item; + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + item.RefreshPositioning(owner, itemPackageCode, slot); + } + + public void RemoveItem(uint itemId) + { + RemoveItem(itemId, 1); + } + + public void RemoveItem(uint itemId, int quantity) + { + RemoveItem(itemId, quantity, 1); + } + + public void RemoveItem(uint itemId, int quantity, int quality) + { + if (!HasItem(itemId, quantity, quality)) + return; + + List slotsToUpdate = new List(); + List itemsToRemove = new List(); + List slotsToRemove = new List(); + List AddItemPackets = new List(); + + //Remove as we go along + int quantityCount = quantity; + ushort lowestSlot = 0; + for (int i = endOfListIndex - 1; i >= 0; i--) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.itemId == itemId && item.quality == quality) + { + int oldQuantity = item.quantity; + //Stack nomnomed + if (item.quantity - quantityCount <= 0) + { + DoDatabaseRemove(list[i].uniqueId); + list[i] = null; + } + //Stack reduced + else + { + item.quantity -= quantityCount; + DoDatabaseQuantity(list[i].uniqueId, list[i].quantity);} + + isDirty[i] = true; + + quantityCount -= oldQuantity; + lowestSlot = item.slot; + + if (quantityCount <= 0) + break; + } + } + + DoRealign(); + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + } + + public void RemoveItem(InventoryItem item) + { + RemoveItemByUniqueId(item.uniqueId, item.quantity); + } + + public void RemoveItem(InventoryItem item, int quantity) + { + RemoveItemByUniqueId(item.uniqueId, quantity); + } + + public void RemoveItemByUniqueId(ulong itemDBId, int quantity) + { + ushort slot = 0; + InventoryItem toDelete = null; + for (int i = 0; i < endOfListIndex; i++) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.uniqueId == itemDBId) + { + toDelete = item; + break; + } + slot++; + } + + if (toDelete == null) + return; + + if (quantity >= toDelete.quantity) + { + DoDatabaseRemove(toDelete.uniqueId); + list[slot].RefreshPositioning(null, 0xFFFF, 0xFFFF); + list[slot] = null; + } + else + { + list[slot].quantity -= quantity; + DoDatabaseQuantity(list[slot].uniqueId, list[slot].quantity); + } + + isDirty[slot] = true; + + DoRealign(); + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + } + + public void RemoveItemAtSlot(ushort slot) + { + if (slot >= endOfListIndex) + return; + + DoDatabaseRemove(list[slot].uniqueId); + + list[slot].RefreshPositioning(null, 0xFFFF, 0xFFFF); + list[slot] = null; + isDirty[slot] = true; + + DoRealign(); + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + } + + public void RemoveItemAtSlot(ushort slot, int quantity) + { + if (slot >= endOfListIndex) + return; + + if (list[slot] != null) + { + list[slot].quantity -= quantity; + + if (list[slot].quantity <= 0) + { + DoDatabaseRemove(list[slot].uniqueId); + + list[slot].RefreshPositioning(null, 0xFFFF, 0xFFFF); + list[slot] = null; + DoRealign(); + } + else + DoDatabaseQuantity(list[slot].uniqueId, list[slot].quantity); + + isDirty[slot] = true; + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + } + } + + public void Clear() + { + for (int i = 0; i < endOfListIndex; i++) + { + list[i].RefreshPositioning(null, 0xFFFF, 0xFFFF); + list[i] = null; + isDirty[i] = true; + } + endOfListIndex = 0; + + if (owner is Player) + { + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + } + + public void MarkDirty(InventoryItem item) + { + if (item.itemPackage != itemPackageCode || list[item.slot] == null) + return; + + isDirty[item.slot] = true; + } + + public void MarkDirty(ushort slot) + { + isDirty[slot] = true; + } + + public InventoryItem[] GetRawList() + { + return list; + } + + public void ChangeDurability(uint slot, uint durabilityChange) + { + isDirty[slot] = true; + } + + public void ChangeSpiritBind(uint slot, uint spiritBindChange) + { + isDirty[slot] = true; + } + + public void ChangeMateria(uint slot, byte materiaSlot, byte materiaId) + { + isDirty[slot] = true; + } + #endregion + + #region Packet Functions + public void SendFullPackage(Player player) + { + player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + SendItemPackets(player, 0); + player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + } + + public void SendUpdate() + { + if (owner is Player && !holdingUpdates) + { + SendUpdate((Player)owner); + } + } + + public void SendUpdate(Player player) + { + List items = new List(); + List slotsToRemove = new List(); + + for (int i = 0; i < list.Length; i++) + { + if (i == endOfListIndex) + break; + if (isDirty[i]) + items.Add(list[i]); + } + + for (int i = endOfListIndex; i < list.Length; i++) + { + if (isDirty[i]) + slotsToRemove.Add((ushort)i); + } + + if (!holdingUpdates) + Array.Clear(isDirty, 0, isDirty.Length); + + player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + //Send Updated Slots + SendItemPackets(player, items); + //Send Remove packets for tail end + SendItemPackets(player, slotsToRemove); + player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + //If player is updating their normal inventory, we need to send + //an equip update as well to resync the slots. + if (player.Equals(owner) && itemPackageCode == NORMAL) + player.GetEquipment().SendUpdate(); + } + + private void SendItemPackets(Player player, InventoryItem item) + { + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, item)); + } + + private void SendItemPackets(Player player, List items) + { + int currentIndex = 0; + + while (true) + { + if (items.Count - currentIndex >= 64) + player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex >= 32) + player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex >= 16) + player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex > 1) + player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex == 1) + { + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); + currentIndex++; + } + else + break; + } + } + + private void SendItemPackets(Player player, int startOffset) + { + int currentIndex = startOffset; + + List lst = new List(); + for (int i = 0; i < endOfListIndex; i++) + lst.Add(list[i]); + + while (true) + { + if (endOfListIndex - currentIndex >= 64) + player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + else if (endOfListIndex - currentIndex >= 32) + player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + else if (endOfListIndex - currentIndex >= 16) + player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + else if (endOfListIndex - currentIndex > 1) + player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + else if (endOfListIndex - currentIndex == 1) + { + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex])); + currentIndex++; + } + else + break; + } + } + + private void SendItemPackets(Player player, ushort index) + { + player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, index)); + } + + private void SendItemPackets(Player player, List indexes) + { + int currentIndex = 0; + + while (true) + { + if (indexes.Count - currentIndex >= 64) + player.QueuePacket(InventoryRemoveX64Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + else if (indexes.Count - currentIndex >= 32) + player.QueuePacket(InventoryRemoveX32Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + else if (indexes.Count - currentIndex >= 16) + player.QueuePacket(InventoryRemoveX16Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + else if (indexes.Count - currentIndex > 1) + player.QueuePacket(InventoryRemoveX08Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + else if (indexes.Count - currentIndex == 1) + { + player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, indexes[currentIndex])); + currentIndex++; + } + else + break; + } + } + #endregion + + #region Automatic Client and DB Updating + + private void DoDatabaseAdd(InventoryItem addedItem) + { + if (isTemporary) + return; + + if (itemPackageCode == BAZAAR) + return; + + if (owner is Player) + Database.AddItem((Player)owner, addedItem, itemPackageCode); + else if (owner is Retainer) + Database.AddItem((Retainer)owner, addedItem, itemPackageCode); + } + + private void DoDatabaseQuantity(ulong itemDBId, int quantity) + { + if (isTemporary) + return; + + + if (itemPackageCode == BAZAAR) + return; + + Database.SetQuantity(itemDBId, quantity); + } + + private void DoDatabaseRemove(ulong itemDBId) + { + if (isTemporary) + return; + + if (itemPackageCode == BAZAAR) + return; + + if (owner is Player) + Database.RemoveItem((Player)owner, itemDBId); + else if (owner is Retainer) + Database.RemoveItem((Retainer)owner, itemDBId); + } + + public void StartSendUpdate() + { + holdingUpdates = true; + } + + public void DoneSendUpdate() + { + holdingUpdates = false; + SendUpdate(); + Array.Clear(isDirty, 0, isDirty.Length); + } + + #endregion + + #region Inventory Utils + + public bool IsFull() + { + return endOfListIndex >= itemPackageCapacity; + } + + public int GetFreeSlots() + { + return itemPackageCapacity - endOfListIndex; + } + + public bool IsSpaceForAdd(uint itemId, int quantity, int quality) + { + int quantityCount = quantity; + for (int i = 0; i < endOfListIndex; i++) + { + InventoryItem item = list[i]; + ItemData gItem = Server.GetItemGamedata(item.itemId); + if (item.itemId == itemId && item.quality == quality && item.quantity < gItem.maxStack) + { + quantityCount -= (gItem.maxStack - item.quantity); + if (quantityCount <= 0) + break; + } + } + + return quantityCount <= 0 || (quantityCount > 0 && !IsFull()); + } + + public bool HasItem(uint itemId) + { + return HasItem(itemId, 1); + } + + public bool HasItem(uint itemId, int minQuantity) + { + return HasItem(itemId, minQuantity, 1); + } + + public bool HasItem(uint itemId, int minQuantity, int quality) + { + int count = 0; + + for (int i = endOfListIndex - 1; i >= 0; i--) + { + InventoryItem item = list[i]; + + Debug.Assert(item != null, "Item slot was null!!!"); + + if (item.itemId == itemId && item.quality == quality) + count += item.quantity; + + if (count >= minQuantity) + return true; + } + + return false; + } + + public int GetNextEmptySlot() + { + return endOfListIndex; + } + + private void DoRealign() + { + int lastNullSlot = -1; + + for (int i = 0; i < endOfListIndex; i++) + { + if (list[i] == null && lastNullSlot == -1) + { + lastNullSlot = i; + continue; + } + else if (list[i] != null && lastNullSlot != -1) + { + list[lastNullSlot] = list[i]; + list[lastNullSlot].slot = (ushort)lastNullSlot; + list[i] = null; + isDirty[lastNullSlot] = true; + isDirty[i] = true; + lastNullSlot++; + } + } + + if (lastNullSlot != -1) + endOfListIndex = lastNullSlot; + } + + #endregion + + public int GetCount() + { + return endOfListIndex; + } + } +} diff --git a/FFXIVClassic Map Server/actors/chara/Modifier.cs b/FFXIVClassic Map Server/actors/chara/Modifier.cs index 97be6395..bba437b7 100644 --- a/FFXIVClassic Map Server/actors/chara/Modifier.cs +++ b/FFXIVClassic Map Server/actors/chara/Modifier.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.chara { diff --git a/FFXIVClassic Map Server/actors/chara/ModifierList.cs b/FFXIVClassic Map Server/actors/chara/ModifierList.cs index 15b188b6..b09790a6 100644 --- a/FFXIVClassic Map Server/actors/chara/ModifierList.cs +++ b/FFXIVClassic Map Server/actors/chara/ModifierList.cs @@ -1,9 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FFXIVClassic_Map_Server.actors.chara.npc; namespace FFXIVClassic_Map_Server.actors.chara { diff --git a/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs b/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs new file mode 100644 index 00000000..cb8b7c64 --- /dev/null +++ b/FFXIVClassic Map Server/actors/chara/ReferencedItemPackage.cs @@ -0,0 +1,295 @@ +using FFXIVClassic_Map_Server.actors.chara.player; +using FFXIVClassic_Map_Server.Actors; +using FFXIVClassic_Map_Server.dataobjects; +using FFXIVClassic_Map_Server.packets.send.actor.inventory; +using System.Collections.Generic; +using System.Diagnostics; + +namespace FFXIVClassic_Map_Server.actors.chara +{ + + class ReferencedItemPackage + { + const uint EMPTY = 0xFFFFFFFF; + + private readonly Player owner; + private readonly InventoryItem[] referenceList; + private readonly ushort itemPackageCode; + private readonly ushort itemPackageCapacity; + private bool writeToDB = false; + + public ReferencedItemPackage(Player owner, ushort capacity, ushort code) + { + this.owner = owner; + itemPackageCode = code; + itemPackageCapacity = capacity; + referenceList = new InventoryItem[capacity]; + + if (code == ItemPackage.EQUIPMENT) + writeToDB = true; + } + + public void ToggleDBWrite(bool flag) + { + writeToDB = flag; + } + + #region Package Management + public void SetList(InventoryItem[] toSet) + { + Debug.Assert(referenceList.Length == itemPackageCapacity); + toSet.CopyTo(referenceList, 0); + } + + public void Set(ushort[] positions, ushort[] itemSlots, ushort itemPackage) + { + Debug.Assert(positions.Length == itemSlots.Length); + + for (int i = 0; i < positions.Length; i++) + { + InventoryItem item = owner.GetItemPackage(itemPackage)?.GetItemAtSlot(itemSlots[i]); + + if (item == null) + continue; + + Database.EquipItem(owner, positions[i], item.uniqueId); + referenceList[positions[i]] = item; + } + + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + SendUpdate(); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + + public void Set(ushort position, ushort itemPackagePosition, ushort itemPackageCode) + { + InventoryItem item = owner.GetItemPackage(itemPackageCode).GetItemAtSlot(itemPackagePosition); + + if (item == null) + return; + + Set(position, item); + } + + public void Set(ushort position, InventoryItem item) + { + if (position >= referenceList.Length) + return; + + if (writeToDB) + Database.EquipItem(owner, position, item.uniqueId); + + ItemPackage newPackage = owner.GetItemPackage(item.itemPackage); + ItemPackage oldPackage = null; + + if (referenceList[position] != null) + { + oldPackage = owner.GetItemPackage(referenceList[position].itemPackage); + InventoryItem oldItem = referenceList[position]; + oldPackage.MarkDirty(oldItem); + } + + newPackage.MarkDirty(item); + + referenceList[position] = item; + + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + if (oldPackage != null) + oldPackage.SendUpdate(); + newPackage.SendUpdate(); + SendSingleUpdate(position); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + + public void Clear(ushort position) + { + if (position >= referenceList.Length) + return; + + if (writeToDB) + Database.UnequipItem(owner, position); + + ItemPackage oldItemPackage = owner.GetItemPackage(referenceList[position].itemPackage); + + oldItemPackage.MarkDirty(referenceList[position]); + referenceList[position] = null; + + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + oldItemPackage.SendUpdate(); + SendSingleUpdate(position); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + + public void ClearAll() + { + List packagesToRefresh = new List(); + + for (int i = 0; i < referenceList.Length; i++) + { + if (referenceList[i] == null) + continue; + + if (writeToDB) + Database.UnequipItem(owner, (ushort)i); + + ItemPackage package = owner.GetItemPackage(referenceList[i].itemPackage); + package.MarkDirty(referenceList[i]); + packagesToRefresh.Add(package); + + referenceList[i] = null; + } + + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + for (int i = 0; i < packagesToRefresh.Count; i++) + packagesToRefresh[i].SendUpdate(); + SendUpdate(); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + } + #endregion + + #region Send Update Functions + public void SendSingleUpdate(ushort position) + { + owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + SendSingleLinkedItemPacket(owner, position); + owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + } + + public void SendUpdate() + { + SendUpdate(owner); + } + + public void SendUpdate(Player targetPlayer) + { + List slotsToUpdate = new List(); + + for (ushort i = 0; i < referenceList.Length; i++) + { + if (referenceList[i] != null) + slotsToUpdate.Add(i); + } + + targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + SendLinkedItemPackets(targetPlayer, slotsToUpdate); + targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + } + + public void SendUpdateAsItemPackage(Player targetPlayer) + { + SendUpdateAsItemPackage(targetPlayer, itemPackageCapacity, itemPackageCode); + } + + public void SendUpdateAsItemPackage(Player targetPlayer, ushort destinationCapacity, ushort destinationCode) + { + List items = new List(); + + for (ushort i = 0; i < referenceList.Length; i++) + { + if (referenceList[i] == null) + continue; + + InventoryItem item = referenceList[i]; + item.linkSlot = i; //We have to set the linkSlot as this is the position in the Referenced IP, not the original IP it's linked from. + items.Add(referenceList[i]); + } + + targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, destinationCapacity, destinationCode)); + SendItemPackets(targetPlayer, items); + targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + + //Clean Up linkSlots + for (ushort i = 0; i < referenceList.Length; i++) + { + if (referenceList[i] == null) + continue; + InventoryItem item = referenceList[i]; + item.linkSlot = 0xFFFF; + } + } + #endregion + + #region Packet Functions (Private) + private void SendSingleLinkedItemPacket(Player targetPlayer, ushort position) + { + if (referenceList[position] == null) + targetPlayer.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, position)); + else + targetPlayer.QueuePacket(LinkedItemListX01Packet.BuildPacket(owner.actorId, position, referenceList[position])); + } + + private void SendLinkedItemPackets(Player targetPlayer, List slotsToUpdate) + { + int currentIndex = 0; + + while (true) + { + if (slotsToUpdate.Count - currentIndex >= 64) + targetPlayer.QueuePacket(LinkedItemListX64Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + else if (slotsToUpdate.Count - currentIndex >= 32) + targetPlayer.QueuePacket(LinkedItemListX32Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + else if (slotsToUpdate.Count - currentIndex >= 16) + targetPlayer.QueuePacket(LinkedItemListX16Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + else if (slotsToUpdate.Count - currentIndex > 1) + targetPlayer.QueuePacket(LinkedItemListX08Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + else if (slotsToUpdate.Count - currentIndex == 1) + { + targetPlayer.QueuePacket(LinkedItemListX01Packet.BuildPacket(owner.actorId, slotsToUpdate[currentIndex], referenceList[slotsToUpdate[currentIndex]])); + currentIndex++; + } + else + break; + } + } + + private void SendItemPackets(Player player, List items) + { + int currentIndex = 0; + + while (true) + { + if (items.Count - currentIndex >= 64) + player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex >= 32) + player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex >= 16) + player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex > 1) + player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + else if (items.Count - currentIndex == 1) + { + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); + currentIndex++; + } + else + break; + } + } + #endregion + + #region Getters/Setters + public ushort GetCode() + { + return itemPackageCode; + } + + public int GetCapacity() + { + return itemPackageCapacity; + } + + public Player GetOwner() + { + return owner; + } + + public InventoryItem GetItemAtSlot(ushort position) + { + if (position < referenceList.Length) + return referenceList[position]; + else + return null; + } + #endregion + } +} diff --git a/FFXIVClassic Map Server/actors/chara/SubState.cs b/FFXIVClassic Map Server/actors/chara/SubState.cs index e7e3d8c7..38cb3693 100644 --- a/FFXIVClassic Map Server/actors/chara/SubState.cs +++ b/FFXIVClassic Map Server/actors/chara/SubState.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.chara +namespace FFXIVClassic_Map_Server.actors.chara { class SubState { diff --git a/FFXIVClassic Map Server/actors/chara/ai/AIContainer.cs b/FFXIVClassic Map Server/actors/chara/ai/AIContainer.cs index 38c636a1..254068a6 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/AIContainer.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/AIContainer.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.actors.chara.ai.state; using FFXIVClassic_Map_Server.actors.chara.ai.controllers; diff --git a/FFXIVClassic Map Server/actors/chara/ai/BattleCommand.cs b/FFXIVClassic Map Server/actors/chara/ai/BattleCommand.cs index d23a4913..2a9cf6f6 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/BattleCommand.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/BattleCommand.cs @@ -1,11 +1,6 @@ using FFXIVClassic_Map_Server.Actors; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FFXIVClassic_Map_Server.actors.chara.player; -using FFXIVClassic.Common; using FFXIVClassic_Map_Server.packets.send.actor.battle; using FFXIVClassic_Map_Server.actors.chara.ai.utils; using MoonSharp.Interpreter; diff --git a/FFXIVClassic Map Server/actors/chara/ai/BattleTrait.cs b/FFXIVClassic Map Server/actors/chara/ai/BattleTrait.cs index f8f41b48..0ab36e87 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/BattleTrait.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/BattleTrait.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.chara.ai +namespace FFXIVClassic_Map_Server.actors.chara.ai { class BattleTrait { diff --git a/FFXIVClassic Map Server/actors/chara/ai/HateContainer.cs b/FFXIVClassic Map Server/actors/chara/ai/HateContainer.cs index 47086f68..72f62dcc 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/HateContainer.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/HateContainer.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using FFXIVClassic_Map_Server.Actors; namespace FFXIVClassic_Map_Server.actors.chara.ai diff --git a/FFXIVClassic Map Server/actors/chara/ai/StatusEffect.cs b/FFXIVClassic Map Server/actors/chara/ai/StatusEffect.cs index 6defe33a..7f006567 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/StatusEffect.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/StatusEffect.cs @@ -1,12 +1,7 @@ using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.lua; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.actor.battle; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using MoonSharp.Interpreter; using FFXIVClassic.Common; diff --git a/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs b/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs index cab2d16c..9e0925d8 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs @@ -1,16 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.lua; -using FFXIVClassic_Map_Server.actors.area; -using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using System.Collections.ObjectModel; using FFXIVClassic_Map_Server.utils; namespace FFXIVClassic_Map_Server.actors.chara.ai diff --git a/FFXIVClassic Map Server/actors/chara/ai/controllers/AllyController.cs b/FFXIVClassic Map Server/actors/chara/ai/controllers/AllyController.cs index 4098e2bb..3a474e4f 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/controllers/AllyController.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/controllers/AllyController.cs @@ -1,11 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.actors.chara.npc; -using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers { diff --git a/FFXIVClassic Map Server/actors/chara/ai/controllers/Controller.cs b/FFXIVClassic Map Server/actors/chara/ai/controllers/Controller.cs index ab194953..2bc58f6f 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/controllers/Controller.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/controllers/Controller.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers diff --git a/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs b/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs index bfcef0ac..83290fbe 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers diff --git a/FFXIVClassic Map Server/actors/chara/ai/controllers/PlayerController.cs b/FFXIVClassic Map Server/actors/chara/ai/controllers/PlayerController.cs index 1505d453..0266ee6f 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/controllers/PlayerController.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/controllers/PlayerController.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor; -using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers { diff --git a/FFXIVClassic Map Server/actors/chara/ai/helpers/ActionQueue.cs b/FFXIVClassic Map Server/actors/chara/ai/helpers/ActionQueue.cs index 87112724..96c0b51d 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/helpers/ActionQueue.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/helpers/ActionQueue.cs @@ -1,11 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; -using MoonSharp; -using MoonSharp.Interpreter; using FFXIVClassic_Map_Server.lua; namespace FFXIVClassic_Map_Server.actors.chara.ai diff --git a/FFXIVClassic Map Server/actors/chara/ai/helpers/PathFind.cs b/FFXIVClassic Map Server/actors/chara/ai/helpers/PathFind.cs index 399bb9b5..d45b0787 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/helpers/PathFind.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/helpers/PathFind.cs @@ -1,14 +1,9 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server; using FFXIVClassic_Map_Server.utils; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.area; -using FFXIVClassic_Map_Server.packets.send.actor; // port of https://github.com/DarkstarProject/darkstar/blob/master/src/map/ai/helpers/pathfind.h diff --git a/FFXIVClassic Map Server/actors/chara/ai/helpers/TargetFind.cs b/FFXIVClassic Map Server/actors/chara/ai/helpers/TargetFind.cs index d2c94e00..49adbcb8 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/helpers/TargetFind.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/helpers/TargetFind.cs @@ -1,14 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.actors.chara.ai.controllers; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.packets.send.actor; // port of dsp's ai code https://github.com/DarkstarProject/darkstar/blob/master/src/map/ai/ diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/AbilityState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/AbilityState.cs index 955fe22b..a37cb2dd 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/AbilityState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/AbilityState.cs @@ -1,13 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.packets.send; namespace FFXIVClassic_Map_Server.actors.chara.ai.state { diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/AttackState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/AttackState.cs index febcdcdc..14e7d226 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/AttackState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/AttackState.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.packets.send.actor; diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/DeathState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/DeathState.cs index a2d33ae3..4e049679 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/DeathState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/DeathState.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.packets.send.actor; diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/DespawnState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/DespawnState.cs index 4ba940b2..edf85561 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/DespawnState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/DespawnState.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.packets.send.actor; diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/InactiveState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/InactiveState.cs index 735d7765..63bf140b 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/InactiveState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/InactiveState.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; namespace FFXIVClassic_Map_Server.actors.chara.ai.state diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/ItemState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/ItemState.cs index dad3d6b8..f5cb8d9b 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/ItemState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/ItemState.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.actors.chara.player; +using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; namespace FFXIVClassic_Map_Server.actors.chara.ai.state diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/MagicState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/MagicState.cs index 67e0df80..4008a72a 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/MagicState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/MagicState.cs @@ -1,14 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.packets.send; -using FFXIVClassic_Map_Server.utils; namespace FFXIVClassic_Map_Server.actors.chara.ai.state { diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/State.cs b/FFXIVClassic Map Server/actors/chara/ai/state/State.cs index cebd3227..81985221 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/State.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/State.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic.Common; using FFXIVClassic_Map_Server.packets.send.actor.battle; namespace FFXIVClassic_Map_Server.actors.chara.ai.state diff --git a/FFXIVClassic Map Server/actors/chara/ai/state/WeaponSkillState.cs b/FFXIVClassic Map Server/actors/chara/ai/state/WeaponSkillState.cs index 3b0da761..a6ecb15e 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/state/WeaponSkillState.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/state/WeaponSkillState.cs @@ -1,13 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.packets.send; namespace FFXIVClassic_Map_Server.actors.chara.ai.state { diff --git a/FFXIVClassic Map Server/actors/chara/ai/utils/AttackUtils.cs b/FFXIVClassic Map Server/actors/chara/ai/utils/AttackUtils.cs index cdd7865d..e2aa568c 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/utils/AttackUtils.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/utils/AttackUtils.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FFXIVClassic_Map_Server.Actors; +using FFXIVClassic_Map_Server.Actors; namespace FFXIVClassic_Map_Server.actors.chara.ai.utils { static class AttackUtils diff --git a/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs b/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs index c9ebdc92..85141818 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs @@ -1,15 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.packets.send.actor.battle; -using FFXIVClassic_Map_Server.actors.chara.player; using FFXIVClassic_Map_Server.actors.chara.npc; -using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.actors.chara.ai.utils diff --git a/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs b/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs index 730f9cac..61e6d8eb 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.chara.npc +namespace FFXIVClassic_Map_Server.actors.chara.npc { class ActorClass { diff --git a/FFXIVClassic Map Server/actors/chara/npc/Ally.cs b/FFXIVClassic Map Server/actors/chara/npc/Ally.cs index d8924544..ae0daf94 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/Ally.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/Ally.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FFXIVClassic_Map_Server.Actors; +using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.actors.chara.ai.controllers; diff --git a/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs b/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs index e12470cd..7d736201 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs @@ -1,22 +1,15 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.actors.chara.npc; -using FFXIVClassic_Map_Server.actors; using FFXIVClassic_Map_Server.actors.chara; using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.actors.chara.ai.controllers; -using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.actors.chara.ai.state; using FFXIVClassic_Map_Server.utils; using FFXIVClassic_Map_Server.packets.send.actor.battle; using FFXIVClassic_Map_Server.actors.chara.ai.utils; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.packets.send; using FFXIVClassic_Map_Server.Actors.Chara; namespace FFXIVClassic_Map_Server.Actors diff --git a/FFXIVClassic Map Server/actors/chara/npc/MobModifier.cs b/FFXIVClassic Map Server/actors/chara/npc/MobModifier.cs index 1e525cb0..20aa606d 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/MobModifier.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/MobModifier.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.chara.npc +namespace FFXIVClassic_Map_Server.actors.chara.npc { enum MobModifier { diff --git a/FFXIVClassic Map Server/actors/chara/npc/Npc.cs b/FFXIVClassic Map Server/actors/chara/npc/Npc.cs index a351e73b..6d681fea 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/Npc.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/Npc.cs @@ -1,22 +1,14 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors; -using FFXIVClassic_Map_Server.actors.area; using FFXIVClassic_Map_Server.actors.chara.npc; using FFXIVClassic_Map_Server.Actors.Chara; -using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.lua; -using FFXIVClassic_Map_Server.packets.receive.events; using FFXIVClassic_Map_Server.packets.send.actor; using FFXIVClassic_Map_Server.utils; -using MoonSharp.Interpreter; using MySql.Data.MySqlClient; using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_Map_Server.actors.chara.ai; namespace FFXIVClassic_Map_Server.Actors diff --git a/FFXIVClassic Map Server/actors/chara/npc/Pet.cs b/FFXIVClassic Map Server/actors/chara/npc/Pet.cs index 3068d023..ef7bcc85 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/Pet.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/Pet.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.actors.chara.ai.controllers; using FFXIVClassic_Map_Server.actors.chara.npc; -using FFXIVClassic_Map_Server.packets.send.actor; namespace FFXIVClassic_Map_Server.Actors { diff --git a/FFXIVClassic Map Server/actors/chara/npc/Retainer.cs b/FFXIVClassic Map Server/actors/chara/npc/Retainer.cs index ec82890e..2e6e2531 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/Retainer.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/Retainer.cs @@ -1,12 +1,6 @@ -using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.chara.player; +using FFXIVClassic_Map_Server.actors.chara.player; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor.inventory; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.chara.npc { @@ -18,7 +12,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.npc private uint retainerId; private Player ownerPlayer; - private Dictionary inventories = new Dictionary(); public Retainer(uint retainerId, ActorClass actorClass, Player player, float posX, float posY, float posZ, float rot) : base(0, actorClass, "myretainer", player.GetZone(), posX, posY, posZ, rot, 0, 0, null) @@ -27,33 +20,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.npc this.ownerPlayer = player; this.actorName = String.Format("_rtnre{0:x7}", actorId); - inventories[Inventory.NORMAL] = new Inventory(this, MAXSIZE_INVENTORY_NORMAL, Inventory.NORMAL); - inventories[Inventory.CURRENCY_CRYSTALS] = new Inventory(this, MAXSIZE_INVENTORY_CURRANCY, Inventory.CURRENCY_CRYSTALS); - inventories[Inventory.BAZAAR] = new Inventory(this, MAXSIZE_INVENTORY_BAZAAR, Inventory.BAZAAR); + itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL); + itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS); + itemPackages[ItemPackage.BAZAAR] = new ItemPackage(this, MAXSIZE_INVENTORY_BAZAAR, ItemPackage.BAZAAR); - inventories[Inventory.NORMAL].InitList(Database.GetInventory(this, Inventory.NORMAL)); - inventories[Inventory.CURRENCY_CRYSTALS].InitList(Database.GetInventory(this, Inventory.CURRENCY_CRYSTALS)); - inventories[Inventory.BAZAAR].InitList(Database.GetInventory(this, Inventory.BAZAAR)); + itemPackages[ItemPackage.NORMAL].InitList(Database.GetInventory(this, ItemPackage.NORMAL)); + itemPackages[ItemPackage.CURRENCY_CRYSTALS].InitList(Database.GetInventory(this, ItemPackage.CURRENCY_CRYSTALS)); + itemPackages[ItemPackage.BAZAAR].InitList(Database.GetInventory(this, ItemPackage.BAZAAR)); } - public Inventory GetInventory(ushort type) - { - if (inventories.ContainsKey(type)) - return inventories[type]; - else - return null; - } - - public void SendFullRetainerInventory(Player player) - { - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId)); - inventories[Inventory.NORMAL].SendFullInventory(player); - inventories[Inventory.CURRENCY_CRYSTALS].SendFullInventory(player); - inventories[Inventory.BAZAAR].SendFullInventory(player); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); - } - - public uint getRetainerId() + public uint GetRetainerId() { return retainerId; } diff --git a/FFXIVClassic Map Server/actors/chara/player/Equipment.cs b/FFXIVClassic Map Server/actors/chara/player/Equipment.cs deleted file mode 100644 index 87ad1210..00000000 --- a/FFXIVClassic Map Server/actors/chara/player/Equipment.cs +++ /dev/null @@ -1,236 +0,0 @@ -using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.dataobjects; -using FFXIVClassic_Map_Server.packets.send.actor.inventory; -using System.Collections.Generic; - -namespace FFXIVClassic_Map_Server.actors.chara.player -{ - class Equipment - { - public const int SLOT_MAINHAND = 0; - public const int SLOT_OFFHAND = 1; - public const int SLOT_THROWINGWEAPON = 4; - public const int SLOT_PACK = 5; - public const int SLOT_POUCH = 6; - public const int SLOT_HEAD = 8; - public const int SLOT_UNDERSHIRT = 9; - public const int SLOT_BODY = 10; - public const int SLOT_UNDERGARMENT = 11; - public const int SLOT_LEGS = 12; - public const int SLOT_HANDS = 13; - public const int SLOT_BOOTS = 14; - public const int SLOT_WAIST = 15; - public const int SLOT_NECK = 16; - public const int SLOT_EARS = 17; - public const int SLOT_WRISTS = 19; - public const int SLOT_RIGHTFINGER = 21; - public const int SLOT_LEFTFINGER = 22; - - private Player owner; - private ushort inventoryCapacity; - private ushort inventoryCode; - private InventoryItem[] list; - private Inventory normalInventory; - - private bool writeToDB = true; - - public Equipment(Player ownerPlayer, Inventory normalInventory, ushort capacity, ushort code) - { - owner = ownerPlayer; - inventoryCapacity = capacity; - inventoryCode = code; - list = new InventoryItem[inventoryCapacity]; - this.normalInventory = normalInventory; - } - - public InventoryItem GetItemAtSlot(ushort slot) - { - if (slot < list.Length) - return list[slot]; - else - return null; - } - - public void SendCheckEquipmentToPlayer(Player toPlayer) - { - List items = new List(); - for (ushort i = 0; i < list.Length; i++) - { - if (list[i] != null) - { - InventoryItem equipItem = new InventoryItem(list[i], i); - items.Add(equipItem); - } - } - - toPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER)); - int currentIndex = 0; - - while (true) - { - if (items.Count - currentIndex >= 16) - toPlayer.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); - else if (items.Count - currentIndex > 1) - toPlayer.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); - else if (items.Count - currentIndex == 1) - { - toPlayer.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); - currentIndex++; - } - else - break; - } - toPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - } - - public void SendFullEquipment(bool DoClear) - { - List slotsToUpdate = new List(); - for (ushort i = 0; i < list.Length; i++) - { - if (list[i] == null && DoClear) - slotsToUpdate.Add(0); - else if (list[i] != null) - slotsToUpdate.Add(i); - } - - owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendEquipmentPackets(slotsToUpdate); - owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - } - - public void SetEquipment(ushort[] slots, ushort[] itemSlots) - { - if (slots.Length != itemSlots.Length) - return; - - for (int i = 0; i < slots.Length; i++) - { - InventoryItem item = normalInventory.GetItemAtSlot(itemSlots[i]); - - if (item == null) - continue; - - Database.EquipItem(owner, slots[i], item.uniqueId); - list[slots[i]] = normalInventory.GetItemAtSlot(itemSlots[i]); - } - - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); - SendFullEquipment(false); - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); - } - - public void SetEquipment(InventoryItem[] toEquip) - { - List slotsToUpdate = new List(); - for (ushort i = 0; i < toEquip.Length; i++) - { - if (toEquip[i] != null) - slotsToUpdate.Add(i); - } - list = toEquip; - } - - public void Equip(ushort slot, ushort invSlot) - { - InventoryItem item = normalInventory.GetItemAtSlot(invSlot); - - if (item == null) - return; - - Equip(slot, item); - } - - public void Equip(ushort slot, InventoryItem item) - { - if (slot >= list.Length) - return; - - if (writeToDB) - Database.EquipItem(owner, slot, item.uniqueId); - - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); - - if (list[slot] != null) - normalInventory.RefreshItem(owner, list[slot], item); - else - normalInventory.RefreshItem(owner, item); - - owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendEquipmentPackets(slot, item); - owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); - - list[slot] = item; - owner.CalculateBaseStats();// RecalculateStats(); - } - - public void ToggleDBWrite(bool flag) - { - writeToDB = flag; - } - - public void Unequip(ushort slot) - { - if (slot >= list.Length) - return; - - if (writeToDB) - Database.UnequipItem(owner, slot); - - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); - - normalInventory.RefreshItem(owner, list[slot]); - - owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); - SendEquipmentPackets(slot, null); - owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); - - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); - - list[slot] = null; - owner.RecalculateStats(); - } - - private void SendEquipmentPackets(ushort equipSlot, InventoryItem item) - { - if (item == null) - owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, equipSlot)); - else - owner.QueuePacket(EquipmentListX01Packet.BuildPacket(owner.actorId, equipSlot, item.slot)); - } - - private void SendEquipmentPackets(List slotsToUpdate) - { - - int currentIndex = 0; - - while (true) - { - if (slotsToUpdate.Count - currentIndex >= 64) - owner.QueuePacket(EquipmentListX64Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); - else if (slotsToUpdate.Count - currentIndex >= 32) - owner.QueuePacket(EquipmentListX32Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); - else if (slotsToUpdate.Count - currentIndex >= 16) - owner.QueuePacket(EquipmentListX16Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); - else if (slotsToUpdate.Count - currentIndex > 1) - owner.QueuePacket(EquipmentListX08Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); - else if (slotsToUpdate.Count - currentIndex == 1) - { - owner.QueuePacket(EquipmentListX01Packet.BuildPacket(owner.actorId, slotsToUpdate[currentIndex], list[slotsToUpdate[currentIndex]].slot)); - currentIndex++; - } - else - break; - } - - } - - public int GetCapacity() - { - return list.Length; - } - - } -} diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index 5dfc5c4e..6bac9570 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -23,19 +23,12 @@ using FFXIVClassic_Map_Server.packets.send.actor.inventory; using FFXIVClassic_Map_Server.packets.send.player; using FFXIVClassic_Map_Server.packets.send.actor.battle; using FFXIVClassic_Map_Server.packets.receive.events; +using static FFXIVClassic_Map_Server.LuaUtils; namespace FFXIVClassic_Map_Server.Actors { class Player : Character { - public const int MAXSIZE_INVENTORY_NORMAL = 200; - public const int MAXSIZE_INVENTORY_CURRANCY = 320; - public const int MAXSIZE_INVENTORY_KEYITEMS = 500; - public const int MAXSIZE_INVENTORY_LOOT = 10; - public const int MAXSIZE_INVENTORY_MELDREQUEST = 4; - public const int MAXSIZE_INVENTORY_BAZAAR = 10; - public const int MAXSIZE_INVENTORY_EQUIPMENT = 35; - public const int TIMER_TOTORAK = 0; public const int TIMER_DZEMAEL = 1; public const int TIMER_BOWL_OF_EMBERS_HARD = 2; @@ -62,6 +55,25 @@ namespace FFXIVClassic_Map_Server.Actors public const int NPCLS_ACTIVE = 2; public const int NPCLS_ALERT = 3; + public const int SLOT_MAINHAND = 0; + public const int SLOT_OFFHAND = 1; + public const int SLOT_THROWINGWEAPON = 4; + public const int SLOT_PACK = 5; + public const int SLOT_POUCH = 6; + public const int SLOT_HEAD = 8; + public const int SLOT_UNDERSHIRT = 9; + public const int SLOT_BODY = 10; + public const int SLOT_UNDERGARMENT = 11; + public const int SLOT_LEGS = 12; + public const int SLOT_HANDS = 13; + public const int SLOT_BOOTS = 14; + public const int SLOT_WAIST = 15; + public const int SLOT_NECK = 16; + public const int SLOT_EARS = 17; + public const int SLOT_WRISTS = 19; + public const int SLOT_RIGHTFINGER = 21; + public const int SLOT_LEFTFINGER = 22; + public static int[] MAXEXP = {570, 700, 880, 1100, 1500, 1800, 2300, 3200, 4300, 5000, //Level <= 10 5900, 6800, 7700, 8700, 9700, 11000, 12000, 13000, 15000, 16000, //Level <= 20 20000, 22000, 23000, 25000, 27000, 29000, 31000, 33000, 35000, 38000, //Level <= 30 @@ -71,7 +83,6 @@ namespace FFXIVClassic_Map_Server.Actors //Event Related public uint currentEventOwner = 0; public string currentEventName = ""; - public Coroutine currentEventRunning; //Player Info @@ -84,9 +95,10 @@ namespace FFXIVClassic_Map_Server.Actors public bool isGM = false; public bool isZoneChanging = true; - //Inventory - private Dictionary inventories = new Dictionary(); - private Equipment equipment; + //Trading + private Player otherTrader = null; + private ReferencedItemPackage myOfferings; + private bool isTradeAccepted = false; //GC Related public byte gcCurrent; @@ -115,6 +127,10 @@ namespace FFXIVClassic_Map_Server.Actors public uint homepoint = 0; public byte homepointInn = 0; + //Nameplate Stuff + public uint currentLSPlate = 0; + public byte repairType = 0; + //Retainer RetainerMeetingRelationGroup retainerMeetingGroup = null; public Retainer currentSpawnedRetainer = null; @@ -140,14 +156,13 @@ namespace FFXIVClassic_Map_Server.Actors moveSpeeds[2] = SetActorSpeedPacket.DEFAULT_RUN; moveSpeeds[3] = SetActorSpeedPacket.DEFAULT_ACTIVE; - inventories[Inventory.NORMAL] = new Inventory(this, MAXSIZE_INVENTORY_NORMAL, Inventory.NORMAL); - inventories[Inventory.KEYITEMS] = new Inventory(this, MAXSIZE_INVENTORY_KEYITEMS, Inventory.KEYITEMS); - inventories[Inventory.CURRENCY_CRYSTALS] = new Inventory(this, MAXSIZE_INVENTORY_CURRANCY, Inventory.CURRENCY_CRYSTALS); - inventories[Inventory.MELDREQUEST] = new Inventory(this, MAXSIZE_INVENTORY_MELDREQUEST, Inventory.MELDREQUEST); - inventories[Inventory.BAZAAR] = new Inventory(this, MAXSIZE_INVENTORY_BAZAAR, Inventory.BAZAAR); - inventories[Inventory.LOOT] = new Inventory(this, MAXSIZE_INVENTORY_LOOT, Inventory.LOOT); - - equipment = new Equipment(this, inventories[Inventory.NORMAL], MAXSIZE_INVENTORY_EQUIPMENT, Inventory.EQUIPMENT); + itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, ItemPackage.MAXSIZE_NORMAL, ItemPackage.NORMAL); + itemPackages[ItemPackage.KEYITEMS] = new ItemPackage(this, ItemPackage.MAXSIZE_KEYITEMS, ItemPackage.KEYITEMS); + itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, ItemPackage.MAXSIZE_CURRANCY, ItemPackage.CURRENCY_CRYSTALS); + itemPackages[ItemPackage.MELDREQUEST] = new ItemPackage(this, ItemPackage.MAXSIZE_MELDREQUEST, ItemPackage.MELDREQUEST); + itemPackages[ItemPackage.BAZAAR] = new ItemPackage(this, ItemPackage.MAXSIZE_BAZAAR, ItemPackage.BAZAAR); + itemPackages[ItemPackage.LOOT] = new ItemPackage(this, ItemPackage.MAXSIZE_LOOT, ItemPackage.LOOT); + equipment = new ReferencedItemPackage(this, ItemPackage.MAXSIZE_EQUIPMENT, ItemPackage.EQUIPMENT); //Set the Skill level caps of all FFXIV (classes)skills to 50 for (int i = 0; i < charaWork.battleSave.skillLevelCap.Length; i++) @@ -230,7 +245,7 @@ namespace FFXIVClassic_Map_Server.Actors Database.LoadPlayerCharacter(this); lastPlayTimeUpdate = Utils.UnixTimeStampUTC(); - + this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this)); allegiance = CharacterTargetingAllegiance.Player; CalculateBaseStats(); @@ -476,7 +491,18 @@ namespace FFXIVClassic_Map_Server.Actors propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", i)); } - //NPC Linkshell + //Bazaar + CheckBazaarFlags(true); + if (charaWork.eventSave.repairType != 0) + propPacketUtil.AddProperty("charaWork.eventSave.repairType"); + if (charaWork.eventTemp.bazaarRetail) + propPacketUtil.AddProperty("charaWork.eventTemp.bazaarRetail"); + if (charaWork.eventTemp.bazaarRepair) + propPacketUtil.AddProperty("charaWork.eventTemp.bazaarRepair"); + if (charaWork.eventTemp.bazaarMateria) + propPacketUtil.AddProperty("charaWork.eventTemp.bazaarMateria"); + + //NPC Linkshell for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++) { if (playerWork.npcLinkshellChatCalling[i] != false) @@ -516,14 +542,14 @@ namespace FFXIVClassic_Map_Server.Actors //GetSpawnPackets(actorId, spawnType).DebugPrintPacket(); #region Inventory & Equipment - QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId)); - inventories[Inventory.NORMAL].SendFullInventory(this); - inventories[Inventory.CURRENCY_CRYSTALS].SendFullInventory(this); - inventories[Inventory.KEYITEMS].SendFullInventory(this); - inventories[Inventory.BAZAAR].SendFullInventory(this); - inventories[Inventory.MELDREQUEST].SendFullInventory(this); - inventories[Inventory.LOOT].SendFullInventory(this); - equipment.SendFullEquipment(false); + QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + itemPackages[ItemPackage.NORMAL].SendFullPackage(this); + itemPackages[ItemPackage.CURRENCY_CRYSTALS].SendFullPackage(this); + itemPackages[ItemPackage.KEYITEMS].SendFullPackage(this); + itemPackages[ItemPackage.BAZAAR].SendFullPackage(this); + itemPackages[ItemPackage.MELDREQUEST].SendFullPackage(this); + itemPackages[ItemPackage.LOOT].SendFullPackage(this); + equipment.SendUpdate(this); playerSession.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); #endregion @@ -625,6 +651,33 @@ namespace FFXIVClassic_Map_Server.Actors } } + public void BroadcastPackets(List packets, bool sendToSelf) + { + foreach (SubPacket packet in packets) + { + if (sendToSelf) + { + + SubPacket clonedPacket = new SubPacket(packet, actorId); + QueuePacket(clonedPacket); + } + + foreach (Actor a in playerSession.actorInstanceList) + { + if (a is Player) + { + Player p = (Player)a; + + if (p.Equals(this)) + continue; + + SubPacket clonedPacket = new SubPacket(packet, a.actorId); + p.QueuePacket(clonedPacket); + } + } + } + } + public void BroadcastPacket(SubPacket packet, bool sendToSelf) { if (sendToSelf) @@ -940,6 +993,8 @@ namespace FFXIVClassic_Map_Server.Actors public void PrepareClassChange(byte classId) { //If new class, init abilties and level + if (charaWork.battleSave.skillLevel[classId - 1] <= 0) + UpdateClassLevel(classId, 1); SendCharaExpInfo(); } @@ -1012,6 +1067,16 @@ namespace FFXIVClassic_Map_Server.Actors RecalculateStats(); } + public void UpdateClassLevel(byte classId, short level) + { + Database.PlayerCharacterUpdateClassLevel(this, classId, level); + charaWork.battleSave.skillLevel[classId - 1] = level; + ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/exp", this); + propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId-1)); + List packets = propertyBuilder.Done(); + QueuePackets(packets); + } + public void GraphicChange(int slot, InventoryItem invItem) { if (invItem == null) @@ -1057,18 +1122,68 @@ namespace FFXIVClassic_Map_Server.Actors BroadcastPacket(CreateAppearancePacket(), true); } - public Inventory GetInventory(ushort type) + public void SetRepairRequest(byte type) { - if (inventories.ContainsKey(type)) - return inventories[type]; - else - return null; + charaWork.eventSave.repairType = type; + ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/bazaar", this); + propPacketUtil.AddProperty("charaWork.eventSave.repairType"); + QueuePackets(propPacketUtil.Done()); } + public void CheckBazaarFlags(bool noUpdate = false) + { + bool isDealing = false, isRepairing = false, seekingItem = false; + lock (GetItemPackage(ItemPackage.BAZAAR)) + { + foreach (InventoryItem item in GetItemPackage(ItemPackage.BAZAAR).GetRawList()) + { + if (item == null) + break; + + if (item.GetBazaarMode() == InventoryItem.TYPE_SINGLE || item.GetBazaarMode() == InventoryItem.TYPE_MULTI || item.GetBazaarMode() == InventoryItem.TYPE_STACK) + isDealing = true; + if (item.GetBazaarMode() == InventoryItem.TYPE_SEEK_REPAIR) + isRepairing = true; + if (item.GetBazaarMode() == InventoryItem.TYPE_SEEK_ITEM) + isDealing = true; + + if (isDealing && isRepairing && seekingItem) + break; + } + } + + bool doUpdate = false; + + ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/bazaar", this); + if (charaWork.eventTemp.bazaarRetail != isDealing) + { + charaWork.eventTemp.bazaarRetail = isDealing; + propPacketUtil.AddProperty("charaWork.eventTemp.bazaarRetail"); + doUpdate = true; + } + + if (charaWork.eventTemp.bazaarRepair != isRepairing) + { + charaWork.eventTemp.bazaarRepair = isRepairing; + propPacketUtil.AddProperty("charaWork.eventTemp.bazaarRepair"); + doUpdate = true; + } + + if (charaWork.eventTemp.bazaarMateria != (GetItemPackage(ItemPackage.MELDREQUEST).GetCount() != 0)) + { + charaWork.eventTemp.bazaarMateria = GetItemPackage(ItemPackage.MELDREQUEST).GetCount() != 0; + propPacketUtil.AddProperty("charaWork.eventTemp.bazaarMateria"); + doUpdate = true; + } + + if (!noUpdate && doUpdate) + BroadcastPackets(propPacketUtil.Done(), true); + } + public int GetCurrentGil() { - if (GetInventory(Inventory.CURRENCY_CRYSTALS).HasItem(1000001)) - return GetInventory(Inventory.CURRENCY_CRYSTALS).GetItemByCatelogId(1000001).quantity; + if (HasItem(1000001)) + return GetItemPackage(ItemPackage.CURRENCY_CRYSTALS).GetItemByCatelogId(1000001).quantity; else return 0; } @@ -1094,7 +1209,7 @@ namespace FFXIVClassic_Map_Server.Actors return isZoneChanging; } - public Equipment GetEquipment() + public ReferencedItemPackage GetEquipment() { return equipment; } @@ -1578,16 +1693,10 @@ namespace FFXIVClassic_Map_Server.Actors else return; - QueuePacket(InventoryBeginChangePacket.BuildPacket(toBeExamined.actorId)); - toBeExamined.GetEquipment().SendCheckEquipmentToPlayer(this); + QueuePacket(InventoryBeginChangePacket.BuildPacket(toBeExamined.actorId, true)); + toBeExamined.GetEquipment().SendUpdateAsItemPackage(this, ItemPackage.MAXSIZE_EQUIPMENT_OTHERPLAYER, ItemPackage.EQUIPMENT_OTHERPLAYER); QueuePacket(InventoryEndChangePacket.BuildPacket(toBeExamined.actorId)); - } - - public void SendMyTradeToPlayer(Player player) - { - Inventory tradeInventory = new Inventory(this, 4, Inventory.TRADE); - tradeInventory.SendFullInventory(player); - } + } public void SendDataPacket(params object[] parameters) { @@ -1599,13 +1708,15 @@ namespace FFXIVClassic_Map_Server.Actors public void StartEvent(Actor owner, EventStartPacket start) { + currentEventOwner = start.scriptOwnerActorID; + currentEventName = start.triggerName; LuaEngine.GetInstance().EventStarted(this, owner, start); } public void UpdateEvent(EventUpdatePacket update) { - LuaEngine.GetInstance().OnEventUpdate(this, update.luaParams); - } + LuaEngine.GetInstance().OnEventUpdate(this, update.luaParams); + } public void KickEvent(Actor actor, string conditionName, params object[] parameters) { @@ -1613,7 +1724,18 @@ namespace FFXIVClassic_Map_Server.Actors return; List lParams = LuaUtils.CreateLuaParamList(parameters); - SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, conditionName, lParams); + SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, 0x75dc1705, conditionName, lParams); + spacket.DebugPrintSubPacket(); + QueuePacket(spacket); + } + + public void KickEventSpecial(Actor actor, uint unknown, string conditionName, params object[] parameters) + { + if (actor == null) + return; + + List lParams = LuaUtils.CreateLuaParamList(parameters); + SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, unknown, conditionName, lParams); spacket.DebugPrintSubPacket(); QueuePacket(spacket); } @@ -1621,7 +1743,7 @@ namespace FFXIVClassic_Map_Server.Actors public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte unknown) { QueuePacket(packets.send.actor.events.SetEventStatus.BuildPacket(actor.actorId, enabled, unknown, conditionName)); - } + } public void RunEventFunction(string functionName, params object[] parameters) { @@ -2475,7 +2597,7 @@ namespace FFXIVClassic_Map_Server.Actors base.CalculateBaseStats(); //Add weapon property mod var equip = GetEquipment(); - var mainHandItem = equip.GetItemAtSlot(Equipment.SLOT_MAINHAND); + var mainHandItem = equip.GetItemAtSlot(SLOT_MAINHAND); var damageAttribute = 0; var attackDelay = 3000; var hitCount = 1; @@ -2549,5 +2671,120 @@ namespace FFXIVClassic_Map_Server.Actors return equippedItem != null && equippedItem.itemId == itemId; } + public Retainer GetSpawnedRetainer() + { + return currentSpawnedRetainer; + } + + public void StartTradeTransaction(Player otherPlayer) + { + myOfferings = new ReferencedItemPackage(this, ItemPackage.MAXSIZE_TRADE, ItemPackage.TRADE); + otherTrader = otherPlayer; + isTradeAccepted = false; + } + + public Player GetOtherTrader() + { + return otherTrader; + } + + public ReferencedItemPackage GetTradeOfferings() + { + return myOfferings; + } + + public bool IsTrading() + { + return otherTrader != null; + } + + public bool IsTradeAccepted() + { + return isTradeAccepted; + } + + public void AddTradeItem(ushort slot, ItemRefParam chosenItem, int tradeQuantity) + { + if (!IsTrading()) + return; + + //Get chosen item + InventoryItem offeredItem = itemPackages[chosenItem.itemPackage].GetItemAtSlot(chosenItem.slot); + offeredItem.SetTradeQuantity(tradeQuantity); + + myOfferings.Set(slot, offeredItem); + SendTradePackets(); + } + + public void RemoveTradeItem(ushort slot) + { + if (!IsTrading()) + return; + + InventoryItem offeredItem = myOfferings.GetItemAtSlot(slot); + offeredItem.SetNormal(); + + myOfferings.Clear(slot); + SendTradePackets(); + } + + public void ClearTradeItems() + { + if (!IsTrading()) + return; + + for (ushort i = 0; i < myOfferings.GetCapacity(); i++) + { + InventoryItem offeredItem = myOfferings.GetItemAtSlot(i); + if (offeredItem != null) + offeredItem.SetNormal(); + } + + myOfferings.ClearAll(); + SendTradePackets(); + } + + private void SendTradePackets() + { + //Send to self + QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + myOfferings.SendUpdate(this); + QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + + //Send to other trader + otherTrader.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + myOfferings.SendUpdateAsItemPackage(otherTrader); + otherTrader.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + } + + public void AcceptTrade(bool accepted) + { + if (!IsTrading()) + return; + isTradeAccepted = accepted; + } + + public void FinishTradeTransaction() + { + if (myOfferings != null) + { + myOfferings.ClearAll(); + for (ushort i = 0; i < myOfferings.GetCapacity(); i++) + { + InventoryItem offeredItem = myOfferings.GetItemAtSlot(i); + if (offeredItem != null) + offeredItem.SetNormal(); + } + + QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + myOfferings.SendUpdate(this); + QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + } + + isTradeAccepted = false; + myOfferings = null; + otherTrader = null; + } + } } diff --git a/FFXIVClassic Map Server/actors/director/Director.cs b/FFXIVClassic Map Server/actors/director/Director.cs index db46a3cd..3f3c5a6b 100644 --- a/FFXIVClassic Map Server/actors/director/Director.cs +++ b/FFXIVClassic Map Server/actors/director/Director.cs @@ -8,7 +8,6 @@ using FFXIVClassic_Map_Server.packets.send.actor; using MoonSharp.Interpreter; using System; using System.Collections.Generic; -using System.IO; namespace FFXIVClassic_Map_Server.actors.director { diff --git a/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs b/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs index 0bfa49a4..578fefc9 100644 --- a/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs +++ b/FFXIVClassic Map Server/actors/director/GuildleveDirector.cs @@ -1,15 +1,10 @@ using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.area; using FFXIVClassic_Map_Server.actors.director.Work; -using FFXIVClassic_Map_Server.actors.group; using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.utils; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.director { diff --git a/FFXIVClassic Map Server/actors/director/Work/GuildleveWork.cs b/FFXIVClassic Map Server/actors/director/Work/GuildleveWork.cs index 105a427d..c69929c4 100644 --- a/FFXIVClassic Map Server/actors/director/Work/GuildleveWork.cs +++ b/FFXIVClassic Map Server/actors/director/Work/GuildleveWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.director.Work +namespace FFXIVClassic_Map_Server.actors.director.Work { class GuildleveWork diff --git a/FFXIVClassic Map Server/actors/group/ContentGroup.cs b/FFXIVClassic Map Server/actors/group/ContentGroup.cs index ca15fcbd..673a620f 100644 --- a/FFXIVClassic Map Server/actors/group/ContentGroup.cs +++ b/FFXIVClassic Map Server/actors/group/ContentGroup.cs @@ -5,12 +5,7 @@ using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.packets.send.group; using FFXIVClassic_Map_Server.packets.send.groups; -using FFXIVClassic_Map_Server.utils; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.group { diff --git a/FFXIVClassic Map Server/actors/group/GLContentGroup.cs b/FFXIVClassic Map Server/actors/group/GLContentGroup.cs index ada138f3..169d58e2 100644 --- a/FFXIVClassic Map Server/actors/group/GLContentGroup.cs +++ b/FFXIVClassic Map Server/actors/group/GLContentGroup.cs @@ -1,16 +1,4 @@ -using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.director; -using FFXIVClassic_Map_Server.actors.group.Work; -using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.dataobjects; -using FFXIVClassic_Map_Server.packets.send.group; -using FFXIVClassic_Map_Server.packets.send.groups; -using FFXIVClassic_Map_Server.utils; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using FFXIVClassic_Map_Server.actors.director; namespace FFXIVClassic_Map_Server.actors.group { diff --git a/FFXIVClassic Map Server/actors/group/MonsterParty.cs b/FFXIVClassic Map Server/actors/group/MonsterParty.cs index 7c0b344f..ba1085d9 100644 --- a/FFXIVClassic Map Server/actors/group/MonsterParty.cs +++ b/FFXIVClassic Map Server/actors/group/MonsterParty.cs @@ -2,11 +2,7 @@ using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.packets.send.group; using FFXIVClassic_Map_Server.packets.send.groups; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.group { diff --git a/FFXIVClassic Map Server/actors/group/Party.cs b/FFXIVClassic Map Server/actors/group/Party.cs index 58e438dd..9f7e62b8 100644 --- a/FFXIVClassic Map Server/actors/group/Party.cs +++ b/FFXIVClassic Map Server/actors/group/Party.cs @@ -1,12 +1,6 @@ -using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.actors.group.Work; -using FFXIVClassic_Map_Server.dataobjects; +using FFXIVClassic_Map_Server.actors.group.Work; using FFXIVClassic_Map_Server.packets.send.group; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.group { diff --git a/FFXIVClassic Map Server/actors/group/Relation.cs b/FFXIVClassic Map Server/actors/group/RelationGroup.cs similarity index 91% rename from FFXIVClassic Map Server/actors/group/Relation.cs rename to FFXIVClassic Map Server/actors/group/RelationGroup.cs index 600c8b9c..0afa2570 100644 --- a/FFXIVClassic Map Server/actors/group/Relation.cs +++ b/FFXIVClassic Map Server/actors/group/RelationGroup.cs @@ -3,21 +3,17 @@ using FFXIVClassic_Map_Server.actors.group.Work; using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.packets.send.group; using FFXIVClassic_Map_Server.packets.send.groups; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.group { - class Relation : Group + class RelationGroup : Group { public RelationWork work = new RelationWork(); private uint charaOther; private ulong topicGroup; - public Relation(ulong groupIndex, uint host, uint other, uint command, ulong topicGroup) : base (groupIndex) + public RelationGroup(ulong groupIndex, uint host, uint other, uint command, ulong topicGroup) : base (groupIndex) { this.charaOther = other; work._globalTemp.host = ((ulong)host << 32) | (0xc17909); diff --git a/FFXIVClassic Map Server/actors/group/RetainerMeetingRelationGroup.cs b/FFXIVClassic Map Server/actors/group/RetainerMeetingRelationGroup.cs index bbab8b32..6a428122 100644 --- a/FFXIVClassic Map Server/actors/group/RetainerMeetingRelationGroup.cs +++ b/FFXIVClassic Map Server/actors/group/RetainerMeetingRelationGroup.cs @@ -4,11 +4,7 @@ using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using FFXIVClassic_Map_Server.packets.send.group; using FFXIVClassic_Map_Server.packets.send.groups; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.actors.group { diff --git a/FFXIVClassic Map Server/actors/group/TradeGroup.cs b/FFXIVClassic Map Server/actors/group/TradeGroup.cs new file mode 100644 index 00000000..92e2da6b --- /dev/null +++ b/FFXIVClassic Map Server/actors/group/TradeGroup.cs @@ -0,0 +1,73 @@ +using FFXIVClassic.Common; +using FFXIVClassic_Map_Server.actors.group.Work; +using FFXIVClassic_Map_Server.dataobjects; +using FFXIVClassic_Map_Server.packets.send.group; +using FFXIVClassic_Map_Server.packets.send.groups; +using System.Collections.Generic; + +namespace FFXIVClassic_Map_Server.actors.group +{ + class TradeGroup : Group + { + public RelationWork work = new RelationWork(); + private uint charaOther; + private ulong topicGroup; + + public TradeGroup(ulong groupIndex, uint host, uint other) + : base(groupIndex) + { + this.charaOther = other; + work._globalTemp.host = ((ulong)host << 32) | (0xc17909); + work._globalTemp.variableCommand = 30001; + } + + public uint GetHost() + { + return (uint)(((ulong)work._globalTemp.host >> 32) & 0xFFFFFFFF); + } + + public uint GetOther() + { + return charaOther; + } + + public override int GetMemberCount() + { + return 2; + } + + public override uint GetTypeId() + { + return Group.TradeRelationGroup; + } + + public ulong GetTopicGroupIndex() + { + return topicGroup; + } + + public override List BuildMemberList(uint id) + { + List groupMembers = new List(); + + uint hostId = (uint)((work._globalTemp.host >> 32) & 0xFFFFFFFF); + + groupMembers.Add(new GroupMember(hostId, -1, 0, false, Server.GetServer().GetSession(hostId) != null, Server.GetWorldManager().GetActorInWorld(hostId).customDisplayName)); + groupMembers.Add(new GroupMember(charaOther, -1, 0, false, Server.GetServer().GetSession(charaOther) != null, Server.GetWorldManager().GetActorInWorld(charaOther).customDisplayName)); + return groupMembers; + } + + public override void SendInitWorkValues(Session session) + { + SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupIndex); + groupWork.addProperty(this, "work._globalTemp.host"); + groupWork.addProperty(this, "work._globalTemp.variableCommand"); + groupWork.setTarget("/_init"); + + SubPacket test = groupWork.buildPacket(session.id); + test.DebugPrintSubPacket(); + session.QueuePacket(test); + } + + } +} diff --git a/FFXIVClassic Map Server/actors/group/work/ContentGroupWork.cs b/FFXIVClassic Map Server/actors/group/work/ContentGroupWork.cs index 9029474f..85f0a929 100644 --- a/FFXIVClassic Map Server/actors/group/work/ContentGroupWork.cs +++ b/FFXIVClassic Map Server/actors/group/work/ContentGroupWork.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class ContentGroupWork { diff --git a/FFXIVClassic Map Server/actors/group/work/GlobalTemp.cs b/FFXIVClassic Map Server/actors/group/work/GlobalTemp.cs index 4faf2864..6aa7e98d 100644 --- a/FFXIVClassic Map Server/actors/group/work/GlobalTemp.cs +++ b/FFXIVClassic Map Server/actors/group/work/GlobalTemp.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class GlobalTemp { diff --git a/FFXIVClassic Map Server/actors/group/work/GroupGlobalSave.cs b/FFXIVClassic Map Server/actors/group/work/GroupGlobalSave.cs index 3027fd05..e6ff8e0e 100644 --- a/FFXIVClassic Map Server/actors/group/work/GroupGlobalSave.cs +++ b/FFXIVClassic Map Server/actors/group/work/GroupGlobalSave.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class GroupGlobalSave { diff --git a/FFXIVClassic Map Server/actors/group/work/GroupGlobalTemp.cs b/FFXIVClassic Map Server/actors/group/work/GroupGlobalTemp.cs index 18a1f826..33ccf7de 100644 --- a/FFXIVClassic Map Server/actors/group/work/GroupGlobalTemp.cs +++ b/FFXIVClassic Map Server/actors/group/work/GroupGlobalTemp.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class GroupGlobalTemp { diff --git a/FFXIVClassic Map Server/actors/group/work/GroupMemberSave.cs b/FFXIVClassic Map Server/actors/group/work/GroupMemberSave.cs index 011e5b0a..ebbba2d8 100644 --- a/FFXIVClassic Map Server/actors/group/work/GroupMemberSave.cs +++ b/FFXIVClassic Map Server/actors/group/work/GroupMemberSave.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class GroupMemberSave { diff --git a/FFXIVClassic Map Server/actors/group/work/PartyWork.cs b/FFXIVClassic Map Server/actors/group/work/PartyWork.cs index d3b75640..e3c6adcc 100644 --- a/FFXIVClassic Map Server/actors/group/work/PartyWork.cs +++ b/FFXIVClassic Map Server/actors/group/work/PartyWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class PartyWork { diff --git a/FFXIVClassic Map Server/actors/group/work/RelationWork.cs b/FFXIVClassic Map Server/actors/group/work/RelationWork.cs index b6f2f33a..1b275e39 100644 --- a/FFXIVClassic Map Server/actors/group/work/RelationWork.cs +++ b/FFXIVClassic Map Server/actors/group/work/RelationWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.actors.group.Work +namespace FFXIVClassic_Map_Server.actors.group.Work { class RelationWork { diff --git a/FFXIVClassic Map Server/actors/quest/Quest.cs b/FFXIVClassic Map Server/actors/quest/Quest.cs index 109f8570..2011fc36 100644 --- a/FFXIVClassic Map Server/actors/quest/Quest.cs +++ b/FFXIVClassic Map Server/actors/quest/Quest.cs @@ -1,5 +1,4 @@ -using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.lua; +using FFXIVClassic_Map_Server.lua; using Newtonsoft.Json; using System; using System.Collections.Generic; diff --git a/FFXIVClassic Map Server/dataobjects/GuildleveData.cs b/FFXIVClassic Map Server/dataobjects/GuildleveData.cs index 32834f07..f50017a2 100644 --- a/FFXIVClassic Map Server/dataobjects/GuildleveData.cs +++ b/FFXIVClassic Map Server/dataobjects/GuildleveData.cs @@ -1,9 +1,4 @@ using MySql.Data.MySqlClient; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.dataobjects { diff --git a/FFXIVClassic Map Server/dataobjects/InventoryItem.cs b/FFXIVClassic Map Server/dataobjects/InventoryItem.cs index 13c51499..c6c87382 100644 --- a/FFXIVClassic Map Server/dataobjects/InventoryItem.cs +++ b/FFXIVClassic Map Server/dataobjects/InventoryItem.cs @@ -1,73 +1,149 @@ -using System; +using FFXIVClassic_Map_Server.Actors; +using System; using System.IO; namespace FFXIVClassic_Map_Server.dataobjects { class InventoryItem { + public const byte DEALINGMODE_NONE = 0; + public const byte DEALINGMODE_REFERENCED = 1; + public const byte DEALINGMODE_PRICED = 2; + + public const byte TAG_EXCLUSIVE = 0x3; + public const byte TAG_DEALING = 0xC9; + public const byte TAG_ATTACHED = 0xCA; + + public const byte TYPE_SINGLE = 11; + public const byte TYPE_MULTI = 12; + public const byte TYPE_STACK = 13; + public const byte TYPE_SEEK_ITEM = 20; + public const byte TYPE_SEEK_REPAIR = 30; + public ulong uniqueId; public uint itemId; public int quantity = 1; - public ushort slot; - public byte itemType; + public byte dealingVal = 0; + public byte dealingMode = DEALINGMODE_NONE; + public int dealingAttached1 = 0; + public int dealingAttached2 = 0; + public int dealingAttached3 = 0; + + public byte[] tags = new byte[4]; + public byte[] tagValues = new byte[4]; + public byte quality = 1; - public int durability = 0; - public ushort spiritbind = 0; + private ulong attachedTo = 0; - public byte materia1 = 0; - public byte materia2 = 0; - public byte materia3 = 0; - public byte materia4 = 0; - public byte materia5 = 0; + public ItemModifier modifiers; + + public readonly ItemData itemData; + public Character owner = null; + public ushort slot = 0xFFFF; + public ushort linkSlot = 0xFFFF; + public ushort itemPackage = 0xFFFF; + + public class ItemModifier + { + public uint durability = 0; + public ushort use = 0; + public uint materiaId = 0; + public uint materiaLife = 0; + public byte mainQuality = 0; + public byte[] subQuality = new byte[3]; + public uint polish = 0; + public uint param1 = 0; + public uint param2 = 0; + public uint param3 = 0; + public ushort spiritbind = 0; + public byte[] materiaType = new byte[5]; + public byte[] materiaGrade = new byte[5]; + + public ItemModifier() + { + } + + public ItemModifier(MySql.Data.MySqlClient.MySqlDataReader reader) + { + durability = reader.GetUInt32("durability"); + mainQuality = reader.GetByte("mainQuality"); + subQuality[0] = reader.GetByte("subQuality1"); + subQuality[1] = reader.GetByte("subQuality2"); + subQuality[2] = reader.GetByte("subQuality3"); + param1 = reader.GetUInt32("param1"); + param2 = reader.GetUInt32("param2"); + param3 = reader.GetUInt32("param3"); + spiritbind = reader.GetUInt16("spiritbind"); + + ushort materia1 = reader.GetUInt16("materia1"); + ushort materia2 = reader.GetUInt16("materia2"); + ushort materia3 = reader.GetUInt16("materia3"); + ushort materia4 = reader.GetUInt16("materia4"); + ushort materia5 = reader.GetUInt16("materia5"); + + materiaType[0] = (byte)(materia1 & 0xFF); + materiaGrade[0] = (byte)((materia1 >> 8) & 0xFF); + materiaType[1] = (byte)(materia2 & 0xFF); + materiaGrade[1] = (byte)((materia2 >> 8) & 0xFF); + materiaType[2] = (byte)(materia3 & 0xFF); + materiaGrade[2] = (byte)((materia3 >> 8) & 0xFF); + materiaType[3] = (byte)(materia4 & 0xFF); + materiaGrade[3] = (byte)((materia4 >> 8) & 0xFF); + materiaType[4] = (byte)(materia5 & 0xFF); + materiaGrade[4] = (byte)((materia5 >> 8) & 0xFF); + } + + public void WriteBytes(BinaryWriter binWriter) + { + binWriter.Write((UInt32) durability); + binWriter.Write((UInt16) use); + binWriter.Write((UInt32) materiaId); + binWriter.Write((UInt32) materiaLife); + binWriter.Write((Byte) mainQuality); + binWriter.Write((Byte) subQuality[0]); + binWriter.Write((Byte) subQuality[1]); + binWriter.Write((Byte) subQuality[2]); + binWriter.Write((UInt32) polish); + binWriter.Write((UInt32) param1); + binWriter.Write((UInt32) param2); + binWriter.Write((UInt32) param3); + binWriter.Write((UInt16) spiritbind); + binWriter.Write((Byte) materiaType[0]); + binWriter.Write((Byte) materiaType[1]); + binWriter.Write((Byte) materiaType[2]); + binWriter.Write((Byte) materiaType[3]); + binWriter.Write((Byte) materiaType[4]); + binWriter.Write((Byte) materiaGrade[0]); + binWriter.Write((Byte) materiaGrade[1]); + binWriter.Write((Byte) materiaGrade[2]); + binWriter.Write((Byte) materiaGrade[3]); + binWriter.Write((Byte) materiaGrade[4]); + } + } //Bare Minimum - public InventoryItem(uint id, uint itemId) + public InventoryItem(uint id, ItemData data) { this.uniqueId = id; - this.itemId = itemId; + this.itemId = data.catalogID; + this.itemData = data; this.quantity = 1; - ItemData gItem = Server.GetItemGamedata(itemId); - itemType = gItem.isExclusive ? (byte)0x3 : (byte)0x0; + tags[1] = itemData.isExclusive ? TAG_EXCLUSIVE : (byte)0; } - - //For check command - public InventoryItem(InventoryItem item, ushort equipSlot) - { - this.uniqueId = item.uniqueId; - this.itemId = item.itemId; - this.quantity = item.quantity; - this.slot = equipSlot; - - this.itemType = item.itemType; - this.quality = item.quality; - - this.durability = item.durability; - this.spiritbind = item.spiritbind; - - this.materia1 = item.materia1; - this.materia2 = item.materia2; - this.materia3 = item.materia3; - this.materia4 = item.materia4; - this.materia5 = item.materia5; - } - - public InventoryItem(uint uniqueId, uint itemId, int quantity, byte itemType, byte qualityNumber, int durability, ushort spiritbind, byte materia1, byte materia2, byte materia3, byte materia4, byte materia5) + + public InventoryItem(uint uniqueId, ItemData itemData, int quantity, byte qualityNumber, ItemModifier modifiers = null) { this.uniqueId = uniqueId; - this.itemId = itemId; + this.itemId = itemData.catalogID; + this.itemData = itemData; this.quantity = quantity; - this.itemType = itemType; this.quality = qualityNumber; - this.durability = durability; - this.spiritbind = spiritbind; - this.materia1 = materia1; - this.materia2 = materia2; - this.materia3 = materia3; - this.materia4 = materia4; - this.materia5 = materia5; + this.modifiers = modifiers; + + tags[1] = itemData.isExclusive ? TAG_EXCLUSIVE : (byte)0; } public byte[] ToPacketBytes() @@ -81,42 +157,174 @@ namespace FFXIVClassic_Map_Server.dataobjects binWriter.Write((UInt64)uniqueId); binWriter.Write((Int32)quantity); binWriter.Write((UInt32)itemId); - binWriter.Write((UInt16)slot); - binWriter.Write((UInt16)0x0001); - binWriter.Write((UInt32)0x00000000); - binWriter.Write((UInt32)0x00000000); - binWriter.Write((UInt32)0x00000000); + if (linkSlot == 0xFFFF) + binWriter.Write((UInt16)slot); + else + binWriter.Write((UInt16)linkSlot); + linkSlot = 0xFFFF; - binWriter.Write((UInt32)itemType); + binWriter.Write((Byte)dealingVal); + binWriter.Write((Byte)dealingMode); - binWriter.Write((UInt32)0x00000000); + binWriter.Write((UInt32)dealingAttached1); + binWriter.Write((UInt32)dealingAttached2); + binWriter.Write((UInt32)dealingAttached3); - binWriter.Write((byte)quality); - binWriter.Write((byte)0x01); - binWriter.Write((uint)durability); + for (int i = 0; i < tags.Length; i++) + binWriter.Write((Byte) tags[i]); + for (int i = 0; i < tagValues.Length; i++) + binWriter.Write((Byte) tagValues[i]); - binWriter.BaseStream.Seek(0x10-0x06, SeekOrigin.Current); - - binWriter.Write((byte)0x01); - binWriter.Write((byte)0x01); - binWriter.Write((byte)0x01); - binWriter.Write((byte)0x01); - - binWriter.BaseStream.Seek(0x10, SeekOrigin.Current); - - binWriter.Write((ushort)spiritbind); - - binWriter.Write((byte)materia1); - binWriter.Write((byte)materia2); - binWriter.Write((byte)materia3); - binWriter.Write((byte)materia4); - binWriter.Write((byte)materia5); + binWriter.Write((Byte)quality); + + if (modifiers != null) + { + binWriter.Write((Byte)0x01); + modifiers.WriteBytes(binWriter); + } } } return data; } + public void SetQuantity(uint quantity) + { + lock (owner.GetItemPackage(itemPackage)) + { + this.quantity = (int)quantity; + if (quantity < 0) + quantity = 0; + Database.SetQuantity(uniqueId, this.quantity); + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + } + + public void ChangeQuantity(int quantityDelta) + { + lock (owner.GetItemPackage(itemPackage)) + { + this.quantity += quantityDelta; + if (quantity < 0) + quantity = 0; + + if (quantity == 0) + { + owner.RemoveItem(this); + return; + } + + Database.SetQuantity(uniqueId, this.quantity); + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + } + + public void RefreshPositioning(Character owner, ushort itemPackage, ushort slot) + { + this.owner = owner; + this.itemPackage = itemPackage; + this.slot = slot; + } + + public void SetHasAttached(bool isAttached) + { + tags[0] = isAttached ? TAG_ATTACHED : (byte)0; + } + + public void SetNormal() + { + tags[0] = 0; + tagValues[0] = 0; + attachedTo = 0; + dealingVal = 0; + dealingMode = 0; + dealingAttached1 = 0; + dealingAttached2 = 0; + dealingAttached3 = 0; + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + + public void SetDealing(byte mode, int price) + { + tags[0] = TAG_DEALING; + tagValues[0] = mode; + + if (mode == TYPE_SINGLE || mode == TYPE_MULTI || mode == TYPE_STACK) + { + dealingVal = 1; + dealingMode = DEALINGMODE_PRICED; + dealingAttached1 = 1; + dealingAttached2 = price; + dealingAttached3 = 0; + } + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + + public void SetDealingAttached(byte mode, ulong attached) + { + tags[0] = TAG_DEALING; + tagValues[0] = mode; + attachedTo = attached; + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + + public ulong GetAttached() + { + return attachedTo; + } + + public void SetAttachedIndex(ushort package, ushort index) + { + dealingVal = 1; + dealingMode = DEALINGMODE_REFERENCED; + dealingAttached1 = ((package << 16) | index); + dealingAttached2 = 0; + dealingAttached3 = 0; + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + + public void SetTradeQuantity(int quantity) + { + dealingAttached3 = quantity; + + if (owner != null) + owner.GetItemPackage(itemPackage).MarkDirty(this); + } + + public int GetTradeQuantity() + { + return dealingAttached3; + } + + public ItemData GetItemData() + { + return itemData; + } + + public byte GetBazaarMode() + { + if (tags[0] == 0xC9) + return tagValues[0]; + return 0; + } + + public bool IsSelling() + { + return GetBazaarMode() == TYPE_SINGLE || GetBazaarMode() == TYPE_MULTI || GetBazaarMode() == TYPE_STACK; + } + } } diff --git a/FFXIVClassic Map Server/dataobjects/SeamlessBoundry.cs b/FFXIVClassic Map Server/dataobjects/SeamlessBoundry.cs index 9e78f1eb..9d4fbcb3 100644 --- a/FFXIVClassic Map Server/dataobjects/SeamlessBoundry.cs +++ b/FFXIVClassic Map Server/dataobjects/SeamlessBoundry.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.dataobjects +namespace FFXIVClassic_Map_Server.dataobjects { class SeamlessBoundry { diff --git a/FFXIVClassic Map Server/dataobjects/TradeTransaction.cs b/FFXIVClassic Map Server/dataobjects/TradeTransaction.cs new file mode 100644 index 00000000..a3f09c86 --- /dev/null +++ b/FFXIVClassic Map Server/dataobjects/TradeTransaction.cs @@ -0,0 +1,3 @@ +namespace FFXIVClassic_Map_Server.dataobjects +{ +} diff --git a/FFXIVClassic Map Server/dataobjects/ZoneConnection.cs b/FFXIVClassic Map Server/dataobjects/ZoneConnection.cs index ef4ab7bf..6e6833bb 100644 --- a/FFXIVClassic Map Server/dataobjects/ZoneConnection.cs +++ b/FFXIVClassic Map Server/dataobjects/ZoneConnection.cs @@ -4,7 +4,6 @@ using System.Net.Sockets; using FFXIVClassic.Common; using System.Collections.Concurrent; using System.Net; -using System.Collections.Generic; using FFXIVClassic_Map_Server.packets.WorldPackets.Send; namespace FFXIVClassic_Map_Server.dataobjects @@ -19,7 +18,7 @@ namespace FFXIVClassic_Map_Server.dataobjects public void QueuePacket(SubPacket subpacket) { - if(SendPacketQueue.Count == 1000) + if (SendPacketQueue.Count == SendPacketQueue.BoundedCapacity - 1) FlushQueuedSendPackets(); SendPacketQueue.Add(subpacket); diff --git a/FFXIVClassic Map Server/lua/LuaEngine.cs b/FFXIVClassic Map Server/lua/LuaEngine.cs index 9382f4cb..65e6728a 100644 --- a/FFXIVClassic Map Server/lua/LuaEngine.cs +++ b/FFXIVClassic Map Server/lua/LuaEngine.cs @@ -11,8 +11,6 @@ using MoonSharp.Interpreter.Loaders; using System; using System.Collections.Generic; using System.IO; -using System.Diagnostics; -using FFXIVClassic_Map_Server.lua; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.area; using System.Threading; @@ -93,7 +91,7 @@ namespace FFXIVClassic_Map_Server.lua } } - public void OnSignal(string signal) + public void OnSignal(string signal, params object[] args) { List mToAwake = new List(); @@ -105,7 +103,7 @@ namespace FFXIVClassic_Map_Server.lua foreach (Coroutine key in mToAwake) { - DynValue value = key.Resume(); + DynValue value = key.Resume(args); ResolveResume(null, key, value); } } @@ -642,6 +640,7 @@ namespace FFXIVClassic_Map_Server.lua public static void RunGMCommand(Player player, String cmd, string[] param, bool help = false) { bool playerNull = player == null; + if (playerNull) { if (param.Length >= 2 && param[1].Contains("\"")) @@ -649,6 +648,10 @@ namespace FFXIVClassic_Map_Server.lua else if (param.Length > 2) player = Server.GetWorldManager().GetPCInWorld(param[1] + param[2]); } + + if (playerNull && param.Length >= 3) + player = Server.GetWorldManager().GetPCInWorld(param[1] + " " + param[2]); + // load from scripts/commands/gm/ directory var path = String.Format("./scripts/commands/gm/{0}.lua", cmd.ToLower()); diff --git a/FFXIVClassic Map Server/lua/LuaScript.cs b/FFXIVClassic Map Server/lua/LuaScript.cs index 6442ceca..1357e171 100644 --- a/FFXIVClassic Map Server/lua/LuaScript.cs +++ b/FFXIVClassic Map Server/lua/LuaScript.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MoonSharp; using MoonSharp.Interpreter; using NLog; using MoonSharp.Interpreter.Debugging; diff --git a/FFXIVClassic Map Server/lua/LuaUtils.cs b/FFXIVClassic Map Server/lua/LuaUtils.cs index f1181564..7c324a3a 100644 --- a/FFXIVClassic Map Server/lua/LuaUtils.cs +++ b/FFXIVClassic Map Server/lua/LuaUtils.cs @@ -12,19 +12,37 @@ namespace FFXIVClassic_Map_Server class LuaUtils { - public class Type7Param + public class ItemRefParam { public uint actorId; public byte unknown; public byte slot; - public byte inventoryType; + public byte itemPackage; - public Type7Param(uint actorId, byte unknown, byte slot, byte inventoryType) + public ItemRefParam(uint actorId, byte unknown, byte slot, byte itemPackage) { this.actorId = actorId; this.unknown = unknown; this.slot = slot; - this.inventoryType = inventoryType; + this.itemPackage = itemPackage; + } + } + + public class ItemOfferParam + { + public uint actorId; + public ushort offerSlot; + public ushort unknown1; + public ushort seekSlot; + public ushort unknown2; + + public ItemOfferParam(uint actorId, ushort unknown1, ushort offerSlot, ushort seekSlot, ushort unknown2) + { + this.actorId = actorId; + this.unknown1 = unknown1; + this.offerSlot = offerSlot; + this.seekSlot = seekSlot; + this.unknown2 = unknown2; } } @@ -81,13 +99,25 @@ namespace FFXIVClassic_Map_Server case 0x6: //Actor (By Id) value = Utils.SwapEndian(reader.ReadUInt32()); break; - case 0x7: //Weird one used for inventory - uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32()); - byte type7Unknown = reader.ReadByte(); - byte type7Slot = reader.ReadByte(); - byte type7InventoryType = reader.ReadByte(); - value = new Type7Param(type7ActorId, type7Unknown, type7Slot, type7InventoryType); + case 0x7: //Item Reference to Inventory Spot + { + uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32()); + byte type7Unknown = reader.ReadByte(); + byte type7Slot = reader.ReadByte(); + byte type7InventoryType = reader.ReadByte(); + value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType); + } break; + case 0x8: //Used for offering + { + uint actorId = Utils.SwapEndian(reader.ReadUInt32()); + ushort unk1 = Utils.SwapEndian(reader.ReadUInt16()); + ushort offerSlot = Utils.SwapEndian(reader.ReadUInt16()); + ushort seekSlot = Utils.SwapEndian(reader.ReadUInt16()); + ushort unk2 = Utils.SwapEndian(reader.ReadUInt16()); + value = new ItemOfferParam(actorId, unk1, offerSlot, seekSlot, unk2); + } + break; case 0x9: //Two Longs (only storing first one) value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64())); break; @@ -105,7 +135,13 @@ namespace FFXIVClassic_Map_Server if (isDone) break; - if (value != null) + //Special case cause fuck Type8 + if (value != null && value is ItemOfferParam) + { + luaParams.Add(new LuaParam(code, value)); + luaParams.Add(new LuaParam(5, null)); + } + else if (value != null) luaParams.Add(new LuaParam(code, value)); else if (wasNil) luaParams.Add(new LuaParam(code, value)); @@ -152,11 +188,11 @@ namespace FFXIVClassic_Map_Server writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value)); break; case 0x7: //Weird one used for inventory - Type7Param type7 = (Type7Param)l.value; + ItemRefParam type7 = (ItemRefParam)l.value; writer.Write((UInt32)Utils.SwapEndian((UInt32)type7.actorId)); writer.Write((Byte)type7.unknown); writer.Write((Byte)type7.slot); - writer.Write((Byte)type7.inventoryType); + writer.Write((Byte)type7.itemPackage); break; case 0x9: //Two Longs (only storing first one) writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item1)); @@ -226,7 +262,7 @@ namespace FFXIVClassic_Map_Server byte type7Unknown = reader.ReadByte(); byte type7Slot = reader.ReadByte(); byte type7InventoryType = reader.ReadByte(); - value = new Type7Param(type7ActorId, type7Unknown, type7Slot, type7InventoryType); + value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType); break; case 0x9: //Two Longs (only storing first one) value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64())); @@ -359,9 +395,13 @@ namespace FFXIVClassic_Map_Server { luaParams.Add(new LuaParam(0x6, ((Actor)o).actorId)); } - else if (o is Type7Param) + else if (o is ItemRefParam) { - luaParams.Add(new LuaParam(0x7, (Type7Param)o)); + luaParams.Add(new LuaParam(0x7, (ItemRefParam)o)); + } + else if (o is ItemOfferParam) + { + luaParams.Add(new LuaParam(0x8, (ItemOfferParam)o)); } else if (o is Type9Param) { @@ -416,16 +456,20 @@ namespace FFXIVClassic_Map_Server dumpString += String.Format("0x{0:X}", (uint)lParams[i].value); break; case 0x7: //Weird one used for inventory - Type7Param type7Param = ((Type7Param)lParams[i].value); - dumpString += String.Format("Type7 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X})", type7Param.actorId, type7Param.unknown, type7Param.slot, type7Param.inventoryType); + ItemRefParam type7Param = ((ItemRefParam)lParams[i].value); + dumpString += String.Format("Type7 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X})", type7Param.actorId, type7Param.unknown, type7Param.slot, type7Param.itemPackage); break; - case 0xC: //Byte - dumpString += String.Format("0x{0:X}", (byte)lParams[i].value); + case 0x8: //Weird one used for inventory + ItemOfferParam itemOfferParam = ((ItemOfferParam)lParams[i].value); + dumpString += String.Format("Type8 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X}, 0x{4:X})", itemOfferParam.actorId, itemOfferParam.unknown1, itemOfferParam.offerSlot, itemOfferParam.seekSlot, itemOfferParam.unknown2); break; case 0x9: //Long (+ 8 bytes ignored) Type9Param type9Param = ((Type9Param)lParams[i].value); dumpString += String.Format("Type9 Param: (0x{0:X}, 0x{1:X})", type9Param.item1, type9Param.item2); break; + case 0xC: //Byte + dumpString += String.Format("0x{0:X}", (byte)lParams[i].value); + break; case 0x1B: //Short? dumpString += String.Format("0x{0:X}", (ushort)lParams[i].value); break; diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Receive/ErrorPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Receive/ErrorPacket.cs index ae31462d..a7722045 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Receive/ErrorPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Receive/ErrorPacket.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Receive/LinkshellResultPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Receive/LinkshellResultPacket.cs new file mode 100644 index 00000000..24d5192b --- /dev/null +++ b/FFXIVClassic Map Server/packets/WorldPackets/Receive/LinkshellResultPacket.cs @@ -0,0 +1,31 @@ +using System; +using System.IO; + +namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive +{ + class LinkshellResultPacket + { + public int resultCode; + + public bool invalidPacket = false; + + public LinkshellResultPacket(byte[] data) + { + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryReader binReader = new BinaryReader(mem)) + { + try + { + resultCode = binReader.ReadInt32(); + } + catch (Exception) + { + invalidPacket = true; + } + } + } + + } + } +} diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Receive/PartySyncPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Receive/PartySyncPacket.cs index 92d7421e..aff6baff 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Receive/PartySyncPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Receive/PartySyncPacket.cs @@ -1,10 +1,5 @@ -using FFXIVClassic_Map_Server.actors.group; -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionBeginPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionBeginPacket.cs index f970004e..94a17102 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionBeginPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionBeginPacket.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionEndPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionEndPacket.cs index 77dd6395..9532d04a 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionEndPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Receive/SessionEndPacket.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/CreateLinkshellPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/CreateLinkshellPacket.cs index 5a64741f..66c4b25a 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/CreateLinkshellPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/CreateLinkshellPacket.cs @@ -1,7 +1,6 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; using System.Text; @@ -20,6 +19,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group using (BinaryWriter binWriter = new BinaryWriter(mem)) { binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name)); + binWriter.BaseStream.Seek(0x20, SeekOrigin.Begin); binWriter.Write((UInt16)crest); binWriter.Write((UInt32)master); } diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/DeleteLinkshellPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/DeleteLinkshellPacket.cs index d9460354..b2814854 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/DeleteLinkshellPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/DeleteLinkshellPacket.cs @@ -1,6 +1,5 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; -using System; using System.IO; using System.Text; diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/GroupInviteResultPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/GroupInviteResultPacket.cs index 02ca4f25..e1b3e8ac 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/GroupInviteResultPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/GroupInviteResultPacket.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellChangePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellChangePacket.cs index b4e894c8..bbd5985b 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellChangePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellChangePacket.cs @@ -1,8 +1,5 @@ using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; -using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInviteCancelPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInviteCancelPacket.cs index 9ad80615..6c6036f1 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInviteCancelPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInviteCancelPacket.cs @@ -1,11 +1,5 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInvitePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInvitePacket.cs index fee38aa0..02388c8c 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInvitePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellInvitePacket.cs @@ -1,11 +1,8 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellLeavePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellLeavePacket.cs index b902903f..f6a60bd1 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellLeavePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellLeavePacket.cs @@ -1,8 +1,6 @@ using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellRankChangePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellRankChangePacket.cs index 1791e492..a30d8238 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellRankChangePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/LinkshellRankChangePacket.cs @@ -1,8 +1,6 @@ using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyInvitePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyInvitePacket.cs index de8ccb31..1f8d7b07 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyInvitePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyInvitePacket.cs @@ -1,11 +1,8 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyLeavePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyLeavePacket.cs index 652e83d0..4bc9f132 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyLeavePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyLeavePacket.cs @@ -1,10 +1,7 @@ using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Text; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group { diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyModifyPacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyModifyPacket.cs index 4c58773e..fd7e8828 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyModifyPacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/Group/PartyModifyPacket.cs @@ -1,8 +1,6 @@ using FFXIVClassic.Common; -using FFXIVClassic_Map_Server.Actors; using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic Map Server/packets/WorldPackets/Send/WorldRequestZoneChangePacket.cs b/FFXIVClassic Map Server/packets/WorldPackets/Send/WorldRequestZoneChangePacket.cs index 197ca935..af9b736a 100644 --- a/FFXIVClassic Map Server/packets/WorldPackets/Send/WorldRequestZoneChangePacket.cs +++ b/FFXIVClassic Map Server/packets/WorldPackets/Send/WorldRequestZoneChangePacket.cs @@ -1,10 +1,6 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send { diff --git a/FFXIVClassic Map Server/packets/receive/AchievementProgressRequestPacket.cs b/FFXIVClassic Map Server/packets/receive/AchievementProgressRequestPacket.cs new file mode 100644 index 00000000..15c76bbe --- /dev/null +++ b/FFXIVClassic Map Server/packets/receive/AchievementProgressRequestPacket.cs @@ -0,0 +1,32 @@ +using System; +using System.IO; + +namespace FFXIVClassic_Map_Server.packets.receive +{ + class AchievementProgressRequestPacket + { + public bool invalidPacket = false; + + public uint achievementId; + public uint responseType; + + public AchievementProgressRequestPacket(byte[] data) + { + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryReader binReader = new BinaryReader(mem)) + { + try + { + achievementId = binReader.ReadUInt32(); + responseType = binReader.ReadUInt32(); + } + catch (Exception) + { + invalidPacket = true; + } + } + } + } + } +} diff --git a/FFXIVClassic Map Server/packets/receive/GroupCreatedPacket.cs b/FFXIVClassic Map Server/packets/receive/GroupCreatedPacket.cs index d4bd436a..620f2bab 100644 --- a/FFXIVClassic Map Server/packets/receive/GroupCreatedPacket.cs +++ b/FFXIVClassic Map Server/packets/receive/GroupCreatedPacket.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.receive { diff --git a/FFXIVClassic Map Server/packets/receive/UpdateItemPackagePacket.cs b/FFXIVClassic Map Server/packets/receive/UpdateItemPackagePacket.cs new file mode 100644 index 00000000..2f863013 --- /dev/null +++ b/FFXIVClassic Map Server/packets/receive/UpdateItemPackagePacket.cs @@ -0,0 +1,29 @@ +using System; +using System.IO; + +namespace FFXIVClassic_Map_Server.packets.receive +{ + class UpdateItemPackagePacket + { + public bool invalidPacket = false; + public uint actorID; + public uint packageId; + + public UpdateItemPackagePacket(byte[] data) + { + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryReader binReader = new BinaryReader(mem)) + { + try{ + actorID = binReader.ReadUInt32(); + packageId = binReader.ReadUInt32(); + } + catch (Exception){ + invalidPacket = true; + } + } + } + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/AddActorPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/AddActorPacket.cs index 33aec37c..8f5352c0 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/AddActorPacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/AddActorPacket.cs @@ -1,6 +1,6 @@ using FFXIVClassic.Common; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class AddActorPacket { diff --git a/FFXIVClassic Map Server/packets/send/Actor/DeleteAllActorsPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/DeleteAllActorsPacket.cs index c2234468..3921b0dd 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/DeleteAllActorsPacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/DeleteAllActorsPacket.cs @@ -1,6 +1,6 @@ using FFXIVClassic.Common; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class DeleteAllActorsPacket { diff --git a/FFXIVClassic Map Server/packets/send/Actor/PlayAnimationOnActorPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/PlayAnimationOnActorPacket.cs index cd5ed453..182b0107 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/PlayAnimationOnActorPacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/PlayAnimationOnActorPacket.cs @@ -1,9 +1,5 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.actor { diff --git a/FFXIVClassic Map Server/packets/send/Actor/PlayBGAnimation.cs b/FFXIVClassic Map Server/packets/send/Actor/PlayBGAnimation.cs index 0e8a4e59..753414d6 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/PlayBGAnimation.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/PlayBGAnimation.cs @@ -2,7 +2,7 @@ using System.IO; using System.Text; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class PlayBGAnimation { diff --git a/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs index 1d9d1fe0..02cf9a1f 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/SetActorPropetyPacket.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Reflection; using System.Text; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class SetActorPropetyPacket { @@ -110,6 +110,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor { string[] split = name.Split('.'); int arrayIndex = 0; + if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork") || split[0].Equals("guildleveWork"))) return false; diff --git a/FFXIVClassic Map Server/packets/send/Actor/SetActorStatePacket.cs b/FFXIVClassic Map Server/packets/send/Actor/SetActorStatePacket.cs index 8bab2346..b0a602fe 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/SetActorStatePacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/SetActorStatePacket.cs @@ -1,7 +1,7 @@ using FFXIVClassic.Common; using System; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class SetActorStatePacket { diff --git a/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusAllPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusAllPacket.cs index 79bbbf90..79d242a7 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusAllPacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusAllPacket.cs @@ -2,7 +2,7 @@ using System; using System.IO; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class SetActorStatusAllPacket { diff --git a/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusPacket.cs b/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusPacket.cs index 2cdaf82e..669cdca8 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusPacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/SetActorStatusPacket.cs @@ -2,7 +2,7 @@ using System; using System.IO; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class SetActorStatusPacket { diff --git a/FFXIVClassic Map Server/packets/send/Actor/SetActorSubStatePacket.cs b/FFXIVClassic Map Server/packets/send/Actor/SetActorSubStatePacket.cs index bbb2b747..3c0a9cba 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/SetActorSubStatePacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/SetActorSubStatePacket.cs @@ -1,10 +1,9 @@ -using System; -using System.IO; +using System.IO; using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.chara; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class SetActorSubStatePacket { diff --git a/FFXIVClassic Map Server/packets/send/Actor/_0x132Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/_0x132Packet.cs index 0bcd6b15..769d517d 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/_0x132Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/_0x132Packet.cs @@ -3,7 +3,7 @@ using System; using System.IO; using System.Text; -namespace FFXIVClassic_Map_Server.packets.send.actor +namespace FFXIVClassic_Map_Server.packets.send.actor { class _0x132Packet { diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/BattleAction.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleAction.cs new file mode 100644 index 00000000..71bf867b --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleAction.cs @@ -0,0 +1,12 @@ +namespace FFXIVClassic_Map_Server.packets.send.actor.battle +{ + class BattleAction + { + public uint targetId; + public ushort amount; + public ushort worldMasterTextId; + public uint effectId; + public byte param; + public byte unknown; + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX10Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX10Packet.cs new file mode 100644 index 00000000..bbca0af1 --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX10Packet.cs @@ -0,0 +1,59 @@ +using FFXIVClassic.Common; +using System; +using System.IO; + +namespace FFXIVClassic_Map_Server.packets.send.actor.battle +{ + class BattleActionX10Packet + { + public const ushort OPCODE = 0x013A; + public const uint PACKET_SIZE = 0xD8; + + public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((UInt32)sourceActorId); + binWriter.Write((UInt32)animationId); + + //Missing... last value is float, string in here as well? + + binWriter.Seek(0x20, SeekOrigin.Begin); + binWriter.Write((UInt32) actionList.Length); //Num actions (always 1 for this) + binWriter.Write((UInt16)commandId); + binWriter.Write((UInt16)810); //? + + binWriter.Seek(0x20, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt32)action.targetId); + + binWriter.Seek(0x50, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt16)action.amount); + + binWriter.Seek(0x64, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt16)action.worldMasterTextId); + + binWriter.Seek(0x78, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt32)action.effectId); + + binWriter.Seek(0xA0, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((Byte)action.param); + + binWriter.Seek(0xAA, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((Byte)action.unknown); + } + } + + return new SubPacket(OPCODE, sourceActorId, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX18Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX18Packet.cs new file mode 100644 index 00000000..0983fb6a --- /dev/null +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX18Packet.cs @@ -0,0 +1,59 @@ +using FFXIVClassic.Common; +using System; +using System.IO; + +namespace FFXIVClassic_Map_Server.packets.send.actor.battle +{ + class BattleActionX18Packet + { + public const ushort OPCODE = 0x013B; + public const uint PACKET_SIZE = 0x148; + + public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((UInt32)sourceActorId); + binWriter.Write((UInt32)animationId); + + //Missing... last value is float, string in here as well? + + binWriter.Seek(0x20, SeekOrigin.Begin); + binWriter.Write((UInt32) actionList.Length); //Num actions (always 1 for this) + binWriter.Write((UInt16)commandId); + binWriter.Write((UInt16)810); //? + + binWriter.Seek(0x58, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt32)action.targetId); + + binWriter.Seek(0xA0, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt16)action.amount); + + binWriter.Seek(0xC4, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt16)action.worldMasterTextId); + + binWriter.Seek(0xE8, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((UInt32)action.effectId); + + binWriter.Seek(0x130, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((Byte)action.param); + + binWriter.Seek(0x142, SeekOrigin.Begin); + foreach (BattleAction action in actionList) + binWriter.Write((Byte)action.unknown); + } + } + + return new SubPacket(OPCODE, sourceActorId, data); + } + } +} diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResult.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResult.cs index 6ba46e8a..09c663cd 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResult.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResult.cs @@ -1,12 +1,9 @@ -using FFXIVClassic.Common; -using System; -using System.Collections.Generic; +using System; using FFXIVClassic_Map_Server.actors.chara.ai; using FFXIVClassic_Map_Server.actors.chara.ai.utils; using FFXIVClassic_Map_Server.Actors; -using FFXIVClassic_Map_Server.packets.send.actor.battle; -namespace FFXIVClassic_Map_Server.packets.send.actor.battle +namespace FFXIVClassic_Map_Server.packets.send.actor.battle { //These flags can be stacked and mixed, but the client will prioritize certain flags over others. [Flags] diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultContainer.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultContainer.cs index 2cf424bb..ddb3cda4 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultContainer.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultContainer.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace FFXIVClassic_Map_Server.packets.send.actor.battle { diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultX00Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultX00Packet.cs index 06cbe136..fc1a2436 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultX00Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/CommandResultX00Packet.cs @@ -2,7 +2,7 @@ using System; using System.IO; -namespace FFXIVClassic_Map_Server.packets.send.actor.battle +namespace FFXIVClassic_Map_Server.packets.send.actor.battle { class CommandResultX00Packet { diff --git a/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs b/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs index 688fbcf1..98582ef0 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/events/SetEmoteEventCondition.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Text; -namespace FFXIVClassic_Map_Server.packets.send.actor.events +namespace FFXIVClassic_Map_Server.packets.send.actor.events { class SetEmoteEventCondition { diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryBeginChangePacket.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryBeginChangePacket.cs index 6f423d78..1601fe33 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryBeginChangePacket.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryBeginChangePacket.cs @@ -7,16 +7,13 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory public const ushort OPCODE = 0x016D; public const uint PACKET_SIZE = 0x28; - public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId) + public static SubPacket BuildPacket(uint playerActorID, bool clearItemPackage = false) { byte[] data = new byte[8]; - data[0] = 2; - return new SubPacket(OPCODE, sourceActorId, data); - } - public static SubPacket BuildPacket(uint playerActorID) - { - byte[] data = new byte[8]; + if (clearItemPackage) + data[0] = 2; + return new SubPacket(OPCODE, playerActorID, data); } } diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryRemoveX08Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryRemoveX08Packet.cs index 270d749f..df87fc59 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryRemoveX08Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/InventoryRemoveX08Packet.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using System.IO; -namespace FFXIVClassic_Map_Server.packets.send.actor.inventory +namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { class InventoryRemoveX08Packet { diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX01Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX01Packet.cs similarity index 65% rename from FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX01Packet.cs rename to FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX01Packet.cs index 925758d7..fe427925 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX01Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX01Packet.cs @@ -2,15 +2,16 @@ using System.IO; using FFXIVClassic.Common; +using FFXIVClassic_Map_Server.dataobjects; namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { - class EquipmentListX01Packet + class LinkedItemListX01Packet { public const ushort OPCODE = 0x014D; public const uint PACKET_SIZE = 0x28; - public static SubPacket BuildPacket(uint playerActorID, ushort equipSlot, uint itemSlot) + public static SubPacket BuildPacket(uint playerActorID, ushort position, InventoryItem linkedItem) { byte[] data = new byte[PACKET_SIZE - 0x20]; @@ -18,12 +19,13 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { using (BinaryWriter binWriter = new BinaryWriter(mem)) { - binWriter.Write((UInt16)equipSlot); - binWriter.Write((UInt32)itemSlot); + binWriter.Write((UInt16)position); + binWriter.Write((UInt16)linkedItem.slot); + binWriter.Write((UInt16)linkedItem.itemPackage); } } return new SubPacket(OPCODE, playerActorID, data); - } + } } } diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX08Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX08Packet.cs similarity index 76% rename from FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX08Packet.cs rename to FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX08Packet.cs index c3f94f37..220dc8bb 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX08Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX08Packet.cs @@ -7,12 +7,12 @@ using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { - class EquipmentListX08Packet + class LinkedItemListX08Packet { public const ushort OPCODE = 0x14E; public const uint PACKET_SIZE = 0x58; - public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List slotsToUpdate, ref int listOffset) + public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List slotsToUpdate, ref int listOffset) { byte[] data = new byte[PACKET_SIZE - 0x20]; @@ -28,8 +28,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory for (int i = 0; i < max; i++) { - binWriter.Write((UInt16)slotsToUpdate[i]); - binWriter.Write((UInt32)equipment[slotsToUpdate[i]].slot); + binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code listOffset++; } diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX16Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX16Packet.cs similarity index 75% rename from FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX16Packet.cs rename to FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX16Packet.cs index fe347718..6eda3cff 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX16Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX16Packet.cs @@ -7,12 +7,12 @@ using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { - class EquipmentListX16Packet + class LinkedItemListX16Packet { public const ushort OPCODE = 0x14F; public const uint PACKET_SIZE = 0x80; - public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List slotsToUpdate, ref int listOffset) + public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List slotsToUpdate, ref int listOffset) { byte[] data = new byte[PACKET_SIZE - 0x20]; @@ -28,8 +28,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory for (int i = 0; i < max; i++) { - binWriter.Write((UInt16)slotsToUpdate[i]); - binWriter.Write((UInt32)equipment[slotsToUpdate[i]].slot); + binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code listOffset++; } diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX32Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX32Packet.cs similarity index 75% rename from FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX32Packet.cs rename to FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX32Packet.cs index 82614765..8fd2c519 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX32Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX32Packet.cs @@ -7,12 +7,12 @@ using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { - class EquipmentListX32Packet + class LinkedItemListX32Packet { public const ushort OPCODE = 0x150; public const uint PACKET_SIZE = 0xE0; - public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List slotsToUpdate, ref int listOffset) + public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List slotsToUpdate, ref int listOffset) { byte[] data = new byte[PACKET_SIZE - 0x20]; @@ -28,8 +28,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory for (int i = 0; i < max; i++) { - binWriter.Write((UInt16)slotsToUpdate[i]); - binWriter.Write((UInt32)equipment[slotsToUpdate[i]].slot); + binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code listOffset++; } diff --git a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX64Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX64Packet.cs similarity index 75% rename from FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX64Packet.cs rename to FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX64Packet.cs index 05cb42c4..c9886704 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/inventory/EquipmentListX64Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/inventory/LinkedItemListX64Packet.cs @@ -7,12 +7,12 @@ using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.actor.inventory { - class EquipmentListX64Packet + class LinkedItemListX64Packet { public const ushort OPCODE = 0x151; public const uint PACKET_SIZE = 0x194; - public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List slotsToUpdate, ref int listOffset) + public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List slotsToUpdate, ref int listOffset) { byte[] data = new byte[PACKET_SIZE - 0x20]; @@ -28,8 +28,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory for (int i = 0; i < max; i++) { - binWriter.Write((UInt16)slotsToUpdate[i]); - binWriter.Write((UInt32)equipment[slotsToUpdate[i]].slot); + binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot + binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code listOffset++; } diff --git a/FFXIVClassic Map Server/packets/send/events/KickEventPacket.cs b/FFXIVClassic Map Server/packets/send/events/KickEventPacket.cs index fe0a2d19..7fc79d64 100644 --- a/FFXIVClassic Map Server/packets/send/events/KickEventPacket.cs +++ b/FFXIVClassic Map Server/packets/send/events/KickEventPacket.cs @@ -13,7 +13,7 @@ namespace FFXIVClassic_Map_Server.packets.send.events public const ushort OPCODE = 0x012F; public const uint PACKET_SIZE = 0x90; - public static SubPacket BuildPacket(uint sourcePlayerActorId, uint targetEventActorId, string conditionName, List luaParams) + public static SubPacket BuildPacket(uint sourcePlayerActorId, uint targetEventActorId, uint unknown, string conditionName, List luaParams) { byte[] data = new byte[PACKET_SIZE - 0x20]; @@ -23,10 +23,7 @@ namespace FFXIVClassic_Map_Server.packets.send.events { binWriter.Write((UInt32)sourcePlayerActorId); binWriter.Write((UInt32)targetEventActorId); - - int test = 0x75dc1705; //This will crash if set to 0 on pushCommand but not for mining which has to be 0???? - - binWriter.Write((UInt32)test); + binWriter.Write((UInt32)unknown); binWriter.Write((UInt32)0x30400000); binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(conditionName)); diff --git a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX08Packet.cs b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX08Packet.cs index 8bc05ab5..6933179f 100644 --- a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX08Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX08Packet.cs @@ -2,9 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX16Packet.cs b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX16Packet.cs index d263d6d4..645241fb 100644 --- a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX16Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX16Packet.cs @@ -2,9 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX32Packet.cs b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX32Packet.cs index 363d96c4..4b70c7d4 100644 --- a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX32Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX32Packet.cs @@ -2,9 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX64Packet.cs b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX64Packet.cs index 88d73a06..d81c05e9 100644 --- a/FFXIVClassic Map Server/packets/send/groups/ContentMembersX64Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/ContentMembersX64Packet.cs @@ -2,9 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroup.cs b/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroup.cs index 2274ae95..934aa187 100644 --- a/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroup.cs +++ b/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroup.cs @@ -1,12 +1,8 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroupMultiple.cs b/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroupMultiple.cs index f6905c97..382a241a 100644 --- a/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroupMultiple.cs +++ b/FFXIVClassic Map Server/packets/send/groups/CreateNamedGroupMultiple.cs @@ -1,12 +1,8 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/DeleteGroupPacket.cs b/FFXIVClassic Map Server/packets/send/groups/DeleteGroupPacket.cs index 571cd879..9e69d11d 100644 --- a/FFXIVClassic Map Server/packets/send/groups/DeleteGroupPacket.cs +++ b/FFXIVClassic Map Server/packets/send/groups/DeleteGroupPacket.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.groups { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupHeaderPacket.cs b/FFXIVClassic Map Server/packets/send/groups/GroupHeaderPacket.cs index 6cb222b2..3a679c63 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupHeaderPacket.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupHeaderPacket.cs @@ -1,12 +1,8 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMember.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMember.cs index 819d47ea..318c2060 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMember.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMember.cs @@ -1,6 +1,4 @@ -using FFXIVClassic.Common; - -namespace FFXIVClassic_Map_Server.packets.send.group +namespace FFXIVClassic_Map_Server.packets.send.group { class GroupMember { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMembersBeginPacket.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMembersBeginPacket.cs index 5b24aa4d..561bbcc4 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMembersBeginPacket.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMembersBeginPacket.cs @@ -1,12 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMembersEndPacket.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMembersEndPacket.cs index 9bba4e06..8d044419 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMembersEndPacket.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMembersEndPacket.cs @@ -1,12 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; -using FFXIVClassic_Map_Server.dataobjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX08Packet.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX08Packet.cs index cca76aaf..24842c5a 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX08Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX08Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX16Packet.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX16Packet.cs index b4ba775b..c75648ac 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX16Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX16Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX32Packet.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX32Packet.cs index 7abee729..e4d4cb74 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX32Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX32Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX64Packet.cs b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX64Packet.cs index 44d98851..b77bdf75 100644 --- a/FFXIVClassic Map Server/packets/send/groups/GroupMembersX64Packet.cs +++ b/FFXIVClassic Map Server/packets/send/groups/GroupMembersX64Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.group { diff --git a/FFXIVClassic Map Server/packets/send/groups/SynchGroupWorkValuesPacket.cs b/FFXIVClassic Map Server/packets/send/groups/SynchGroupWorkValuesPacket.cs index f33202ef..bad80e9f 100644 --- a/FFXIVClassic Map Server/packets/send/groups/SynchGroupWorkValuesPacket.cs +++ b/FFXIVClassic Map Server/packets/send/groups/SynchGroupWorkValuesPacket.cs @@ -1,12 +1,10 @@ using FFXIVClassic.Common; using FFXIVClassic_Map_Server.actors.group; using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.groups { diff --git a/FFXIVClassic Map Server/packets/send/search/ItemSearchClosePacket.cs b/FFXIVClassic Map Server/packets/send/search/ItemSearchClosePacket.cs index 759efea7..22bc7a8b 100644 --- a/FFXIVClassic Map Server/packets/send/search/ItemSearchClosePacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/ItemSearchClosePacket.cs @@ -1,6 +1,4 @@ -using System.IO; -using System.Text; - + using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.search diff --git a/FFXIVClassic Map Server/packets/send/search/ItemSearchResult.cs b/FFXIVClassic Map Server/packets/send/search/ItemSearchResult.cs index 7d9c51d1..50a44fd8 100644 --- a/FFXIVClassic Map Server/packets/send/search/ItemSearchResult.cs +++ b/FFXIVClassic Map Server/packets/send/search/ItemSearchResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.packets.send.search +namespace FFXIVClassic_Map_Server.packets.send.search { class ItemSearchResult { diff --git a/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBeginPacket.cs b/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBeginPacket.cs index 42fc4f51..e9d2f405 100644 --- a/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBeginPacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBeginPacket.cs @@ -1,6 +1,4 @@ -using System.IO; -using System.Text; - + using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.search diff --git a/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBodyPacket.cs b/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBodyPacket.cs index 54df84a8..0ba7f712 100644 --- a/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBodyPacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsBodyPacket.cs @@ -1,5 +1,4 @@ using System.IO; -using System.Text; using System; using FFXIVClassic.Common; using System.Collections.Generic; diff --git a/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsEndPacket.cs b/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsEndPacket.cs index 8eedcb3f..01fd575b 100644 --- a/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsEndPacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/ItemSearchResultsEndPacket.cs @@ -1,6 +1,4 @@ -using System.IO; -using System.Text; - + using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.search diff --git a/FFXIVClassic Map Server/packets/send/search/PlayerSearchResult.cs b/FFXIVClassic Map Server/packets/send/search/PlayerSearchResult.cs index 9adf6cff..feab11e7 100644 --- a/FFXIVClassic Map Server/packets/send/search/PlayerSearchResult.cs +++ b/FFXIVClassic Map Server/packets/send/search/PlayerSearchResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.packets.send.search +namespace FFXIVClassic_Map_Server.packets.send.search { class PlayerSearchResult { diff --git a/FFXIVClassic Map Server/packets/send/search/RetainerResultBodyPacket.cs b/FFXIVClassic Map Server/packets/send/search/RetainerResultBodyPacket.cs index 32b0c8ec..abdbc600 100644 --- a/FFXIVClassic Map Server/packets/send/search/RetainerResultBodyPacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/RetainerResultBodyPacket.cs @@ -1,5 +1,4 @@ using System.IO; -using System.Text; using FFXIVClassic.Common; diff --git a/FFXIVClassic Map Server/packets/send/search/RetainerResultEndPacket.cs b/FFXIVClassic Map Server/packets/send/search/RetainerResultEndPacket.cs index 4e3707fa..947f331e 100644 --- a/FFXIVClassic Map Server/packets/send/search/RetainerResultEndPacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/RetainerResultEndPacket.cs @@ -1,6 +1,4 @@ -using System.IO; -using System.Text; - + using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.search diff --git a/FFXIVClassic Map Server/packets/send/search/RetainerResultUpdatePacket.cs b/FFXIVClassic Map Server/packets/send/search/RetainerResultUpdatePacket.cs index 2a8a0619..bc703e1f 100644 --- a/FFXIVClassic Map Server/packets/send/search/RetainerResultUpdatePacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/RetainerResultUpdatePacket.cs @@ -1,8 +1,4 @@ -using System.IO; -using System.Text; -using System; -using FFXIVClassic.Common; -using System.Collections.Generic; +using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.packets.send.search { diff --git a/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryPacket.cs b/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryPacket.cs index 85d79d9c..ec0d1d33 100644 --- a/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryPacket.cs +++ b/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryPacket.cs @@ -1,10 +1,6 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_Map_Server.packets.send.search { diff --git a/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryResult.cs b/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryResult.cs index df801164..a32a75de 100644 --- a/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryResult.cs +++ b/FFXIVClassic Map Server/packets/send/search/RetainerSearchHistoryResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.packets.send.search +namespace FFXIVClassic_Map_Server.packets.send.search { class RetainerSearchHistoryResult { diff --git a/FFXIVClassic Map Server/packets/send/search/RetainerSearchResult.cs b/FFXIVClassic Map Server/packets/send/search/RetainerSearchResult.cs index 7747d90c..edbf308b 100644 --- a/FFXIVClassic Map Server/packets/send/search/RetainerSearchResult.cs +++ b/FFXIVClassic Map Server/packets/send/search/RetainerSearchResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_Map_Server.packets.send.search +namespace FFXIVClassic_Map_Server.packets.send.search { class RetainerSearchResult { diff --git a/FFXIVClassic Map Server/utils/NavmeshUtils.cs b/FFXIVClassic Map Server/utils/NavmeshUtils.cs index 8145d0cb..e2c882ea 100644 --- a/FFXIVClassic Map Server/utils/NavmeshUtils.cs +++ b/FFXIVClassic Map Server/utils/NavmeshUtils.cs @@ -1,13 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; using SharpNav; using SharpNav.Pathfinding; -using SharpNav.Crowds; -using SharpNav.IO; using FFXIVClassic.Common; namespace FFXIVClassic_Map_Server.utils diff --git a/FFXIVClassic World Server/Actor/Group/Work/ContentWork.cs b/FFXIVClassic World Server/Actor/Group/Work/ContentWork.cs index 6e7c3941..d60dd63c 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/ContentWork.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/ContentWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class ContentWork { diff --git a/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalSave.cs b/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalSave.cs index 3a2ff84d..e84a9ee4 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalSave.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalSave.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class GroupGlobalSave { diff --git a/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalTemp.cs b/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalTemp.cs index f8ab5051..7a9111ca 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalTemp.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/GroupGlobalTemp.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class GroupGlobalTemp { diff --git a/FFXIVClassic World Server/Actor/Group/Work/GroupMemberSave.cs b/FFXIVClassic World Server/Actor/Group/Work/GroupMemberSave.cs index f72fa714..01159a9c 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/GroupMemberSave.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/GroupMemberSave.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class GroupMemberSave { diff --git a/FFXIVClassic World Server/Actor/Group/Work/LinkshellWork.cs b/FFXIVClassic World Server/Actor/Group/Work/LinkshellWork.cs index 9d58eb4e..5312e451 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/LinkshellWork.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/LinkshellWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class LinkshellWork { diff --git a/FFXIVClassic World Server/Actor/Group/Work/PartyWork.cs b/FFXIVClassic World Server/Actor/Group/Work/PartyWork.cs index f8bcb97a..967793ed 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/PartyWork.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/PartyWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class PartyWork { diff --git a/FFXIVClassic World Server/Actor/Group/Work/RelationWork.cs b/FFXIVClassic World Server/Actor/Group/Work/RelationWork.cs index 18eaab6e..9e94b7fb 100644 --- a/FFXIVClassic World Server/Actor/Group/Work/RelationWork.cs +++ b/FFXIVClassic World Server/Actor/Group/Work/RelationWork.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.Actor.Group.Work +namespace FFXIVClassic_World_Server.Actor.Group.Work { class RelationWork { diff --git a/FFXIVClassic World Server/DataObjects/Group/Linkshell.cs b/FFXIVClassic World Server/DataObjects/Group/Linkshell.cs index a49178dc..7fa11229 100644 --- a/FFXIVClassic World Server/DataObjects/Group/Linkshell.cs +++ b/FFXIVClassic World Server/DataObjects/Group/Linkshell.cs @@ -1,9 +1,6 @@ using FFXIVClassic_World_Server.Actor.Group.Work; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups; using FFXIVClassic.Common; diff --git a/FFXIVClassic World Server/DataObjects/Group/LinkshellMember.cs b/FFXIVClassic World Server/DataObjects/Group/LinkshellMember.cs index 21faf8f4..0942e9e4 100644 --- a/FFXIVClassic World Server/DataObjects/Group/LinkshellMember.cs +++ b/FFXIVClassic World Server/DataObjects/Group/LinkshellMember.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.DataObjects.Group { diff --git a/FFXIVClassic World Server/DataObjects/Group/Party.cs b/FFXIVClassic World Server/DataObjects/Group/Party.cs index da7e4ea4..3e8b87a8 100644 --- a/FFXIVClassic World Server/DataObjects/Group/Party.cs +++ b/FFXIVClassic World Server/DataObjects/Group/Party.cs @@ -3,9 +3,6 @@ using FFXIVClassic_World_Server.Actor.Group.Work; using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.DataObjects.Group { diff --git a/FFXIVClassic World Server/DataObjects/Group/Relation.cs b/FFXIVClassic World Server/DataObjects/Group/Relation.cs index f38727c3..5ca5fb5f 100644 --- a/FFXIVClassic World Server/DataObjects/Group/Relation.cs +++ b/FFXIVClassic World Server/DataObjects/Group/Relation.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.Actor.Group.Work; using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.DataObjects.Group { diff --git a/FFXIVClassic World Server/DataObjects/Group/RetainerGroup.cs b/FFXIVClassic World Server/DataObjects/Group/RetainerGroup.cs index bfe5c69f..57729666 100644 --- a/FFXIVClassic World Server/DataObjects/Group/RetainerGroup.cs +++ b/FFXIVClassic World Server/DataObjects/Group/RetainerGroup.cs @@ -3,9 +3,6 @@ using FFXIVClassic_World_Server.Actor.Group.Work; using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.DataObjects.Group { diff --git a/FFXIVClassic World Server/DataObjects/Group/RetainerGroupMember.cs b/FFXIVClassic World Server/DataObjects/Group/RetainerGroupMember.cs index acd5e535..e30d32d4 100644 --- a/FFXIVClassic World Server/DataObjects/Group/RetainerGroupMember.cs +++ b/FFXIVClassic World Server/DataObjects/Group/RetainerGroupMember.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FFXIVClassic_World_Server.DataObjects.Group +namespace FFXIVClassic_World_Server.DataObjects.Group { class RetainerGroupMember { diff --git a/FFXIVClassic World Server/DataObjects/Group/RetainerMeetingRelationGroup.cs b/FFXIVClassic World Server/DataObjects/Group/RetainerMeetingRelationGroup.cs index d54afb16..51ce639f 100644 --- a/FFXIVClassic World Server/DataObjects/Group/RetainerMeetingRelationGroup.cs +++ b/FFXIVClassic World Server/DataObjects/Group/RetainerMeetingRelationGroup.cs @@ -1,11 +1,5 @@ using FFXIVClassic.Common; -using FFXIVClassic_World_Server.Actor.Group.Work; using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.DataObjects.Group { diff --git a/FFXIVClassic World Server/DataObjects/ZoneServer.cs b/FFXIVClassic World Server/DataObjects/ZoneServer.cs index da665001..2ee408ac 100644 --- a/FFXIVClassic World Server/DataObjects/ZoneServer.cs +++ b/FFXIVClassic World Server/DataObjects/ZoneServer.cs @@ -1,10 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; using FFXIVClassic.Common; using FFXIVClassic_World_Server.Packets.WorldPackets.Send; diff --git a/FFXIVClassic World Server/Database.cs b/FFXIVClassic World Server/Database.cs index 36c7df4b..5f595adf 100644 --- a/FFXIVClassic World Server/Database.cs +++ b/FFXIVClassic World Server/Database.cs @@ -529,5 +529,35 @@ namespace FFXIVClassic_World_Server } return success; } + + public static bool LinkshellIsBannedName(string name) + { + return false; + } + + public static bool LinkshellExists(string name) + { + bool hasLS = false; + using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) + { + try + { + conn.Open(); + MySqlCommand cmd = new MySqlCommand("SELECT * FROM server_linkshells WHERE name = @lsName", conn); + cmd.Parameters.AddWithValue("@lsName", name); + object result = cmd.ExecuteScalar(); + hasLS = result != null && ((uint)result > 0); + } + catch (MySqlException e) + { + Program.Log.Error(e.ToString()); + } + finally + { + conn.Dispose(); + } + } + return hasLS; + } } } diff --git a/FFXIVClassic World Server/FFXIVClassic World Server.csproj b/FFXIVClassic World Server/FFXIVClassic World Server.csproj index affed8c5..5e0c5bcf 100644 --- a/FFXIVClassic World Server/FFXIVClassic World Server.csproj +++ b/FFXIVClassic World Server/FFXIVClassic World Server.csproj @@ -158,6 +158,7 @@ + diff --git a/FFXIVClassic World Server/LinkshellManager.cs b/FFXIVClassic World Server/LinkshellManager.cs index e6423c11..6fe08acd 100644 --- a/FFXIVClassic World Server/LinkshellManager.cs +++ b/FFXIVClassic World Server/LinkshellManager.cs @@ -1,9 +1,6 @@ using FFXIVClassic_World_Server.DataObjects.Group; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server { @@ -23,8 +20,22 @@ namespace FFXIVClassic_World_Server mCurrentWorldGroupsReference = worldGroupList; } + //Checks if the LS name is in use or banned + public int CanCreateLinkshell(string name) + { + bool nameBanned = Database.LinkshellIsBannedName(name); + bool alreadyExists = Database.LinkshellExists(name); + + if (nameBanned) + return 2; + if (alreadyExists) + return 1; + else + return 0; + } + //Creates a new linkshell and adds it to the list - public ulong CreateLinkshell(string name, ushort crest, uint master) + public Linkshell CreateLinkshell(string name, ushort crest, uint master) { lock (mGroupLockReference) { @@ -32,18 +43,19 @@ namespace FFXIVClassic_World_Server if (resultId >= 0) { Linkshell newLs = new Linkshell(resultId, mWorldManager.GetGroupIndex(), name, crest, master, 0xa); + + mLinkshellList.Add(mWorldManager.GetGroupIndex(), newLs); + mNameToIdLookup.Add(newLs.name, newLs.groupIndex); + mLSIdToIdLookup.Add(newLs.dbId, newLs); + mCurrentWorldGroupsReference.Add(mWorldManager.GetGroupIndex(), newLs); + mWorldManager.IncrementGroupIndex(); //Add founder to the LS - if (AddMemberToLinkshell(master, newLs.name)) - { - mLinkshellList.Add(mWorldManager.GetGroupIndex(), newLs); - mNameToIdLookup.Add(newLs.name, newLs.groupIndex); - mLSIdToIdLookup.Add(newLs.dbId, newLs); - mCurrentWorldGroupsReference.Add(mWorldManager.GetGroupIndex(), newLs); - mWorldManager.IncrementGroupIndex(); - } + AddMemberToLinkshell(master, newLs.name); + + return newLs; } - return resultId; + return null; } } diff --git a/FFXIVClassic World Server/PacketProcessor.cs b/FFXIVClassic World Server/PacketProcessor.cs index abf41fd6..56909658 100644 --- a/FFXIVClassic World Server/PacketProcessor.cs +++ b/FFXIVClassic World Server/PacketProcessor.cs @@ -7,10 +7,7 @@ using FFXIVClassic_World_Server.Packets.Send; using FFXIVClassic_World_Server.Packets.Send.Login; using FFXIVClassic_World_Server.Packets.Send.Subpackets; using FFXIVClassic_World_Server.Packets.WorldPackets.Receive; -using FFXIVClassic_World_Server.Packets.WorldPackets.Send; -using System; using System.Collections.Generic; -using System.IO; namespace FFXIVClassic_World_Server { diff --git a/FFXIVClassic World Server/Packets/Receive/HelloPacket.cs b/FFXIVClassic World Server/Packets/Receive/HelloPacket.cs index 6f2992e5..fff1ce9c 100644 --- a/FFXIVClassic World Server/Packets/Receive/HelloPacket.cs +++ b/FFXIVClassic World Server/Packets/Receive/HelloPacket.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Receive { diff --git a/FFXIVClassic World Server/Packets/Receive/Subpackets/GroupCreatedPacket.cs b/FFXIVClassic World Server/Packets/Receive/Subpackets/GroupCreatedPacket.cs index f7135041..df553177 100644 --- a/FFXIVClassic World Server/Packets/Receive/Subpackets/GroupCreatedPacket.cs +++ b/FFXIVClassic World Server/Packets/Receive/Subpackets/GroupCreatedPacket.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Receive.Subpackets { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroup.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroup.cs index 9081283d..133578da 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroup.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroup.cs @@ -1,12 +1,8 @@ using FFXIVClassic.Common; -using FFXIVClassic_World_Server.Actor.Group; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroupMultiple.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroupMultiple.cs index 98d9ad13..1c0bb36d 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroupMultiple.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/CreateNamedGroupMultiple.cs @@ -1,12 +1,8 @@ using FFXIVClassic.Common; -using FFXIVClassic_World_Server.Actor.Group; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/DeleteGroupPacket.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/DeleteGroupPacket.cs index d661ae52..100cbb46 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/DeleteGroupPacket.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/DeleteGroupPacket.cs @@ -1,12 +1,7 @@ using FFXIVClassic.Common; -using FFXIVClassic_World_Server.Actor.Group; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupHeaderPacket.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupHeaderPacket.cs index c28fe084..a87874a9 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupHeaderPacket.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupHeaderPacket.cs @@ -1,11 +1,8 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMember.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMember.cs index 8c6b8944..b9885080 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMember.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMember.cs @@ -1,6 +1,4 @@ -using FFXIVClassic.Common; - -namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups +namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { class GroupMember { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersBeginPacket.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersBeginPacket.cs index 46f15905..6774a152 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersBeginPacket.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersBeginPacket.cs @@ -1,14 +1,10 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups -{ +{ class GroupMembersBeginPacket { public const ushort OPCODE = 0x017D; diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersEndPacket.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersEndPacket.cs index 3d095b8b..4ce56683 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersEndPacket.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersEndPacket.cs @@ -1,15 +1,10 @@ using FFXIVClassic.Common; -using FFXIVClassic_World_Server.Actor.Group; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups -{ +{ class GroupMembersEndPacket { public const ushort OPCODE = 0x017E; diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX08Packet.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX08Packet.cs index 734e843c..01634103 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX08Packet.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX08Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX16Packet.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX16Packet.cs index f3181570..6f1a8d55 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX16Packet.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX16Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX32Packet.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX32Packet.cs index f6669f08..01521604 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX32Packet.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX32Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX64Packet.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX64Packet.cs index 5a18d0cd..e3cb902c 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX64Packet.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/GroupMembersX64Packet.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SetActiveLinkshellPacket.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SetActiveLinkshellPacket.cs index d387a029..31146cde 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SetActiveLinkshellPacket.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SetActiveLinkshellPacket.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SynchGroupWorkValuesPacket.cs b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SynchGroupWorkValuesPacket.cs index 57f100cf..831993fc 100644 --- a/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SynchGroupWorkValuesPacket.cs +++ b/FFXIVClassic World Server/Packets/Send/Subpackets/Groups/SynchGroupWorkValuesPacket.cs @@ -1,13 +1,10 @@ using FFXIVClassic.Common; -using FFXIVClassic_World_Server.Actor.Group; using FFXIVClassic_World_Server.DataObjects.Group; using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups { diff --git a/FFXIVClassic World Server/Packets/Send/_0x2Packet.cs b/FFXIVClassic World Server/Packets/Send/_0x2Packet.cs index 1fc6ef98..ba91a5a2 100644 --- a/FFXIVClassic World Server/Packets/Send/_0x2Packet.cs +++ b/FFXIVClassic World Server/Packets/Send/_0x2Packet.cs @@ -1,10 +1,6 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send { diff --git a/FFXIVClassic World Server/Packets/Send/_0x7Packet.cs b/FFXIVClassic World Server/Packets/Send/_0x7Packet.cs index f7d6d452..1463543f 100644 --- a/FFXIVClassic World Server/Packets/Send/_0x7Packet.cs +++ b/FFXIVClassic World Server/Packets/Send/_0x7Packet.cs @@ -1,10 +1,6 @@ using FFXIVClassic.Common; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.Send { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateLinkshellPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateLinkshellPacket.cs index aa952d1a..f8ca2669 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateLinkshellPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateLinkshellPacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateRelationPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateRelationPacket.cs index eb573b5b..80f86099 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateRelationPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/CreateRelationPacket.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Text; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/GroupInviteResultPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/GroupInviteResultPacket.cs index 6197b16c..d0ec1b60 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/GroupInviteResultPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/GroupInviteResultPacket.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Text; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellChangePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellChangePacket.cs index 99b8bd7f..1ac77f3d 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellChangePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellChangePacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInviteCancelPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInviteCancelPacket.cs index 0f2bf8f7..045f6b72 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInviteCancelPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInviteCancelPacket.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Text; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInvitePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInvitePacket.cs index 5f1e86b4..0c7fa1ed 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInvitePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellInvitePacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellLeavePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellLeavePacket.cs index ea8a5469..7c479d65 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellLeavePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellLeavePacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellRankChangePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellRankChangePacket.cs index 83615df7..c62a4568 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellRankChangePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/LinkshellRankChangePacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyInvitePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyInvitePacket.cs index 1a4d55e3..a0588afd 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyInvitePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyInvitePacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyLeavePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyLeavePacket.cs index f29cb06e..07826db6 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyLeavePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyLeavePacket.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Text; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyModifyPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyModifyPacket.cs index 58bffa54..73bfc919 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyModifyPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/Group/PartyModifyPacket.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionBeginConfirmPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionBeginConfirmPacket.cs index 189865c6..46201ddf 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionBeginConfirmPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionBeginConfirmPacket.cs @@ -1,11 +1,5 @@ -using FFXIVClassic.Common; -using FFXIVClassic_World_Server.DataObjects; -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionEndConfirmPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionEndConfirmPacket.cs index b0e22aec..91f2573b 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionEndConfirmPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/SessionEndConfirmPacket.cs @@ -1,11 +1,5 @@ -using FFXIVClassic.Common; -using FFXIVClassic_World_Server.DataObjects; -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Receive/WorldRequestZoneChangePacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Receive/WorldRequestZoneChangePacket.cs index faa2e4b4..95720e6f 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Receive/WorldRequestZoneChangePacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Receive/WorldRequestZoneChangePacket.cs @@ -1,11 +1,5 @@ -using FFXIVClassic.Common; -using FFXIVClassic_World_Server.DataObjects; -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Receive { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Send/ErrorPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Send/ErrorPacket.cs index c17ae48f..c096552b 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Send/ErrorPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Send/ErrorPacket.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Send/LinkshellResultPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Send/LinkshellResultPacket.cs new file mode 100644 index 00000000..3d87b79c --- /dev/null +++ b/FFXIVClassic World Server/Packets/WorldPackets/Send/LinkshellResultPacket.cs @@ -0,0 +1,28 @@ +using FFXIVClassic.Common; +using FFXIVClassic_World_Server.DataObjects; +using System; +using System.IO; + +namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send +{ + class LinkshellResultPacket + { + public const ushort OPCODE = 0x1025; + public const uint PACKET_SIZE = 0x24; + + public static SubPacket BuildPacket(Session session, int result) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((Int32)result); + } + } + + return new SubPacket(true, OPCODE, session.sessionId, data); + } + } +} diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionBeginPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionBeginPacket.cs index 6871c6eb..12422d4e 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionBeginPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionBeginPacket.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send { diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs index afe00492..2c6701ab 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs @@ -1,11 +1,7 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send { diff --git a/FFXIVClassic World Server/Program.cs b/FFXIVClassic World Server/Program.cs index 8dc2aafe..a1c14c19 100644 --- a/FFXIVClassic World Server/Program.cs +++ b/FFXIVClassic World Server/Program.cs @@ -1,13 +1,8 @@ using FFXIVClassic_World_Server.DataObjects; using MySql.Data.MySqlClient; using NLog; -using NLog.Fluent; using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server { diff --git a/FFXIVClassic World Server/Properties/AssemblyInfo.cs b/FFXIVClassic World Server/Properties/AssemblyInfo.cs index 2bb7a8a3..5e84fed1 100644 --- a/FFXIVClassic World Server/Properties/AssemblyInfo.cs +++ b/FFXIVClassic World Server/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/FFXIVClassic World Server/RetainerGroupManager.cs b/FFXIVClassic World Server/RetainerGroupManager.cs index 5fa14b34..c682df72 100644 --- a/FFXIVClassic World Server/RetainerGroupManager.cs +++ b/FFXIVClassic World Server/RetainerGroupManager.cs @@ -1,9 +1,6 @@ using FFXIVClassic_World_Server.DataObjects.Group; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server { diff --git a/FFXIVClassic World Server/Server.cs b/FFXIVClassic World Server/Server.cs index 1dddb069..20b53159 100644 --- a/FFXIVClassic World Server/Server.cs +++ b/FFXIVClassic World Server/Server.cs @@ -1,10 +1,9 @@ using FFXIVClassic.Common; using FFXIVClassic_World_Server.DataObjects; using FFXIVClassic_World_Server.DataObjects.Group; -using FFXIVClassic_World_Server.Packets.Receive.Subpackets; -using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups; using FFXIVClassic_World_Server.Packets.WorldPackets.Receive; using FFXIVClassic_World_Server.Packets.WorldPackets.Receive.Group; +using FFXIVClassic_World_Server.Packets.WorldPackets.Send; using System; using System.Collections.Generic; using System.Net; @@ -283,7 +282,22 @@ namespace FFXIVClassic_World_Server //Linkshell create request case 0x1025: CreateLinkshellPacket createLinkshellPacket = new CreateLinkshellPacket(subpacket.data); - mWorldManager.GetLinkshellManager().CreateLinkshell(createLinkshellPacket.name, createLinkshellPacket.crestid, createLinkshellPacket.master); + + Linkshell newLs = null; + int lsError = mWorldManager.GetLinkshellManager().CanCreateLinkshell(createLinkshellPacket.name); + + if (lsError == 0) + { + newLs = mWorldManager.GetLinkshellManager().CreateLinkshell(createLinkshellPacket.name, createLinkshellPacket.crestid, createLinkshellPacket.master); + + if (newLs != null) + newLs.SendGroupPackets(session); + else + lsError = 3; + } + + SubPacket resultPacket = LinkshellResultPacket.BuildPacket(session, lsError); + zoneServer.SendPacket(resultPacket); break; //Linkshell modify request case 0x1026: diff --git a/FFXIVClassic World Server/WorldMaster.cs b/FFXIVClassic World Server/WorldMaster.cs index 53a1a3d9..4bfcc35f 100644 --- a/FFXIVClassic World Server/WorldMaster.cs +++ b/FFXIVClassic World Server/WorldMaster.cs @@ -8,11 +8,6 @@ using FFXIVClassic_World_Server.Packets.WorldPackets.Send.Group; using MySql.Data.MySqlClient; using System; using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; namespace FFXIVClassic_World_Server { diff --git a/Launcher Editor/Program.cs b/Launcher Editor/Program.cs index 53794df6..766aaac4 100644 --- a/Launcher Editor/Program.cs +++ b/Launcher Editor/Program.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace Launcher_Editor { diff --git a/Launcher Editor/Properties/AssemblyInfo.cs b/Launcher Editor/Properties/AssemblyInfo.cs index bed36e48..3f32537b 100644 --- a/Launcher Editor/Properties/AssemblyInfo.cs +++ b/Launcher Editor/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/data/scripts/base/chara/npc/object/MarketEntrance.lua b/data/scripts/base/chara/npc/object/MarketEntrance.lua index aa858698..5c0269b6 100644 --- a/data/scripts/base/chara/npc/object/MarketEntrance.lua +++ b/data/scripts/base/chara/npc/object/MarketEntrance.lua @@ -11,6 +11,8 @@ eventPushStepPrvMarket(?, ?, ?) - require ("global") +local MARKETWARD_ENTRANCE = {-201.0, 0.0, -160.0, 1.5}; + function init(npc) return false, false, 0, 0; end diff --git a/data/scripts/base/chara/npc/object/ObjectItemStorage.lua b/data/scripts/base/chara/npc/object/ObjectItemStorage.lua index a511db6c..ca81859d 100644 --- a/data/scripts/base/chara/npc/object/ObjectItemStorage.lua +++ b/data/scripts/base/chara/npc/object/ObjectItemStorage.lua @@ -31,7 +31,7 @@ function onEventStarted(player, npc, triggerName) itemId = callClientFunction(player, "selectStoreItem", nil, categoryChoice); if (itemId ~= nil) then - player:GetInventory(INVENTORY_NORMAL):RemoveItem(itemId, 1); + player:GetItemPackage(INVENTORY_NORMAL):RemoveItem(itemId, 1); end elseif (storageChoice == 2) then @@ -44,7 +44,7 @@ function onEventStarted(player, npc, triggerName) itemId = callClientFunction(player, "selectReceiveItem", nil, categoryChoice); if (itemId ~= nil) then - player:GetInventory(INVENTORY_NORMAL):AddItem(itemId, 1); + player:GetItemPackage(INVENTORY_NORMAL):AddItem(itemId, 1); end end diff --git a/data/scripts/base/chara/npc/populace/PopulaceBlackMarketeer.lua b/data/scripts/base/chara/npc/populace/PopulaceBlackMarketeer.lua index cc506739..26bfbece 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceBlackMarketeer.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceBlackMarketeer.lua @@ -68,7 +68,7 @@ function onEventStarted(player, npc, triggerName) callClientFunction(player, "eventTalkWelcome", player); - if player:GetInventory(INVENTORY_NORMAL):HasItem(commemorativeCoin) and playerGC > 0 then + if player:GetItemPackage(INVENTORY_NORMAL):HasItem(commemorativeCoin) and playerGC > 0 then -- Checks for player having a commemorative coin, show window trade option if so. coinChoice = callClientFunction(player, "eventSellItemAsk", player, commemorativeCoin, commemorativeCoinValue); if coinChoice == 1 then @@ -76,8 +76,8 @@ function onEventStarted(player, npc, triggerName) elseif coinChoice == 2 then -- You trade for . player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, commemorativeCoin, 1, playerGCSeal, 1, 1, commemorativeCoinValue); - player:GetInventory(INVENTORY_NORMAL):RemoveItem(commemorativeCoin, 1); - player:getInventory(INVENTORY_CURRENCY):addItem(playerGCSeal, 25000, 1) + player:GetItemPackage(INVENTORY_NORMAL):RemoveItem(commemorativeCoin, 1); + player:GetItemPackage(INVENTORY_CURRENCY):addItem(playerGCSeal, 25000, 1) -- TODO: Add handling for checking GC seals limit and not going over it end else diff --git a/data/scripts/base/chara/npc/populace/PopulaceChocoboLender.lua b/data/scripts/base/chara/npc/populace/PopulaceChocoboLender.lua index 18163c85..abb7b223 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceChocoboLender.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceChocoboLender.lua @@ -46,7 +46,7 @@ function onEventStarted(player, npc, triggerName) --callClientFunction(player, "eventAfterChocoboName", player); local curLevel = 20; -- TODO: pull from character - local hasIssuance = player:GetInventory(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]); + local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]); local hasChocobo = player.hasChocobo; if (player.isGM and hasChocobo == false) then -- Let GMs auto have the issuance for debugging @@ -78,11 +78,11 @@ function onEventStarted(player, npc, triggerName) player:SendGameMessage(player, GetWorldMaster(), 25248, 0x20, 2001007); player:SendDataPacket("attention", GetWorldMaster(), "", 25248, 2001007); - if (player:GetInventory(INVENTORY_KEYITEMS):HasItem(2001007) == false) then - player:GetInventory(INVENTORY_KEYITEMS):AddItem(2001007); + if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then + player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007); end - player:GetInventory(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1); + player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1); player:EndEvent(); return; diff --git a/data/scripts/base/chara/npc/populace/PopulaceCompanyOfficer.lua b/data/scripts/base/chara/npc/populace/PopulaceCompanyOfficer.lua index 9197354e..33ed752d 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceCompanyOfficer.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceCompanyOfficer.lua @@ -50,7 +50,7 @@ function onEventStarted(player, npc, triggerName) if playerGC == gcOfficer[npcId] then callClientFunction(player, "eventTalkWelcome"); if playerCurrentRank < currentRankCap then - if player:GetInventory(INVENTORY_CURRENCY):HasItem(playerGCSeal, playerRankUpCost) then + if player:GetItemPackage(INVENTORY_CURRENCY):HasItem(playerGCSeal, playerRankUpCost) then -- Show Promotion window, allow paying local choice = callClientFunction(player, "eventTalkJoined", playerCurrentRank, playerNextRank, true, true); diff --git a/data/scripts/base/chara/npc/populace/PopulaceCompanySupply.lua b/data/scripts/base/chara/npc/populace/PopulaceCompanySupply.lua index 92076990..3da329e2 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceCompanySupply.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceCompanySupply.lua @@ -370,7 +370,7 @@ function deliveryMenuOpen(player, npc, itemId, price, hqPrice, supplyType) player:SendMessage(0x20, "", "Type7Param: " .. tostring(Type7Param.slot)); --]] - pickedItem = GetItemGamedata(player:GetInventory(INVENTORY_NORMAL):GetItemAtSlot(Type7Param.slot).itemId).name; + pickedItem = GetItemGamedata(player:GetItemPackage(INVENTORY_NORMAL):GetItemAtSlot(Type7Param.slot).itemId).name; player:SendMessage(0x20, "", "Player tried to deliver " .. quantity .. " " .. pickedItem); -- TODO: Add error handling for capped seals, no-long-available-to-deliver, etc diff --git a/data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua b/data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua index 9a5481b9..3fd8e34a 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceCompanyWarp.lua @@ -69,8 +69,6 @@ aethernet = } } - - function init(npc) return false, false, 0, 0; end @@ -86,19 +84,19 @@ function onEventStarted(player, npc, triggerName) if city == 1 then - if player:GetInventory(INVENTORY_KEYITEMS):HasItem(passLimsa) then + if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then passCheck = 1; else if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end end; elseif city == 2 then - if player:GetInventory(INVENTORY_KEYITEMS):HasItem(passGrid) 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:GetInventory(INVENTORY_KEYITEMS):HasItem(passUldah) then + if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah) then passCheck = 1; else if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end diff --git a/data/scripts/base/chara/npc/populace/PopulaceLinkshellManager.lua b/data/scripts/base/chara/npc/populace/PopulaceLinkshellManager.lua index 094772c7..1a01e526 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceLinkshellManager.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceLinkshellManager.lua @@ -10,6 +10,12 @@ eventTalkStepMakeupDone() - Confirm when creating LS eventTalkStepModifyDone() - Confirm when modding LS eventTalkStepBreakDone() - Confirm when deleting LS +Text IDs: + +25121 - That [@SWITCH($E8(1),linkshell,company)] name is already being used. +25122 - That [@SWITCH($E8(1),linkshell,company)] name cannot be used. +25123 - The [@SWITCH($E8(1),linkshell,company)] “[@STRING($EA(2))]” has been [@SWITCH($E8(1),created,founded)]. + --]] require ("global") @@ -18,44 +24,49 @@ function init(npc) return false, false, 0, 0; end -function createLinkshell(name, crest) +function createLinkshell(player, name, crest) + GetWorldManager():RequestWorldLinkshellCreate(player, name, crest); + return waitForSignal("ls_result"); +end + +function modifyLinkshell(player, name, crest) end -function modifyLinkshell(name, crest) - -end - -function disbandLinkshell(name, crest) +function disbandLinkshell(player, name, crest) end function onEventStarted(player, npc, triggerName) - hasNoActiveLS = false; + local hasNoActiveLS = false; callClientFunction(player, "eventTalkStep1", hasNoActiveLS); - command, lsName, crestId = callClientFunction(player, "eventTalkStep2", hasNoActiveLS); + local command, lsName, crestId = callClientFunction(player, "eventTalkStep2", hasNoActiveLS); --Create - if (result == 3) then - - player:SendMessage(0x20, "", "" .. tostring(lsName)); - player:SendMessage(0x20, "", "" .. tostring(crestId)); - player:SendMessage(0x20, "", "" .. tostring(command)); - - createLinkshell(lsName, crestId); - callClientFunction(player, "eventTalkStepMakeupDone"); + if (command == 3) then + local result = createLinkshell(player, lsName, crestId); + if (result == 0) then + callClientFunction(player, "eventTalkStepMakeupDone"); + elseif (result == 1) then + player:SendGameMessage(player, GetWorldMaster(), 25121, 0x20); --LS already exists + callClientFunction(player, "eventTalkStepBreakDone"); + elseif (result == 2) then + player:SendGameMessage(player, GetWorldMaster(), 25122, 0x20); --Cannot use this name (reserved/banned) + callClientFunction(player, "eventTalkStepBreakDone"); + elseif (result == 3) then + end --Modify - elseif (result == 4) then - modifyLinkshell(lsName, crestId); + elseif (command == 4) then + modifyLinkshell(player, lsName, crestId); callClientFunction(player, "eventTalkStepModifyDone"); --Disband - elseif (result == 5) then - disbandLinkshell(lsName, crestId); + elseif (command == 5) then + disbandLinkshell(player, lsName, crestId); callClientFunction(player, "eventTalkStepBreakDone"); end - + player:endEvent(); end \ No newline at end of file diff --git a/data/scripts/base/chara/npc/populace/PopulaceRetainerManager.lua b/data/scripts/base/chara/npc/populace/PopulaceRetainerManager.lua index 50c0b727..5506a6ae 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceRetainerManager.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceRetainerManager.lua @@ -13,65 +13,133 @@ eventTalkStepFinalAnswer(actorClassId) - Confirm Dialog eventTalkStepError(errorCode) - Error dialog, 1: No Extra Retainers, 2: Server Busy. eventTalkStepFinish() + --]] require ("global") + function init(npc) - return false, false, 0, 0; + return false, false, 0, 0; end function onEventStarted(player, npc, triggerName) - - introChoice = callClientFunction(player, "newEventTalkStep1", false); - - if (introChoice == 1) then - - raceChoice = callClientFunction(player, "eventTalkStep2"); - - while (true) do - - if (retainerChoice == 0) then - raceChoice = callClientFunction(player, "eventTalkStep22"); - end - - if (raceChoice == 0) then - --Choose random actorId - elseif (raceChoice > 0) then - --Choose 5 random but correct actor ids - retainerChoice = callClientFunction(player, "eventTaklSelectCutSeane", "rtn0g010", 0x2DCB1A, 0x2DCB1A, 0x2DCB1A, 0x2DCB1A, 0x2DCB1A); - - if (retainerChoice == -1) then - player:EndEvent(); - return; - elseif (retainerChoice > 0) then - --Retainer chosen, choose name - retainerName = callClientFunction(player, "eventTalkStep4", 0x2DCB1A); - - if (retainerName ~= "") then - confirmChoice = callClientFunction(player, "eventTalkStepFinalAnswer", 0x2DCB1A); - - if (confirmChoice == 1) then - callClientFunction(player, "eventTalkStepFinish"); - player:EndEvent(); - return; - elseif (confirmChoice == 3) then - raceChoice = 0; - else - player:EndEvent(); - return; - end - - end - - end - else - break; - end - - end - - end - - player:EndEvent(); + + local npcActorClass = npc:GetActorClassId() + local retainerIndex = 3001100; + local cutscene = "rtn0l010" -- Defaulting to Limsa for now for testing + + if npcActorClass == 1000166 then + cutscene = "rtn0l010"; + retainerIndex = 3001101; + elseif npcActorClass == 1000865 then + cutscene = "rtn0u010"; + retainerIndex = 3002101; + elseif npcActorClass == 1001184 then + cutscene = "rtn0g010"; + retainerIndex = 3003101; + else + return; + end + + + introChoice = callClientFunction(player, "newEventTalkStep1", false); + + if (introChoice == 1) then + + -- Choose Retainer or Random + raceChoice = callClientFunction(player, "eventTalkStep2"); + + while (true) do + + + if (retainerChoice == 0) then + raceChoice = callClientFunction(player, "eventTalkStep22"); + end + + + if (raceChoice == 0) then + --Choose random actorId from a valid set for the city + + math.randomseed(os.time()); + local randomRetainer = math.random(retainerIndex, (retainerIndex+74)); + + retainerName = callClientFunction(player, "eventTalkStep4", randomRetainer); + + if (retainerName ~= "") then + confirmChoice = callClientFunction(player, "eventTalkStepFinalAnswer", randomRetainer); + + if (confirmChoice == 1) then + callClientFunction(player, "eventTalkStepFinish"); + player:EndEvent(); + return; + elseif (confirmChoice == 3) then + raceChoice = 0; + else + player:EndEvent(); + return; + end + else + callClientFunction(player, "eventTalkStepBreak"); + raceChoice = -1; + end + + + elseif (raceChoice > 0) and (raceChoice < 16) then + --Choose 5 random but correct actor ids for the city and race/tribe + + local retainerRace = ((retainerIndex) + (5*(raceChoice-1))); + local retainerRaceChoices = {retainerRace, retainerRace+1, retainerRace+2, retainerRace+3, retainerRace+4}; + + -- Randomize the appearance order of the available five + shuffle(retainerRaceChoices); + + retainerChoice = callClientFunction(player, "eventTaklSelectCutSeane", cutscene, retainerRaceChoices[1], retainerRaceChoices[2], retainerRaceChoices[3], retainerRaceChoices[4], retainerRaceChoices[5]); + + if (retainerChoice == -1) then + player:EndEvent(); + return; + elseif (retainerChoice > 0) then + --Retainer chosen, choose name + retainerName = callClientFunction(player, "eventTalkStep4", retainerRaceChoices[retainerChoice]); + + if (retainerName ~= "") then + confirmChoice = callClientFunction(player, "eventTalkStepFinalAnswer", retainerRaceChoices[retainerChoice]); + + if (confirmChoice == 1) then + callClientFunction(player, "eventTalkStepFinish"); + player:EndEvent(); + return; + elseif (confirmChoice == 3) then + retainerChoice = 0; + else + player:EndEvent(); + return; + end + else + callClientFunction(player, "eventTalkStepBreak"); + raceChoice = -1; + end + + end + else + break; + end + + + end + + end + + player:EndEvent(); +end + + + +function shuffle(tbl) + for i = #tbl, 2, -1 do + local j = math.random(i) + tbl[i], tbl[j] = tbl[j], tbl[i] + end + return tbl end \ No newline at end of file diff --git a/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua b/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua index d4a8c29b..e7221be1 100644 --- a/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua +++ b/data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua @@ -64,7 +64,7 @@ function onEventStarted(player, npc, triggerName) player:SendMessage(0x20, "", "You pretend to hand over four over-aspected crystals."); callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC); - local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1); + local invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1); if invCheck == INV_ERROR_SUCCESS then player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, crystal, 1, npcGCSeal, 1, 4, 1000); end @@ -73,7 +73,7 @@ function onEventStarted(player, npc, triggerName) --callClientFunction(player, "eventTalkCsOverflow", player, npcGC); callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC); - local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1); + local invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1); if invCheck == INV_ERROR_SUCCESS then player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, cluster, 1, npcGCSeal, 1, 1, 3000); end diff --git a/data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua b/data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua index ed6466b6..6c03a449 100644 --- a/data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua +++ b/data/scripts/base/chara/npc/populace/shop/PopulaceGuildShop.lua @@ -17,7 +17,6 @@ guildExplain(npcId, player) -- Guild Mark tutorial dialo --]] - require ("global") require ("shop") @@ -79,7 +78,7 @@ function onEventStarted(player, npc) end; processGuildShop(player, shopPack, shopCurrency); elseif (choice == 121) then -- Exchange marks for Gil. 1 mark = 4 gil - local markAmount = player:GetInventory(INVENTORY_CURRENCY):GetItemQuantity(shopCurrency); + local markAmount = player:GetItemPackage(INVENTORY_CURRENCY):GetItemQuantity(shopCurrency); purchaseItem(player, INVENTORY_CURRENCY, gilCurrency, markAmount*4, 1, markAmount, shopCurrency); end diff --git a/data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua b/data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua index 26039572..a4ef74cc 100644 --- a/data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua +++ b/data/scripts/base/chara/npc/populace/shop/PopulaceShopSalesman.lua @@ -264,7 +264,7 @@ function openSellMenu(player) break; else if sellState == 1 then - itemToSell = player:GetInventory(INVENTORY_NORMAL):GetItemAtSlot(sellItemSlot-1); + itemToSell = player:GetItemPackage(INVENTORY_NORMAL):GetItemAtSlot(sellItemSlot-1); gItemSellId = itemToSell.itemId; gItemQuality = itemToSell.quality; gItemPrice = GetItemGamedata(gItemSellId); diff --git a/data/scripts/base/chara/npc/retainer/OrdinaryRetainer.lua b/data/scripts/base/chara/npc/retainer/OrdinaryRetainer.lua index 2131a414..69f13f70 100644 --- a/data/scripts/base/chara/npc/retainer/OrdinaryRetainer.lua +++ b/data/scripts/base/chara/npc/retainer/OrdinaryRetainer.lua @@ -24,10 +24,6 @@ function init(npc) return false, false, 0, 0; end -function onSpawn(player, npc) - npc:SendFullRetainerInventory(player); -end - function onEventStarted(player, retainer, triggerName) while (true) do diff --git a/data/scripts/battlenpc.lua b/data/scripts/battlenpc.lua index 542e0aae..ee4b526c 100644 --- a/data/scripts/battlenpc.lua +++ b/data/scripts/battlenpc.lua @@ -81,26 +81,26 @@ function initClassItems(player) --DoW if (player.charaWork.parameterSave.state_mainSkill[0] == 2) then --PUG - player:GetInventory(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307}); + player:GetItemPackage(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307}); player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 3) then --GLA - player:GetInventory(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307}); + player:GetItemPackage(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307}); player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 4) then --MRD - player:GetInventory(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307}); + player:GetItemPackage(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307}); player:GetEquipment():SetEquipment({0, 8, 12, 13, 15},{0, 1, 2, 3, 4}); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 7) then --ARC - player:GetInventory(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307}); + player:GetItemPackage(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307}); player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 8) then --LNC - player:GetInventory(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307}); + player:GetItemPackage(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307}); player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); --DoM elseif (player.charaWork.parameterSave.state_mainSkill[0] == 22) then --THM - player:GetInventory(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208}); + player:GetItemPackage(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208}); player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 23) then --CNJ - player:GetInventory(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208}); + player:GetItemPackage(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208}); player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); --DoH @@ -124,50 +124,50 @@ end function initRaceItems(player) if (player.playerWork.tribe == 1) then --Hyur Midlander Male - player:GetInventory(0):AddItem(8040001); - player:GetInventory(0):AddItem(8060001); + player:GetItemPackage(0):AddItem(8040001); + player:GetItemPackage(0):AddItem(8060001); elseif (player.playerWork.tribe == 2) then --Hyur Midlander Female - player:GetInventory(0):AddItem(8040002); - player:GetInventory(0):AddItem(8060002); + player:GetItemPackage(0):AddItem(8040002); + player:GetItemPackage(0):AddItem(8060002); elseif (player.playerWork.tribe == 3) then --Hyur Highlander Male - player:GetInventory(0):AddItem(8040003); - player:GetInventory(0):AddItem(8060003); + player:GetItemPackage(0):AddItem(8040003); + player:GetItemPackage(0):AddItem(8060003); elseif (player.playerWork.tribe == 4) then --Elezen Wildwood Male - player:GetInventory(0):AddItem(8040004); - player:GetInventory(0):AddItem(8060004); + player:GetItemPackage(0):AddItem(8040004); + player:GetItemPackage(0):AddItem(8060004); elseif (player.playerWork.tribe == 5) then --Elezen Wildwood Female - player:GetInventory(0):AddItem(8040006); - player:GetInventory(0):AddItem(8060006); + player:GetItemPackage(0):AddItem(8040006); + player:GetItemPackage(0):AddItem(8060006); elseif (player.playerWork.tribe == 6) then --Elezen Duskwight Male - player:GetInventory(0):AddItem(8040005); - player:GetInventory(0):AddItem(8060005); + player:GetItemPackage(0):AddItem(8040005); + player:GetItemPackage(0):AddItem(8060005); elseif (player.playerWork.tribe == 7) then --Elezen Duskwight Female - player:GetInventory(0):AddItem(8040007); - player:GetInventory(0):AddItem(8060007); + player:GetItemPackage(0):AddItem(8040007); + player:GetItemPackage(0):AddItem(8060007); elseif (player.playerWork.tribe == 8) then --Lalafell Plainsfolk Male - player:GetInventory(0):AddItem(8040008); - player:GetInventory(0):AddItem(8060008); + player:GetItemPackage(0):AddItem(8040008); + player:GetItemPackage(0):AddItem(8060008); elseif (player.playerWork.tribe == 9) then --Lalafell Plainsfolk Female - player:GetInventory(0):AddItem(8040010); - player:GetInventory(0):AddItem(8060010); + player:GetItemPackage(0):AddItem(8040010); + player:GetItemPackage(0):AddItem(8060010); elseif (player.playerWork.tribe == 10) then --Lalafell Dunesfolk Male - player:GetInventory(0):AddItem(8040009); - player:GetInventory(0):AddItem(8060009); + player:GetItemPackage(0):AddItem(8040009); + player:GetItemPackage(0):AddItem(8060009); elseif (player.playerWork.tribe == 11) then --Lalafell Dunesfolk Female - player:GetInventory(0):AddItem(8040011); - player:GetInventory(0):AddItem(8060011); + player:GetItemPackage(0):AddItem(8040011); + player:GetItemPackage(0):AddItem(8060011); elseif (player.playerWork.tribe == 12) then --Miqo'te Seekers of the Sun - player:GetInventory(0):AddItem(8040012); - player:GetInventory(0):AddItem(8060012); + player:GetItemPackage(0):AddItem(8040012); + player:GetItemPackage(0):AddItem(8060012); elseif (player.playerWork.tribe == 13) then --Miqo'te Seekers of the Moon - player:GetInventory(0):AddItem(8040013); - player:GetInventory(0):AddItem(8060013); + player:GetItemPackage(0):AddItem(8040013); + player:GetItemPackage(0):AddItem(8060013); elseif (player.playerWork.tribe == 14) then --Roegadyn Sea Wolf - player:GetInventory(0):AddItem(8040014); - player:GetInventory(0):AddItem(8060014); + player:GetItemPackage(0):AddItem(8040014); + player:GetItemPackage(0):AddItem(8060014); elseif (player.playerWork.tribe == 15) then --Roegadyn Hellsguard - player:GetInventory(0):AddItem(8040015); - player:GetInventory(0):AddItem(8060015); + player:GetItemPackage(0):AddItem(8040015); + player:GetItemPackage(0):AddItem(8060015); end player:GetEquipment():SetEquipment({9, 11},{5,6}); diff --git a/data/scripts/commands/BazaarCheckCommand.lua b/data/scripts/commands/BazaarCheckCommand.lua new file mode 100644 index 00000000..87b63e84 --- /dev/null +++ b/data/scripts/commands/BazaarCheckCommand.lua @@ -0,0 +1,29 @@ +--[[ + +BazaarCheckCommand Script + +Handles what happens when you examine a player's bazaar + +--]] + +require ("global") + +function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, bazaarActorId) + + local bazaarActor = nil; + + if (name ~= nil) then + bazaarActor = player:GetZone():FindPCInZone(name); + elseif (bazaarActorId ~= nil) then + bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); + end + + if (bazaarActor ~= nil) then + callClientFunction(player, "delegateCommand", GetStaticActor("BazaarCheckCommand"), "processChackBazaar"); + else + --Show error + end + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/BazaarDealCommand.lua b/data/scripts/commands/BazaarDealCommand.lua new file mode 100644 index 00000000..17edb358 --- /dev/null +++ b/data/scripts/commands/BazaarDealCommand.lua @@ -0,0 +1,71 @@ +--[[ + +BazaarDealCommand Script + +Handles various bazaar transfer options + +All bazaar args have a Reward (The item the person who fufills the request gets) and a Seek (The item the player wants, either gil or an item). + +--]] + +function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds) + + local originalReward = nil; + local originalSeek = nil; + + --Handle special case for offers + if (seekItem == nil) then + originalSeek = player:GetItemPackage(0):GetItemAtSlot(rewardItem.seekSlot); + originalReward = player:GetItemPackage(0):GetItemAtSlot(rewardItem.offerSlot); + end + + --Handle Reward + if (type(rewardItem) == "number") then + rewardItem = GetWorldManager():CreateItem(rewardItem, rewardAmount); + player:RemoveItem(1000001, rewardAmount); + elseif (seekItem == nil) then + rewardItem = originalReward; + if (bazaarMode ~= 11) then + rewardItem = GetWorldManager():CreateItem(rewardItem.itemId, rewardAmount, rewardItem.quality, rewardItem.modifiers); + end + else + rewardItem = player:GetItem(rewardItem); + originalReward = rewardItem; + if (bazaarMode ~= 11) then + rewardItem = GetWorldManager():CreateItem(rewardItem.itemId, rewardAmount, rewardItem.quality, rewardItem.modifiers); + end + end + + --Handle Seek + if (type(seekItem) == "number") then + seekItem = GetWorldManager():CreateItem(seekItem, seekAmount); + elseif (seekItem == nil) then + seekItem = originalSeek; + if (bazaarMode ~= 11) then + seekItem = GetWorldManager():CreateItem(seekItem.itemId, seekAmount, seekItem.quality, seekItem.modifiers); + end + else + seekItem = player:GetItem(seekItem); + originalSeek = seekItem; + if (bazaarMode ~= 11) then + seekItem = GetWorldManager():CreateItem(seekItem.itemId, seekAmount, seekItem.quality, seekItem.modifiers); + end + end + + --If not selling, remove the seek item + if (bazaarMode ~= 11 and bazaarMode ~= 12 and bazaarMode ~= 13) then + if (originalSeek ~= nil) then + player:RemoveItem(originalSeek, seekAmount); + end + end + + --Remove the reward item + if (originalReward ~= nil) then + player:RemoveItem(originalReward, rewardAmount); + end + + GetWorldManager():AddToBazaar(player, rewardItem, seekItem, rewardAmount, seekAmount, bazaarMode); + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/BazaarTradeCommand.lua b/data/scripts/commands/BazaarTradeCommand.lua new file mode 100644 index 00000000..dbd3cf82 --- /dev/null +++ b/data/scripts/commands/BazaarTradeCommand.lua @@ -0,0 +1,53 @@ +--[[ + +BazaarTradeCommand Script + +Handles bazaar trade + +All bazaar args have a Reward (The item the person who fufills the request gets) and a Seek (The item the player wants, either gil or an item). + +--]] + +function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds) + + local originalReward = nil; + local originalSeek = nil; + local bazaarActor = nil; + + --Get the bazaar actor + if (bazaarActorId ~= nil) then + bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); + end + + --Abort if no actor + if (bazaarActor == nil) then + player:SendGameMessage(player, worldMaster, 25111, 0x20); + player:EndEvent(); + return; + end + + --If seekItem is a number, we are buying an item (ExecuteBazaarBuy) + if (type(seekItemOrCost) == "number") then + if (player:GetCurrentGil() >= seekItemOrCost) then + if (GetWorldManager():BazaarBuyOperation(bazaarActor, player, bazaarActor:GetItem(rewardItem), rewardAmount, seekItemOrCost)) then + else + player:SendGameMessage(player, worldMaster, 25111, 0x20); + end + else + player:SendGameMessage(player, worldMaster, 40252, 0x20); + end + else --Else we are fufilling a sought out item (ExecuteBazaarSell) + local rewardItem = bazaarActor:GetItem(rewardItem); + local seekItem = player:GetItem(seekItemOrCost); + if (rewardItem ~= nil and seekItem ~= nil) then + if (GetWorldManager():BazaarSellOperation(bazaarActor, player, rewardItem, rewardAmount, seekItem, seekAmount)) then + else + player:SendGameMessage(player, worldMaster, 25111, 0x20); + end + else + end + end + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/BazaarUndealCommand.lua b/data/scripts/commands/BazaarUndealCommand.lua new file mode 100644 index 00000000..a42a82dd --- /dev/null +++ b/data/scripts/commands/BazaarUndealCommand.lua @@ -0,0 +1,22 @@ +--[[ + +BazaarUndealCommand Script + +Handles canceling bazaar items + +25107 - Your bazaar is either full or already contains that unique item. +25111 - Unable to complete transaction. +25112 - You are unable to remove the item from your bazaar. You cannot hold any more items. +25113 - Offered and sought items cannot be identical. +25114 - Items in less than mint condition cannot be offered. +25115 - Items in less than mint condition cannot be placed in your bazaar. + +--]] + +function onEventStarted(player, actor, triggerName, rewardItem, arg1, bazaarType, arg2, bazaarActor, rewardAmount, seekAmount, arg3, arg4, type9ItemIds) + + GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem)); + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/ConfirmTradeCommand.lua b/data/scripts/commands/ConfirmTradeCommand.lua new file mode 100644 index 00000000..109f783c --- /dev/null +++ b/data/scripts/commands/ConfirmTradeCommand.lua @@ -0,0 +1,20 @@ +--[[ + +ConfirmTradeCommand Script + +Handles what happens when you accept/refuse a trade + +--]] + +function onEventStarted(player, actor, triggerName, groupType, result) + + --Accept + if (result == 1) then + GetWorldManager():AcceptTrade(player); + --Refuse + elseif (result == 2) then + GetWorldManager():RefuseTrade(player); + end + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/EquipCommand.lua b/data/scripts/commands/EquipCommand.lua index 0713d1f2..576a5f8b 100644 --- a/data/scripts/commands/EquipCommand.lua +++ b/data/scripts/commands/EquipCommand.lua @@ -6,7 +6,7 @@ Notes: Gearset activating could be optimized a bit more by doing the item packets in one go. -The param "invActionInfo" has the vars: actorId, unknown, slot, and inventoryType. +The param "equippedItem" has the vars: actorId, unknown, slot, and inventoryType. The param "itemDBIds" has the vars: item1 and item2. --]] @@ -53,12 +53,12 @@ GRAPHICSLOT_L_RINGFINGER = 24; GRAPHICSLOT_R_INDEXFINGER = 25; GRAPHICSLOT_L_INDEXFINGER = 26; -function onEventStarted(player, actor, triggerName, invActionInfo, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds) +function onEventStarted(player, actor, triggerName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds) equipSlot = equipSlot-1; --Equip Item - if (invActionInfo ~= nil) then - item = player:GetInventory(0):GetItemAtSlot(invActionInfo.slot); + if (equippedItem ~= nil) then + item = player:GetItemPackage(equippedItem.itemPackage):GetItemAtSlot(equippedItem.slot); equipItem(player, equipSlot, item); player:SendAppearance(); --Unequip Item @@ -69,6 +69,8 @@ function onEventStarted(player, actor, triggerName, invActionInfo, param1, param end end + player.CalculateBaseStats(); --player.RecalculateStats(); + player:EndEvent(); end @@ -83,7 +85,7 @@ function loadGearset(player, classId) for slot = 0, 34 do if (slot ~= EQUIPSLOT_MAINHAND and slot ~= EQUIPSLOT_UNDERSHIRT and slot ~= EQUIPSLOT_UNDERGARMENT) then - itemAtSlot = player:GetEquipment():GetItemAtSlot(slot); + itemAtSlot = slot; itemAtGearsetSlot = gearset[slot]; if (itemAtSlot ~= nil or itemAtGearsetSlot ~= nil) then @@ -98,10 +100,8 @@ function loadGearset(player, classId) end end - end - - player:GetEquipment():ToggleDBWrite(true); - + end + player:GetEquipment():ToggleDBWrite(true); end function equipItem(player, equipSlot, item) @@ -151,7 +151,7 @@ function equipItem(player, equipSlot, item) player:DoClassChange(classId); end - player:GetEquipment():Equip(equipSlot, item); + player:GetEquipment():Set(equipSlot, item); if (equipSlot == EQUIPSLOT_MAINHAND and gItem:IsNailWeapon() == false) then graphicSlot = GRAPHICSLOT_MAINHAND; elseif (equipSlot == EQUIPSLOT_OFFHAND) then graphicSlot = GRAPHICSLOT_OFFHAND; @@ -163,19 +163,23 @@ function equipItem(player, equipSlot, item) elseif (equipSlot == EQUIPSLOT_HANDS) then graphicSlot = GRAPHICSLOT_HANDS; elseif (equipSlot == EQUIPSLOT_FEET) then graphicSlot = GRAPHICSLOT_FEET; elseif (equipSlot == EQUIPSLOT_WAIST) then graphicSlot = GRAPHICSLOT_WAIST; - elseif (equipSlot == EQUIPSLOT_RFINGER) then graphicSlot = GRAPHICSLOT_RFINGER; - elseif (equipSlot == EQUIPSLOT_LFINGER) then graphicSlot = GRAPHICSLOT_LFINGER; + elseif (equipSlot == EQUIPSLOT_NECK) then graphicSlot = GRAPHICSLOT_NECK; + elseif (equipSlot == EQUIPSLOT_RFINGER) then graphicSlot = GRAPHICSLOT_R_RINGFINGER; + elseif (equipSlot == EQUIPSLOT_LFINGER) then graphicSlot = GRAPHICSLOT_L_RINGFINGER; end - + --Graphic Slot was set, otherwise it's a special case if (graphicSlot ~= nil) then player:GraphicChange(graphicSlot, item); elseif (gItem:IsNailWeapon()) then player:GraphicChange(GRAPHICSLOT_MAINHAND, item); - player:GraphicChange(GRAPHICSLOT_OFFHAND, item); + player:GraphicChange(GRAPHICSLOT_OFFHAND, item); elseif (equipSlot == EQUIPSLOT_EARS) then player:GraphicChange(GRAPHICSLOT_R_EAR, item); player:GraphicChange(GRAPHICSLOT_L_EAR, item); + elseif (equipSlot == EQUIPSLOT_WRIST) then + player:GraphicChange(GRAPHICSLOT_R_WRIST, item); + player:GraphicChange(GRAPHICSLOT_L_WRIST, item); end end end @@ -187,7 +191,7 @@ function unequipItem(player, equipSlot, item) player:SendGameMessage(player, worldMaster, 30730, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1); --Unable to unequip elseif (item ~= nil) then player:SendGameMessage(player, worldMaster, 30602, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1); --Item Removed - player:GetEquipment():Unequip(equipSlot); + player:GetEquipment():Clear(equipSlot); if (equipSlot == EQUIPSLOT_BODY) then --Show Undershirt item = player:GetEquipment():GetItemAtSlot(EQUIPSLOT_UNDERSHIRT); @@ -204,9 +208,11 @@ function unequipItem(player, equipSlot, item) elseif (equipSlot == EQUIPSLOT_PACK) then player:GraphicChange(GRAPHICSLOT_PACK, nil); elseif (equipSlot == EQUIPSLOT_HEAD) then player:GraphicChange(GRAPHICSLOT_HEAD, nil); elseif (equipSlot == EQUIPSLOT_WAIST) then player:GraphicChange(GRAPHICSLOT_WAIST, nil); + elseif (equipSlot == EQUIPSLOT_NECK) then player:GraphicChange(GRAPHICSLOT_NECK, nil); elseif (equipSlot == EQUIPSLOT_EARS) then player:GraphicChange(GRAPHICSLOT_L_EAR, nil); player:GraphicChange(GRAPHICSLOT_R_EAR, nil); - elseif (equipSlot == EQUIPSLOT_RFINGER) then player:GraphicChange(GRAPHICSLOT_RFINGER, nil); - elseif (equipSlot == EQUIPSLOT_LFINGER) then player:GraphicChange(GRAPHICSLOT_LFINGER, nil); + elseif (equipSlot == EQUIPSLOT_WRIST) then player:GraphicChange(GRAPHICSLOT_L_WRIST, nil); player:GraphicChange(GRAPHICSLOT_R_WRIST, nil); + elseif (equipSlot == EQUIPSLOT_RFINGER) then player:GraphicChange(GRAPHICSLOT_R_RINGFINGER, nil); + elseif (equipSlot == EQUIPSLOT_LFINGER) then player:GraphicChange(GRAPHICSLOT_L_RINGFINGER, nil); end end return true; diff --git a/data/scripts/commands/ItemMovePackageCommand.lua b/data/scripts/commands/ItemMovePackageCommand.lua new file mode 100644 index 00000000..5f1bd6c4 --- /dev/null +++ b/data/scripts/commands/ItemMovePackageCommand.lua @@ -0,0 +1,13 @@ +--[[ + +ItemMovePackageCommand Script + +Handles moving items across item packages (IE: Taking loot) + +--]] + +function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds) + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/ItemTransferCommand.lua b/data/scripts/commands/ItemTransferCommand.lua new file mode 100644 index 00000000..392c54f9 --- /dev/null +++ b/data/scripts/commands/ItemTransferCommand.lua @@ -0,0 +1,13 @@ +--[[ + +ItemTransferCommand Script + +Handles giving an item to another party member. + +--]] + +function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds) + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/ItemWasteCommand.lua b/data/scripts/commands/ItemWasteCommand.lua index c906675b..a5ff9cd2 100644 --- a/data/scripts/commands/ItemWasteCommand.lua +++ b/data/scripts/commands/ItemWasteCommand.lua @@ -9,7 +9,7 @@ The param "itemDBIds" has the vars: item1 and item2. --]] -function onEventStarted(player, actor, triggerName, invActionInfo, param1, param2, param3, param4, param5, param6, param7, param8, itemDBIds) - player:GetInventory(0x00):RemoveItemAtSlot(invActionInfo.slot); +function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds) + player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot); player:EndEvent(); end diff --git a/data/scripts/commands/TradeExecuteCommand.lua b/data/scripts/commands/TradeExecuteCommand.lua new file mode 100644 index 00000000..590a0458 --- /dev/null +++ b/data/scripts/commands/TradeExecuteCommand.lua @@ -0,0 +1,97 @@ +--[[ + +TradeExecuteCommand Script + +Handles all trading between players + +Functions: + +processTradeCommandOpenTray() - Opens the trade widget. +processTradeCommandCloseTray() - Closes the trade widget. +processTradeCommandReply(command, params) - Operates the trade widget. +processUpdateTradeCommandTrayData() - ? + +Commands: + +set: TradeWidget resets "Set Mode" (turned on once item selected while waiting for reply). +back: TradeWidget resets "Choose Mode" (turned on when ui operation is done). +fix: You have accepted the deal. +targetfix: Target has accepted the deal. +doedit: You have canceled your accept. +reedit: Target has canceled their accept. + +--]] + +require ("global") + +function onEventStarted(player, actor, triggerName) + + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray"); + + tradeOffering = player:GetTradeOfferings(); + + while (true) do + widgetOpen, chosenOperation, tradeSlot, itemActor, quantity, itemPackageId, itemSlot = callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processUpdateTradeCommandTrayData"); + + --Abort script if client script dead + if (widgetOpen == false or widgetOpen == nil) then + player:FinishTradeTransaction(); + break; + end + + --Handle you/target canceling/finishing the trade + if (not player:IsTrading() or not player:GetOtherTrader():IsTrading()) then + player:FinishTradeTransaction(); + break; + end + + --Handle target accepting + if (player:GetOtherTrader():IsTradeAccepted() == true) then + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "targetfix"); + else + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "reedit"); + end + + --Check if both accepted the trade + if (player:IsTradeAccepted() and player:GetOtherTrader():IsTradeAccepted()) then + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandCloseTray"); + GetWorldManager():CompleteTrade(player, player:GetOtherTrader()); + break; + end + + --Clear Item + if (chosenOperation == 1) then + player:RemoveTradeItem(tradeSlot - 1); + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set"); + --Clear All + elseif (chosenOperation == 2) then + player:ClearTradeItems(); + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set"); + --Item Chosen + elseif (chosenOperation == 3) then + player:AddTradeItem(tradeSlot - 1, itemActor, quantity); + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set", 2, 2, 2, 2); + --Gil Chosen + elseif (chosenOperation == 4) then + player:AddTradeItem(tradeSlot - 1, itemActor, quantity); + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set"); + --Cancel + elseif (chosenOperation == 11) then + player:FinishTradeTransaction(); + break; + --OK + elseif (chosenOperation == 12) then + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "fix"); + player:AcceptTrade(true); + --Reedit + elseif (chosenOperation == 13) then + callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "doedit"); + player:AcceptTrade(false); + end + + wait(1); + end + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/TradeOfferCancelCommand.lua b/data/scripts/commands/TradeOfferCancelCommand.lua new file mode 100644 index 00000000..71edd609 --- /dev/null +++ b/data/scripts/commands/TradeOfferCancelCommand.lua @@ -0,0 +1,14 @@ +--[[ + +TradeOfferCommand Script + +Handles what happens a player cancels a trade + +--]] + +function onEventStarted(player, actor, triggerName, commandId, result) + + GetWorldManager():CancelTrade(player); + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/TradeOfferCommand.lua b/data/scripts/commands/TradeOfferCommand.lua new file mode 100644 index 00000000..8222d7d8 --- /dev/null +++ b/data/scripts/commands/TradeOfferCommand.lua @@ -0,0 +1,26 @@ +--[[ + +TradeOfferCommand Script + +Handles what happens when you invite to trade + +--]] + +function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId) + + local otherActor = nil; + + if (name ~= nil) then + otherActor = player:GetZone():FindPCInZone(name); + elseif (actorId ~= nil) then + otherActor = player:GetZone():FindActorInArea(actorId); + end + + if (otherActor ~= nil) then + GetWorldManager():CreateTradeGroup(player, otherActor); + else + end + + player:EndEvent(); + +end \ No newline at end of file diff --git a/data/scripts/commands/gm/delcurrency.lua b/data/scripts/commands/gm/delcurrency.lua index 28318d71..dab322be 100644 --- a/data/scripts/commands/gm/delcurrency.lua +++ b/data/scripts/commands/gm/delcurrency.lua @@ -26,7 +26,7 @@ function onTrigger(player, argc, currency, qty, name, lastName) currency = tonumber(currency) or nil; qty = tonumber(qty) or 1; - local removed = player:GetInventory(INVENTORY_CURRENCY):RemoveItem(currency, qty); + local removed = player:GetItemPackage(INVENTORY_CURRENCY):RemoveItem(currency, qty); local messageID = MESSAGE_TYPE_SYSTEM_ERROR; local message = "Attempting to remove currency" -- "unable to remove currency"; diff --git a/data/scripts/commands/gm/delitem.lua b/data/scripts/commands/gm/delitem.lua index bdfcd761..23dc3b19 100644 --- a/data/scripts/commands/gm/delitem.lua +++ b/data/scripts/commands/gm/delitem.lua @@ -39,7 +39,7 @@ function onTrigger(player, argc, item, qty, location, name, lastName) location = INVENTORY_NORMAL; end; - local removed = player:GetInventory(location):RemoveItem(item, qty); + local removed = player:GetItemPackage(location):RemoveItem(item, qty); if removed then -- RemoveItem() currently returns nothing for verification, this statement can't work message = string.format("Removed item %u of kind %u to %s", item, location, player:GetName()); diff --git a/data/scripts/commands/gm/delkeyitem.lua b/data/scripts/commands/gm/delkeyitem.lua index be763961..90b76585 100644 --- a/data/scripts/commands/gm/delkeyitem.lua +++ b/data/scripts/commands/gm/delkeyitem.lua @@ -27,7 +27,7 @@ function onTrigger(player, argc, keyitem, qty, name, lastName) qty = tonumber(qty) or 1; local location = INVENTORY_KEYITEMS; - local removed = player:GetInventory(location):RemoveItem(keyitem, qty); + local removed = player:GetItemPackage(location):RemoveItem(keyitem, qty); local messageID = MESSAGE_TYPE_SYSTEM_ERROR; local message = "Attempting to remove keyitem" -- "unable to remove keyitem"; diff --git a/data/scripts/commands/gm/givegil.lua b/data/scripts/commands/gm/givegil.lua index b4d3a9c1..b92d0ab4 100644 --- a/data/scripts/commands/gm/givegil.lua +++ b/data/scripts/commands/gm/givegil.lua @@ -27,7 +27,7 @@ function onTrigger(player, argc, qty, name, lastName) qty = tonumber(qty) or 1; location = INVENTORY_CURRENCY; - local added = player:GetInventory(location):AddItem(currency, qty, 1); + local added = player:GetItemPackage(location):AddItem(currency, qty, 1); local messageID = MESSAGE_TYPE_SYSTEM_ERROR; local message = "unable to add gil"; diff --git a/data/scripts/commands/gm/giveitem.lua b/data/scripts/commands/gm/giveitem.lua index 79d01ff5..5506f724 100644 --- a/data/scripts/commands/gm/giveitem.lua +++ b/data/scripts/commands/gm/giveitem.lua @@ -46,8 +46,7 @@ function onTrigger(player, argc, item, qty, location, name, lastName) location = INVENTORY_NORMAL; end; - - local invCheck = player:getInventory(location):AddItem(item, qty, 1); + local invCheck = player:getItemPackage(location):addItem(item, qty, 1); if (invCheck == INV_ERROR_FULL) then -- Your inventory is full. diff --git a/data/scripts/commands/gm/givekeyitem.lua b/data/scripts/commands/gm/givekeyitem.lua index 9963005e..2e23f6ec 100644 --- a/data/scripts/commands/gm/givekeyitem.lua +++ b/data/scripts/commands/gm/givekeyitem.lua @@ -27,7 +27,7 @@ function onTrigger(player, argc, keyitem, name, lastName) qty = 1; location = INVENTORY_KEYITEMS; - local added = player:GetInventory(location):AddItem(keyitem, qty, 1); + local added = player:GetItemPackage(location):AddItem(keyitem, qty, 1); local messageID = MESSAGE_TYPE_SYSTEM_ERROR; local message = "unable to add keyitem"; diff --git a/data/scripts/effects/excruciate.lua b/data/scripts/effects/excruciate.lua index 9123623d..0a35bf39 100644 --- a/data/scripts/effects/excruciate.lua +++ b/data/scripts/effects/excruciate.lua @@ -25,6 +25,6 @@ end function onCrit(effect, attacker, defender, skill, action, actionContainer) if skill.GetCommandType() == CommandType.Spell then - defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); + attacker.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/data/scripts/gcseals.lua b/data/scripts/gcseals.lua index da6e1e40..2017956d 100644 --- a/data/scripts/gcseals.lua +++ b/data/scripts/gcseals.lua @@ -35,7 +35,7 @@ function GetGCSeals(player, company) company = tonumber(company); if company ~= nil and company > 0 and company < 4 then - return player:GetInventory(INVENTORY_CURRENCY):GetItemQuantity(companySeal[tonumber(company)]); + return player:GetItemPackage(INVENTORY_CURRENCY):GetItemQuantity(companySeal[tonumber(company)]); else return -1; end @@ -52,7 +52,7 @@ function AddGCSeals(player, company, amount) if currentAmount ~= -1 then if amount then if currentAmount + amount <= maxAmount then - invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(companySeal[company], amount, 1); + invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(companySeal[company], amount, 1); if invCheck == INV_ERROR_SUCCESS then return INV_ERROR_SUCCESS; end diff --git a/data/scripts/player.lua b/data/scripts/player.lua index 4fdbddd7..edcfdacd 100644 --- a/data/scripts/player.lua +++ b/data/scripts/player.lua @@ -82,27 +82,27 @@ function initClassItems(player) --DoW if (player.charaWork.parameterSave.state_mainSkill[0] == 2) then --PUG - player:GetInventory(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307}); - player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({4020001, 8030701, 8050728, 8080601, 8090307}); + player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 3) then --GLA - player:GetInventory(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307}); - player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({4030010, 8031120, 8050245, 8080601, 8090307}); + player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 4) then --MRD - player:GetInventory(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307}); - player:GetEquipment():SetEquipment({0, 8, 12, 13, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({4040001, 8011001, 8050621, 8070346, 8090307}); + player:GetEquipment():Set({0, 8, 12, 13, 15},{0, 1, 2, 3, 4},0); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 7) then --ARC - player:GetInventory(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307}); - player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({4070001, 8030601, 8050622, 8080601, 8090307}); + player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 8) then --LNC - player:GetInventory(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307}); - player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({4080201, 8030801, 8051015, 8080501, 8090307}); + player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0); --DoM elseif (player.charaWork.parameterSave.state_mainSkill[0] == 22) then --THM - player:GetInventory(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208}); - player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({5020001, 8030245, 8050346, 8080346, 8090208}); + player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0); elseif (player.charaWork.parameterSave.state_mainSkill[0] == 23) then --CNJ - player:GetInventory(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208}); - player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4}); + player:GetItemPackage(0):AddItems({5030101, 8030445, 8050031, 8080246, 8090208}); + player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0); --DoH elseif (player.charaWork.parameterSave.state_mainSkill[0] == 29) then -- @@ -125,52 +125,52 @@ end function initRaceItems(player) if (player.playerWork.tribe == 1) then --Hyur Midlander Male - player:GetInventory(0):AddItem(8040001); - player:GetInventory(0):AddItem(8060001); + player:GetItemPackage(0):AddItem(8040001); + player:GetItemPackage(0):AddItem(8060001); elseif (player.playerWork.tribe == 2) then --Hyur Midlander Female - player:GetInventory(0):AddItem(8040002); - player:GetInventory(0):AddItem(8060002); + player:GetItemPackage(0):AddItem(8040002); + player:GetItemPackage(0):AddItem(8060002); elseif (player.playerWork.tribe == 3) then --Hyur Highlander Male - player:GetInventory(0):AddItem(8040003); - player:GetInventory(0):AddItem(8060003); + player:GetItemPackage(0):AddItem(8040003); + player:GetItemPackage(0):AddItem(8060003); elseif (player.playerWork.tribe == 4) then --Elezen Wildwood Male - player:GetInventory(0):AddItem(8040004); - player:GetInventory(0):AddItem(8060004); + player:GetItemPackage(0):AddItem(8040004); + player:GetItemPackage(0):AddItem(8060004); elseif (player.playerWork.tribe == 5) then --Elezen Wildwood Female - player:GetInventory(0):AddItem(8040006); - player:GetInventory(0):AddItem(8060006); + player:GetItemPackage(0):AddItem(8040006); + player:GetItemPackage(0):AddItem(8060006); elseif (player.playerWork.tribe == 6) then --Elezen Duskwight Male - player:GetInventory(0):AddItem(8040005); - player:GetInventory(0):AddItem(8060005); + player:GetItemPackage(0):AddItem(8040005); + player:GetItemPackage(0):AddItem(8060005); elseif (player.playerWork.tribe == 7) then --Elezen Duskwight Female - player:GetInventory(0):AddItem(8040007); - player:GetInventory(0):AddItem(8060007); + player:GetItemPackage(0):AddItem(8040007); + player:GetItemPackage(0):AddItem(8060007); elseif (player.playerWork.tribe == 8) then --Lalafell Plainsfolk Male - player:GetInventory(0):AddItem(8040008); - player:GetInventory(0):AddItem(8060008); + player:GetItemPackage(0):AddItem(8040008); + player:GetItemPackage(0):AddItem(8060008); elseif (player.playerWork.tribe == 9) then --Lalafell Plainsfolk Female - player:GetInventory(0):AddItem(8040010); - player:GetInventory(0):AddItem(8060010); + player:GetItemPackage(0):AddItem(8040010); + player:GetItemPackage(0):AddItem(8060010); elseif (player.playerWork.tribe == 10) then --Lalafell Dunesfolk Male - player:GetInventory(0):AddItem(8040009); - player:GetInventory(0):AddItem(8060009); + player:GetItemPackage(0):AddItem(8040009); + player:GetItemPackage(0):AddItem(8060009); elseif (player.playerWork.tribe == 11) then --Lalafell Dunesfolk Female - player:GetInventory(0):AddItem(8040011); - player:GetInventory(0):AddItem(8060011); + player:GetItemPackage(0):AddItem(8040011); + player:GetItemPackage(0):AddItem(8060011); elseif (player.playerWork.tribe == 12) then --Miqo'te Seekers of the Sun - player:GetInventory(0):AddItem(8040012); - player:GetInventory(0):AddItem(8060012); + player:GetItemPackage(0):AddItem(8040012); + player:GetItemPackage(0):AddItem(8060012); elseif (player.playerWork.tribe == 13) then --Miqo'te Seekers of the Moon - player:GetInventory(0):AddItem(8040013); - player:GetInventory(0):AddItem(8060013); + player:GetItemPackage(0):AddItem(8040013); + player:GetItemPackage(0):AddItem(8060013); elseif (player.playerWork.tribe == 14) then --Roegadyn Sea Wolf - player:GetInventory(0):AddItem(8040014); - player:GetInventory(0):AddItem(8060014); + player:GetItemPackage(0):AddItem(8040014); + player:GetItemPackage(0):AddItem(8060014); elseif (player.playerWork.tribe == 15) then --Roegadyn Hellsguard - player:GetInventory(0):AddItem(8040015); - player:GetInventory(0):AddItem(8060015); + player:GetItemPackage(0):AddItem(8040015); + player:GetItemPackage(0):AddItem(8060015); end - player:GetEquipment():SetEquipment({9, 11},{5,6}); + player:GetEquipment():Set({9,11},{5,6}, 0); end \ No newline at end of file diff --git a/data/scripts/retainer.lua b/data/scripts/retainer.lua index 7348bd20..e4aa3c8c 100644 --- a/data/scripts/retainer.lua +++ b/data/scripts/retainer.lua @@ -22,18 +22,24 @@ function doItemTrade(player, retainer) callClientFunction(player, "eventTalkRetainerItemTrade", 1); while (true) do - resultCode, type7Param, un1, quantity, itemId, quality = callClientFunction(player, "eventTalkRetainerItemTrade", 2); + resultCode, item, un1, quantity, itemId, quality = callClientFunction(player, "eventTalkRetainerItemTrade", 2); + player:SendMessage(0x20, "", "" .. tostring(resultCode)); + player:SendMessage(0x20, "", "" .. tostring(un1)); + player:SendMessage(0x20, "", "" .. tostring(quantity)); + player:SendMessage(0x20, "", "" .. tostring(itemId)); + player:SendMessage(0x20, "", "" .. tostring(quality)); + --Retreieve if (resultCode == 31) then - retainer:GetInventory(type7Param.inventoryType):RemoveItemAtSlot(type7Param.slot, quantity); - retainer:GetInventory(type7Param.inventoryType):SendUpdatePackets(player, true); - player:GetInventory(type7Param.inventoryType):AddItem(itemId, quantity, quality); + retainer:GetItemPackage(item.itemPackage):RemoveItemAtSlot(item.slot, quantity); + retainer:GetItemPackage(item.itemPackage):SendUpdatePackets(player, true); + player:GetItemPackage(item.itemPackage):AddItem(itemId, quantity, quality); --Entrust elseif (resultCode == 32) then - player:GetInventory(type7Param.inventoryType):RemoveItemAtSlot(type7Param.slot, quantity); - retainer:GetInventory(type7Param.inventoryType):AddItem(itemId, quantity, quality); - retainer:GetInventory(type7Param.inventoryType):SendUpdatePackets(player, true); + player:GetItemPackage(item.itemPackage):RemoveItemAtSlot(item.slot, quantity); + retainer:GetItemPackage(item.itemPackage):AddItem(itemId, quantity, quality); + retainer:GetItemPackage(item.itemPackage):SendUpdatePackets(player, true); end callClientFunction(player, "eventReturnResult", resultCode, false); diff --git a/data/scripts/shop.lua b/data/scripts/shop.lua index acaf3f93..d0df39b8 100644 --- a/data/scripts/shop.lua +++ b/data/scripts/shop.lua @@ -9,8 +9,8 @@ function purchaseItem(player, location, itemId, quantity, quality, price, curren local worldMaster = GetWorldMaster(); local invCheck = -1; - if (player:GetInventory(INVENTORY_CURRENCY):HasItem(currency, price)) then - invCheck = player:GetInventory(location):AddItem(itemId, quantity, quality); + 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. @@ -21,7 +21,7 @@ function purchaseItem(player, location, itemId, quantity, quality, price, curren elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then player:SendMessage(0x20, "", "[DEBUG] Server Error on adding item."); elseif (invCheck == INV_ERROR_SUCCESS) then - player:GetInventory(INVENTORY_CURRENCY):removeItem(currency, price); + player:GetItemPackage(INVENTORY_CURRENCY):removeItem(currency, price); if (currency == 1000001) then -- If Gil -- You purchase for gil. @@ -48,8 +48,8 @@ function sellItem(player, itemId, quantity, quality, itemPrice, slot, currency) local worldMaster = GetWorldMaster(); local cost = quantity * itemPrice; - player:GetInventory(INVENTORY_CURRENCY):AddItem(currency, cost); - player:GetInventory(INVENTORY_NORMAL):RemoveItemAtSlot(slot, quantity); + 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/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua index 8cc5d507..44b89d81 100644 --- a/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua +++ b/data/scripts/unique/fst0Town01a/PopulaceStandard/serpent_lieutenant_marette.lua @@ -4,9 +4,9 @@ function onEventStarted(player, npc) Spl = GetStaticActor("Spl000"); magickedPrism = 3020615; - if not player:GetInventory(INVENTORY_NORMAL):HasItem(magickedPrism) then + if not player:GetItemPackage(INVENTORY_NORMAL):HasItem(magickedPrism) then callClientFunction(player, "delegateEvent", player, Spl, "processEventELNAURE", 2); - local invCheck = player:GetInventory(INVENTORY_NORMAL):AddItem(magickedPrism, 10, 1); + local invCheck = player:GetItemPackage(INVENTORY_NORMAL):AddItem(magickedPrism, 10, 1); if invCheck == INV_ERROR_SUCCESS then player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, magickedPrism, 10); end diff --git a/sql/characters.sql b/sql/characters.sql index 78213547..2bd1102e 100644 --- a/sql/characters.sql +++ b/sql/characters.sql @@ -48,4 +48,4 @@ CREATE TABLE `characters` ( `homepoint` int(10) unsigned NOT NULL DEFAULT '0', `homepointInn` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=166 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; diff --git a/sql/characters_inventory.sql b/sql/characters_inventory.sql index 30cc31b2..c7fcb453 100644 --- a/sql/characters_inventory.sql +++ b/sql/characters_inventory.sql @@ -4,7 +4,7 @@ Source Host: localhost Source Database: ffxiv_server Target Host: localhost Target Database: ffxiv_server -Date: 9/9/2017 2:31:15 PM +Date: 12/17/2017 3:37:39 PM */ SET FOREIGN_KEY_CHECKS=0; @@ -12,10 +12,12 @@ SET FOREIGN_KEY_CHECKS=0; -- Table structure for characters_inventory -- ---------------------------- CREATE TABLE `characters_inventory` ( - `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT, `characterId` int(10) unsigned NOT NULL, - `inventoryType` smallint(5) unsigned NOT NULL DEFAULT '0', `serverItemId` int(10) unsigned NOT NULL, - `quantity` int(10) unsigned NOT NULL DEFAULT '1', - PRIMARY KEY (`id`,`characterId`) -) ENGINE=InnoDB AUTO_INCREMENT=325 DEFAULT CHARSET=utf8; + `itemPackage` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`characterId`,`serverItemId`,`itemPackage`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records +-- ---------------------------- diff --git a/sql/characters_inventory_bazaar.sql b/sql/characters_inventory_bazaar.sql new file mode 100644 index 00000000..0082b120 --- /dev/null +++ b/sql/characters_inventory_bazaar.sql @@ -0,0 +1,28 @@ +/* +MySQL Data Transfer +Source Host: localhost +Source Database: ffxiv_server +Target Host: localhost +Target Database: ffxiv_server +Date: 12/17/2017 3:37:44 PM +*/ + +SET FOREIGN_KEY_CHECKS=0; +-- ---------------------------- +-- Table structure for characters_inventory_bazaar +-- ---------------------------- +CREATE TABLE `characters_inventory_bazaar` ( + `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT, + `characterId` int(10) unsigned NOT NULL DEFAULT '0', + `rewardId` bigint(10) unsigned DEFAULT NULL, + `seekId` bigint(10) unsigned DEFAULT '0', + `rewardAmount` int(11) DEFAULT '0', + `seekAmount` int(11) DEFAULT '0', + `bazaarMode` tinyint(4) unsigned NOT NULL DEFAULT '0', + `sellPrice` int(11) DEFAULT '0', + PRIMARY KEY (`id`,`characterId`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records +-- ---------------------------- diff --git a/sql/characters_inventory_equipment.sql b/sql/characters_inventory_equipment.sql index 8a87e29e..1101b439 100644 --- a/sql/characters_inventory_equipment.sql +++ b/sql/characters_inventory_equipment.sql @@ -1,52 +1,24 @@ --- MySQL dump 10.13 Distrib 5.7.10, for Win64 (x86_64) --- --- Host: localhost Database: ffxiv_database --- ------------------------------------------------------ --- Server version 5.7.10-log +/* +MySQL Data Transfer +Source Host: localhost +Source Database: ffxiv_server +Target Host: localhost +Target Database: ffxiv_server +Date: 12/17/2017 3:37:50 PM +*/ -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `characters_inventory_equipment` --- - -DROP TABLE IF EXISTS `characters_inventory_equipment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `characters_inventory_equipment` ( - `characterId` int(10) unsigned NOT NULL, - `classId` smallint(5) unsigned NOT NULL, - `equipSlot` smallint(5) unsigned NOT NULL, - `itemId` bigint(10) unsigned NOT NULL, - PRIMARY KEY (`characterId`,`classId`,`equipSlot`) +SET FOREIGN_KEY_CHECKS=0; +-- ---------------------------- +-- Table structure for characters_inventory_equipment +-- ---------------------------- +CREATE TABLE `characters_inventory_equipment` ( + `characterId` int(10) unsigned NOT NULL, + `classId` smallint(5) unsigned NOT NULL, + `equipSlot` smallint(5) unsigned NOT NULL, + `itemId` bigint(10) unsigned NOT NULL, + PRIMARY KEY (`characterId`,`classId`,`equipSlot`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; --- --- Dumping data for table `characters_inventory_equipment` --- - -LOCK TABLES `characters_inventory_equipment` WRITE; -/*!40000 ALTER TABLE `characters_inventory_equipment` DISABLE KEYS */; -/*!40000 ALTER TABLE `characters_inventory_equipment` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2016-06-07 22:54:46 +-- ---------------------------- +-- Records +-- ---------------------------- diff --git a/sql/gamedata_items_graphics.sql b/sql/gamedata_items_graphics.sql index e857767f..427510ae 100644 --- a/sql/gamedata_items_graphics.sql +++ b/sql/gamedata_items_graphics.sql @@ -1,30 +1,18 @@ --- MySQL dump 10.13 Distrib 5.7.10, for Win64 (x86_64) --- --- Host: localhost Database: ffxiv_database --- ------------------------------------------------------ --- Server version 5.7.10-log +-- -------------------------------------------------------- +-- Host: 127.0.0.1 +-- Server version: 5.6.17 - MySQL Community Server (GPL) +-- Server OS: Win64 +-- HeidiSQL Version: 10.1.0.5464 +-- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; --- --- Table structure for table `gamedata_items_graphics` --- - -SET autocommit = 0; - -DROP TABLE IF EXISTS `gamedata_items_graphics`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `gamedata_items_graphics` ( +-- Dumping structure for table ffxiv_server.gamedata_items_graphics +CREATE TABLE IF NOT EXISTS `gamedata_items_graphics` ( `catalogID` int(10) unsigned NOT NULL, `weaponId` int(10) unsigned NOT NULL, `equipmentId` int(10) unsigned NOT NULL, @@ -32,120 +20,3950 @@ CREATE TABLE `gamedata_items_graphics` ( `colorId` int(10) unsigned NOT NULL, PRIMARY KEY (`catalogID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; --- --- Dumping data for table `gamedata_items_graphics` --- - -LOCK TABLES `gamedata_items_graphics` WRITE; +-- Dumping data for table ffxiv_server.gamedata_items_graphics: ~3,938 rows (approximately) /*!40000 ALTER TABLE `gamedata_items_graphics` DISABLE KEYS */; -INSERT INTO `gamedata_items_graphics` VALUES (4020001,58,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030010,76,1,90,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030016,76,1,60,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030117,76,2,20,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030303,76,4,10,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030407,79,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030408,77,1,60,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030507,78,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030601,76,10,10,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030602,76,10,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030603,80,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030604,76,14,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030605,76,15,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030606,76,16,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030607,76,13,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030608,76,17,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4030711,76,5,20,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040001,141,1,70,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040013,141,6,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040109,141,8,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040501,141,7,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040502,141,7,10,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040504,141,10,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040505,141,11,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040506,141,12,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4040507,141,9,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4070001,201,1,60,0); -INSERT INTO `gamedata_items_graphics` VALUES (4080201,161,3,50,0); -INSERT INTO `gamedata_items_graphics` VALUES (4100206,31,3,11,0); -INSERT INTO `gamedata_items_graphics` VALUES (4100801,31,12,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4100802,31,13,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (4100803,31,14,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (5020001,281,1,100,4); -INSERT INTO `gamedata_items_graphics` VALUES (5030101,331,1,20,0); -INSERT INTO `gamedata_items_graphics` VALUES (8011001,0,23,5,1); -INSERT INTO `gamedata_items_graphics` VALUES (8011708,0,15,16,0); -INSERT INTO `gamedata_items_graphics` VALUES (8011709,0,15,12,0); -INSERT INTO `gamedata_items_graphics` VALUES (8030245,0,7,18,0); -INSERT INTO `gamedata_items_graphics` VALUES (8030445,0,4,11,0); -INSERT INTO `gamedata_items_graphics` VALUES (8030601,0,9,21,0); -INSERT INTO `gamedata_items_graphics` VALUES (8030701,0,10,13,0); -INSERT INTO `gamedata_items_graphics` VALUES (8030801,0,13,19,0); -INSERT INTO `gamedata_items_graphics` VALUES (8031120,0,31,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8031716,0,15,16,0); -INSERT INTO `gamedata_items_graphics` VALUES (8031719,0,15,12,0); -INSERT INTO `gamedata_items_graphics` VALUES (8032834,0,59,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040001,0,1,5,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040002,0,1,5,2); -INSERT INTO `gamedata_items_graphics` VALUES (8040003,0,1,5,3); -INSERT INTO `gamedata_items_graphics` VALUES (8040004,0,1,5,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040005,0,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040006,0,1,5,3); -INSERT INTO `gamedata_items_graphics` VALUES (8040007,0,1,15,1); -INSERT INTO `gamedata_items_graphics` VALUES (8040008,0,1,5,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040009,0,1,5,1); -INSERT INTO `gamedata_items_graphics` VALUES (8040010,0,1,15,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040011,0,1,15,1); -INSERT INTO `gamedata_items_graphics` VALUES (8040012,0,1,6,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040013,0,1,5,2); -INSERT INTO `gamedata_items_graphics` VALUES (8040014,0,1,5,0); -INSERT INTO `gamedata_items_graphics` VALUES (8040015,0,1,5,2); -INSERT INTO `gamedata_items_graphics` VALUES (8050031,0,2,6,0); -INSERT INTO `gamedata_items_graphics` VALUES (8050245,0,4,11,0); -INSERT INTO `gamedata_items_graphics` VALUES (8050346,0,5,11,0); -INSERT INTO `gamedata_items_graphics` VALUES (8050621,0,9,25,0); -INSERT INTO `gamedata_items_graphics` VALUES (8050622,0,9,24,0); -INSERT INTO `gamedata_items_graphics` VALUES (8050728,0,10,10,0); -INSERT INTO `gamedata_items_graphics` VALUES (8050808,0,15,22,0); -INSERT INTO `gamedata_items_graphics` VALUES (8051015,0,7,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060001,0,1,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060002,0,1,2,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060003,0,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060004,0,1,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060005,0,1,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060006,0,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060007,0,1,2,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060008,0,1,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060009,0,1,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060010,0,1,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060011,0,1,2,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060012,0,1,2,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060013,0,1,6,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060014,0,1,1,0); -INSERT INTO `gamedata_items_graphics` VALUES (8060015,0,1,2,0); -INSERT INTO `gamedata_items_graphics` VALUES (8070243,0,11,7,5); -INSERT INTO `gamedata_items_graphics` VALUES (8070346,0,5,11,0); -INSERT INTO `gamedata_items_graphics` VALUES (8080246,0,4,10,0); -INSERT INTO `gamedata_items_graphics` VALUES (8080346,0,5,12,0); -INSERT INTO `gamedata_items_graphics` VALUES (8080501,0,10,13,0); -INSERT INTO `gamedata_items_graphics` VALUES (8080601,0,25,7,0); -INSERT INTO `gamedata_items_graphics` VALUES (8081208,0,15,16,0); -INSERT INTO `gamedata_items_graphics` VALUES (8081209,0,15,12,0); -INSERT INTO `gamedata_items_graphics` VALUES (8090208,0,4,0,0); -INSERT INTO `gamedata_items_graphics` VALUES (8090307,0,6,0,0); +REPLACE INTO `gamedata_items_graphics` (`catalogID`, `weaponId`, `equipmentId`, `variantId`, `colorId`) VALUES + (3910001, 396, 1, 20, 0), + (3910005, 396, 1, 10, 0), + (3910006, 396, 2, 30, 0), + (3910007, 396, 2, 20, 0), + (3910008, 396, 2, 30, 0), + (3910009, 396, 2, 0, 0), + (3910101, 396, 2, 0, 0), + (3910102, 396, 2, 10, 0), + (3910103, 396, 2, 20, 0), + (3910104, 396, 2, 30, 0), + (3910201, 396, 3, 0, 0), + (3910202, 396, 3, 10, 0), + (3910203, 396, 3, 20, 0), + (3910204, 396, 3, 30, 0), + (3910301, 396, 4, 10, 0), + (3910302, 396, 4, 10, 0), + (3910303, 396, 4, 0, 0), + (3910304, 396, 4, 0, 0), + (3910305, 396, 7, 0, 0), + (3910306, 396, 7, 10, 0), + (3910401, 396, 8, 0, 0), + (3910402, 396, 8, 10, 0), + (3910403, 396, 8, 20, 0), + (3920001, 221, 1, 10, 0), + (3920002, 221, 2, 20, 0), + (3920003, 221, 1, 31, 0), + (3920004, 221, 1, 10, 0), + (3920005, 221, 2, 20, 0), + (3920006, 221, 1, 11, 0), + (3920007, 221, 1, 12, 0), + (3920008, 221, 1, 13, 0), + (3920009, 221, 2, 0, 0), + (3920010, 221, 1, 31, 0), + (3920011, 221, 2, 10, 0), + (3920012, 221, 2, 10, 0), + (3920013, 221, 2, 0, 0), + (3920014, 221, 2, 80, 0), + (3920015, 221, 2, 50, 0), + (3920016, 221, 1, 20, 0), + (3920017, 221, 1, 20, 0), + (3920018, 221, 2, 30, 0), + (3920019, 221, 2, 90, 0), + (3920020, 221, 3, 0, 0), + (3920021, 221, 3, 1, 0), + (4020001, 58, 1, 0, 0), + (4020002, 58, 1, 10, 0), + (4020003, 58, 1, 20, 0), + (4020004, 58, 1, 30, 0), + (4020005, 58, 1, 0, 0), + (4020006, 58, 1, 30, 0), + (4020007, 58, 1, 60, 0), + (4020008, 58, 1, 20, 0), + (4020009, 58, 1, 60, 0), + (4020010, 60, 1, 0, 0), + (4020011, 58, 1, 20, 0), + (4020012, 58, 1, 50, 0), + (4020101, 56, 2, 0, 0), + (4020102, 56, 2, 20, 0), + (4020103, 56, 2, 40, 0), + (4020104, 56, 2, 20, 0), + (4020105, 56, 2, 30, 0), + (4020106, 56, 2, 40, 0), + (4020107, 56, 2, 0, 0), + (4020108, 56, 2, 20, 0), + (4020109, 56, 2, 40, 0), + (4020110, 56, 2, 20, 0), + (4020111, 56, 2, 30, 0), + (4020112, 64, 1, 0, 0), + (4020113, 56, 2, 30, 0), + (4020201, 56, 3, 0, 0), + (4020202, 56, 3, 30, 0), + (4020203, 56, 3, 1, 0), + (4020204, 56, 3, 20, 0), + (4020205, 56, 3, 1, 0), + (4020206, 56, 3, 0, 0), + (4020207, 56, 3, 30, 0), + (4020208, 56, 3, 1, 0), + (4020209, 56, 3, 10, 0), + (4020210, 56, 3, 20, 0), + (4020211, 56, 3, 10, 0), + (4020301, 56, 4, 0, 0), + (4020302, 56, 4, 1, 0), + (4020303, 56, 4, 30, 0), + (4020304, 56, 4, 10, 0), + (4020305, 56, 4, 20, 0), + (4020306, 56, 4, 0, 0), + (4020307, 56, 4, 40, 0), + (4020309, 56, 4, 50, 0), + (4020310, 56, 4, 0, 0), + (4020311, 56, 4, 0, 0), + (4020401, 62, 1, 10, 0), + (4020402, 62, 1, 0, 0), + (4020403, 68, 1, 0, 0), + (4020404, 56, 5, 0, 0), + (4020405, 56, 6, 0, 0), + (4020406, 56, 7, 0, 0), + (4020407, 66, 1, 0, 0), + (4020408, 56, 1, 0, 0), + (4020409, 56, 1, 60, 0), + (4020410, 56, 1, 30, 0), + (4020411, 56, 8, 0, 0), + (4030001, 76, 1, 100, 0), + (4030002, 76, 1, 10, 0), + (4030003, 76, 1, 20, 0), + (4030004, 76, 1, 10, 0), + (4030005, 76, 1, 40, 0), + (4030006, 76, 1, 40, 0), + (4030007, 76, 1, 60, 0), + (4030008, 76, 1, 20, 0), + (4030010, 76, 1, 90, 0), + (4030011, 76, 1, 100, 0), + (4030012, 76, 1, 101, 0), + (4030013, 76, 1, 110, 0), + (4030014, 76, 1, 101, 0), + (4030015, 76, 1, 20, 0), + (4030016, 76, 1, 60, 0), + (4030101, 76, 2, 0, 0), + (4030102, 76, 2, 10, 0), + (4030103, 76, 2, 2, 0), + (4030104, 76, 2, 30, 0), + (4030105, 76, 2, 30, 0), + (4030106, 76, 2, 30, 0), + (4030107, 76, 2, 30, 0), + (4030108, 76, 2, 30, 0), + (4030109, 76, 2, 30, 0), + (4030110, 76, 2, 0, 0), + (4030111, 76, 2, 60, 0), + (4030112, 76, 2, 2, 0), + (4030113, 76, 2, 2, 0), + (4030114, 76, 2, 10, 0), + (4030115, 76, 2, 21, 0), + (4030116, 76, 2, 40, 0), + (4030117, 76, 2, 20, 0), + (4030118, 76, 2, 30, 0), + (4030201, 76, 3, 0, 0), + (4030202, 76, 3, 10, 0), + (4030203, 76, 3, 0, 0), + (4030204, 76, 3, 11, 0), + (4030205, 76, 3, 0, 0), + (4030301, 76, 4, 0, 0), + (4030302, 76, 4, 10, 0), + (4030303, 76, 4, 10, 0), + (4030304, 76, 4, 1, 0), + (4030305, 76, 4, 0, 0), + (4030401, 77, 1, 10, 0), + (4030402, 77, 1, 0, 0), + (4030403, 77, 1, 10, 0), + (4030404, 77, 1, 11, 0), + (4030405, 77, 1, 12, 0), + (4030406, 77, 1, 20, 0), + (4030407, 79, 1, 0, 0), + (4030408, 77, 1, 60, 0), + (4030501, 76, 6, 0, 0), + (4030502, 76, 6, 10, 0), + (4030503, 76, 6, 0, 0), + (4030504, 76, 6, 20, 0), + (4030505, 76, 6, 30, 0), + (4030506, 76, 6, 30, 0), + (4030507, 78, 1, 0, 0), + (4030601, 76, 10, 10, 0), + (4030602, 76, 10, 0, 0), + (4030603, 80, 1, 0, 0), + (4030604, 76, 14, 0, 0), + (4030605, 76, 15, 0, 0), + (4030606, 76, 16, 0, 0), + (4030607, 76, 13, 0, 0), + (4030608, 76, 17, 0, 0), + (4030701, 76, 5, 0, 0), + (4030702, 76, 5, 80, 0), + (4030703, 76, 5, 40, 0), + (4030704, 76, 5, 10, 0), + (4030705, 76, 5, 50, 0), + (4030706, 76, 5, 0, 0), + (4030707, 76, 5, 80, 0), + (4030708, 76, 5, 40, 0), + (4030709, 76, 5, 50, 0), + (4030710, 76, 5, 10, 0), + (4030711, 76, 5, 20, 0), + (4040001, 141, 1, 70, 0), + (4040002, 141, 1, 0, 0), + (4040003, 141, 1, 1, 0), + (4040004, 141, 1, 0, 0), + (4040005, 141, 1, 10, 0), + (4040006, 141, 1, 20, 0), + (4040007, 141, 1, 10, 0), + (4040008, 141, 1, 40, 0), + (4040009, 141, 1, 1, 0), + (4040010, 141, 1, 20, 0), + (4040011, 141, 1, 20, 0), + (4040012, 141, 1, 40, 0), + (4040013, 141, 6, 0, 0), + (4040014, 141, 1, 40, 0), + (4040101, 141, 2, 0, 0), + (4040102, 141, 2, 1, 0), + (4040103, 141, 2, 0, 0), + (4040104, 141, 2, 10, 0), + (4040105, 141, 2, 11, 0), + (4040106, 141, 2, 1, 0), + (4040107, 141, 2, 12, 0), + (4040108, 141, 2, 22, 0), + (4040109, 141, 8, 0, 0), + (4040110, 141, 2, 1, 0), + (4040111, 141, 2, 2, 0), + (4040201, 141, 3, 0, 0), + (4040202, 141, 3, 10, 0), + (4040203, 141, 3, 11, 0), + (4040204, 141, 3, 20, 0), + (4040205, 141, 3, 1, 0), + (4040206, 141, 3, 11, 0), + (4040207, 141, 3, 6, 0), + (4040208, 141, 3, 10, 0), + (4040301, 141, 4, 3, 0), + (4040302, 141, 4, 10, 0), + (4040303, 141, 4, 0, 0), + (4040304, 141, 4, 20, 0), + (4040305, 141, 4, 1, 0), + (4040306, 141, 4, 1, 0), + (4040401, 141, 5, 0, 0), + (4040402, 141, 5, 90, 0), + (4040403, 141, 5, 80, 0), + (4040404, 141, 5, 110, 0), + (4040405, 141, 5, 0, 0), + (4040406, 141, 5, 20, 0), + (4040407, 141, 5, 0, 0), + (4040408, 141, 5, 60, 0), + (4040501, 141, 7, 10, 0), + (4040502, 141, 7, 0, 0), + (4040503, 143, 1, 0, 0), + (4040504, 141, 10, 0, 0), + (4040505, 141, 11, 0, 0), + (4040506, 141, 12, 0, 0), + (4040507, 141, 9, 0, 0), + (4040508, 142, 1, 50, 0), + (4040509, 142, 1, 30, 0), + (4040510, 142, 1, 10, 0), + (4040511, 141, 13, 0, 0), + (4070001, 201, 1, 60, 0), + (4070002, 201, 1, 0, 0), + (4070003, 201, 1, 1, 0), + (4070004, 201, 1, 10, 0), + (4070005, 201, 1, 20, 0), + (4070006, 201, 1, 0, 0), + (4070007, 201, 1, 40, 0), + (4070008, 201, 1, 50, 0), + (4070009, 201, 1, 10, 0), + (4070010, 201, 1, 1, 0), + (4070011, 201, 1, 20, 0), + (4070012, 201, 1, 20, 0), + (4070013, 201, 1, 40, 0), + (4070101, 201, 2, 0, 0), + (4070102, 201, 2, 1, 0), + (4070103, 201, 2, 10, 0), + (4070104, 201, 2, 2, 0), + (4070105, 201, 2, 10, 0), + (4070106, 201, 2, 11, 0), + (4070107, 201, 2, 12, 0), + (4070108, 201, 2, 12, 0), + (4070201, 201, 3, 0, 0), + (4070202, 201, 3, 1, 0), + (4070203, 201, 3, 2, 0), + (4070204, 201, 3, 0, 0), + (4070205, 201, 3, 20, 0), + (4070206, 201, 3, 20, 0), + (4070207, 201, 3, 30, 0), + (4070208, 201, 3, 1, 0), + (4070209, 201, 3, 50, 0), + (4070210, 201, 3, 30, 0), + (4070211, 201, 3, 50, 0), + (4070212, 201, 3, 10, 0), + (4070213, 201, 3, 2, 0), + (4070214, 201, 6, 0, 0), + (4070215, 201, 3, 30, 0), + (4070301, 201, 4, 1, 0), + (4070302, 201, 4, 30, 0), + (4070303, 201, 4, 0, 0), + (4070304, 201, 4, 10, 0), + (4070305, 201, 4, 30, 0), + (4070306, 201, 4, 1, 0), + (4070307, 201, 4, 0, 0), + (4070308, 201, 4, 10, 0), + (4070309, 201, 5, 0, 0), + (4070310, 201, 4, 1, 0), + (4070311, 201, 4, 20, 0), + (4070312, 201, 4, 40, 0), + (4070401, 203, 1, 10, 0), + (4070402, 203, 1, 0, 0), + (4070403, 205, 1, 0, 0), + (4070404, 201, 7, 0, 0), + (4070405, 201, 8, 0, 0), + (4070406, 201, 9, 0, 0), + (4070407, 202, 1, 0, 0), + (4070408, 201, 2, 20, 0), + (4070409, 201, 2, 13, 0), + (4070410, 201, 2, 3, 0), + (4070411, 201, 10, 0, 0), + (4080001, 161, 1, 0, 0), + (4080002, 161, 1, 1, 0), + (4080003, 161, 1, 10, 0), + (4080004, 161, 1, 20, 0), + (4080005, 161, 1, 0, 0), + (4080006, 161, 1, 40, 0), + (4080007, 167, 1, 0, 0), + (4080008, 161, 1, 1, 0), + (4080009, 161, 1, 20, 0), + (4080010, 161, 1, 30, 0), + (4080011, 161, 1, 50, 0), + (4080101, 161, 2, 0, 0), + (4080102, 161, 2, 1, 0), + (4080103, 161, 2, 30, 0), + (4080104, 161, 2, 0, 0), + (4080105, 161, 2, 2, 0), + (4080106, 161, 2, 10, 0), + (4080107, 161, 2, 31, 0), + (4080109, 161, 2, 20, 0), + (4080110, 161, 2, 2, 0), + (4080201, 161, 3, 50, 0), + (4080202, 161, 3, 0, 0), + (4080203, 161, 3, 10, 0), + (4080204, 161, 3, 1, 0), + (4080205, 161, 3, 0, 0), + (4080206, 161, 3, 1, 0), + (4080207, 161, 3, 20, 0), + (4080208, 161, 3, 21, 0), + (4080209, 161, 3, 2, 0), + (4080210, 161, 3, 3, 0), + (4080211, 161, 3, 10, 0), + (4080212, 163, 2, 0, 0), + (4080213, 161, 3, 20, 0), + (4080301, 161, 5, 0, 0), + (4080302, 161, 5, 10, 0), + (4080303, 161, 5, 2, 0), + (4080304, 161, 5, 1, 0), + (4080305, 161, 5, 2, 0), + (4080306, 161, 5, 10, 0), + (4080401, 161, 6, 0, 0), + (4080402, 161, 6, 20, 0), + (4080403, 161, 6, 30, 0), + (4080404, 161, 6, 0, 0), + (4080405, 161, 6, 5, 0), + (4080406, 161, 6, 0, 0), + (4080407, 161, 6, 3, 0), + (4080408, 161, 6, 20, 0), + (4080409, 161, 6, 10, 0), + (4080501, 165, 1, 10, 0), + (4080502, 165, 1, 0, 0), + (4080503, 161, 168, 1, 0), + (4080504, 161, 7, 0, 0), + (4080505, 161, 8, 0, 0), + (4080506, 161, 9, 0, 0), + (4080507, 161, 166, 0, 0), + (4080508, 163, 1, 20, 0), + (4080509, 163, 1, 30, 0), + (4080510, 163, 1, 11, 0), + (4080511, 161, 10, 0, 0), + (4100001, 31, 4, 0, 0), + (4100002, 31, 4, 60, 0), + (4100003, 31, 4, 50, 0), + (4100004, 31, 4, 21, 0), + (4100005, 31, 4, 30, 0), + (4100006, 31, 4, 60, 0), + (4100007, 31, 4, 0, 0), + (4100008, 31, 4, 50, 0), + (4100101, 31, 2, 0, 0), + (4100102, 31, 2, 10, 0), + (4100103, 31, 2, 11, 0), + (4100104, 31, 2, 20, 0), + (4100105, 31, 2, 30, 0), + (4100106, 31, 2, 0, 0), + (4100108, 31, 2, 60, 0), + (4100109, 31, 2, 20, 0), + (4100110, 31, 2, 30, 0), + (4100111, 31, 2, 40, 0), + (4100112, 31, 2, 10, 0), + (4100201, 31, 3, 40, 0), + (4100202, 31, 3, 0, 0), + (4100203, 31, 3, 20, 0), + (4100204, 31, 3, 10, 0), + (4100205, 31, 3, 0, 0), + (4100206, 31, 3, 11, 0), + (4100301, 31, 4, 0, 0), + (4100302, 31, 4, 1, 0), + (4100303, 31, 4, 2, 0), + (4100304, 31, 4, 40, 0), + (4100305, 31, 4, 1, 0), + (4100306, 31, 4, 10, 0), + (4100307, 31, 4, 1, 0), + (4100308, 31, 4, 2, 0), + (4100401, 31, 6, 0, 0), + (4100402, 31, 6, 1, 0), + (4100403, 31, 6, 0, 0), + (4100404, 31, 6, 40, 0), + (4100405, 31, 6, 60, 0), + (4100501, 31, 5, 0, 0), + (4100502, 31, 5, 1, 0), + (4100503, 31, 5, 2, 0), + (4100504, 31, 5, 0, 0), + (4100505, 31, 5, 1, 0), + (4100506, 31, 5, 2, 0), + (4100507, 31, 5, 3, 0), + (4100508, 31, 5, 7, 0), + (4100510, 31, 5, 10, 0), + (4100511, 31, 5, 0, 0), + (4100601, 31, 7, 10, 0), + (4100602, 31, 7, 30, 0), + (4100603, 31, 7, 20, 0), + (4100604, 31, 7, 10, 0), + (4100605, 31, 7, 30, 0), + (4100606, 31, 7, 0, 0), + (4100607, 31, 7, 10, 0), + (4100608, 31, 7, 51, 0), + (4100609, 31, 7, 70, 0), + (4100701, 31, 8, 0, 0), + (4100702, 31, 8, 10, 0), + (4100703, 31, 8, 20, 0), + (4100704, 31, 8, 30, 0), + (4100705, 31, 8, 40, 0), + (4100706, 31, 8, 90, 0), + (4100707, 31, 8, 0, 0), + (4100708, 31, 8, 30, 0), + (4100709, 31, 8, 0, 0), + (4100710, 31, 8, 20, 0), + (4100711, 31, 8, 40, 0), + (4100712, 31, 8, 50, 0), + (4100713, 31, 8, 60, 0), + (4100801, 31, 12, 0, 0), + (4100802, 31, 13, 0, 0), + (4100803, 31, 14, 0, 0), + (4100804, 31, 4, 40, 0), + (4100805, 31, 8, 70, 0), + (4100806, 31, 4, 30, 0), + (4100807, 31, 8, 80, 0), + (4100808, 31, 4, 21, 0), + (4100809, 31, 6, 30, 0), + (4100810, 31, 11, 0, 0), + (5020001, 281, 1, 100, 0), + (5020002, 281, 1, 10, 0), + (5020003, 281, 1, 11, 0), + (5020004, 281, 1, 12, 0), + (5020005, 281, 1, 20, 0), + (5020006, 281, 1, 30, 0), + (5020007, 281, 1, 10, 0), + (5020008, 281, 1, 11, 0), + (5020009, 281, 1, 60, 0), + (5020010, 281, 1, 12, 0), + (5020011, 281, 1, 20, 0), + (5020012, 281, 1, 30, 0), + (5020013, 281, 1, 110, 0), + (5020014, 281, 1, 20, 0), + (5020101, 296, 1, 0, 0), + (5020102, 296, 1, 10, 0), + (5020103, 296, 1, 20, 0), + (5020104, 296, 1, 100, 0), + (5020105, 296, 1, 40, 0), + (5020106, 296, 1, 0, 0), + (5020107, 296, 1, 60, 0), + (5020108, 296, 1, 10, 0), + (5020109, 296, 1, 40, 0), + (5020110, 296, 1, 50, 0), + (5020111, 298, 1, 0, 0), + (5020112, 296, 1, 60, 0), + (5020113, 296, 1, 90, 0), + (5020114, 296, 1, 20, 0), + (5020201, 281, 2, 10, 0), + (5020202, 281, 2, 20, 0), + (5020203, 281, 2, 30, 0), + (5020204, 281, 2, 40, 0), + (5020205, 281, 2, 50, 0), + (5020206, 281, 2, 60, 0), + (5020207, 281, 2, 70, 0), + (5020208, 281, 2, 80, 0), + (5020209, 281, 2, 60, 0), + (5020210, 281, 2, 20, 0), + (5020211, 281, 2, 30, 0), + (5020212, 281, 2, 40, 0), + (5020213, 281, 2, 50, 0), + (5020214, 281, 2, 60, 0), + (5020215, 281, 2, 70, 0), + (5020216, 281, 4, 0, 0), + (5020217, 281, 2, 40, 0), + (5020301, 281, 3, 100, 0), + (5020302, 281, 3, 0, 0), + (5020303, 281, 3, 0, 0), + (5020304, 281, 3, 90, 0), + (5020305, 281, 3, 50, 0), + (5020306, 281, 3, 100, 0), + (5020307, 281, 3, 60, 0), + (5020401, 296, 2, 10, 0), + (5020402, 296, 2, 0, 0), + (5020403, 299, 1, 0, 0), + (5020404, 281, 5, 0, 0), + (5020405, 281, 6, 0, 0), + (5020406, 281, 7, 0, 0), + (5020407, 296, 3, 0, 0), + (5020408, 281, 3, 110, 0), + (5020409, 281, 3, 70, 0), + (5020410, 281, 3, 120, 0), + (5020411, 296, 5, 0, 0), + (5030001, 316, 1, 0, 0), + (5030002, 316, 1, 1, 0), + (5030003, 316, 1, 0, 0), + (5030004, 316, 1, 3, 0), + (5030005, 316, 1, 4, 0), + (5030006, 316, 1, 3, 0), + (5030007, 316, 1, 2, 0), + (5030008, 316, 1, 7, 0), + (5030009, 316, 1, 8, 0), + (5030010, 316, 1, 9, 0), + (5030011, 316, 1, 10, 0), + (5030012, 316, 1, 11, 0), + (5030013, 316, 1, 12, 0), + (5030014, 316, 1, 2, 0), + (5030015, 316, 1, 5, 0), + (5030016, 316, 1, 7, 0), + (5030017, 316, 1, 8, 0), + (5030018, 316, 1, 9, 0), + (5030019, 316, 1, 10, 0), + (5030020, 316, 1, 11, 0), + (5030021, 316, 1, 12, 0), + (5030022, 316, 1, 7, 0), + (5030023, 316, 1, 8, 0), + (5030024, 316, 1, 9, 0), + (5030025, 316, 1, 10, 0), + (5030026, 316, 1, 11, 0), + (5030027, 316, 1, 12, 0), + (5030028, 316, 1, 8, 0), + (5030029, 316, 1, 4, 0), + (5030030, 316, 1, 10, 0), + (5030031, 316, 1, 11, 0), + (5030032, 316, 1, 12, 0), + (5030033, 316, 1, 7, 0), + (5030034, 316, 1, 8, 0), + (5030035, 316, 1, 9, 0), + (5030036, 316, 4, 0, 0), + (5030037, 316, 1, 5, 0), + (5030101, 331, 1, 20, 0), + (5030102, 331, 1, 0, 0), + (5030103, 331, 1, 1, 0), + (5030104, 331, 1, 2, 0), + (5030105, 331, 1, 3, 0), + (5030106, 331, 1, 4, 0), + (5030107, 331, 1, 1, 0), + (5030108, 331, 1, 6, 0), + (5030109, 331, 1, 4, 0), + (5030110, 331, 8, 0, 0), + (5030111, 331, 1, 34, 0), + (5030112, 331, 1, 34, 0), + (5030113, 331, 1, 2, 0), + (5030201, 331, 2, 0, 0), + (5030202, 331, 2, 1, 0), + (5030203, 331, 2, 2, 0), + (5030204, 331, 2, 10, 0), + (5030205, 331, 2, 3, 0), + (5030206, 331, 2, 1, 0), + (5030207, 331, 2, 2, 0), + (5030208, 331, 2, 10, 0), + (5030209, 331, 2, 3, 0), + (5030210, 331, 2, 4, 0), + (5030301, 331, 3, 0, 0), + (5030302, 331, 3, 3, 0), + (5030303, 331, 3, 11, 0), + (5030304, 331, 3, 10, 0), + (5030305, 331, 3, 3, 0), + (5030306, 331, 3, 1, 0), + (5030307, 331, 3, 11, 0), + (5030308, 331, 3, 60, 0), + (5030309, 331, 3, 12, 0), + (5030401, 331, 6, 10, 0), + (5030402, 331, 6, 0, 0), + (5030403, 333, 1, 0, 0), + (5030404, 316, 5, 0, 0), + (5030405, 316, 6, 0, 0), + (5030406, 316, 7, 0, 0), + (5030407, 316, 3, 0, 0), + (5030408, 331, 3, 3, 0), + (5030409, 331, 3, 40, 0), + (5030410, 331, 3, 50, 0), + (5030411, 331, 9, 0, 0), + (6010001, 673, 1, 0, 0), + (6010002, 673, 1, 10, 0), + (6010003, 673, 1, 20, 0), + (6010004, 673, 1, 30, 0), + (6010005, 673, 1, 11, 0), + (6010006, 673, 1, 21, 0), + (6010007, 673, 1, 11, 0), + (6010008, 673, 1, 40, 0), + (6010009, 673, 1, 10, 0), + (6010010, 673, 1, 11, 0), + (6010011, 673, 1, 30, 0), + (6010012, 673, 1, 21, 0), + (6010013, 673, 1, 40, 0), + (6010014, 673, 1, 60, 0), + (6010015, 673, 1, 50, 0), + (6010016, 674, 1, 0, 0), + (6011001, 684, 1, 0, 0), + (6011002, 684, 1, 1, 0), + (6011003, 684, 1, 2, 0), + (6011004, 684, 1, 0, 0), + (6011005, 684, 1, 1, 0), + (6011006, 684, 1, 2, 0), + (6011007, 684, 1, 10, 0), + (6011008, 684, 1, 3, 0), + (6020001, 688, 1, 60, 0), + (6020002, 688, 1, 0, 0), + (6020003, 688, 1, 1, 0), + (6020004, 688, 1, 0, 0), + (6020005, 688, 1, 10, 0), + (6020006, 688, 1, 10, 0), + (6020007, 688, 1, 11, 0), + (6020008, 688, 1, 1, 0), + (6020009, 688, 1, 11, 0), + (6020010, 688, 1, 20, 0), + (6020011, 688, 1, 21, 0), + (6020012, 688, 1, 2, 0), + (6020014, 688, 1, 30, 0), + (6020015, 690, 1, 0, 0), + (6020017, 688, 1, 10, 0), + (6020018, 688, 1, 21, 0), + (6021001, 698, 1, 0, 0), + (6021002, 698, 1, 1, 0), + (6021003, 698, 1, 0, 0), + (6021004, 698, 1, 1, 0), + (6021005, 698, 1, 2, 0), + (6021006, 698, 1, 1, 0), + (6021007, 698, 1, 10, 0), + (6021008, 698, 1, 3, 0), + (6030001, 703, 1, 10, 0), + (6030002, 703, 1, 0, 0), + (6030003, 703, 1, 1, 0), + (6030004, 703, 2, 0, 0), + (6030005, 703, 2, 1, 0), + (6030006, 703, 2, 10, 0), + (6030007, 703, 2, 0, 0), + (6030008, 703, 3, 0, 0), + (6030009, 703, 1, 0, 0), + (6030010, 703, 2, 0, 0), + (6030011, 703, 1, 1, 0), + (6030012, 703, 2, 1, 0), + (6030013, 703, 2, 10, 0), + (6030014, 703, 1, 2, 0), + (6030015, 703, 2, 2, 0), + (6030016, 704, 3, 0, 0), + (6031001, 713, 1, 0, 0), + (6031002, 713, 1, 1, 0), + (6031003, 713, 1, 2, 0), + (6031004, 713, 1, 0, 0), + (6031005, 713, 1, 1, 0), + (6031006, 713, 1, 2, 0), + (6031007, 713, 1, 20, 0), + (6031008, 713, 1, 3, 0), + (6040001, 718, 1, 0, 0), + (6040002, 718, 1, 10, 0), + (6040003, 718, 1, 11, 0), + (6040004, 718, 1, 20, 0), + (6040005, 718, 1, 30, 0), + (6040006, 718, 1, 20, 0), + (6040007, 718, 1, 11, 0), + (6040008, 718, 1, 12, 0), + (6040009, 718, 1, 10, 0), + (6040010, 718, 1, 20, 0), + (6040011, 718, 1, 11, 0), + (6040012, 718, 1, 30, 0), + (6040013, 718, 1, 12, 0), + (6040014, 718, 1, 40, 0), + (6040015, 718, 2, 10, 0), + (6040016, 720, 2, 0, 0), + (6041001, 728, 1, 0, 0), + (6041002, 728, 1, 0, 0), + (6041003, 728, 1, 0, 0), + (7010001, 823, 1, 20, 0), + (7010002, 823, 1, 1, 0), + (7010003, 823, 1, 2, 0), + (7010004, 823, 1, 20, 0), + (7010005, 823, 1, 20, 0), + (7010006, 823, 2, 0, 0), + (7010007, 823, 2, 0, 0), + (7010008, 823, 1, 1, 0), + (7010009, 823, 3, 0, 0), + (7010010, 823, 3, 0, 0), + (7010011, 823, 3, 1, 0), + (7010012, 823, 2, 20, 0), + (7010013, 823, 3, 1, 0), + (7010015, 823, 2, 0, 0), + (7010016, 823, 2, 1, 0), + (7010017, 823, 3, 10, 0), + (8010001, 0, 3, 0, 0), + (8010002, 0, 3, 1, 0), + (8010003, 0, 3, 4, 0), + (8010004, 0, 3, 4, 1), + (8010005, 0, 3, 1, 1), + (8010006, 0, 3, 4, 2), + (8010007, 0, 3, 5, 1), + (8010008, 0, 3, 7, 0), + (8010009, 0, 3, 2, 0), + (8010010, 0, 3, 5, 0), + (8010012, 0, 3, 3, 0), + (8010013, 0, 3, 6, 0), + (8010014, 0, 3, 6, 1), + (8010016, 0, 3, 9, 0), + (8010017, 0, 3, 0, 0), + (8010101, 0, 7, 0, 0), + (8010102, 0, 7, 0, 1), + (8010103, 0, 7, 0, 2), + (8010104, 0, 7, 0, 3), + (8010105, 0, 7, 1, 0), + (8010106, 0, 7, 1, 1), + (8010107, 0, 7, 1, 2), + (8010108, 0, 7, 1, 3), + (8010109, 0, 7, 1, 4), + (8010110, 0, 7, 2, 0), + (8010111, 0, 7, 2, 1), + (8010112, 0, 7, 2, 2), + (8010113, 0, 7, 2, 3), + (8010114, 0, 7, 2, 4), + (8010115, 0, 7, 3, 0), + (8010116, 0, 7, 3, 2), + (8010117, 0, 7, 3, 2), + (8010118, 0, 7, 3, 4), + (8010119, 0, 7, 3, 4), + (8010120, 0, 7, 4, 0), + (8010121, 0, 7, 4, 1), + (8010122, 0, 7, 4, 1), + (8010123, 0, 7, 4, 3), + (8010124, 0, 7, 4, 3), + (8010125, 0, 7, 2, 5), + (8010126, 0, 7, 2, 6), + (8010127, 0, 7, 2, 7), + (8010128, 0, 7, 2, 6), + (8010129, 0, 7, 4, 4), + (8010130, 0, 7, 5, 0), + (8010131, 0, 7, 2, 7), + (8010132, 0, 7, 2, 5), + (8010133, 0, 7, 2, 7), + (8010134, 0, 7, 2, 5), + (8010135, 0, 7, 2, 6), + (8010136, 0, 7, 3, 0), + (8010137, 0, 7, 3, 4), + (8010138, 0, 7, 3, 0), + (8010139, 0, 7, 3, 2), + (8010140, 0, 7, 4, 2), + (8010141, 0, 7, 4, 4), + (8010142, 0, 7, 4, 0), + (8010143, 0, 7, 4, 3), + (8010144, 0, 7, 4, 2), + (8010145, 0, 7, 4, 4), + (8010146, 0, 7, 4, 0), + (8010147, 0, 7, 4, 1), + (8010148, 0, 7, 4, 2), + (8010149, 0, 7, 4, 4), + (8010201, 0, 21, 5, 0), + (8010202, 0, 21, 0, 0), + (8010203, 0, 21, 0, 1), + (8010210, 0, 21, 6, 1), + (8010211, 0, 21, 6, 0), + (8010212, 0, 21, 6, 2), + (8010217, 0, 21, 0, 4), + (8010218, 0, 21, 0, 5), + (8010219, 0, 21, 1, 3), + (8010220, 0, 21, 1, 4), + (8010221, 0, 21, 2, 3), + (8010222, 0, 21, 2, 4), + (8010223, 0, 21, 2, 5), + (8010224, 0, 21, 2, 6), + (8010225, 0, 21, 2, 10), + (8010301, 0, 22, 4, 4), + (8010304, 0, 22, 0, 0), + (8010313, 0, 22, 3, 9), + (8010401, 0, 11, 0, 0), + (8010402, 0, 11, 0, 1), + (8010403, 0, 11, 0, 2), + (8010404, 0, 11, 0, 3), + (8010405, 0, 11, 0, 4), + (8010406, 0, 11, 0, 5), + (8010407, 0, 11, 0, 6), + (8010408, 0, 11, 0, 7), + (8010409, 0, 11, 0, 8), + (8010410, 0, 11, 0, 9), + (8010411, 0, 11, 0, 10), + (8010412, 0, 11, 0, 11), + (8010413, 0, 11, 0, 12), + (8010414, 0, 11, 0, 13), + (8010415, 0, 11, 0, 14), + (8010416, 0, 11, 0, 15), + (8010417, 0, 11, 0, 16), + (8010418, 0, 11, 0, 17), + (8010419, 0, 11, 0, 6), + (8010420, 0, 11, 0, 7), + (8010421, 0, 11, 0, 8), + (8010422, 0, 11, 0, 9), + (8010423, 0, 11, 0, 10), + (8010424, 0, 11, 0, 11), + (8010425, 0, 11, 0, 24), + (8010426, 0, 11, 0, 25), + (8010427, 0, 11, 0, 26), + (8010428, 0, 11, 0, 27), + (8010429, 0, 11, 0, 28), + (8010430, 0, 11, 0, 29), + (8010431, 0, 11, 1, 0), + (8010432, 0, 11, 1, 1), + (8010433, 0, 11, 1, 2), + (8010434, 0, 11, 1, 3), + (8010435, 0, 11, 1, 4), + (8010436, 0, 11, 1, 5), + (8010437, 0, 11, 0, 12), + (8010438, 0, 11, 0, 13), + (8010439, 0, 11, 0, 14), + (8010440, 0, 11, 0, 15), + (8010441, 0, 11, 0, 16), + (8010442, 0, 11, 0, 17), + (8010443, 0, 11, 1, 6), + (8010444, 0, 11, 1, 7), + (8010445, 0, 11, 1, 8), + (8010446, 0, 11, 1, 9), + (8010447, 0, 11, 1, 10), + (8010448, 0, 11, 1, 11), + (8010449, 0, 11, 1, 0), + (8010450, 0, 11, 1, 1), + (8010451, 0, 11, 1, 2), + (8010452, 0, 11, 1, 3), + (8010453, 0, 11, 1, 4), + (8010454, 0, 11, 1, 5), + (8010473, 0, 11, 5, 0), + (8010474, 0, 11, 5, 1), + (8010475, 0, 11, 5, 4), + (8010476, 0, 11, 5, 4), + (8010477, 0, 11, 5, 4), + (8010501, 0, 4, 0, 0), + (8010502, 0, 4, 0, 1), + (8010503, 0, 4, 0, 2), + (8010504, 0, 4, 0, 3), + (8010505, 0, 4, 1, 0), + (8010506, 0, 4, 1, 1), + (8010507, 0, 4, 1, 2), + (8010508, 0, 4, 1, 3), + (8010509, 0, 4, 1, 4), + (8010510, 0, 4, 2, 0), + (8010511, 0, 4, 2, 1), + (8010512, 0, 4, 2, 2), + (8010513, 0, 4, 2, 3), + (8010514, 0, 4, 2, 4), + (8010515, 0, 4, 3, 0), + (8010516, 0, 4, 3, 1), + (8010517, 0, 4, 3, 2), + (8010518, 0, 4, 3, 3), + (8010519, 0, 4, 3, 4), + (8010520, 0, 4, 0, 0), + (8010521, 0, 4, 1, 1), + (8010522, 0, 4, 2, 2), + (8010523, 0, 4, 1, 0), + (8010524, 0, 4, 1, 2), + (8010525, 0, 4, 1, 3), + (8010526, 0, 4, 4, 0), + (8010527, 0, 4, 4, 2), + (8010528, 0, 4, 4, 4), + (8010529, 0, 4, 6, 0), + (8010530, 0, 4, 6, 1), + (8010531, 0, 4, 6, 4), + (8010532, 0, 4, 0, 1), + (8010533, 0, 4, 0, 2), + (8010534, 0, 4, 0, 0), + (8010535, 0, 4, 0, 2), + (8010536, 0, 4, 0, 0), + (8010537, 0, 4, 0, 1), + (8010538, 0, 4, 1, 2), + (8010539, 0, 4, 1, 3), + (8010540, 0, 4, 1, 0), + (8010541, 0, 4, 1, 3), + (8010542, 0, 4, 1, 0), + (8010543, 0, 4, 1, 2), + (8010544, 0, 4, 4, 2), + (8010545, 0, 4, 11, 0), + (8010546, 0, 4, 4, 4), + (8010547, 0, 4, 5, 0), + (8010548, 0, 4, 7, 0), + (8010549, 0, 4, 4, 4), + (8010550, 0, 4, 4, 0), + (8010551, 0, 4, 4, 4), + (8010552, 0, 4, 4, 0), + (8010553, 0, 4, 4, 2), + (8010554, 0, 4, 6, 1), + (8010555, 0, 4, 6, 4), + (8010556, 0, 4, 6, 2), + (8010557, 0, 4, 6, 3), + (8010558, 0, 4, 6, 0), + (8010559, 0, 4, 6, 4), + (8010560, 0, 4, 6, 2), + (8010561, 0, 4, 6, 3), + (8010562, 0, 4, 6, 0), + (8010563, 0, 4, 6, 1), + (8010564, 0, 4, 6, 2), + (8010565, 0, 4, 6, 3), + (8010566, 0, 4, 1, 3), + (8010567, 0, 4, 2, 3), + (8010601, 0, 5, 0, 0), + (8010602, 0, 5, 0, 1), + (8010603, 0, 5, 0, 2), + (8010604, 0, 5, 0, 3), + (8010605, 0, 5, 1, 0), + (8010606, 0, 5, 1, 1), + (8010607, 0, 5, 2, 0), + (8010608, 0, 5, 2, 1), + (8010609, 0, 5, 2, 2), + (8010610, 0, 5, 3, 0), + (8010611, 0, 5, 3, 1), + (8010612, 0, 5, 4, 0), + (8010613, 0, 5, 4, 1), + (8010614, 0, 5, 4, 2), + (8010615, 0, 5, 5, 0), + (8010616, 0, 5, 5, 1), + (8010617, 0, 5, 5, 2), + (8010618, 0, 5, 5, 3), + (8010619, 0, 5, 5, 4), + (8010620, 0, 5, 8, 0), + (8010621, 0, 5, 8, 4), + (8010622, 0, 5, 8, 2), + (8010623, 0, 5, 8, 1), + (8010624, 0, 5, 9, 0), + (8010625, 0, 5, 9, 2), + (8010626, 0, 5, 9, 3), + (8010627, 0, 5, 9, 4), + (8010628, 0, 5, 8, 4), + (8010629, 0, 5, 8, 2), + (8010630, 0, 5, 8, 1), + (8010631, 0, 5, 8, 0), + (8010632, 0, 5, 8, 2), + (8010633, 0, 5, 8, 1), + (8010634, 0, 5, 8, 0), + (8010635, 0, 5, 8, 4), + (8010636, 0, 5, 8, 1), + (8010637, 0, 5, 8, 0), + (8010638, 0, 5, 8, 4), + (8010639, 0, 5, 8, 2), + (8010640, 0, 5, 9, 2), + (8010641, 0, 5, 9, 3), + (8010642, 0, 5, 9, 4), + (8010643, 0, 5, 9, 1), + (8010644, 0, 5, 9, 0), + (8010645, 0, 5, 9, 3), + (8010646, 0, 5, 16, 0), + (8010647, 0, 5, 9, 4), + (8010648, 0, 5, 9, 1), + (8010649, 0, 5, 9, 0), + (8010650, 0, 5, 9, 2), + (8010651, 0, 5, 9, 4), + (8010652, 0, 5, 9, 1), + (8010653, 0, 5, 9, 0), + (8010654, 0, 5, 9, 2), + (8010655, 0, 5, 9, 3), + (8010656, 0, 5, 9, 1), + (8010701, 0, 19, 0, 0), + (8010702, 0, 19, 0, 1), + (8010703, 0, 19, 0, 2), + (8010707, 0, 19, 0, 6), + (8010708, 0, 19, 0, 9), + (8010711, 0, 19, 0, 10), + (8010712, 0, 19, 0, 11), + (8010713, 0, 19, 0, 12), + (8010715, 0, 19, 1, 8), + (8010716, 0, 19, 1, 0), + (8010801, 0, 20, 0, 0), + (8010802, 0, 20, 0, 3), + (8010803, 0, 20, 0, 4), + (8010804, 0, 20, 0, 5), + (8010805, 0, 20, 0, 6), + (8010806, 0, 20, 0, 7), + (8010807, 0, 20, 0, 8), + (8010808, 0, 20, 0, 7), + (8010809, 0, 20, 0, 8), + (8010810, 0, 20, 0, 9), + (8010811, 0, 20, 0, 10), + (8010812, 0, 20, 0, 15), + (8010822, 0, 20, 0, 23), + (8010823, 0, 20, 0, 24), + (8010824, 0, 20, 0, 27), + (8010829, 0, 20, 2, 0), + (8010830, 0, 20, 3, 0), + (8010831, 0, 20, 4, 0), + (8010832, 0, 20, 4, 0), + (8010833, 0, 20, 5, 0), + (8010834, 0, 20, 0, 1), + (8010835, 0, 20, 0, 2), + (8010836, 0, 20, 1, 0), + (8010838, 0, 20, 0, 29), + (8010901, 0, 18, 0, 0), + (8010902, 0, 18, 0, 1), + (8010903, 0, 18, 0, 2), + (8010904, 0, 18, 1, 0), + (8010905, 0, 18, 1, 1), + (8010906, 0, 18, 1, 2), + (8010907, 0, 18, 1, 3), + (8010908, 0, 18, 1, 4), + (8010909, 0, 18, 1, 5), + (8010910, 0, 18, 1, 6), + (8010911, 0, 18, 1, 0), + (8010912, 0, 18, 1, 1), + (8010913, 0, 18, 1, 2), + (8010914, 0, 18, 1, 7), + (8010915, 0, 18, 1, 3), + (8010916, 0, 18, 1, 4), + (8010917, 0, 18, 1, 5), + (8010918, 0, 18, 1, 1), + (8010919, 0, 18, 1, 2), + (8010920, 0, 18, 1, 6), + (8010921, 0, 18, 1, 0), + (8010922, 0, 18, 1, 2), + (8010923, 0, 18, 1, 6), + (8010924, 0, 18, 1, 0), + (8010925, 0, 18, 1, 1), + (8010926, 0, 18, 1, 4), + (8010927, 0, 18, 1, 5), + (8010928, 0, 18, 1, 7), + (8010929, 0, 18, 1, 3), + (8010930, 0, 18, 1, 5), + (8010931, 0, 18, 1, 7), + (8010932, 0, 18, 3, 1), + (8010933, 0, 18, 1, 3), + (8010934, 0, 18, 1, 4), + (8011001, 0, 23, 5, 1), + (8011002, 0, 23, 0, 0), + (8011003, 0, 23, 0, 1), + (8011004, 0, 23, 0, 3), + (8011005, 0, 23, 0, 2), + (8011006, 0, 23, 1, 0), + (8011007, 0, 23, 1, 1), + (8011008, 0, 23, 1, 2), + (8011009, 0, 23, 1, 3), + (8011010, 0, 23, 1, 4), + (8011011, 0, 23, 1, 5), + (8011012, 0, 23, 1, 6), + (8011013, 0, 23, 1, 7), + (8011014, 0, 23, 1, 8), + (8011015, 0, 23, 1, 9), + (8011016, 0, 23, 1, 10), + (8011017, 0, 23, 9, 11), + (8011018, 0, 23, 9, 14), + (8011019, 0, 23, 5, 0), + (8011020, 0, 23, 9, 12), + (8011021, 0, 23, 9, 13), + (8011022, 0, 23, 10, 6), + (8011101, 0, 8, 0, 0), + (8011102, 0, 8, 1, 0), + (8011103, 0, 8, 1, 1), + (8011104, 0, 8, 0, 1), + (8011105, 0, 8, 1, 1), + (8011106, 0, 8, 0, 0), + (8011107, 0, 8, 1, 0), + (8011108, 0, 8, 3, 1), + (8011109, 0, 8, 1, 2), + (8011110, 0, 8, 3, 2), + (8011201, 0, 9, 0, 0), + (8011202, 0, 9, 0, 1), + (8011203, 0, 9, 0, 2), + (8011204, 0, 9, 3, 0), + (8011205, 0, 9, 3, 1), + (8011206, 0, 9, 3, 2), + (8011207, 0, 9, 3, 3), + (8011208, 0, 9, 3, 4), + (8011209, 0, 9, 4, 0), + (8011210, 0, 9, 4, 1), + (8011211, 0, 9, 5, 0), + (8011212, 0, 9, 5, 1), + (8011213, 0, 9, 5, 2), + (8011214, 0, 9, 8, 0), + (8011215, 0, 9, 8, 1), + (8011216, 0, 9, 8, 2), + (8011217, 0, 9, 8, 3), + (8011218, 0, 9, 8, 4), + (8011219, 0, 9, 6, 1), + (8011220, 0, 9, 10, 0), + (8011221, 0, 9, 10, 2), + (8011222, 0, 9, 12, 0), + (8011223, 0, 9, 12, 2), + (8011301, 0, 10, 0, 0), + (8011302, 0, 10, 0, 1), + (8011303, 0, 10, 0, 2), + (8011304, 0, 10, 0, 3), + (8011305, 0, 10, 1, 0), + (8011306, 0, 10, 1, 1), + (8011307, 0, 10, 1, 2), + (8011308, 0, 10, 1, 3), + (8011309, 0, 10, 1, 4), + (8011310, 0, 10, 1, 5), + (8011311, 0, 10, 1, 6), + (8011312, 0, 10, 1, 7), + (8011313, 0, 10, 1, 8), + (8011314, 0, 10, 1, 9), + (8011315, 0, 10, 1, 18), + (8011316, 0, 10, 1, 8), + (8011317, 0, 10, 1, 9), + (8011318, 0, 10, 1, 19), + (8011319, 0, 10, 1, 17), + (8011320, 0, 10, 1, 15), + (8011321, 0, 10, 2, 0), + (8011322, 0, 10, 2, 1), + (8011323, 0, 10, 8, 0), + (8011324, 0, 10, 1, 8), + (8011325, 0, 10, 1, 9), + (8011326, 0, 10, 1, 18), + (8011327, 0, 10, 1, 9), + (8011328, 0, 10, 1, 18), + (8011329, 0, 10, 1, 8), + (8011330, 0, 10, 1, 17), + (8011331, 0, 10, 1, 15), + (8011332, 0, 10, 1, 19), + (8011333, 0, 10, 1, 15), + (8011334, 0, 10, 1, 19), + (8011335, 0, 10, 1, 17), + (8011336, 0, 10, 2, 1), + (8011337, 0, 10, 2, 2), + (8011338, 0, 10, 2, 3), + (8011339, 0, 10, 2, 0), + (8011340, 0, 10, 2, 2), + (8011341, 0, 10, 2, 3), + (8011401, 0, 12, 0, 0), + (8011402, 0, 12, 1, 0), + (8011403, 0, 12, 15, 0), + (8011404, 0, 12, 2, 1), + (8011405, 0, 12, 3, 3), + (8011406, 0, 12, 6, 0), + (8011407, 0, 12, 7, 0), + (8011408, 0, 12, 8, 0), + (8011409, 0, 12, 9, 1), + (8011501, 0, 13, 0, 0), + (8011502, 0, 13, 2, 0), + (8011503, 0, 13, 2, 1), + (8011504, 0, 13, 3, 0), + (8011505, 0, 13, 3, 1), + (8011506, 0, 13, 3, 2), + (8011507, 0, 13, 3, 3), + (8011508, 0, 13, 5, 0), + (8011509, 0, 13, 5, 1), + (8011510, 0, 13, 5, 2), + (8011511, 0, 13, 5, 3), + (8011512, 0, 13, 5, 4), + (8011513, 0, 13, 5, 5), + (8011514, 0, 13, 10, 0), + (8011515, 0, 13, 1, 0), + (8011516, 0, 13, 1, 1), + (8011517, 0, 13, 2, 0), + (8011518, 0, 13, 2, 1), + (8011519, 0, 13, 6, 1), + (8011520, 0, 13, 7, 0), + (8011521, 0, 13, 8, 1), + (8011522, 0, 13, 2, 1), + (8011523, 0, 13, 6, 1), + (8011524, 0, 13, 9, 2), + (8011601, 0, 14, 0, 0), + (8011602, 0, 14, 1, 0), + (8011603, 0, 14, 0, 1), + (8011604, 0, 14, 1, 1), + (8011605, 0, 14, 1, 1), + (8011606, 0, 14, 0, 1), + (8011607, 0, 14, 1, 2), + (8011608, 0, 14, 4, 0), + (8011609, 0, 14, 1, 0), + (8011610, 0, 14, 1, 2), + (8011701, 0, 15, 0, 0), + (8011702, 0, 15, 1, 0), + (8011703, 0, 15, 2, 0), + (8011704, 0, 15, 2, 1), + (8011705, 0, 15, 2, 2), + (8011706, 0, 15, 2, 3), + (8011707, 0, 15, 2, 4), + (8011708, 0, 15, 16, 0), + (8011709, 0, 15, 12, 0), + (8011710, 0, 15, 4, 0), + (8011711, 0, 15, 4, 3), + (8011712, 0, 15, 5, 0), + (8011713, 0, 15, 5, 3), + (8011801, 0, 25, 0, 0), + (8011802, 0, 25, 0, 1), + (8011803, 0, 25, 0, 2), + (8011804, 0, 25, 0, 3), + (8011805, 0, 25, 1, 0), + (8011806, 0, 25, 1, 1), + (8011807, 0, 25, 1, 2), + (8011808, 0, 25, 1, 3), + (8011809, 0, 25, 1, 4), + (8011810, 0, 25, 1, 5), + (8011811, 0, 25, 1, 7), + (8011812, 0, 25, 1, 9), + (8011813, 0, 25, 1, 6), + (8011814, 0, 25, 1, 8), + (8011815, 0, 25, 4, 0), + (8011816, 0, 25, 4, 1), + (8011817, 0, 25, 4, 4), + (8011901, 0, 17, 0, 0), + (8011902, 0, 17, 1, 0), + (8011903, 0, 17, 1, 2), + (8012001, 0, 6, 0, 0), + (8012002, 0, 6, 0, 3), + (8012003, 0, 6, 0, 6), + (8012004, 0, 6, 1, 6), + (8012005, 0, 6, 1, 7), + (8012006, 0, 6, 1, 8), + (8012007, 0, 6, 1, 9), + (8012008, 0, 6, 1, 10), + (8012009, 0, 6, 5, 0), + (8012010, 0, 6, 8, 0), + (8012011, 0, 6, 0, 0), + (8012012, 0, 6, 0, 9), + (8012013, 0, 6, 1, 0), + (8012014, 0, 6, 3, 0), + (8012015, 0, 6, 3, 3), + (8012016, 0, 6, 3, 1), + (8012017, 0, 6, 0, 1), + (8012018, 0, 6, 0, 2), + (8012019, 0, 6, 3, 3), + (8012020, 0, 6, 3, 1), + (8012021, 0, 6, 3, 0), + (8012022, 0, 6, 3, 1), + (8012023, 0, 6, 3, 0), + (8012024, 0, 6, 3, 3), + (8012101, 0, 27, 0, 0), + (8012102, 0, 27, 2, 0), + (8012103, 0, 27, 1, 0), + (8012201, 0, 24, 0, 9), + (8012202, 0, 24, 9, 1), + (8012301, 0, 30, 4, 0), + (8012302, 0, 30, 4, 1), + (8012303, 0, 30, 4, 2), + (8012304, 0, 30, 4, 3), + (8012305, 0, 30, 4, 4), + (8012306, 0, 30, 0, 5), + (8012307, 0, 30, 3, 0), + (8012308, 0, 30, 0, 0), + (8012309, 0, 30, 0, 3), + (8012310, 0, 30, 0, 4), + (8012311, 0, 30, 0, 2), + (8012312, 0, 30, 1, 0), + (8012313, 0, 30, 1, 4), + (8012314, 0, 30, 1, 3), + (8012315, 0, 30, 1, 1), + (8012316, 0, 30, 0, 3), + (8012317, 0, 30, 0, 4), + (8012318, 0, 30, 0, 2), + (8012319, 0, 30, 0, 0), + (8012320, 0, 30, 0, 4), + (8012321, 0, 30, 0, 2), + (8012322, 0, 30, 0, 0), + (8012323, 0, 30, 0, 3), + (8012324, 0, 30, 0, 2), + (8012325, 0, 30, 0, 0), + (8012326, 0, 30, 0, 3), + (8012327, 0, 30, 0, 4), + (8012328, 0, 30, 1, 4), + (8012329, 0, 30, 1, 3), + (8012330, 0, 30, 1, 1), + (8012331, 0, 30, 1, 2), + (8012332, 0, 30, 1, 0), + (8012333, 0, 30, 1, 3), + (8012334, 0, 30, 1, 1), + (8012335, 0, 30, 1, 2), + (8012336, 0, 30, 1, 0), + (8012337, 0, 30, 1, 4), + (8012338, 0, 30, 1, 1), + (8012339, 0, 30, 1, 2), + (8012340, 0, 30, 1, 0), + (8012341, 0, 30, 1, 4), + (8012342, 0, 30, 1, 3), + (8012343, 0, 30, 1, 2), + (8012401, 0, 35, 0, 2), + (8012402, 0, 35, 0, 1), + (8012403, 0, 35, 0, 0), + (8012404, 0, 35, 1, 0), + (8012405, 0, 35, 1, 1), + (8012406, 0, 35, 2, 0), + (8012407, 0, 35, 2, 1), + (8012408, 0, 35, 2, 3), + (8012409, 0, 35, 2, 2), + (8012410, 0, 35, 0, 2), + (8012411, 0, 35, 0, 1), + (8012412, 0, 35, 7, 0), + (8012501, 0, 53, 0, 0), + (8012502, 0, 58, 0, 0), + (8012601, 0, 54, 1, 0), + (8012602, 0, 54, 2, 0), + (8012603, 0, 54, 0, 0), + (8012604, 0, 57, 0, 0), + (8012605, 0, 57, 0, 2), + (8012606, 0, 57, 0, 1), + (8012607, 0, 57, 0, 3), + (8012701, 0, 38, 0, 0), + (8012702, 0, 38, 0, 1), + (8012703, 0, 38, 0, 2), + (8012704, 0, 38, 0, 3), + (8012705, 0, 38, 0, 4), + (8012706, 0, 38, 0, 5), + (8012707, 0, 38, 0, 6), + (8012708, 0, 38, 0, 7), + (8012709, 0, 38, 0, 8), + (8012710, 0, 38, 0, 9), + (8012711, 0, 38, 0, 10), + (8012712, 0, 38, 0, 11), + (8012713, 0, 38, 0, 12), + (8012714, 0, 38, 0, 13), + (8012715, 0, 38, 0, 14), + (8012716, 0, 38, 0, 5), + (8012717, 0, 38, 0, 7), + (8012718, 0, 38, 0, 8), + (8012719, 0, 38, 0, 10), + (8012720, 0, 38, 0, 12), + (8012721, 0, 38, 0, 13), + (8012722, 0, 38, 0, 7), + (8012723, 0, 38, 0, 8), + (8012724, 0, 38, 0, 5), + (8012725, 0, 38, 0, 8), + (8012726, 0, 38, 0, 5), + (8012727, 0, 38, 0, 7), + (8012728, 0, 38, 0, 12), + (8012729, 0, 38, 0, 13), + (8012730, 0, 38, 0, 11), + (8012731, 0, 38, 0, 14), + (8012732, 0, 38, 0, 10), + (8012733, 0, 38, 0, 13), + (8012734, 0, 38, 2, 0), + (8012735, 0, 38, 0, 14), + (8012736, 0, 38, 0, 10), + (8012737, 0, 38, 0, 12), + (8012738, 0, 38, 2, 0), + (8012739, 0, 38, 0, 14), + (8012801, 0, 55, 0, 0), + (8012802, 0, 55, 3, 0), + (8012803, 0, 55, 2, 0), + (8012804, 0, 55, 1, 1), + (8012805, 0, 55, 1, 0), + (8012901, 0, 2, 3, 0), + (8012902, 0, 2, 4, 0), + (8012903, 0, 2, 4, 1), + (8012904, 0, 2, 4, 2), + (8013001, 0, 16, 6, 4), + (8013002, 0, 16, 6, 2), + (8013003, 0, 16, 7, 4), + (8013004, 0, 16, 7, 3), + (8013005, 0, 16, 1, 6), + (8013006, 0, 16, 7, 0), + (8013007, 0, 16, 7, 1), + (8013008, 0, 16, 7, 2), + (8013101, 0, 28, 1, 0), + (8013102, 0, 28, 1, 1), + (8013201, 0, 45, 0, 0), + (8013202, 0, 45, 1, 0), + (8013203, 0, 45, 2, 0), + (8013204, 0, 45, 3, 0), + (8013205, 0, 45, 4, 0), + (8013206, 0, 45, 5, 0), + (8013301, 0, 48, 0, 0), + (8013302, 0, 48, 0, 1), + (8013303, 0, 48, 0, 2), + (8013304, 0, 48, 0, 3), + (8013401, 0, 62, 0, 0), + (8013402, 0, 61, 0, 0), + (8013403, 0, 60, 0, 0), + (8013404, 0, 63, 0, 0), + (8013501, 0, 42, 0, 0), + (8013502, 0, 44, 0, 0), + (8013503, 0, 37, 0, 0), + (8013504, 0, 36, 0, 0), + (8013505, 0, 41, 0, 0), + (8013506, 0, 39, 0, 0), + (8013507, 0, 40, 0, 0), + (8013601, 0, 64, 0, 0), + (8013602, 0, 65, 0, 0), + (8013603, 0, 69, 0, 2), + (8013604, 0, 69, 0, 1), + (8013605, 0, 69, 0, 0), + (8013606, 0, 69, 0, 3), + (8013607, 0, 69, 0, 4), + (8013608, 0, 3, 6, 0), + (8013609, 0, 7, 7, 3), + (8013610, 0, 8, 5, 0), + (8013611, 0, 70, 0, 0), + (8013612, 0, 71, 0, 0), + (8013613, 0, 72, 0, 0), + (8013614, 0, 11, 2, 0), + (8013615, 0, 19, 0, 8), + (8013616, 0, 5, 5, 2), + (8013617, 0, 11, 2, 3), + (8013618, 0, 19, 0, 6), + (8013619, 0, 5, 5, 3), + (8013620, 0, 11, 2, 2), + (8013621, 0, 19, 0, 7), + (8013622, 0, 5, 5, 1), + (8013623, 0, 25, 6, 1), + (8013624, 0, 11, 6, 2), + (8013625, 0, 11, 1, 29), + (8013626, 0, 46, 0, 0), + (8013627, 0, 74, 0, 0), + (8013628, 0, 73, 0, 0), + (8013629, 0, 76, 0, 0), + (8013630, 0, 78, 0, 0), + (8013631, 0, 77, 0, 0), + (8013632, 0, 75, 0, 0), + (8013633, 0, 79, 0, 0), + (8013634, 0, 80, 0, 0), + (8013635, 0, 67, 0, 0), + (8013636, 0, 24, 6, 5), + (8013637, 0, 17, 2, 0), + (8030001, 0, 2, 9, 0), + (8030002, 0, 2, 9, 1), + (8030003, 0, 2, 9, 2), + (8030004, 0, 2, 9, 3), + (8030005, 0, 2, 1, 0), + (8030006, 0, 2, 1, 1), + (8030007, 0, 2, 1, 2), + (8030008, 0, 2, 1, 3), + (8030009, 0, 2, 1, 4), + (8030010, 0, 2, 3, 0), + (8030011, 0, 2, 3, 1), + (8030012, 0, 2, 3, 2), + (8030013, 0, 2, 3, 3), + (8030014, 0, 2, 3, 4), + (8030015, 0, 2, 3, 5), + (8030016, 0, 2, 3, 7), + (8030017, 0, 2, 3, 7), + (8030018, 0, 2, 3, 8), + (8030019, 0, 2, 3, 9), + (8030020, 0, 2, 5, 6), + (8030021, 0, 2, 5, 8), + (8030022, 0, 2, 5, 9), + (8030023, 0, 2, 5, 7), + (8030024, 0, 2, 3, 8), + (8030025, 0, 2, 3, 9), + (8030026, 0, 2, 3, 5), + (8030027, 0, 2, 3, 8), + (8030028, 0, 2, 3, 9), + (8030029, 0, 2, 3, 5), + (8030030, 0, 2, 3, 7), + (8030031, 0, 2, 3, 9), + (8030032, 0, 2, 10, 0), + (8030033, 0, 2, 5, 5), + (8030034, 0, 2, 0, 2), + (8030035, 0, 2, 1, 2), + (8030036, 0, 2, 3, 5), + (8030037, 0, 2, 3, 7), + (8030038, 0, 2, 3, 8), + (8030039, 0, 2, 5, 8), + (8030040, 0, 2, 5, 9), + (8030041, 0, 2, 5, 7), + (8030042, 0, 2, 5, 6), + (8030043, 0, 2, 5, 9), + (8030044, 0, 2, 5, 7), + (8030045, 0, 2, 5, 6), + (8030046, 0, 2, 5, 8), + (8030047, 0, 2, 5, 7), + (8030048, 0, 2, 5, 6), + (8030049, 0, 2, 5, 8), + (8030050, 0, 2, 5, 9), + (8030101, 0, 3, 0, 0), + (8030102, 0, 3, 0, 1), + (8030103, 0, 3, 0, 2), + (8030104, 0, 3, 0, 3), + (8030105, 0, 3, 0, 4), + (8030106, 0, 3, 1, 0), + (8030107, 0, 3, 4, 0), + (8030108, 0, 3, 4, 1), + (8030109, 0, 3, 1, 1), + (8030110, 0, 3, 4, 2), + (8030111, 0, 3, 5, 1), + (8030112, 0, 3, 7, 0), + (8030113, 0, 3, 2, 0), + (8030114, 0, 3, 5, 0), + (8030116, 0, 3, 3, 0), + (8030117, 0, 3, 6, 0), + (8030118, 0, 3, 6, 1), + (8030201, 0, 7, 0, 0), + (8030202, 0, 7, 0, 1), + (8030203, 0, 7, 0, 2), + (8030204, 0, 7, 0, 3), + (8030205, 0, 7, 1, 0), + (8030206, 0, 7, 1, 1), + (8030207, 0, 7, 1, 2), + (8030208, 0, 7, 1, 3), + (8030209, 0, 7, 1, 4), + (8030210, 0, 7, 2, 0), + (8030211, 0, 7, 2, 1), + (8030212, 0, 7, 2, 2), + (8030213, 0, 7, 2, 3), + (8030214, 0, 7, 2, 4), + (8030215, 0, 7, 4, 0), + (8030216, 0, 7, 4, 1), + (8030217, 0, 7, 4, 2), + (8030218, 0, 7, 4, 3), + (8030219, 0, 7, 4, 4), + (8030220, 0, 7, 6, 0), + (8030221, 0, 7, 6, 1), + (8030222, 0, 7, 6, 2), + (8030223, 0, 7, 6, 1), + (8030224, 0, 7, 6, 2), + (8030225, 0, 7, 8, 0), + (8030226, 0, 7, 8, 2), + (8030227, 0, 7, 8, 2), + (8030228, 0, 7, 8, 4), + (8030229, 0, 7, 8, 4), + (8030230, 0, 7, 10, 0), + (8030231, 0, 7, 10, 1), + (8030232, 0, 7, 10, 1), + (8030233, 0, 7, 10, 3), + (8030234, 0, 7, 6, 0), + (8030235, 0, 7, 6, 2), + (8030236, 0, 7, 6, 0), + (8030237, 0, 7, 6, 1), + (8030238, 0, 7, 8, 0), + (8030239, 0, 7, 8, 4), + (8030240, 0, 7, 8, 0), + (8030241, 0, 7, 8, 2), + (8030242, 0, 7, 10, 3), + (8030243, 0, 7, 10, 2), + (8030244, 0, 7, 11, 0), + (8030245, 0, 7, 18, 0), + (8030246, 0, 7, 12, 0), + (8030247, 0, 7, 12, 0), + (8030248, 0, 7, 3, 0), + (8030249, 0, 7, 10, 4), + (8030250, 0, 7, 10, 0), + (8030251, 0, 7, 10, 3), + (8030252, 0, 7, 10, 2), + (8030253, 0, 7, 10, 4), + (8030254, 0, 7, 10, 0), + (8030255, 0, 7, 10, 1), + (8030256, 0, 7, 10, 2), + (8030257, 0, 7, 10, 4), + (8030301, 0, 11, 0, 0), + (8030302, 0, 11, 0, 1), + (8030303, 0, 11, 0, 2), + (8030304, 0, 11, 0, 3), + (8030305, 0, 11, 1, 0), + (8030306, 0, 11, 1, 1), + (8030307, 0, 11, 1, 2), + (8030308, 0, 11, 1, 3), + (8030309, 0, 11, 1, 4), + (8030310, 0, 11, 2, 0), + (8030311, 0, 11, 2, 1), + (8030312, 0, 11, 2, 2), + (8030313, 0, 11, 2, 3), + (8030314, 0, 11, 2, 4), + (8030315, 0, 11, 3, 0), + (8030316, 0, 11, 3, 1), + (8030317, 0, 11, 3, 2), + (8030318, 0, 11, 3, 3), + (8030319, 0, 11, 3, 4), + (8030320, 0, 11, 5, 0), + (8030321, 0, 11, 5, 3), + (8030335, 0, 11, 8, 0), + (8030336, 0, 11, 8, 1), + (8030337, 0, 11, 8, 2), + (8030338, 0, 11, 8, 3), + (8030339, 0, 11, 8, 4), + (8030349, 0, 11, 8, 3), + (8030350, 0, 11, 5, 2), + (8030401, 0, 4, 0, 0), + (8030402, 0, 4, 0, 1), + (8030403, 0, 4, 0, 2), + (8030404, 0, 4, 0, 3), + (8030405, 0, 4, 1, 0), + (8030406, 0, 4, 1, 1), + (8030407, 0, 4, 1, 2), + (8030408, 0, 4, 1, 3), + (8030409, 0, 4, 1, 4), + (8030410, 0, 4, 2, 0), + (8030411, 0, 4, 2, 1), + (8030412, 0, 4, 2, 2), + (8030413, 0, 4, 2, 3), + (8030414, 0, 4, 2, 4), + (8030415, 0, 4, 0, 1), + (8030416, 0, 4, 0, 3), + (8030417, 0, 4, 0, 0), + (8030418, 0, 4, 0, 3), + (8030419, 0, 4, 0, 0), + (8030420, 0, 4, 0, 0), + (8030421, 0, 4, 0, 1), + (8030422, 0, 4, 0, 3), + (8030423, 0, 4, 1, 0), + (8030424, 0, 4, 1, 2), + (8030425, 0, 4, 1, 4), + (8030426, 0, 4, 0, 1), + (8030427, 0, 4, 1, 2), + (8030428, 0, 4, 1, 4), + (8030429, 0, 4, 1, 0), + (8030430, 0, 4, 1, 4), + (8030431, 0, 4, 1, 0), + (8030432, 0, 4, 1, 2), + (8030445, 0, 4, 11, 0), + (8030446, 0, 4, 11, 1), + (8030447, 0, 4, 3, 2), + (8030501, 0, 5, 0, 0), + (8030502, 0, 5, 0, 1), + (8030503, 0, 5, 0, 2), + (8030504, 0, 5, 0, 3), + (8030505, 0, 5, 1, 0), + (8030506, 0, 5, 1, 1), + (8030507, 0, 5, 1, 2), + (8030508, 0, 5, 1, 3), + (8030509, 0, 5, 1, 4), + (8030510, 0, 5, 2, 0), + (8030511, 0, 5, 2, 1), + (8030512, 0, 5, 2, 2), + (8030513, 0, 5, 2, 3), + (8030514, 0, 5, 2, 4), + (8030515, 0, 5, 3, 0), + (8030516, 0, 5, 3, 1), + (8030517, 0, 5, 3, 2), + (8030518, 0, 5, 3, 3), + (8030519, 0, 5, 3, 4), + (8030520, 0, 5, 6, 0), + (8030521, 0, 5, 6, 4), + (8030522, 0, 5, 6, 2), + (8030523, 0, 5, 6, 1), + (8030524, 0, 5, 7, 0), + (8030525, 0, 5, 7, 2), + (8030526, 0, 5, 7, 3), + (8030527, 0, 5, 7, 4), + (8030528, 0, 5, 6, 4), + (8030529, 0, 5, 6, 2), + (8030530, 0, 5, 6, 1), + (8030531, 0, 5, 6, 0), + (8030532, 0, 5, 6, 2), + (8030533, 0, 5, 6, 1), + (8030534, 0, 5, 6, 0), + (8030535, 0, 5, 6, 4), + (8030536, 0, 5, 6, 1), + (8030537, 0, 5, 6, 0), + (8030538, 0, 5, 6, 4), + (8030539, 0, 5, 6, 2), + (8030540, 0, 5, 7, 2), + (8030541, 0, 5, 7, 3), + (8030542, 0, 5, 7, 4), + (8030543, 0, 5, 7, 1), + (8030544, 0, 5, 7, 0), + (8030545, 0, 5, 7, 3), + (8030546, 0, 5, 12, 0), + (8030547, 0, 5, 12, 1), + (8030548, 0, 5, 3, 1), + (8030549, 0, 5, 7, 4), + (8030550, 0, 5, 7, 1), + (8030551, 0, 5, 7, 0), + (8030552, 0, 5, 7, 2), + (8030553, 0, 5, 7, 4), + (8030554, 0, 5, 7, 1), + (8030555, 0, 5, 7, 0), + (8030556, 0, 5, 7, 2), + (8030557, 0, 5, 7, 3), + (8030558, 0, 5, 7, 1), + (8030601, 0, 9, 21, 0), + (8030602, 0, 9, 0, 0), + (8030603, 0, 9, 0, 1), + (8030604, 0, 9, 0, 2), + (8030605, 0, 9, 2, 0), + (8030606, 0, 9, 3, 0), + (8030607, 0, 9, 3, 1), + (8030608, 0, 9, 3, 2), + (8030609, 0, 9, 3, 3), + (8030610, 0, 9, 4, 0), + (8030611, 0, 9, 4, 1), + (8030612, 0, 9, 4, 2), + (8030613, 0, 9, 4, 3), + (8030614, 0, 9, 4, 4), + (8030615, 0, 9, 6, 0), + (8030616, 0, 9, 6, 1), + (8030617, 0, 9, 6, 2), + (8030618, 0, 9, 6, 3), + (8030619, 0, 9, 6, 4), + (8030620, 0, 9, 5, 1), + (8030621, 0, 9, 10, 4), + (8030622, 0, 9, 10, 5), + (8030623, 0, 9, 15, 4), + (8030624, 0, 9, 15, 5), + (8030625, 0, 9, 3, 2), + (8030626, 0, 9, 4, 3), + (8030627, 0, 9, 18, 2), + (8030701, 0, 10, 13, 0), + (8030702, 0, 10, 0, 0), + (8030703, 0, 10, 0, 1), + (8030704, 0, 10, 0, 2), + (8030705, 0, 10, 0, 3), + (8030706, 0, 10, 1, 0), + (8030707, 0, 10, 1, 1), + (8030708, 0, 10, 1, 2), + (8030709, 0, 10, 1, 3), + (8030710, 0, 10, 1, 4), + (8030711, 0, 10, 2, 0), + (8030712, 0, 10, 2, 1), + (8030713, 0, 10, 2, 2), + (8030714, 0, 10, 2, 3), + (8030715, 0, 10, 2, 4), + (8030716, 0, 10, 11, 0), + (8030717, 0, 10, 2, 0), + (8030718, 0, 10, 2, 2), + (8030719, 0, 10, 2, 3), + (8030720, 0, 10, 4, 4), + (8030721, 0, 10, 4, 5), + (8030722, 0, 10, 4, 6), + (8030723, 0, 10, 5, 4), + (8030724, 0, 10, 5, 5), + (8030725, 0, 10, 5, 2), + (8030726, 0, 10, 3, 2), + (8030727, 0, 10, 3, 3), + (8030728, 0, 10, 3, 4), + (8030729, 0, 10, 3, 3), + (8030730, 0, 10, 3, 4), + (8030731, 0, 10, 3, 2), + (8030732, 0, 10, 4, 5), + (8030733, 0, 10, 4, 6), + (8030734, 0, 10, 4, 4), + (8030735, 0, 10, 4, 6), + (8030736, 0, 10, 4, 4), + (8030737, 0, 10, 4, 5), + (8030738, 0, 10, 5, 5), + (8030739, 0, 10, 5, 6), + (8030740, 0, 10, 5, 7), + (8030741, 0, 10, 5, 4), + (8030742, 0, 10, 5, 5), + (8030743, 0, 10, 5, 6), + (8030744, 0, 10, 0, 2), + (8030745, 0, 10, 2, 1), + (8030801, 0, 13, 19, 0), + (8030802, 0, 13, 0, 0), + (8030803, 0, 13, 0, 1), + (8030804, 0, 13, 0, 2), + (8030805, 0, 13, 1, 0), + (8030806, 0, 13, 1, 3), + (8030807, 0, 13, 1, 1), + (8030808, 0, 13, 1, 2), + (8030809, 0, 13, 2, 0), + (8030810, 0, 13, 3, 0), + (8030811, 0, 13, 4, 0), + (8030812, 0, 13, 5, 0), + (8030813, 0, 13, 6, 0), + (8030814, 0, 13, 6, 1), + (8030815, 0, 13, 6, 2), + (8030816, 0, 13, 6, 3), + (8030817, 0, 13, 10, 0), + (8030818, 0, 13, 6, 2), + (8030819, 0, 13, 0, 1), + (8030820, 0, 13, 0, 0), + (8030821, 0, 13, 1, 3), + (8030822, 0, 13, 1, 0), + (8030823, 0, 13, 11, 1), + (8030824, 0, 13, 14, 0), + (8030901, 0, 14, 0, 0), + (8030902, 0, 14, 0, 1), + (8030903, 0, 14, 0, 2), + (8030904, 0, 14, 1, 0), + (8030905, 0, 14, 1, 1), + (8030906, 0, 14, 1, 2), + (8030907, 0, 14, 1, 3), + (8030908, 0, 14, 3, 0), + (8030909, 0, 14, 3, 1), + (8030910, 0, 14, 3, 2), + (8030911, 0, 14, 3, 3), + (8030912, 0, 14, 5, 0), + (8030913, 0, 14, 5, 1), + (8030914, 0, 14, 5, 2), + (8030915, 0, 14, 5, 3), + (8030916, 0, 14, 9, 0), + (8030917, 0, 14, 4, 0), + (8030918, 0, 14, 8, 0), + (8030919, 0, 14, 5, 1), + (8030920, 0, 14, 3, 0), + (8030921, 0, 14, 3, 2), + (8030922, 0, 14, 6, 2), + (8030923, 0, 14, 6, 0), + (8030924, 0, 14, 2, 0), + (8031001, 0, 6, 0, 0), + (8031002, 0, 6, 0, 1), + (8031003, 0, 6, 0, 2), + (8031004, 0, 6, 0, 3), + (8031005, 0, 6, 1, 0), + (8031006, 0, 6, 1, 1), + (8031007, 0, 6, 1, 2), + (8031008, 0, 6, 1, 3), + (8031009, 0, 6, 1, 4), + (8031010, 0, 6, 2, 0), + (8031011, 0, 6, 2, 1), + (8031012, 0, 6, 2, 2), + (8031013, 0, 6, 2, 3), + (8031014, 0, 6, 2, 4), + (8031015, 0, 6, 3, 0), + (8031016, 0, 6, 3, 1), + (8031017, 0, 6, 3, 2), + (8031018, 0, 6, 3, 3), + (8031019, 0, 6, 3, 4), + (8031020, 0, 6, 15, 0), + (8031021, 0, 6, 3, 2), + (8031022, 0, 6, 6, 0), + (8031023, 0, 6, 6, 2), + (8031024, 0, 6, 6, 3), + (8031025, 0, 6, 6, 4), + (8031026, 0, 6, 7, 0), + (8031027, 0, 6, 7, 3), + (8031028, 0, 6, 7, 1), + (8031029, 0, 6, 7, 2), + (8031030, 0, 6, 6, 2), + (8031031, 0, 6, 6, 3), + (8031032, 0, 6, 6, 4), + (8031033, 0, 6, 6, 0), + (8031034, 0, 6, 6, 3), + (8031035, 0, 6, 6, 4), + (8031036, 0, 6, 6, 0), + (8031037, 0, 6, 6, 2), + (8031038, 0, 6, 6, 4), + (8031039, 0, 6, 6, 0), + (8031040, 0, 6, 6, 2), + (8031041, 0, 6, 6, 3), + (8031042, 0, 6, 7, 3), + (8031043, 0, 6, 7, 1), + (8031044, 0, 6, 7, 2), + (8031045, 0, 6, 7, 4), + (8031046, 0, 6, 7, 0), + (8031047, 0, 6, 7, 1), + (8031048, 0, 6, 7, 2), + (8031049, 0, 6, 7, 4), + (8031050, 0, 6, 7, 0), + (8031051, 0, 6, 7, 3), + (8031052, 0, 6, 7, 2), + (8031053, 0, 6, 7, 4), + (8031054, 0, 6, 7, 0), + (8031055, 0, 6, 7, 3), + (8031056, 0, 6, 7, 1), + (8031057, 0, 6, 7, 4), + (8031101, 0, 31, 0, 0), + (8031102, 0, 31, 0, 1), + (8031103, 0, 31, 0, 2), + (8031104, 0, 31, 0, 3), + (8031105, 0, 31, 2, 0), + (8031106, 0, 31, 2, 1), + (8031107, 0, 31, 2, 2), + (8031108, 0, 31, 2, 3), + (8031109, 0, 31, 2, 4), + (8031110, 0, 31, 4, 0), + (8031111, 0, 31, 4, 1), + (8031112, 0, 31, 4, 2), + (8031113, 0, 31, 4, 3), + (8031114, 0, 31, 4, 4), + (8031115, 0, 31, 4, 5), + (8031116, 0, 31, 4, 6), + (8031117, 0, 31, 4, 7), + (8031118, 0, 31, 4, 8), + (8031119, 0, 31, 4, 9), + (8031120, 0, 31, 1, 0), + (8031121, 0, 31, 2, 0), + (8031122, 0, 31, 2, 1), + (8031201, 0, 32, 0, 0), + (8031202, 0, 32, 0, 1), + (8031203, 0, 32, 0, 2), + (8031204, 0, 32, 0, 3), + (8031205, 0, 32, 1, 0), + (8031206, 0, 32, 1, 1), + (8031207, 0, 32, 1, 2), + (8031208, 0, 32, 1, 3), + (8031209, 0, 32, 1, 4), + (8031210, 0, 32, 2, 0), + (8031211, 0, 32, 2, 1), + (8031212, 0, 32, 2, 2), + (8031213, 0, 32, 2, 3), + (8031214, 0, 32, 2, 4), + (8031215, 0, 32, 7, 0), + (8031216, 0, 32, 2, 5), + (8031217, 0, 32, 2, 6), + (8031218, 0, 32, 2, 7), + (8031219, 0, 32, 2, 8), + (8031220, 0, 32, 2, 9), + (8031221, 0, 32, 8, 0), + (8031222, 0, 32, 1, 4), + (8031223, 0, 32, 2, 7), + (8031224, 0, 32, 0, 0), + (8031225, 0, 32, 0, 3), + (8031226, 0, 32, 0, 1), + (8031227, 0, 32, 1, 0), + (8031228, 0, 32, 1, 3), + (8031229, 0, 32, 1, 4), + (8031230, 0, 32, 2, 5), + (8031231, 0, 32, 2, 6), + (8031232, 0, 32, 2, 8), + (8031233, 0, 32, 0, 3), + (8031234, 0, 32, 0, 1), + (8031235, 0, 32, 0, 0), + (8031236, 0, 32, 0, 1), + (8031237, 0, 32, 0, 0), + (8031238, 0, 32, 0, 3), + (8031239, 0, 32, 1, 3), + (8031240, 0, 32, 1, 4), + (8031241, 0, 32, 1, 0), + (8031242, 0, 32, 1, 4), + (8031243, 0, 32, 1, 0), + (8031244, 0, 32, 1, 3), + (8031245, 0, 32, 2, 6), + (8031246, 0, 32, 2, 8), + (8031247, 0, 32, 2, 5), + (8031248, 0, 32, 2, 8), + (8031249, 0, 32, 2, 5), + (8031250, 0, 32, 2, 6), + (8031301, 0, 33, 0, 0), + (8031302, 0, 33, 0, 1), + (8031303, 0, 33, 0, 2), + (8031304, 0, 33, 0, 3), + (8031305, 0, 33, 2, 0), + (8031306, 0, 33, 2, 1), + (8031307, 0, 33, 2, 2), + (8031308, 0, 33, 2, 3), + (8031309, 0, 33, 2, 4), + (8031310, 0, 33, 4, 0), + (8031311, 0, 33, 4, 1), + (8031312, 0, 33, 4, 2), + (8031313, 0, 33, 4, 3), + (8031314, 0, 33, 4, 4), + (8031315, 0, 33, 0, 0), + (8031316, 0, 33, 0, 1), + (8031401, 0, 34, 0, 0), + (8031402, 0, 34, 0, 1), + (8031403, 0, 34, 0, 2), + (8031404, 0, 34, 0, 3), + (8031405, 0, 34, 2, 0), + (8031406, 0, 34, 2, 1), + (8031407, 0, 34, 2, 2), + (8031408, 0, 34, 2, 3), + (8031409, 0, 34, 2, 4), + (8031410, 0, 34, 4, 0), + (8031411, 0, 34, 4, 1), + (8031412, 0, 34, 4, 2), + (8031413, 0, 34, 4, 3), + (8031414, 0, 34, 4, 4), + (8031415, 0, 34, 1, 0), + (8031416, 0, 34, 4, 2), + (8031417, 0, 34, 2, 0), + (8031418, 0, 34, 2, 1), + (8031419, 0, 34, 4, 5), + (8031420, 0, 34, 4, 8), + (8031421, 0, 34, 10, 2), + (8031501, 0, 8, 0, 0), + (8031502, 0, 8, 0, 1), + (8031503, 0, 8, 1, 0), + (8031504, 0, 8, 1, 1), + (8031505, 0, 8, 2, 0), + (8031506, 0, 8, 2, 1), + (8031507, 0, 8, 2, 2), + (8031508, 0, 8, 2, 3), + (8031509, 0, 8, 5, 0), + (8031510, 0, 8, 5, 1), + (8031511, 0, 8, 5, 2), + (8031512, 0, 8, 5, 3), + (8031513, 0, 8, 5, 0), + (8031514, 0, 8, 1, 0), + (8031515, 0, 8, 1, 1), + (8031516, 0, 8, 6, 2), + (8031517, 0, 8, 6, 0), + (8031518, 0, 8, 7, 3), + (8031519, 0, 8, 7, 0), + (8031520, 0, 8, 8, 2), + (8031521, 0, 8, 8, 0), + (8031522, 0, 8, 8, 1), + (8031523, 0, 8, 8, 3), + (8031601, 0, 12, 0, 0), + (8031602, 0, 12, 0, 1), + (8031603, 0, 12, 6, 0), + (8031604, 0, 12, 9, 0), + (8031605, 0, 12, 7, 0), + (8031606, 0, 12, 15, 0), + (8031607, 0, 12, 3, 4), + (8031608, 0, 12, 10, 0), + (8031609, 0, 12, 8, 0), + (8031610, 0, 12, 5, 0), + (8031611, 0, 12, 5, 1), + (8031612, 0, 12, 12, 0), + (8031613, 0, 12, 12, 1), + (8031701, 0, 15, 0, 0), + (8031702, 0, 15, 0, 1), + (8031703, 0, 15, 0, 2), + (8031704, 0, 15, 0, 3), + (8031705, 0, 15, 0, 4), + (8031706, 0, 15, 1, 0), + (8031707, 0, 15, 1, 1), + (8031708, 0, 15, 1, 2), + (8031709, 0, 15, 1, 3), + (8031710, 0, 15, 1, 4), + (8031711, 0, 15, 2, 0), + (8031712, 0, 15, 2, 1), + (8031713, 0, 15, 2, 2), + (8031714, 0, 15, 2, 3), + (8031715, 0, 15, 2, 4), + (8031716, 0, 15, 16, 0), + (8031717, 0, 15, 15, 0), + (8031718, 0, 15, 2, 0), + (8031719, 0, 15, 12, 0), + (8031720, 0, 15, 4, 0), + (8031721, 0, 15, 4, 1), + (8031722, 0, 15, 5, 0), + (8031723, 0, 15, 5, 3), + (8031724, 0, 15, 0, 0), + (8031801, 0, 29, 0, 0), + (8031802, 0, 29, 0, 1), + (8031803, 0, 29, 0, 2), + (8031804, 0, 29, 0, 3), + (8031805, 0, 29, 2, 0), + (8031806, 0, 29, 2, 1), + (8031807, 0, 29, 2, 2), + (8031808, 0, 29, 2, 3), + (8031809, 0, 29, 2, 4), + (8031810, 0, 29, 2, 5), + (8031811, 0, 29, 2, 6), + (8031812, 0, 29, 2, 7), + (8031813, 0, 29, 2, 8), + (8031814, 0, 29, 2, 9), + (8031815, 0, 29, 2, 10), + (8031816, 0, 29, 2, 11), + (8031817, 0, 29, 2, 12), + (8031818, 0, 29, 2, 13), + (8031819, 0, 29, 2, 14), + (8031820, 0, 29, 9, 1), + (8031821, 0, 29, 3, 1), + (8031822, 0, 29, 2, 17), + (8031823, 0, 29, 2, 18), + (8031824, 0, 29, 2, 19), + (8031825, 0, 29, 6, 0), + (8031826, 0, 29, 6, 3), + (8031827, 0, 29, 6, 4), + (8031828, 0, 29, 6, 5), + (8031901, 0, 28, 0, 0), + (8031902, 0, 28, 0, 1), + (8031903, 0, 28, 0, 2), + (8031904, 0, 28, 0, 3), + (8031905, 0, 28, 1, 0), + (8031906, 0, 28, 1, 1), + (8031907, 0, 28, 1, 2), + (8031908, 0, 28, 1, 3), + (8031909, 0, 28, 1, 4), + (8031910, 0, 28, 2, 0), + (8031911, 0, 28, 2, 1), + (8031912, 0, 28, 2, 2), + (8031913, 0, 28, 2, 3), + (8031914, 0, 28, 2, 4), + (8031915, 0, 28, 1, 0), + (8031916, 0, 28, 1, 3), + (8031917, 0, 28, 1, 2), + (8032001, 0, 30, 0, 5), + (8032002, 0, 30, 3, 0), + (8032003, 0, 30, 4, 0), + (8032004, 0, 30, 4, 1), + (8032005, 0, 30, 4, 2), + (8032006, 0, 30, 4, 3), + (8032007, 0, 30, 4, 4), + (8032008, 0, 30, 4, 2), + (8032009, 0, 30, 0, 0), + (8032010, 0, 30, 0, 3), + (8032011, 0, 30, 0, 4), + (8032012, 0, 30, 0, 2), + (8032013, 0, 30, 1, 0), + (8032014, 0, 30, 1, 4), + (8032015, 0, 30, 1, 3), + (8032016, 0, 30, 1, 1), + (8032017, 0, 30, 0, 3), + (8032018, 0, 30, 0, 4), + (8032019, 0, 30, 0, 2), + (8032020, 0, 30, 0, 0), + (8032021, 0, 30, 0, 4), + (8032022, 0, 30, 0, 2), + (8032023, 0, 30, 0, 0), + (8032024, 0, 30, 0, 3), + (8032025, 0, 30, 1, 4), + (8032026, 0, 30, 1, 3), + (8032027, 0, 30, 1, 1), + (8032028, 0, 30, 1, 2), + (8032029, 0, 30, 1, 0), + (8032030, 0, 30, 1, 3), + (8032031, 0, 30, 1, 1), + (8032032, 0, 30, 1, 2), + (8032033, 0, 30, 1, 0), + (8032034, 0, 30, 1, 4), + (8032035, 0, 30, 1, 2), + (8032101, 0, 53, 0, 0), + (8032102, 0, 58, 0, 0), + (8032201, 0, 38, 0, 0), + (8032202, 0, 38, 0, 1), + (8032203, 0, 38, 0, 2), + (8032204, 0, 38, 0, 3), + (8032205, 0, 38, 0, 4), + (8032206, 0, 38, 0, 5), + (8032207, 0, 38, 0, 6), + (8032208, 0, 38, 0, 7), + (8032209, 0, 38, 0, 8), + (8032210, 0, 38, 0, 9), + (8032211, 0, 38, 0, 0), + (8032212, 0, 38, 0, 2), + (8032213, 0, 38, 0, 4), + (8032214, 0, 38, 0, 3), + (8032215, 0, 38, 0, 1), + (8032216, 0, 38, 5, 0), + (8032217, 0, 38, 4, 0), + (8032218, 0, 38, 3, 0), + (8032219, 0, 38, 2, 0), + (8032220, 0, 38, 0, 8), + (8032221, 0, 38, 0, 5), + (8032222, 0, 38, 0, 7), + (8032223, 0, 38, 0, 8), + (8032224, 0, 38, 0, 5), + (8032225, 0, 38, 0, 4), + (8032226, 0, 38, 0, 3), + (8032227, 0, 38, 0, 7), + (8032228, 0, 38, 0, 8), + (8032229, 0, 38, 0, 5), + (8032230, 0, 38, 0, 8), + (8032231, 0, 38, 0, 5), + (8032232, 0, 38, 0, 7), + (8032233, 0, 38, 0, 4), + (8032234, 0, 38, 0, 3), + (8032235, 0, 38, 0, 2), + (8032236, 0, 38, 0, 1), + (8032237, 0, 38, 0, 5), + (8032238, 0, 38, 0, 3), + (8032239, 0, 38, 0, 2), + (8032240, 0, 38, 0, 1), + (8032241, 0, 38, 0, 5), + (8032242, 0, 38, 0, 3), + (8032243, 0, 38, 0, 2), + (8032244, 0, 38, 0, 1), + (8032301, 0, 16, 2, 0), + (8032302, 0, 16, 4, 3), + (8032303, 0, 16, 5, 4), + (8032304, 0, 16, 5, 2), + (8032305, 0, 16, 6, 4), + (8032306, 0, 16, 6, 3), + (8032307, 0, 16, 1, 4), + (8032308, 0, 16, 6, 0), + (8032309, 0, 16, 6, 1), + (8032310, 0, 16, 6, 2), + (8032311, 0, 16, 1, 0), + (8032312, 0, 16, 3, 3), + (8032401, 0, 49, 0, 0), + (8032402, 0, 49, 0, 1), + (8032403, 0, 49, 0, 2), + (8032404, 0, 49, 0, 3), + (8032405, 0, 49, 0, 4), + (8032406, 0, 49, 0, 0), + (8032407, 0, 49, 0, 1), + (8032408, 0, 49, 0, 2), + (8032409, 0, 49, 0, 3), + (8032410, 0, 49, 0, 4), + (8032501, 0, 35, 0, 0), + (8032502, 0, 35, 0, 1), + (8032601, 0, 45, 0, 0), + (8032602, 0, 45, 0, 1), + (8032603, 0, 45, 0, 2), + (8032604, 0, 45, 0, 3), + (8032605, 0, 45, 0, 4), + (8032606, 0, 45, 0, 5), + (8032701, 0, 42, 0, 0), + (8032702, 0, 44, 0, 0), + (8032703, 0, 37, 0, 0), + (8032704, 0, 36, 0, 0), + (8032705, 0, 41, 0, 0), + (8032706, 0, 39, 0, 0), + (8032707, 0, 40, 0, 0), + (8032801, 0, 47, 0, 0), + (8032802, 0, 64, 0, 0), + (8032803, 0, 65, 0, 0), + (8032804, 0, 66, 0, 0), + (8032805, 0, 47, 2, 1), + (8032806, 0, 47, 2, 0), + (8032807, 0, 47, 2, 2), + (8032808, 0, 47, 2, 3), + (8032809, 0, 47, 2, 4), + (8032810, 0, 68, 0, 0), + (8032811, 0, 68, 0, 1), + (8032812, 0, 68, 0, 2), + (8032813, 0, 68, 0, 3), + (8032814, 0, 68, 0, 4), + (8032815, 0, 69, 0, 0), + (8032816, 0, 69, 0, 1), + (8032817, 0, 69, 0, 2), + (8032818, 0, 69, 0, 3), + (8032819, 0, 69, 0, 4), + (8032820, 0, 11, 10, 2), + (8032821, 0, 30, 4, 2), + (8032822, 0, 11, 11, 0), + (8032823, 0, 30, 4, 3), + (8032824, 0, 11, 10, 4), + (8032825, 0, 30, 4, 1), + (8032826, 0, 7, 15, 3), + (8032827, 0, 3, 6, 0), + (8032828, 0, 8, 10, 0), + (8032829, 0, 4, 9, 3), + (8032830, 0, 9, 7, 3), + (8032831, 0, 15, 13, 0), + (8032832, 0, 52, 0, 0), + (8032833, 0, 50, 0, 0), + (8032834, 0, 59, 1, 0), + (8032835, 0, 59, 1, 1), + (8032836, 0, 59, 1, 2), + (8032837, 0, 59, 0, 0), + (8032838, 0, 59, 0, 1), + (8032839, 0, 59, 0, 2), + (8040001, 0, 1, 5, 0), + (8040002, 0, 1, 5, 2), + (8040003, 0, 1, 5, 3), + (8040004, 0, 1, 5, 0), + (8040005, 0, 1, 0, 0), + (8040006, 0, 1, 5, 3), + (8040007, 0, 1, 15, 1), + (8040008, 0, 1, 5, 0), + (8040009, 0, 1, 5, 1), + (8040010, 0, 1, 15, 0), + (8040011, 0, 1, 15, 1), + (8040012, 0, 1, 6, 0), + (8040013, 0, 1, 5, 2), + (8040014, 0, 1, 5, 0), + (8040015, 0, 1, 5, 2), + (8050001, 0, 2, 0, 0), + (8050002, 0, 2, 0, 3), + (8050003, 0, 2, 0, 1), + (8050004, 0, 2, 0, 2), + (8050005, 0, 2, 1, 0), + (8050006, 0, 2, 1, 2), + (8050007, 0, 2, 1, 3), + (8050008, 0, 2, 1, 4), + (8050009, 0, 2, 1, 1), + (8050010, 0, 2, 2, 0), + (8050011, 0, 2, 2, 2), + (8050012, 0, 2, 2, 3), + (8050013, 0, 2, 2, 4), + (8050014, 0, 2, 2, 1), + (8050015, 0, 2, 2, 5), + (8050016, 0, 2, 2, 9), + (8050017, 0, 2, 2, 8), + (8050018, 0, 2, 2, 7), + (8050019, 0, 2, 3, 0), + (8050020, 0, 2, 3, 3), + (8050021, 0, 2, 3, 1), + (8050022, 0, 2, 3, 2), + (8050023, 0, 2, 2, 9), + (8050024, 0, 2, 2, 8), + (8050025, 0, 2, 2, 7), + (8050026, 0, 2, 2, 5), + (8050027, 0, 2, 2, 8), + (8050028, 0, 2, 2, 2), + (8050029, 0, 2, 1, 2), + (8050030, 0, 2, 6, 0), + (8050031, 0, 2, 6, 1), + (8050032, 0, 2, 6, 2), + (8050033, 0, 2, 2, 7), + (8050034, 0, 2, 2, 5), + (8050035, 0, 2, 2, 9), + (8050036, 0, 2, 2, 7), + (8050037, 0, 2, 2, 5), + (8050038, 0, 2, 2, 9), + (8050039, 0, 2, 2, 8), + (8050040, 0, 2, 3, 3), + (8050041, 0, 2, 3, 1), + (8050042, 0, 2, 3, 2), + (8050043, 0, 2, 3, 0), + (8050044, 0, 2, 3, 1), + (8050045, 0, 2, 3, 2), + (8050046, 0, 2, 3, 0), + (8050047, 0, 2, 3, 3), + (8050048, 0, 2, 3, 2), + (8050049, 0, 2, 3, 0), + (8050050, 0, 2, 3, 3), + (8050051, 0, 2, 3, 1), + (8050101, 0, 3, 0, 0), + (8050102, 0, 3, 0, 1), + (8050103, 0, 3, 0, 2), + (8050104, 0, 3, 0, 3), + (8050105, 0, 3, 1, 0), + (8050106, 0, 3, 1, 1), + (8050107, 0, 3, 1, 2), + (8050108, 0, 3, 1, 3), + (8050109, 0, 3, 1, 4), + (8050110, 0, 3, 2, 0), + (8050111, 0, 3, 2, 1), + (8050112, 0, 3, 2, 2), + (8050113, 0, 3, 2, 3), + (8050114, 0, 3, 2, 4), + (8050115, 0, 3, 2, 5), + (8050116, 0, 3, 2, 6), + (8050117, 0, 3, 2, 7), + (8050118, 0, 3, 2, 8), + (8050119, 0, 3, 2, 9), + (8050120, 0, 3, 2, 10), + (8050121, 0, 3, 2, 12), + (8050122, 0, 3, 4, 0), + (8050123, 0, 3, 4, 1), + (8050125, 0, 3, 3, 0), + (8050126, 0, 3, 3, 1), + (8050127, 0, 3, 6, 1), + (8050128, 0, 3, 6, 2), + (8050129, 0, 3, 6, 4), + (8050130, 0, 3, 6, 0), + (8050131, 0, 3, 6, 3), + (8050132, 0, 3, 0, 1), + (8050133, 0, 3, 0, 2), + (8050148, 0, 3, 2, 2), + (8050149, 0, 3, 10, 1), + (8050150, 0, 3, 11, 0), + (8050151, 0, 3, 9, 0), + (8050201, 0, 4, 0, 0), + (8050202, 0, 4, 0, 1), + (8050203, 0, 4, 0, 2), + (8050204, 0, 4, 0, 3), + (8050205, 0, 4, 1, 0), + (8050206, 0, 4, 1, 1), + (8050207, 0, 4, 1, 2), + (8050208, 0, 4, 1, 3), + (8050209, 0, 4, 1, 4), + (8050210, 0, 4, 2, 0), + (8050211, 0, 4, 2, 1), + (8050212, 0, 4, 2, 2), + (8050213, 0, 4, 2, 3), + (8050214, 0, 4, 2, 4), + (8050215, 0, 4, 2, 5), + (8050216, 0, 4, 2, 6), + (8050217, 0, 4, 2, 7), + (8050218, 0, 4, 2, 8), + (8050219, 0, 4, 2, 9), + (8050220, 0, 4, 0, 0), + (8050221, 0, 4, 0, 1), + (8050222, 0, 4, 0, 2), + (8050223, 0, 4, 1, 0), + (8050224, 0, 4, 1, 2), + (8050225, 0, 4, 1, 1), + (8050226, 0, 4, 0, 1), + (8050227, 0, 4, 0, 2), + (8050228, 0, 4, 0, 0), + (8050229, 0, 4, 0, 2), + (8050230, 0, 4, 0, 0), + (8050231, 0, 4, 0, 1), + (8050232, 0, 4, 1, 2), + (8050233, 0, 4, 1, 1), + (8050234, 0, 4, 1, 0), + (8050235, 0, 4, 1, 1), + (8050236, 0, 4, 1, 0), + (8050237, 0, 4, 1, 2), + (8050242, 0, 4, 6, 2), + (8050243, 0, 4, 2, 7), + (8050244, 0, 4, 2, 3), + (8050245, 0, 4, 11, 0), + (8050246, 0, 4, 2, 14), + (8050247, 0, 4, 3, 0), + (8050248, 0, 4, 5, 0), + (8050301, 0, 5, 0, 0), + (8050302, 0, 5, 0, 1), + (8050303, 0, 5, 0, 2), + (8050304, 0, 5, 0, 3), + (8050305, 0, 5, 1, 0), + (8050306, 0, 5, 1, 1), + (8050307, 0, 5, 1, 2), + (8050308, 0, 5, 1, 3), + (8050309, 0, 5, 1, 4), + (8050310, 0, 5, 2, 0), + (8050311, 0, 5, 2, 1), + (8050312, 0, 5, 2, 2), + (8050313, 0, 5, 2, 3), + (8050314, 0, 5, 2, 4), + (8050315, 0, 5, 2, 5), + (8050316, 0, 5, 2, 6), + (8050317, 0, 5, 2, 7), + (8050318, 0, 5, 2, 8), + (8050319, 0, 5, 2, 9), + (8050320, 0, 5, 3, 0), + (8050321, 0, 5, 3, 4), + (8050322, 0, 5, 3, 2), + (8050323, 0, 5, 3, 1), + (8050324, 0, 5, 4, 0), + (8050325, 0, 5, 4, 2), + (8050326, 0, 5, 4, 3), + (8050327, 0, 5, 4, 4), + (8050328, 0, 5, 3, 4), + (8050329, 0, 5, 3, 2), + (8050330, 0, 5, 3, 1), + (8050331, 0, 5, 3, 0), + (8050332, 0, 5, 3, 2), + (8050333, 0, 5, 3, 1), + (8050334, 0, 5, 3, 0), + (8050335, 0, 5, 3, 4), + (8050336, 0, 5, 3, 1), + (8050337, 0, 5, 3, 0), + (8050338, 0, 5, 3, 4), + (8050339, 0, 5, 3, 2), + (8050340, 0, 5, 4, 2), + (8050341, 0, 5, 4, 3), + (8050342, 0, 5, 4, 4), + (8050343, 0, 5, 4, 1), + (8050344, 0, 5, 2, 7), + (8050345, 0, 5, 2, 6), + (8050346, 0, 5, 11, 0), + (8050347, 0, 5, 11, 1), + (8050348, 0, 5, 4, 0), + (8050349, 0, 5, 4, 3), + (8050350, 0, 5, 4, 4), + (8050351, 0, 5, 4, 1), + (8050352, 0, 5, 4, 0), + (8050353, 0, 5, 4, 2), + (8050354, 0, 5, 4, 4), + (8050355, 0, 5, 4, 1), + (8050356, 0, 5, 4, 0), + (8050357, 0, 5, 4, 2), + (8050358, 0, 5, 4, 3), + (8050359, 0, 5, 4, 1), + (8050360, 0, 5, 2, 3), + (8050401, 0, 6, 0, 0), + (8050402, 0, 6, 0, 1), + (8050403, 0, 6, 0, 2), + (8050404, 0, 6, 0, 3), + (8050405, 0, 6, 1, 0), + (8050406, 0, 6, 1, 1), + (8050407, 0, 6, 1, 2), + (8050408, 0, 6, 1, 3), + (8050409, 0, 6, 1, 4), + (8050410, 0, 6, 2, 0), + (8050411, 0, 6, 2, 1), + (8050412, 0, 6, 2, 2), + (8050413, 0, 6, 2, 3), + (8050414, 0, 6, 2, 4), + (8050415, 0, 6, 2, 5), + (8050416, 0, 6, 2, 6), + (8050417, 0, 6, 2, 7), + (8050418, 0, 6, 2, 8), + (8050419, 0, 6, 2, 9), + (8050420, 0, 6, 4, 0), + (8050421, 0, 6, 4, 2), + (8050422, 0, 6, 4, 3), + (8050423, 0, 6, 4, 4), + (8050424, 0, 6, 5, 0), + (8050425, 0, 6, 5, 2), + (8050426, 0, 6, 5, 3), + (8050427, 0, 6, 5, 1), + (8050428, 0, 6, 4, 2), + (8050429, 0, 6, 4, 3), + (8050430, 0, 6, 4, 4), + (8050431, 0, 6, 4, 0), + (8050432, 0, 6, 4, 3), + (8050433, 0, 6, 4, 4), + (8050434, 0, 6, 4, 0), + (8050435, 0, 6, 4, 2), + (8050436, 0, 6, 4, 4), + (8050437, 0, 6, 4, 0), + (8050438, 0, 6, 4, 2), + (8050439, 0, 6, 4, 3), + (8050440, 0, 6, 5, 2), + (8050441, 0, 6, 5, 3), + (8050442, 0, 6, 5, 4), + (8050443, 0, 6, 5, 4), + (8050444, 0, 6, 5, 0), + (8050445, 0, 6, 5, 3), + (8050446, 0, 6, 5, 1), + (8050447, 0, 6, 5, 4), + (8050448, 0, 6, 5, 0), + (8050449, 0, 6, 2, 7), + (8050450, 0, 6, 13, 0), + (8050451, 0, 6, 5, 2), + (8050452, 0, 6, 5, 1), + (8050453, 0, 6, 5, 4), + (8050454, 0, 6, 5, 0), + (8050455, 0, 6, 5, 2), + (8050456, 0, 6, 5, 3), + (8050457, 0, 6, 5, 4), + (8050501, 0, 8, 0, 0), + (8050502, 0, 8, 1, 0), + (8050503, 0, 8, 4, 0), + (8050504, 0, 8, 5, 0), + (8050505, 0, 8, 4, 0), + (8050506, 0, 8, 5, 0), + (8050507, 0, 8, 7, 0), + (8050508, 0, 8, 8, 0), + (8050509, 0, 8, 13, 0), + (8050510, 0, 8, 12, 0), + (8050511, 0, 8, 15, 0), + (8050512, 0, 8, 14, 0), + (8050513, 0, 8, 17, 0), + (8050514, 0, 8, 16, 0), + (8050519, 0, 8, 6, 0), + (8050520, 0, 8, 7, 0), + (8050521, 0, 8, 25, 0), + (8050601, 0, 9, 0, 0), + (8050602, 0, 9, 1, 0), + (8050603, 0, 9, 2, 0), + (8050604, 0, 9, 3, 0), + (8050605, 0, 9, 5, 0), + (8050606, 0, 9, 6, 0), + (8050607, 0, 9, 7, 0), + (8050608, 0, 9, 8, 0), + (8050609, 0, 9, 0, 0), + (8050610, 0, 9, 1, 0), + (8050611, 0, 9, 2, 0), + (8050612, 0, 9, 3, 0), + (8050613, 0, 9, 13, 0), + (8050614, 0, 9, 14, 0), + (8050615, 0, 9, 16, 0), + (8050616, 0, 9, 17, 0), + (8050618, 0, 9, 0, 0), + (8050619, 0, 9, 7, 0), + (8050620, 0, 9, 11, 0), + (8050621, 0, 9, 25, 0), + (8050622, 0, 9, 24, 0), + (8050701, 0, 10, 0, 0), + (8050702, 0, 10, 0, 1), + (8050703, 0, 10, 0, 2), + (8050704, 0, 10, 1, 0), + (8050705, 0, 10, 1, 1), + (8050706, 0, 10, 1, 2), + (8050707, 0, 10, 1, 3), + (8050708, 0, 10, 2, 0), + (8050709, 0, 10, 2, 1), + (8050710, 0, 10, 2, 2), + (8050711, 0, 10, 2, 3), + (8050712, 0, 10, 2, 4), + (8050713, 0, 10, 2, 2), + (8050714, 0, 10, 2, 3), + (8050715, 0, 10, 2, 1), + (8050716, 0, 10, 3, 4), + (8050717, 0, 10, 3, 3), + (8050718, 0, 10, 3, 1), + (8050719, 0, 10, 3, 2), + (8050720, 0, 10, 4, 4), + (8050721, 0, 10, 4, 3), + (8050722, 0, 10, 4, 2), + (8050723, 0, 10, 4, 1), + (8050724, 0, 10, 2, 2), + (8050725, 0, 10, 2, 3), + (8050726, 0, 10, 2, 1), + (8050727, 0, 10, 7, 0), + (8050728, 0, 10, 10, 0), + (8050729, 0, 10, 2, 4), + (8050730, 0, 10, 2, 3), + (8050731, 0, 10, 2, 1), + (8050732, 0, 10, 2, 4), + (8050733, 0, 10, 2, 2), + (8050734, 0, 10, 2, 1), + (8050735, 0, 10, 2, 4), + (8050736, 0, 10, 2, 2), + (8050737, 0, 10, 2, 3), + (8050738, 0, 10, 3, 3), + (8050739, 0, 10, 3, 1), + (8050740, 0, 10, 3, 2), + (8050741, 0, 10, 3, 4), + (8050742, 0, 10, 3, 1), + (8050743, 0, 10, 3, 2), + (8050744, 0, 10, 3, 4), + (8050745, 0, 10, 3, 3), + (8050746, 0, 10, 3, 2), + (8050747, 0, 10, 3, 4), + (8050748, 0, 10, 3, 3), + (8050749, 0, 10, 3, 1), + (8050750, 0, 10, 4, 3), + (8050751, 0, 10, 4, 2), + (8050752, 0, 10, 4, 1), + (8050753, 0, 10, 4, 5), + (8050754, 0, 10, 4, 4), + (8050755, 0, 10, 4, 2), + (8050756, 0, 10, 4, 1), + (8050757, 0, 10, 4, 5), + (8050758, 0, 10, 4, 4), + (8050759, 0, 10, 4, 3), + (8050760, 0, 10, 4, 1), + (8050761, 0, 10, 4, 5), + (8050762, 0, 10, 4, 4), + (8050763, 0, 10, 4, 3), + (8050764, 0, 10, 4, 2), + (8050765, 0, 10, 4, 5), + (8050766, 0, 10, 1, 0), + (8050767, 0, 10, 2, 0), + (8050768, 0, 10, 1, 2), + (8050769, 0, 10, 1, 1), + (8050801, 0, 15, 0, 0), + (8050802, 0, 15, 1, 0), + (8050803, 0, 15, 2, 0), + (8050804, 0, 15, 3, 0), + (8050805, 0, 15, 4, 0), + (8050806, 0, 15, 5, 0), + (8050807, 0, 15, 6, 0), + (8050808, 0, 15, 22, 0), + (8050809, 0, 15, 7, 0), + (8050810, 0, 15, 9, 0), + (8050811, 0, 15, 4, 0), + (8050901, 0, 16, 5, 4), + (8050902, 0, 16, 5, 2), + (8050903, 0, 16, 6, 4), + (8050904, 0, 16, 6, 3), + (8050905, 0, 16, 6, 0), + (8050906, 0, 16, 6, 1), + (8050907, 0, 16, 6, 2), + (8050940, 0, 16, 12, 0), + (8051001, 0, 7, 0, 0), + (8051002, 0, 7, 0, 1), + (8051003, 0, 7, 0, 2), + (8051004, 0, 7, 0, 3), + (8051005, 0, 7, 2, 0), + (8051006, 0, 7, 2, 1), + (8051007, 0, 7, 2, 2), + (8051008, 0, 7, 2, 3), + (8051009, 0, 7, 2, 4), + (8051010, 0, 7, 2, 5), + (8051011, 0, 7, 2, 6), + (8051012, 0, 7, 2, 7), + (8051013, 0, 7, 2, 8), + (8051014, 0, 7, 2, 9), + (8051015, 0, 7, 1, 0), + (8051016, 0, 7, 3, 1), + (8051017, 0, 7, 2, 8), + (8051018, 0, 7, 2, 5), + (8051019, 0, 7, 2, 6), + (8051020, 0, 7, 2, 10), + (8051021, 0, 7, 2, 14), + (8051022, 0, 7, 4, 0), + (8051023, 0, 7, 4, 2), + (8051024, 0, 7, 2, 6), + (8051025, 0, 7, 4, 4), + (8051101, 0, 28, 0, 0), + (8051102, 0, 28, 0, 1), + (8051103, 0, 28, 0, 2), + (8051104, 0, 28, 0, 3), + (8051105, 0, 28, 1, 0), + (8051106, 0, 28, 1, 1), + (8051107, 0, 28, 1, 2), + (8051108, 0, 28, 1, 4), + (8051109, 0, 28, 1, 3), + (8051110, 0, 28, 2, 0), + (8051111, 0, 28, 2, 1), + (8051112, 0, 28, 2, 2), + (8051113, 0, 28, 2, 3), + (8051114, 0, 28, 2, 4), + (8051115, 0, 28, 0, 0), + (8051116, 0, 28, 0, 1), + (8051117, 0, 28, 0, 3), + (8051118, 0, 28, 1, 0), + (8051119, 0, 28, 1, 3), + (8051120, 0, 28, 1, 2), + (8051121, 0, 28, 5, 1), + (8051201, 0, 38, 0, 0), + (8051202, 0, 38, 1, 0), + (8051203, 0, 38, 2, 0), + (8051204, 0, 38, 3, 0), + (8051205, 0, 38, 4, 0), + (8051206, 0, 38, 5, 0), + (8051207, 0, 38, 6, 0), + (8051208, 0, 38, 7, 0), + (8051209, 0, 38, 8, 0), + (8051210, 0, 38, 9, 0), + (8051211, 0, 38, 10, 0), + (8051212, 0, 38, 11, 0), + (8051213, 0, 38, 12, 0), + (8051214, 0, 38, 13, 0), + (8051215, 0, 38, 14, 0), + (8051216, 0, 38, 5, 0), + (8051217, 0, 38, 7, 0), + (8051218, 0, 38, 8, 0), + (8051219, 0, 38, 10, 0), + (8051220, 0, 38, 12, 0), + (8051221, 0, 38, 13, 0), + (8051222, 0, 38, 8, 0), + (8051223, 0, 38, 11, 0), + (8051224, 0, 38, 14, 0), + (8051301, 0, 49, 0, 0), + (8051302, 0, 49, 0, 1), + (8051303, 0, 49, 0, 2), + (8051304, 0, 49, 0, 3), + (8051305, 0, 49, 0, 4), + (8051306, 0, 49, 0, 0), + (8051307, 0, 49, 0, 1), + (8051308, 0, 49, 0, 2), + (8051309, 0, 49, 0, 3), + (8051310, 0, 49, 0, 4), + (8051401, 0, 42, 0, 0), + (8051402, 0, 44, 0, 0), + (8051403, 0, 37, 0, 0), + (8051404, 0, 36, 0, 0), + (8051405, 0, 41, 0, 0), + (8051406, 0, 39, 0, 0), + (8051407, 0, 40, 0, 0), + (8051501, 0, 47, 0, 0), + (8051502, 0, 66, 0, 0), + (8051503, 0, 47, 1, 0), + (8051504, 0, 47, 2, 0), + (8051505, 0, 47, 2, 2), + (8051506, 0, 47, 2, 3), + (8051507, 0, 47, 2, 4), + (8051508, 0, 68, 0, 0), + (8051509, 0, 68, 0, 1), + (8051510, 0, 68, 0, 2), + (8051511, 0, 68, 0, 3), + (8051512, 0, 68, 0, 4), + (8051513, 0, 3, 10, 0), + (8051514, 0, 7, 7, 3), + (8051515, 0, 8, 18, 0), + (8051516, 0, 4, 5, 0), + (8051517, 0, 2, 2, 9), + (8051518, 0, 3, 4, 4), + (8051519, 0, 52, 0, 0), + (8051520, 0, 50, 0, 0), + (8051521, 0, 59, 1, 0), + (8051522, 0, 59, 1, 1), + (8051523, 0, 59, 1, 2), + (8051524, 0, 59, 0, 0), + (8051525, 0, 59, 0, 1), + (8051526, 0, 59, 0, 2), + (8060001, 0, 1, 1, 0), + (8060002, 0, 1, 2, 0), + (8060003, 0, 1, 0, 0), + (8060004, 0, 1, 1, 0), + (8060005, 0, 1, 1, 0), + (8060006, 0, 1, 0, 0), + (8060007, 0, 1, 2, 0), + (8060008, 0, 1, 1, 0), + (8060009, 0, 1, 1, 0), + (8060010, 0, 1, 0, 0), + (8060011, 0, 1, 2, 0), + (8060012, 0, 1, 2, 0), + (8060013, 0, 1, 6, 0), + (8060014, 0, 1, 1, 0), + (8060015, 0, 1, 2, 0), + (8070001, 0, 2, 8, 0), + (8070002, 0, 2, 1, 0), + (8070003, 0, 2, 1, 1), + (8070004, 0, 2, 1, 2), + (8070005, 0, 2, 1, 3), + (8070006, 0, 2, 1, 4), + (8070007, 0, 2, 2, 0), + (8070008, 0, 2, 2, 2), + (8070014, 0, 2, 4, 0), + (8070015, 0, 2, 4, 2), + (8070016, 0, 2, 4, 1), + (8070017, 0, 2, 4, 3), + (8070019, 0, 2, 9, 0), + (8070020, 0, 2, 0, 0), + (8070021, 0, 2, 8, 1), + (8070022, 0, 2, 8, 2), + (8070023, 0, 2, 4, 0), + (8070024, 0, 2, 0, 1), + (8070101, 0, 3, 0, 0), + (8070102, 0, 3, 0, 1), + (8070103, 0, 3, 0, 2), + (8070104, 0, 3, 0, 3), + (8070105, 0, 3, 0, 4), + (8070106, 0, 3, 1, 0), + (8070107, 0, 3, 4, 0), + (8070108, 0, 3, 4, 1), + (8070109, 0, 3, 1, 1), + (8070110, 0, 3, 4, 2), + (8070111, 0, 3, 5, 1), + (8070112, 0, 3, 7, 0), + (8070113, 0, 3, 2, 0), + (8070114, 0, 3, 5, 0), + (8070201, 0, 11, 0, 0), + (8070202, 0, 11, 1, 0), + (8070208, 0, 11, 3, 0), + (8070209, 0, 11, 3, 1), + (8070210, 0, 11, 3, 2), + (8070211, 0, 11, 3, 3), + (8070212, 0, 11, 3, 4), + (8070213, 0, 11, 5, 0), + (8070214, 0, 11, 5, 1), + (8070215, 0, 11, 5, 2), + (8070216, 0, 11, 5, 3), + (8070217, 0, 11, 5, 4), + (8070218, 0, 11, 6, 0), + (8070219, 0, 11, 6, 2), + (8070220, 0, 11, 7, 0), + (8070221, 0, 11, 7, 1), + (8070222, 0, 11, 8, 0), + (8070223, 0, 11, 8, 1), + (8070224, 0, 11, 10, 0), + (8070225, 0, 11, 10, 1), + (8070226, 0, 11, 10, 3), + (8070227, 0, 11, 10, 4), + (8070243, 0, 11, 7, 5), + (8070301, 0, 5, 0, 0), + (8070302, 0, 5, 0, 1), + (8070303, 0, 5, 0, 2), + (8070304, 0, 5, 0, 3), + (8070305, 0, 5, 1, 0), + (8070306, 0, 5, 1, 1), + (8070307, 0, 5, 1, 2), + (8070308, 0, 5, 1, 3), + (8070309, 0, 5, 1, 4), + (8070310, 0, 5, 2, 0), + (8070311, 0, 5, 2, 1), + (8070312, 0, 5, 2, 2), + (8070313, 0, 5, 2, 3), + (8070314, 0, 5, 2, 4), + (8070315, 0, 5, 3, 0), + (8070316, 0, 5, 3, 1), + (8070317, 0, 5, 3, 2), + (8070318, 0, 5, 3, 3), + (8070319, 0, 5, 3, 4), + (8070320, 0, 5, 0, 0), + (8070321, 0, 5, 0, 3), + (8070322, 0, 5, 1, 0), + (8070323, 0, 5, 1, 3), + (8070324, 0, 5, 5, 0), + (8070325, 0, 5, 5, 4), + (8070326, 0, 5, 5, 2), + (8070327, 0, 5, 5, 1), + (8070328, 0, 5, 6, 0), + (8070329, 0, 5, 6, 2), + (8070330, 0, 5, 6, 3), + (8070331, 0, 5, 6, 4), + (8070332, 0, 5, 5, 4), + (8070333, 0, 5, 5, 2), + (8070334, 0, 5, 5, 1), + (8070335, 0, 5, 5, 0), + (8070336, 0, 5, 5, 2), + (8070337, 0, 5, 5, 1), + (8070338, 0, 5, 5, 0), + (8070339, 0, 5, 5, 4), + (8070340, 0, 5, 5, 1), + (8070341, 0, 5, 5, 0), + (8070342, 0, 5, 5, 4), + (8070343, 0, 5, 5, 2), + (8070344, 0, 5, 6, 2), + (8070345, 0, 5, 6, 3), + (8070346, 0, 5, 11, 0), + (8070347, 0, 5, 6, 4), + (8070348, 0, 5, 6, 1), + (8070349, 0, 5, 6, 0), + (8070350, 0, 5, 6, 3), + (8070351, 0, 5, 6, 4), + (8070352, 0, 5, 6, 1), + (8070353, 0, 5, 6, 0), + (8070354, 0, 5, 6, 2), + (8070355, 0, 5, 6, 4), + (8070356, 0, 5, 6, 1), + (8070357, 0, 5, 6, 0), + (8070358, 0, 5, 6, 2), + (8070359, 0, 5, 6, 3), + (8070360, 0, 5, 6, 1), + (8070361, 0, 5, 0, 2), + (8070362, 0, 5, 3, 1), + (8070363, 0, 5, 2, 3), + (8070401, 0, 6, 10, 0), + (8070402, 0, 6, 0, 0), + (8070403, 0, 6, 0, 1), + (8070404, 0, 6, 0, 2), + (8070405, 0, 6, 0, 3), + (8070406, 0, 6, 2, 0), + (8070407, 0, 6, 2, 1), + (8070408, 0, 6, 2, 2), + (8070409, 0, 6, 2, 3), + (8070410, 0, 6, 2, 4), + (8070411, 0, 6, 2, 10), + (8070412, 0, 6, 2, 11), + (8070413, 0, 6, 2, 12), + (8070414, 0, 6, 2, 13), + (8070415, 0, 6, 2, 14), + (8070416, 0, 6, 0, 0), + (8070417, 0, 6, 0, 3), + (8070418, 0, 6, 2, 0), + (8070419, 0, 6, 2, 2), + (8070420, 0, 6, 5, 0), + (8070421, 0, 6, 5, 2), + (8070422, 0, 6, 5, 3), + (8070423, 0, 6, 5, 4), + (8070424, 0, 6, 6, 0), + (8070425, 0, 6, 6, 3), + (8070426, 0, 6, 6, 1), + (8070427, 0, 6, 6, 2), + (8070428, 0, 6, 5, 2), + (8070429, 0, 6, 5, 3), + (8070430, 0, 6, 5, 4), + (8070431, 0, 6, 5, 0), + (8070432, 0, 6, 5, 3), + (8070433, 0, 6, 5, 4), + (8070434, 0, 6, 5, 0), + (8070435, 0, 6, 5, 2), + (8070436, 0, 6, 5, 4), + (8070437, 0, 6, 5, 0), + (8070438, 0, 6, 5, 2), + (8070439, 0, 6, 5, 3), + (8070440, 0, 6, 6, 3), + (8070441, 0, 6, 6, 1), + (8070442, 0, 6, 6, 2), + (8070443, 0, 6, 6, 4), + (8070444, 0, 6, 6, 0), + (8070445, 0, 6, 6, 1), + (8070446, 0, 6, 6, 2), + (8070447, 0, 6, 6, 4), + (8070448, 0, 6, 6, 0), + (8070449, 0, 6, 6, 3), + (8070450, 0, 6, 6, 2), + (8070451, 0, 6, 6, 4), + (8070452, 0, 6, 6, 0), + (8070453, 0, 6, 6, 3), + (8070454, 0, 6, 6, 1), + (8070455, 0, 6, 6, 4), + (8070501, 0, 10, 0, 0), + (8070502, 0, 10, 2, 0), + (8070503, 0, 10, 3, 0), + (8070504, 0, 10, 3, 1), + (8070505, 0, 10, 3, 2), + (8070506, 0, 10, 3, 3), + (8070507, 0, 10, 4, 0), + (8070508, 0, 10, 4, 1), + (8070509, 0, 10, 4, 2), + (8070510, 0, 10, 4, 3), + (8070511, 0, 10, 13, 0), + (8070512, 0, 10, 11, 1), + (8070513, 0, 10, 10, 1), + (8070514, 0, 10, 3, 0), + (8070515, 0, 10, 3, 1), + (8070516, 0, 10, 3, 3), + (8070517, 0, 10, 5, 0), + (8070518, 0, 10, 5, 1), + (8070519, 0, 10, 5, 3), + (8070520, 0, 10, 6, 0), + (8070521, 0, 10, 6, 2), + (8070522, 0, 10, 6, 1), + (8070523, 0, 10, 7, 0), + (8070524, 0, 10, 7, 2), + (8070525, 0, 10, 7, 1), + (8070526, 0, 10, 11, 0), + (8070527, 0, 10, 3, 1), + (8070528, 0, 10, 3, 3), + (8070529, 0, 10, 3, 0), + (8070530, 0, 10, 3, 3), + (8070531, 0, 10, 3, 0), + (8070532, 0, 10, 3, 1), + (8070533, 0, 10, 5, 1), + (8070534, 0, 10, 5, 3), + (8070535, 0, 10, 5, 0), + (8070536, 0, 10, 5, 3), + (8070537, 0, 10, 5, 0), + (8070538, 0, 10, 5, 1), + (8070539, 0, 10, 6, 2), + (8070540, 0, 10, 6, 1), + (8070541, 0, 10, 6, 0), + (8070542, 0, 10, 6, 1), + (8070543, 0, 10, 6, 0), + (8070544, 0, 10, 6, 2), + (8070545, 0, 10, 7, 2), + (8070546, 0, 10, 7, 1), + (8070547, 0, 10, 7, 3), + (8070548, 0, 10, 7, 0), + (8070549, 0, 10, 7, 1), + (8070550, 0, 10, 7, 3), + (8070551, 0, 10, 7, 0), + (8070552, 0, 10, 7, 2), + (8070553, 0, 10, 7, 3), + (8070601, 0, 8, 0, 0), + (8070602, 0, 8, 0, 1), + (8070603, 0, 8, 2, 0), + (8070604, 0, 8, 5, 0), + (8070605, 0, 8, 3, 0), + (8070606, 0, 8, 0, 0), + (8070607, 0, 8, 0, 1), + (8070608, 0, 8, 6, 0), + (8070609, 0, 8, 8, 0), + (8070610, 0, 8, 9, 0), + (8070701, 0, 9, 0, 0), + (8070702, 0, 9, 0, 1), + (8070703, 0, 9, 0, 2), + (8070704, 0, 9, 1, 0), + (8070705, 0, 9, 1, 1), + (8070706, 0, 9, 1, 2), + (8070707, 0, 9, 1, 3), + (8070708, 0, 9, 1, 4), + (8070709, 0, 9, 2, 0), + (8070710, 0, 9, 2, 1), + (8070711, 0, 9, 2, 2), + (8070712, 0, 9, 2, 3), + (8070713, 0, 9, 2, 4), + (8070714, 0, 9, 3, 5), + (8070715, 0, 9, 3, 6), + (8070716, 0, 9, 3, 7), + (8070717, 0, 9, 3, 8), + (8070718, 0, 9, 3, 9), + (8070719, 0, 9, 6, 0), + (8070720, 0, 9, 5, 0), + (8070721, 0, 9, 5, 2), + (8070722, 0, 9, 7, 0), + (8070723, 0, 9, 7, 2), + (8070724, 0, 9, 1, 3), + (8070725, 0, 9, 2, 3), + (8070801, 0, 13, 0, 0), + (8070802, 0, 13, 0, 1), + (8070803, 0, 13, 1, 0), + (8070804, 0, 13, 2, 0), + (8070805, 0, 13, 5, 0), + (8070806, 0, 13, 11, 0), + (8070807, 0, 13, 0, 0), + (8070808, 0, 13, 0, 1), + (8070809, 0, 13, 2, 0), + (8070810, 0, 13, 4, 0), + (8070811, 0, 13, 8, 0), + (8070901, 0, 14, 0, 0), + (8070902, 0, 14, 1, 0), + (8070903, 0, 14, 2, 0), + (8070904, 0, 14, 2, 1), + (8070905, 0, 14, 2, 2), + (8070906, 0, 14, 2, 3), + (8070907, 0, 14, 6, 0), + (8070908, 0, 14, 6, 1), + (8070909, 0, 14, 6, 2), + (8070910, 0, 14, 6, 3), + (8070911, 0, 14, 2, 0), + (8070912, 0, 14, 2, 2), + (8070913, 0, 14, 6, 2), + (8070914, 0, 14, 6, 0), + (8070915, 0, 14, 7, 0), + (8071001, 0, 25, 0, 0), + (8071002, 0, 25, 0, 1), + (8071003, 0, 25, 0, 2), + (8071004, 0, 25, 1, 0), + (8071005, 0, 25, 1, 1), + (8071006, 0, 25, 2, 0), + (8071007, 0, 25, 2, 1), + (8071008, 0, 25, 2, 2), + (8071009, 0, 25, 2, 3), + (8071010, 0, 25, 2, 4), + (8071011, 0, 25, 3, 0), + (8071012, 0, 25, 3, 1), + (8071013, 0, 25, 0, 0), + (8071014, 0, 25, 0, 1), + (8071015, 0, 25, 1, 0), + (8071016, 0, 25, 1, 1), + (8071017, 0, 25, 0, 2), + (8071018, 0, 25, 2, 1), + (8071101, 0, 38, 0, 0), + (8071102, 0, 38, 0, 1), + (8071103, 0, 38, 0, 2), + (8071104, 0, 38, 0, 3), + (8071105, 0, 38, 0, 4), + (8071106, 0, 38, 0, 5), + (8071107, 0, 38, 0, 6), + (8071108, 0, 38, 0, 7), + (8071109, 0, 38, 0, 8), + (8071110, 0, 38, 0, 9), + (8071111, 0, 38, 0, 10), + (8071112, 0, 38, 0, 11), + (8071113, 0, 38, 0, 12), + (8071114, 0, 38, 0, 13), + (8071115, 0, 38, 0, 14), + (8071116, 0, 38, 0, 5), + (8071117, 0, 38, 0, 7), + (8071118, 0, 38, 0, 8), + (8071119, 0, 38, 0, 10), + (8071120, 0, 38, 0, 12), + (8071121, 0, 38, 0, 13), + (8071122, 0, 38, 0, 11), + (8071123, 0, 38, 0, 14), + (8071201, 0, 7, 1, 0), + (8071202, 0, 7, 3, 0), + (8071203, 0, 7, 3, 4), + (8071204, 0, 7, 6, 0), + (8071205, 0, 7, 6, 2), + (8071206, 0, 7, 7, 0), + (8071207, 0, 7, 8, 0), + (8071208, 0, 7, 9, 0), + (8071209, 0, 7, 10, 0), + (8071210, 0, 7, 11, 0), + (8071211, 0, 7, 12, 0), + (8071212, 0, 7, 3, 2), + (8071301, 0, 45, 0, 0), + (8071302, 0, 45, 0, 1), + (8071303, 0, 45, 0, 2), + (8071304, 0, 45, 0, 3), + (8071305, 0, 45, 0, 4), + (8071306, 0, 45, 0, 5), + (8071401, 0, 42, 0, 0), + (8071402, 0, 44, 0, 0), + (8071403, 0, 37, 0, 0), + (8071404, 0, 36, 0, 0), + (8071405, 0, 41, 0, 0), + (8071406, 0, 39, 0, 0), + (8071407, 0, 40, 0, 0), + (8071501, 0, 47, 0, 0), + (8071502, 0, 64, 0, 0), + (8071503, 0, 65, 0, 0), + (8071504, 0, 66, 0, 0), + (8071505, 0, 47, 1, 0), + (8071506, 0, 47, 2, 0), + (8071507, 0, 47, 2, 2), + (8071508, 0, 47, 2, 3), + (8071509, 0, 47, 2, 4), + (8071510, 0, 68, 0, 0), + (8071511, 0, 68, 0, 1), + (8071512, 0, 68, 0, 2), + (8071513, 0, 68, 0, 3), + (8071514, 0, 68, 0, 4), + (8071515, 0, 69, 0, 2), + (8071516, 0, 69, 0, 1), + (8071517, 0, 69, 0, 0), + (8071518, 0, 69, 0, 3), + (8071519, 0, 69, 0, 4), + (8071520, 0, 13, 8, 1), + (8071521, 0, 38, 6, 0), + (8071522, 0, 13, 8, 3), + (8071523, 0, 38, 6, 1), + (8071524, 0, 13, 8, 2), + (8071525, 0, 38, 6, 2), + (8071526, 0, 7, 9, 0), + (8071527, 0, 3, 6, 0), + (8071528, 0, 8, 10, 0), + (8080001, 0, 2, 6, 0), + (8080002, 0, 2, 6, 1), + (8080003, 0, 2, 6, 2), + (8080004, 0, 2, 6, 3), + (8080005, 0, 2, 6, 4), + (8080006, 0, 2, 1, 0), + (8080008, 0, 2, 1, 2), + (8080009, 0, 2, 2, 1), + (8080010, 0, 2, 2, 3), + (8080011, 0, 2, 2, 0), + (8080012, 0, 2, 2, 2), + (8080015, 0, 2, 6, 1), + (8080016, 0, 2, 8, 0), + (8080017, 0, 2, 7, 0), + (8080018, 0, 2, 0, 1), + (8080019, 0, 2, 2, 0), + (8080020, 0, 2, 3, 0), + (8080101, 0, 3, 0, 0), + (8080102, 0, 3, 0, 1), + (8080103, 0, 3, 0, 2), + (8080104, 0, 3, 0, 3), + (8080105, 0, 3, 0, 4), + (8080106, 0, 3, 1, 0), + (8080107, 0, 3, 4, 0), + (8080108, 0, 3, 4, 1), + (8080109, 0, 3, 1, 1), + (8080110, 0, 3, 4, 2), + (8080111, 0, 3, 5, 1), + (8080112, 0, 3, 7, 0), + (8080113, 0, 3, 2, 0), + (8080114, 0, 3, 5, 0), + (8080115, 0, 3, 0, 0), + (8080116, 0, 3, 1, 0), + (8080117, 0, 3, 6, 0), + (8080118, 0, 3, 6, 1), + (8080201, 0, 4, 0, 0), + (8080202, 0, 4, 0, 1), + (8080203, 0, 4, 0, 2), + (8080204, 0, 4, 0, 3), + (8080205, 0, 4, 1, 0), + (8080206, 0, 4, 1, 1), + (8080207, 0, 4, 1, 2), + (8080208, 0, 4, 1, 3), + (8080209, 0, 4, 1, 4), + (8080210, 0, 4, 2, 0), + (8080211, 0, 4, 2, 1), + (8080212, 0, 4, 2, 2), + (8080213, 0, 4, 2, 3), + (8080214, 0, 4, 2, 4), + (8080215, 0, 4, 3, 0), + (8080216, 0, 4, 3, 1), + (8080217, 0, 4, 3, 2), + (8080218, 0, 4, 3, 3), + (8080219, 0, 4, 3, 4), + (8080220, 0, 4, 0, 0), + (8080221, 0, 4, 0, 1), + (8080222, 0, 4, 0, 3), + (8080223, 0, 4, 0, 2), + (8080224, 0, 4, 1, 0), + (8080225, 0, 4, 1, 2), + (8080226, 0, 4, 1, 4), + (8080227, 0, 4, 1, 3), + (8080228, 0, 4, 0, 1), + (8080229, 0, 4, 0, 3), + (8080230, 0, 4, 0, 2), + (8080231, 0, 4, 0, 0), + (8080232, 0, 4, 0, 3), + (8080233, 0, 4, 0, 2), + (8080234, 0, 4, 0, 0), + (8080235, 0, 4, 0, 1), + (8080236, 0, 4, 1, 2), + (8080237, 0, 4, 1, 4), + (8080238, 0, 4, 1, 3), + (8080239, 0, 4, 1, 0), + (8080240, 0, 4, 1, 4), + (8080241, 0, 4, 1, 3), + (8080242, 0, 4, 1, 0), + (8080243, 0, 4, 1, 2), + (8080245, 0, 4, 2, 0), + (8080246, 0, 4, 10, 0), + (8080247, 0, 4, 2, 3), + (8080301, 0, 5, 0, 0), + (8080302, 0, 5, 0, 1), + (8080303, 0, 5, 0, 2), + (8080304, 0, 5, 0, 3), + (8080305, 0, 5, 1, 0), + (8080306, 0, 5, 1, 1), + (8080307, 0, 5, 1, 2), + (8080308, 0, 5, 1, 3), + (8080309, 0, 5, 1, 4), + (8080310, 0, 5, 2, 0), + (8080311, 0, 5, 2, 1), + (8080312, 0, 5, 2, 2), + (8080313, 0, 5, 2, 3), + (8080314, 0, 5, 2, 4), + (8080315, 0, 5, 3, 0), + (8080316, 0, 5, 3, 1), + (8080317, 0, 5, 3, 2), + (8080318, 0, 5, 3, 3), + (8080319, 0, 5, 3, 4), + (8080320, 0, 5, 6, 0), + (8080321, 0, 5, 6, 4), + (8080322, 0, 5, 6, 2), + (8080323, 0, 5, 6, 1), + (8080324, 0, 5, 7, 0), + (8080325, 0, 5, 7, 2), + (8080326, 0, 5, 7, 3), + (8080327, 0, 5, 7, 4), + (8080328, 0, 5, 6, 4), + (8080329, 0, 5, 6, 2), + (8080330, 0, 5, 6, 1), + (8080331, 0, 5, 6, 0), + (8080332, 0, 5, 6, 2), + (8080333, 0, 5, 6, 1), + (8080334, 0, 5, 6, 0), + (8080335, 0, 5, 6, 4), + (8080336, 0, 5, 6, 1), + (8080337, 0, 5, 6, 0), + (8080338, 0, 5, 6, 4), + (8080339, 0, 5, 6, 2), + (8080340, 0, 5, 7, 2), + (8080341, 0, 5, 7, 3), + (8080342, 0, 5, 7, 4), + (8080343, 0, 5, 7, 1), + (8080344, 0, 5, 7, 0), + (8080345, 0, 5, 7, 3), + (8080346, 0, 5, 12, 0), + (8080347, 0, 5, 12, 1), + (8080348, 0, 5, 10, 5), + (8080349, 0, 5, 2, 3), + (8080350, 0, 5, 7, 4), + (8080351, 0, 5, 7, 1), + (8080352, 0, 5, 7, 0), + (8080353, 0, 5, 7, 2), + (8080354, 0, 5, 7, 4), + (8080355, 0, 5, 7, 1), + (8080356, 0, 5, 7, 0), + (8080357, 0, 5, 7, 2), + (8080358, 0, 5, 7, 3), + (8080359, 0, 5, 7, 1), + (8080360, 0, 5, 2, 3), + (8080401, 0, 6, 0, 0), + (8080402, 0, 6, 0, 1), + (8080403, 0, 6, 0, 2), + (8080404, 0, 6, 0, 3), + (8080405, 0, 6, 1, 0), + (8080406, 0, 6, 1, 1), + (8080407, 0, 6, 1, 2), + (8080408, 0, 6, 1, 3), + (8080409, 0, 6, 1, 4), + (8080410, 0, 6, 2, 0), + (8080411, 0, 6, 2, 1), + (8080412, 0, 6, 2, 2), + (8080413, 0, 6, 2, 3), + (8080414, 0, 6, 2, 4), + (8080415, 0, 6, 2, 5), + (8080416, 0, 6, 2, 6), + (8080417, 0, 6, 2, 7), + (8080418, 0, 6, 2, 8), + (8080419, 0, 6, 2, 9), + (8080420, 0, 6, 3, 0), + (8080421, 0, 6, 3, 1), + (8080422, 0, 6, 3, 2), + (8080423, 0, 6, 3, 3), + (8080424, 0, 6, 3, 4), + (8080425, 0, 6, 12, 1), + (8080426, 0, 6, 12, 0), + (8080427, 0, 6, 6, 0), + (8080428, 0, 6, 6, 2), + (8080429, 0, 6, 6, 4), + (8080430, 0, 6, 6, 1), + (8080431, 0, 6, 5, 0), + (8080432, 0, 6, 5, 2), + (8080433, 0, 6, 5, 3), + (8080434, 0, 6, 5, 1), + (8080435, 0, 6, 6, 2), + (8080436, 0, 6, 6, 4), + (8080437, 0, 6, 6, 1), + (8080438, 0, 6, 6, 0), + (8080439, 0, 6, 6, 4), + (8080440, 0, 6, 6, 1), + (8080441, 0, 6, 6, 0), + (8080442, 0, 6, 6, 2), + (8080443, 0, 6, 6, 1), + (8080444, 0, 6, 6, 0), + (8080445, 0, 6, 6, 2), + (8080446, 0, 6, 6, 4), + (8080447, 0, 6, 5, 2), + (8080448, 0, 6, 5, 3), + (8080449, 0, 6, 5, 1), + (8080450, 0, 6, 5, 4), + (8080451, 0, 6, 5, 0), + (8080452, 0, 6, 5, 3), + (8080453, 0, 6, 5, 1), + (8080454, 0, 6, 5, 4), + (8080455, 0, 6, 5, 0), + (8080456, 0, 6, 5, 2), + (8080457, 0, 6, 5, 1), + (8080458, 0, 6, 5, 4), + (8080459, 0, 6, 5, 0), + (8080460, 0, 6, 5, 2), + (8080461, 0, 6, 5, 3), + (8080462, 0, 6, 5, 4), + (8080501, 0, 10, 13, 0), + (8080502, 0, 10, 0, 0), + (8080503, 0, 10, 2, 0), + (8080504, 0, 10, 3, 0), + (8080505, 0, 10, 3, 1), + (8080506, 0, 10, 3, 2), + (8080507, 0, 10, 3, 3), + (8080508, 0, 10, 4, 0), + (8080509, 0, 10, 4, 1), + (8080510, 0, 10, 4, 2), + (8080511, 0, 10, 4, 3), + (8080512, 0, 10, 9, 4), + (8080513, 0, 10, 0, 0), + (8080514, 0, 10, 2, 1), + (8080515, 0, 10, 2, 3), + (8080516, 0, 10, 2, 2), + (8080517, 0, 10, 5, 0), + (8080518, 0, 10, 5, 1), + (8080519, 0, 10, 5, 3), + (8080520, 0, 10, 5, 2), + (8080521, 0, 10, 6, 0), + (8080522, 0, 10, 6, 2), + (8080523, 0, 10, 6, 1), + (8080524, 0, 10, 6, 3), + (8080525, 0, 10, 11, 0), + (8080526, 0, 10, 2, 1), + (8080527, 0, 10, 2, 3), + (8080528, 0, 10, 2, 2), + (8080529, 0, 10, 2, 0), + (8080530, 0, 10, 2, 3), + (8080531, 0, 10, 2, 2), + (8080532, 0, 10, 2, 0), + (8080533, 0, 10, 2, 1), + (8080534, 0, 10, 2, 2), + (8080535, 0, 10, 2, 0), + (8080536, 0, 10, 2, 1), + (8080537, 0, 10, 2, 3), + (8080538, 0, 10, 5, 1), + (8080539, 0, 10, 5, 3), + (8080540, 0, 10, 5, 2), + (8080541, 0, 10, 5, 0), + (8080542, 0, 10, 5, 3), + (8080543, 0, 10, 5, 2), + (8080544, 0, 10, 5, 0), + (8080545, 0, 10, 5, 1), + (8080546, 0, 10, 5, 2), + (8080547, 0, 10, 5, 0), + (8080548, 0, 10, 5, 1), + (8080549, 0, 10, 5, 3), + (8080550, 0, 10, 6, 2), + (8080551, 0, 10, 6, 1), + (8080552, 0, 10, 6, 3), + (8080553, 0, 10, 6, 0), + (8080554, 0, 10, 6, 1), + (8080555, 0, 10, 6, 3), + (8080556, 0, 10, 6, 0), + (8080557, 0, 10, 6, 2), + (8080558, 0, 10, 6, 3), + (8080559, 0, 10, 6, 0), + (8080560, 0, 10, 6, 2), + (8080561, 0, 10, 6, 1), + (8080562, 0, 10, 0, 0), + (8080563, 0, 10, 2, 0), + (8080564, 0, 10, 4, 3), + (8080565, 0, 10, 4, 1), + (8080601, 0, 25, 7, 0), + (8080602, 0, 25, 7, 1), + (8080603, 0, 25, 0, 0), + (8080604, 0, 25, 0, 1), + (8080605, 0, 25, 0, 2), + (8080606, 0, 25, 1, 0), + (8080607, 0, 25, 1, 1), + (8080608, 0, 25, 2, 0), + (8080609, 0, 25, 2, 1), + (8080610, 0, 25, 2, 2), + (8080611, 0, 25, 2, 3), + (8080612, 0, 25, 2, 4), + (8080613, 0, 25, 3, 0), + (8080614, 0, 25, 3, 1), + (8080615, 0, 25, 0, 0), + (8080616, 0, 25, 0, 1), + (8080617, 0, 25, 1, 0), + (8080618, 0, 25, 1, 1), + (8080701, 0, 9, 0, 0), + (8080702, 0, 9, 1, 0), + (8080703, 0, 9, 2, 0), + (8080704, 0, 9, 5, 0), + (8080705, 0, 9, 5, 1), + (8080706, 0, 9, 5, 2), + (8080707, 0, 9, 5, 3), + (8080708, 0, 9, 5, 4), + (8080709, 0, 9, 13, 0), + (8080710, 0, 9, 6, 0), + (8080711, 0, 9, 6, 4), + (8080712, 0, 9, 8, 5), + (8080713, 0, 9, 8, 6), + (8080714, 0, 9, 3, 0), + (8080715, 0, 9, 0, 0), + (8080716, 0, 9, 3, 4), + (8080717, 0, 9, 9, 0), + (8080801, 0, 21, 0, 0), + (8080802, 0, 21, 0, 1), + (8080803, 0, 21, 0, 2), + (8080804, 0, 21, 1, 0), + (8080805, 0, 21, 1, 1), + (8080806, 0, 21, 4, 0), + (8080807, 0, 21, 4, 1), + (8080808, 0, 21, 4, 2), + (8080809, 0, 21, 4, 3), + (8080810, 0, 21, 4, 4), + (8080811, 0, 21, 4, 5), + (8080812, 0, 21, 4, 6), + (8080813, 0, 21, 4, 7), + (8080814, 0, 21, 4, 8), + (8080815, 0, 21, 4, 9), + (8080816, 0, 21, 12, 0), + (8080817, 0, 21, 2, 1), + (8080818, 0, 21, 7, 0), + (8080819, 0, 21, 4, 10), + (8080820, 0, 21, 4, 11), + (8080821, 0, 21, 4, 15), + (8080822, 0, 21, 4, 16), + (8080823, 0, 21, 6, 1), + (8080824, 0, 21, 6, 3), + (8080825, 0, 21, 9, 0), + (8080826, 0, 21, 10, 0), + (8080827, 0, 21, 10, 1), + (8080901, 0, 1, 0, 0), + (8080902, 0, 1, 0, 1), + (8080903, 0, 1, 1, 0), + (8080904, 0, 1, 1, 1), + (8080905, 0, 1, 1, 2), + (8080906, 0, 1, 1, 3), + (8080907, 0, 1, 1, 4), + (8081001, 0, 8, 0, 0), + (8081002, 0, 8, 0, 1), + (8081003, 0, 8, 0, 2), + (8081004, 0, 8, 1, 0), + (8081005, 0, 8, 1, 1), + (8081006, 0, 8, 2, 0), + (8081007, 0, 8, 2, 1), + (8081008, 0, 8, 2, 2), + (8081009, 0, 8, 2, 3), + (8081010, 0, 8, 2, 4), + (8081011, 0, 8, 2, 5), + (8081012, 0, 8, 2, 6), + (8081013, 0, 8, 2, 7), + (8081014, 0, 8, 2, 8), + (8081015, 0, 8, 2, 9), + (8081016, 0, 8, 1, 0), + (8081017, 0, 8, 1, 1), + (8081018, 0, 8, 7, 2), + (8081019, 0, 8, 7, 4), + (8081020, 0, 8, 8, 0), + (8081021, 0, 8, 8, 1), + (8081022, 0, 8, 9, 0), + (8081023, 0, 8, 9, 1), + (8081101, 0, 13, 0, 0), + (8081102, 0, 13, 0, 1), + (8081103, 0, 13, 0, 2), + (8081104, 0, 13, 0, 3), + (8081105, 0, 13, 1, 0), + (8081106, 0, 13, 1, 1), + (8081107, 0, 13, 1, 2), + (8081108, 0, 13, 2, 0), + (8081109, 0, 13, 2, 1), + (8081110, 0, 13, 2, 2), + (8081111, 0, 13, 2, 3), + (8081112, 0, 13, 2, 4), + (8081113, 0, 13, 5, 0), + (8081114, 0, 13, 5, 1), + (8081115, 0, 13, 5, 2), + (8081116, 0, 13, 5, 3), + (8081117, 0, 13, 4, 0), + (8081118, 0, 13, 0, 2), + (8081119, 0, 13, 0, 3), + (8081120, 0, 13, 2, 0), + (8081121, 0, 13, 2, 1), + (8081122, 0, 13, 6, 3), + (8081123, 0, 13, 0, 2), + (8081124, 0, 13, 1, 0), + (8081201, 0, 15, 0, 0), + (8081202, 0, 15, 1, 0), + (8081203, 0, 15, 2, 0), + (8081204, 0, 15, 2, 1), + (8081205, 0, 15, 2, 2), + (8081206, 0, 15, 2, 3), + (8081207, 0, 15, 2, 4), + (8081208, 0, 15, 16, 0), + (8081209, 0, 15, 12, 0), + (8081210, 0, 15, 4, 0), + (8081211, 0, 15, 4, 2), + (8081212, 0, 15, 5, 0), + (8081213, 0, 15, 5, 3), + (8081301, 0, 28, 0, 0), + (8081302, 0, 28, 0, 2), + (8081303, 0, 28, 0, 1), + (8081304, 0, 28, 1, 0), + (8081305, 0, 28, 1, 1), + (8081306, 0, 28, 5, 0), + (8081307, 0, 28, 2, 0), + (8081308, 0, 28, 2, 1), + (8081309, 0, 28, 2, 3), + (8081310, 0, 28, 2, 2), + (8081311, 0, 28, 1, 0), + (8081312, 0, 28, 1, 1), + (8081401, 0, 35, 0, 1), + (8081402, 0, 35, 0, 0), + (8081403, 0, 35, 0, 2), + (8081404, 0, 35, 0, 0), + (8081501, 0, 53, 0, 0), + (8081601, 0, 38, 0, 0), + (8081602, 0, 38, 0, 1), + (8081603, 0, 38, 0, 2), + (8081604, 0, 38, 0, 3), + (8081605, 0, 38, 0, 4), + (8081606, 0, 38, 0, 5), + (8081607, 0, 38, 0, 6), + (8081608, 0, 38, 0, 7), + (8081609, 0, 38, 0, 8), + (8081610, 0, 38, 0, 9), + (8081611, 0, 38, 0, 10), + (8081612, 0, 38, 0, 11), + (8081613, 0, 38, 0, 12), + (8081614, 0, 38, 0, 13), + (8081615, 0, 38, 0, 14), + (8081616, 0, 38, 0, 0), + (8081617, 0, 38, 0, 7), + (8081618, 0, 38, 0, 8), + (8081619, 0, 38, 0, 10), + (8081620, 0, 38, 0, 12), + (8081621, 0, 38, 0, 13), + (8081622, 0, 38, 0, 11), + (8081623, 0, 38, 0, 14), + (8081701, 0, 45, 0, 0), + (8081702, 0, 45, 0, 1), + (8081703, 0, 45, 0, 2), + (8081704, 0, 45, 0, 3), + (8081705, 0, 45, 0, 4), + (8081706, 0, 45, 0, 5), + (8081801, 0, 42, 0, 0), + (8081802, 0, 44, 0, 0), + (8081803, 0, 37, 0, 0), + (8081804, 0, 36, 0, 0), + (8081805, 0, 41, 0, 0), + (8081806, 0, 39, 0, 0), + (8081807, 0, 40, 0, 0), + (8081901, 0, 64, 0, 0), + (8081902, 0, 65, 0, 0), + (8081903, 0, 66, 0, 0), + (8081904, 0, 68, 0, 0), + (8081905, 0, 68, 0, 1), + (8081906, 0, 68, 0, 2), + (8081907, 0, 68, 0, 3), + (8081908, 0, 68, 0, 4), + (8081909, 0, 69, 0, 0), + (8081910, 0, 69, 0, 1), + (8081911, 0, 69, 0, 2), + (8081912, 0, 69, 0, 3), + (8081913, 0, 69, 0, 4), + (8081914, 0, 21, 4, 14), + (8081915, 0, 21, 4, 12), + (8081916, 0, 21, 4, 11), + (8081917, 0, 4, 8, 3), + (8081918, 0, 3, 6, 0), + (8081919, 0, 8, 6, 0), + (8081920, 0, 5, 10, 2), + (8081921, 0, 59, 1, 0), + (8081922, 0, 59, 0, 0), + (8090001, 0, 2, 0, 0), + (8090002, 0, 120, 0, 0), + (8090003, 0, 121, 0, 0), + (8090004, 0, 122, 0, 0), + (8090005, 0, 123, 0, 0), + (8090006, 0, 124, 0, 0), + (8090007, 0, 2, 0, 0), + (8090008, 0, 123, 0, 0), + (8090009, 0, 122, 0, 0), + (8090101, 0, 130, 0, 0), + (8090102, 0, 131, 0, 0), + (8090103, 0, 134, 0, 0), + (8090104, 0, 135, 0, 0), + (8090105, 0, 3, 0, 0), + (8090106, 0, 138, 0, 0), + (8090107, 0, 132, 0, 0), + (8090108, 0, 130, 0, 0), + (8090201, 0, 4, 0, 0), + (8090202, 0, 140, 0, 0), + (8090203, 0, 141, 0, 0), + (8090204, 0, 142, 0, 0), + (8090205, 0, 143, 0, 0), + (8090206, 0, 144, 0, 0), + (8090207, 0, 145, 0, 0), + (8090208, 0, 4, 0, 0), + (8090301, 0, 6, 0, 0), + (8090302, 0, 160, 0, 0), + (8090303, 0, 161, 0, 0), + (8090304, 0, 162, 0, 0), + (8090305, 0, 163, 0, 0), + (8090306, 0, 164, 0, 0), + (8090307, 0, 160, 0, 0), + (8090401, 0, 7, 0, 0), + (8090402, 0, 7, 0, 0), + (8090403, 0, 171, 0, 0), + (8090404, 0, 172, 0, 0), + (8090405, 0, 171, 0, 0), + (8090406, 0, 172, 0, 0), + (8090407, 0, 170, 0, 0), + (8090408, 0, 174, 0, 0), + (8090501, 0, 8, 0, 0), + (8090502, 0, 180, 0, 0), + (8090503, 0, 8, 0, 0), + (8090504, 0, 181, 0, 0), + (8090505, 0, 183, 0, 0), + (8090506, 0, 180, 0, 0), + (8090507, 0, 182, 0, 0), + (8090601, 0, 9, 0, 0), + (8090602, 0, 190, 0, 0), + (8090603, 0, 191, 0, 0), + (8090604, 0, 192, 0, 0), + (8090605, 0, 193, 0, 0), + (8090606, 0, 194, 0, 0), + (8090607, 0, 195, 0, 0), + (8090608, 0, 190, 0, 0), + (8090609, 0, 192, 0, 0), + (8090701, 0, 10, 0, 0), + (8090702, 0, 200, 0, 0), + (8090703, 0, 201, 0, 0), + (8090704, 0, 10, 0, 0), + (8090705, 0, 200, 0, 0), + (8090706, 0, 200, 0, 0), + (8090707, 0, 201, 0, 0), + (8090708, 0, 10, 0, 0), + (8090709, 0, 200, 0, 0), + (8090801, 0, 210, 0, 0), + (8090802, 0, 211, 0, 0), + (8090803, 0, 214, 0, 0), + (8090804, 0, 213, 0, 0), + (8090807, 0, 215, 0, 0), + (8090901, 0, 14, 0, 0), + (8090902, 0, 243, 0, 0), + (8090903, 0, 244, 0, 0), + (8090904, 0, 240, 0, 0), + (8090905, 0, 243, 0, 0), + (8090906, 0, 244, 0, 0), + (8090907, 0, 14, 0, 0), + (8090908, 0, 240, 0, 0), + (8091001, 0, 23, 0, 0), + (8091002, 0, 330, 0, 0), + (8091003, 0, 331, 0, 0), + (8091004, 0, 333, 0, 0), + (8091005, 0, 332, 0, 0), + (8091101, 0, 382, 0, 0), + (8091102, 0, 383, 0, 0), + (8091103, 0, 28, 0, 0), + (8091104, 0, 380, 0, 0), + (8091105, 0, 381, 0, 0), + (8091106, 0, 380, 0, 0), + (8091107, 0, 381, 0, 0), + (8091201, 0, 401, 0, 0), + (8091202, 0, 400, 0, 0), + (8091203, 0, 30, 0, 0), + (8091204, 0, 402, 0, 0), + (8091301, 0, 38, 0, 0), + (8091302, 0, 480, 0, 0), + (8091303, 0, 482, 0, 0), + (8091304, 0, 481, 0, 0), + (8091305, 0, 480, 0, 0), + (8091306, 0, 483, 0, 0), + (8091401, 0, 35, 0, 0), + (9010001, 0, 2, 0, 0), + (9010002, 0, 2, 0, 0), + (9010003, 0, 1, 0, 0), + (9010004, 0, 1, 0, 0), + (9010005, 0, 2, 0, 0), + (9010006, 0, 1, 0, 0), + (9010007, 0, 201, 0, 0), + (9010008, 0, 101, 0, 0), + (9010009, 0, 102, 0, 0), + (9010010, 0, 103, 0, 0), + (9010011, 0, 104, 0, 0), + (9010012, 0, 105, 0, 0), + (9010013, 0, 106, 0, 0), + (9010014, 0, 107, 0, 0), + (9010015, 0, 108, 0, 0), + (9010016, 0, 503, 0, 0), + (9010017, 0, 506, 0, 0), + (9010018, 0, 509, 0, 0), + (9010019, 0, 502, 0, 0), + (9010020, 0, 505, 0, 0), + (9010021, 0, 508, 0, 0), + (9010022, 0, 501, 0, 0), + (9010023, 0, 504, 0, 0), + (9010024, 0, 507, 0, 0), + (9010025, 0, 503, 0, 0), + (9010026, 0, 2, 0, 0), + (9010027, 0, 2, 0, 0), + (9010028, 0, 1, 0, 0), + (9010029, 0, 1, 0, 0), + (9010030, 0, 2, 0, 0), + (9010031, 0, 101, 0, 0), + (9010032, 0, 102, 0, 0), + (9010033, 0, 103, 0, 0), + (9010034, 0, 104, 0, 0), + (9010035, 0, 105, 0, 0), + (9010036, 0, 106, 0, 0), + (9010037, 0, 101, 0, 0), + (9010038, 0, 102, 0, 0), + (9010039, 0, 103, 0, 0), + (9010040, 0, 104, 0, 0), + (9010041, 0, 105, 0, 0), + (9010042, 0, 106, 0, 0), + (9010043, 0, 107, 0, 0), + (9010044, 0, 109, 0, 0), + (9010045, 0, 110, 0, 0), + (9010046, 0, 111, 0, 0), + (9010047, 0, 112, 0, 0), + (9010048, 0, 113, 0, 0), + (9010049, 0, 115, 0, 0), + (9010050, 0, 116, 0, 0), + (9010051, 0, 201, 0, 0), + (9010052, 0, 202, 0, 0), + (9010053, 0, 203, 0, 0), + (9010054, 0, 509, 0, 0), + (9010055, 0, 503, 0, 0), + (9010056, 0, 506, 0, 0), + (9010057, 0, 502, 0, 0), + (9010058, 0, 507, 0, 0), + (9010059, 0, 202, 0, 0), + (9010060, 0, 1, 0, 0), + (9010061, 0, 101, 0, 0), + (9010062, 0, 104, 0, 0), + (9010063, 0, 108, 0, 0), + (9010064, 0, 2, 0, 0), + (9030001, 0, 201, 0, 0), + (9030002, 0, 2, 0, 0), + (9030003, 0, 2, 0, 0), + (9030004, 0, 1, 0, 0), + (9030005, 0, 2, 0, 0), + (9030006, 0, 101, 0, 0), + (9030007, 0, 102, 0, 0), + (9030008, 0, 103, 0, 0), + (9030009, 0, 104, 0, 0), + (9030010, 0, 105, 0, 0), + (9030011, 0, 106, 0, 0), + (9030012, 0, 107, 0, 0), + (9030013, 0, 108, 0, 0), + (9030014, 0, 109, 0, 0), + (9030015, 0, 110, 0, 0), + (9030016, 0, 111, 0, 0), + (9030017, 0, 112, 0, 0), + (9030018, 0, 113, 0, 0), + (9030019, 0, 114, 0, 0), + (9030020, 0, 117, 0, 0), + (9030021, 0, 2, 0, 0), + (9030022, 0, 2, 0, 0), + (9030023, 0, 1, 0, 0), + (9030024, 0, 1, 0, 0), + (9030025, 0, 2, 0, 0), + (9030026, 0, 101, 0, 0), + (9030027, 0, 102, 0, 0), + (9030028, 0, 103, 0, 0), + (9030029, 0, 104, 0, 0), + (9030030, 0, 105, 0, 0), + (9030031, 0, 106, 0, 0), + (9030032, 0, 101, 0, 0), + (9030033, 0, 102, 0, 0), + (9030034, 0, 103, 0, 0), + (9030035, 0, 104, 0, 0), + (9030036, 0, 105, 0, 0), + (9030037, 0, 106, 0, 0), + (9030038, 0, 107, 0, 0), + (9030039, 0, 109, 0, 0), + (9030040, 0, 110, 0, 0), + (9030041, 0, 111, 0, 0), + (9030042, 0, 112, 0, 0), + (9030043, 0, 113, 0, 0), + (9030044, 0, 115, 0, 0), + (9030045, 0, 116, 0, 0), + (9030046, 0, 201, 0, 0), + (9030047, 0, 202, 0, 0), + (9030048, 0, 201, 0, 0), + (9030049, 0, 203, 0, 0), + (9030050, 0, 3, 0, 0), + (9030051, 0, 5, 0, 0), + (9030052, 0, 4, 0, 0), + (9030053, 0, 118, 0, 0), + (9030054, 0, 1, 0, 0), + (9030055, 0, 116, 0, 0), + (9030056, 0, 202, 0, 0), + (9030057, 0, 115, 0, 0), + (9030058, 0, 6, 0, 0), + (9030059, 0, 1, 0, 0), + (9030060, 0, 101, 0, 0), + (9030061, 0, 104, 0, 0), + (9030062, 0, 108, 0, 0), + (9030063, 0, 7, 0, 0), + (9030064, 0, 8, 0, 0), + (9040001, 0, 2, 0, 0), + (9040002, 0, 2, 0, 0), + (9040003, 0, 1, 0, 0), + (9040004, 0, 2, 0, 0), + (9040005, 0, 1, 0, 0), + (9040006, 0, 101, 0, 0), + (9040007, 0, 102, 0, 0), + (9040008, 0, 103, 0, 0), + (9040009, 0, 104, 0, 0), + (9040010, 0, 105, 0, 0), + (9040011, 0, 106, 0, 0), + (9040012, 0, 109, 0, 0), + (9040013, 0, 110, 0, 0), + (9040014, 0, 111, 0, 0), + (9040015, 0, 112, 0, 0), + (9040016, 0, 113, 0, 0), + (9040017, 0, 115, 0, 0), + (9040018, 0, 501, 0, 0), + (9040019, 0, 510, 0, 0), + (9040020, 0, 511, 0, 0), + (9040021, 0, 512, 0, 0), + (9040022, 0, 2, 0, 0), + (9040023, 0, 2, 0, 0), + (9040024, 0, 1, 0, 0), + (9040025, 0, 1, 0, 0), + (9040026, 0, 2, 0, 0), + (9040027, 0, 2, 0, 0), + (9040028, 0, 2, 0, 0), + (9040029, 0, 1, 0, 0), + (9040030, 0, 1, 0, 0), + (9040031, 0, 2, 0, 0), + (9040032, 0, 101, 0, 0), + (9040033, 0, 102, 0, 0), + (9040034, 0, 103, 0, 0), + (9040035, 0, 104, 0, 0), + (9040036, 0, 105, 0, 0), + (9040037, 0, 106, 0, 0), + (9040038, 0, 101, 0, 0), + (9040039, 0, 102, 0, 0), + (9040040, 0, 103, 0, 0), + (9040041, 0, 104, 0, 0), + (9040042, 0, 105, 0, 0), + (9040043, 0, 106, 0, 0), + (9040044, 0, 107, 0, 0), + (9040045, 0, 109, 0, 0), + (9040046, 0, 110, 0, 0), + (9040047, 0, 111, 0, 0), + (9040048, 0, 112, 0, 0), + (9040049, 0, 113, 0, 0), + (9040050, 0, 115, 0, 0), + (9040051, 0, 116, 0, 0), + (9040052, 0, 201, 0, 0), + (9040053, 0, 202, 0, 0), + (9040054, 0, 201, 0, 0), + (9040055, 0, 203, 0, 0), + (9040056, 0, 503, 0, 0), + (9040057, 0, 501, 0, 0), + (9040058, 0, 502, 0, 0), + (9040059, 0, 501, 0, 0), + (9040060, 0, 502, 0, 0), + (9040061, 0, 1, 0, 0), + (9040062, 0, 2, 0, 0), + (9040063, 0, 202, 0, 0), + (9040064, 0, 503, 0, 0), + (9040065, 0, 101, 0, 0), + (9040066, 0, 104, 0, 0), + (9040067, 0, 108, 0, 0), + (9040068, 0, 2, 0, 0), + (9050001, 0, 201, 0, 0), + (9050002, 0, 2, 0, 0), + (9050003, 0, 2, 0, 0), + (9050004, 0, 1, 0, 0), + (9050005, 0, 1, 0, 0), + (9050006, 0, 2, 0, 0), + (9050007, 0, 101, 0, 0), + (9050008, 0, 102, 0, 0), + (9050009, 0, 103, 0, 0), + (9050010, 0, 104, 0, 0), + (9050011, 0, 105, 0, 0), + (9050012, 0, 106, 0, 0), + (9050013, 0, 107, 0, 0), + (9050014, 0, 108, 0, 0), + (9050015, 0, 109, 0, 0), + (9050016, 0, 110, 0, 0), + (9050017, 0, 111, 0, 0), + (9050018, 0, 112, 0, 0), + (9050019, 0, 113, 0, 0), + (9050020, 0, 114, 0, 0), + (9050021, 0, 109, 0, 0), + (9050022, 0, 110, 0, 0), + (9050023, 0, 113, 0, 0), + (9050024, 0, 111, 0, 0), + (9050025, 0, 114, 0, 0), + (9050026, 0, 112, 0, 0), + (9050027, 0, 2, 0, 0), + (9050028, 0, 2, 0, 0), + (9050029, 0, 1, 0, 0), + (9050030, 0, 1, 0, 0), + (9050031, 0, 2, 0, 0), + (9050032, 0, 101, 0, 0), + (9050033, 0, 102, 0, 0), + (9050034, 0, 103, 0, 0), + (9050035, 0, 104, 0, 0), + (9050036, 0, 105, 0, 0), + (9050037, 0, 106, 0, 0), + (9050038, 0, 101, 0, 0), + (9050039, 0, 102, 0, 0), + (9050040, 0, 103, 0, 0), + (9050041, 0, 104, 0, 0), + (9050042, 0, 105, 0, 0), + (9050043, 0, 106, 0, 0), + (9050044, 0, 107, 0, 0), + (9050045, 0, 109, 0, 0), + (9050046, 0, 110, 0, 0), + (9050047, 0, 111, 0, 0), + (9050048, 0, 112, 0, 0), + (9050049, 0, 113, 0, 0), + (9050050, 0, 114, 0, 0), + (9050051, 0, 116, 0, 0), + (9050052, 0, 201, 0, 0), + (9050053, 0, 202, 0, 0), + (9050054, 0, 203, 0, 0), + (9050055, 0, 3, 0, 0), + (9050056, 0, 5, 0, 0), + (9050057, 0, 4, 0, 0), + (9050058, 0, 204, 0, 0), + (9050059, 0, 205, 0, 0), + (9050060, 0, 206, 0, 0), + (9050061, 0, 207, 0, 0), + (9050062, 0, 208, 0, 0), + (9050063, 0, 1, 0, 0), + (9050064, 0, 116, 0, 0), + (9050065, 0, 202, 0, 0), + (9050066, 0, 115, 0, 0), + (9050067, 0, 101, 0, 0), + (9050068, 0, 104, 0, 0), + (9050069, 0, 108, 0, 0), + (9050070, 0, 9, 0, 0), + (9050071, 0, 9, 0, 0), + (9050072, 0, 9, 0, 0), + (9050073, 0, 9, 0, 0), + (9050074, 0, 9, 0, 0), + (9050075, 0, 9, 0, 0), + (9050076, 0, 9, 0, 0), + (9050077, 0, 9, 0, 0), + (9050078, 0, 9, 0, 0), + (9050079, 0, 9, 0, 0), + (9050080, 0, 9, 0, 0), + (9050081, 0, 9, 0, 0); /*!40000 ALTER TABLE `gamedata_items_graphics` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!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 */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - -COMMIT; - --- Dump completed on 2016-06-07 22:54:52 diff --git a/sql/retainers_inventory.sql b/sql/retainers_inventory.sql index 3264da35..15f62160 100644 --- a/sql/retainers_inventory.sql +++ b/sql/retainers_inventory.sql @@ -4,7 +4,7 @@ Source Host: localhost Source Database: ffxiv_server Target Host: localhost Target Database: ffxiv_server -Date: 9/9/2017 2:30:28 PM +Date: 12/17/2017 3:38:25 PM */ SET FOREIGN_KEY_CHECKS=0; @@ -12,10 +12,12 @@ SET FOREIGN_KEY_CHECKS=0; -- Table structure for retainers_inventory -- ---------------------------- CREATE TABLE `retainers_inventory` ( - `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT, `retainerId` int(10) unsigned NOT NULL, - `inventoryType` smallint(5) unsigned NOT NULL DEFAULT '0', `serverItemId` int(10) unsigned NOT NULL, - `quantity` int(10) unsigned NOT NULL DEFAULT '1', - PRIMARY KEY (`id`,`retainerId`) -) ENGINE=InnoDB AUTO_INCREMENT=333 DEFAULT CHARSET=utf8; + `itemPackage` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`retainerId`,`serverItemId`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records +-- ---------------------------- diff --git a/sql/server_items.sql b/sql/server_items.sql index a0cf8694..095b491e 100644 --- a/sql/server_items.sql +++ b/sql/server_items.sql @@ -4,7 +4,7 @@ Source Host: localhost Source Database: ffxiv_server Target Host: localhost Target Database: ffxiv_server -Date: 9/9/2017 2:31:34 PM +Date: 12/17/2017 3:38:35 PM */ SET FOREIGN_KEY_CHECKS=0; @@ -12,16 +12,16 @@ SET FOREIGN_KEY_CHECKS=0; -- Table structure for server_items -- ---------------------------- CREATE TABLE `server_items` ( - `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT, + `id` bigint(20) unsigned zerofill NOT NULL AUTO_INCREMENT, `itemId` int(10) unsigned NOT NULL, - `quality` tinyint(3) unsigned NOT NULL DEFAULT '0', - `itemType` tinyint(6) unsigned NOT NULL DEFAULT '0', - `durability` int(11) NOT NULL DEFAULT '0', - `spiritbind` smallint(5) unsigned DEFAULT '0', - `materia1` tinyint(3) unsigned DEFAULT '0', - `materia2` tinyint(3) unsigned DEFAULT '0', - `materia3` tinyint(3) unsigned DEFAULT '0', - `materia4` tinyint(3) unsigned DEFAULT '0', - `materia5` tinyint(3) unsigned DEFAULT '0', + `quantity` int(10) unsigned DEFAULT '1', + `quality` tinyint(3) unsigned DEFAULT '1', + `isExclusive` tinyint(1) unsigned DEFAULT '0', + `isAttached` tinyint(1) unsigned DEFAULT '0', + `isDealing` tinyint(1) unsigned DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1435 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records +-- ---------------------------- diff --git a/sql/server_items_modifiers.sql b/sql/server_items_modifiers.sql new file mode 100644 index 00000000..49f3b29f --- /dev/null +++ b/sql/server_items_modifiers.sql @@ -0,0 +1,35 @@ +/* +MySQL Data Transfer +Source Host: localhost +Source Database: ffxiv_server +Target Host: localhost +Target Database: ffxiv_server +Date: 12/17/2017 3:38:44 PM +*/ + +SET FOREIGN_KEY_CHECKS=0; +-- ---------------------------- +-- Table structure for server_items_modifiers +-- ---------------------------- +CREATE TABLE `server_items_modifiers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `durability` int(10) unsigned NOT NULL DEFAULT '0', + `mainQuality` tinyint(3) unsigned NOT NULL DEFAULT '1', + `subQuality1` tinyint(3) unsigned NOT NULL DEFAULT '1', + `subQuality2` tinyint(3) unsigned NOT NULL DEFAULT '1', + `subQuality3` tinyint(3) unsigned NOT NULL DEFAULT '1', + `param1` int(10) unsigned NOT NULL DEFAULT '0', + `param2` int(10) unsigned NOT NULL DEFAULT '0', + `param3` int(10) unsigned NOT NULL DEFAULT '0', + `spiritbind` smallint(5) unsigned NOT NULL DEFAULT '0', + `materia1` smallint(5) unsigned NOT NULL DEFAULT '0', + `materia2` smallint(5) unsigned NOT NULL DEFAULT '0', + `materia3` smallint(5) unsigned NOT NULL DEFAULT '0', + `materia4` smallint(5) unsigned NOT NULL DEFAULT '0', + `materia5` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2315 DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records +-- ---------------------------- diff --git a/www/patch/ffxiv/48eca647/metainfo/D2010.09.19.0000.torrent b/www/patch/ffxiv/48eca647/metainfo/D2010.09.19.0000.torrent deleted file mode 100644 index a01c5ef6..00000000 Binary files a/www/patch/ffxiv/48eca647/metainfo/D2010.09.19.0000.torrent and /dev/null differ diff --git a/www/patch/ffxiv/48eca647/metainfo/D2010.09.23.0000.torrent b/www/patch/ffxiv/48eca647/metainfo/D2010.09.23.0000.torrent deleted file mode 100644 index ba51ba5c..00000000 Binary files a/www/patch/ffxiv/48eca647/metainfo/D2010.09.23.0000.torrent and /dev/null differ diff --git a/www/patch/ffxiv/48eca647/metainfo/D2012.05.20.0000.0001.torrent b/www/patch/ffxiv/48eca647/metainfo/D2012.05.20.0000.0001.torrent deleted file mode 100644 index 6cd55e8e..00000000 Binary files a/www/patch/ffxiv/48eca647/metainfo/D2012.05.20.0000.0001.torrent and /dev/null differ diff --git a/www/patch/ffxiv/48eca647/patch/D2010.09.23.0000.patch b/www/patch/ffxiv/48eca647/patch/D2010.09.23.0000.patch deleted file mode 100644 index d28c7adf..00000000 Binary files a/www/patch/ffxiv/48eca647/patch/D2010.09.23.0000.patch and /dev/null differ diff --git a/www/patch/test.php b/www/patch/test.php deleted file mode 100644 index a612015f..00000000 --- a/www/patch/test.php +++ /dev/null @@ -1,3 +0,0 @@ - - -