diff --git a/l2-unity/Assets/Scenes/Menu.unity b/l2-unity/Assets/Scenes/Menu.unity index 6e93c6fad..7dddfd7e5 100644 --- a/l2-unity/Assets/Scenes/Menu.unity +++ b/l2-unity/Assets/Scenes/Menu.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 0.245 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 1061591418} - m_IndirectSpecularColor: {r: 0.063133255, g: 0.093109384, b: 0.10891574, a: 0.245} + m_IndirectSpecularColor: {r: 0.056544498, g: 0.088350356, b: 0.10549344, a: 0.245} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -123,75 +123,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!21 &197917878 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Override - m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: [] - m_Ints: [] - m_Floats: - - _AdvancedCat: 1 - - _Banner: 1 - - _DirectionalCat: 1 - - _DirectionalFalloff: 2 - - _DirectionalIntensity: 1 - - _FarDistanceHeight: 0 - - _FarDistanceOffset: 0 - - _FogAxisMode: 1 - - _FogCameraMode: 0 - - _FogCat: 1 - - _FogColorDuo: 1 - - _FogDistanceEnd: 100 - - _FogDistanceFalloff: 2 - - _FogDistanceStart: 0 - - _FogHeightEnd: 100 - - _FogHeightFalloff: 2 - - _FogHeightStart: 0 - - _FogIntensity: 1 - - _FogLayersMode: 0 - - _IsHeightFogPreset: 1 - - _IsHeightFogShader: 1 - - _JitterIntensity: 1 - - _NoiseCat: 1 - - _NoiseDistanceEnd: 50 - - _NoiseIntensity: 1 - - _NoiseMax: 1 - - _NoiseMin: 0 - - _NoiseModeBlend: 1 - - _NoiseScale: 30 - - _SkyboxCat: 1 - - _SkyboxFogBottom: 0 - - _SkyboxFogFalloff: 1 - - _SkyboxFogFill: 1 - - _SkyboxFogHeight: 1 - - _SkyboxFogIntensity: 1 - - _SkyboxFogOffset: 0 - m_Colors: - - _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1} - - _DirectionalDir: {r: 0, g: 0, b: 0, a: 0} - - _FogAxisOption: {r: 0, g: 0, b: 0, a: 0} - - _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1} - - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} - - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} - m_BuildTextureStacks: [] --- !u!1 &413261805 GameObject: m_ObjectHideFlags: 0 @@ -291,7 +222,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.size - value: 4 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[0] @@ -299,11 +230,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[1] - value: 16_24 + value: 17_25 objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[2] - value: 17_24 + value: 17_25 objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[3] @@ -512,6 +443,41 @@ MonoBehaviour: _entityMask: serializedVersion: 2 m_Bits: 64 +--- !u!21 &968757019 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Height Fog Global + m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AdvancedCat: 1 + - _Banner: 1 + - _DirectionalCat: 1 + - _FogCat: 1 + - _HeightFogGlobal: 1 + - _IsHeightFogShader: 1 + - _NoiseCat: 1 + - _SkyboxCat: 1 + m_Colors: [] + m_BuildTextureStacks: [] --- !u!1001 &1001879169 PrefabInstance: m_ObjectHideFlags: 0 @@ -868,7 +834,7 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3} ---- !u!21 &1446991640 +--- !u!21 &1237903006 Material: serializedVersion: 8 m_ObjectHideFlags: 0 @@ -937,15 +903,15 @@ Material: - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} m_BuildTextureStacks: [] ---- !u!21 &1487777543 +--- !u!21 &1446991640 Material: serializedVersion: 8 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Height Fog Global - m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3} + m_Name: Override + m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] @@ -953,7 +919,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] m_LockedProperties: @@ -965,12 +931,46 @@ Material: - _AdvancedCat: 1 - _Banner: 1 - _DirectionalCat: 1 + - _DirectionalFalloff: 2 + - _DirectionalIntensity: 1 + - _FarDistanceHeight: 0 + - _FarDistanceOffset: 0 + - _FogAxisMode: 1 + - _FogCameraMode: 0 - _FogCat: 1 - - _HeightFogGlobal: 1 + - _FogColorDuo: 1 + - _FogDistanceEnd: 100 + - _FogDistanceFalloff: 2 + - _FogDistanceStart: 0 + - _FogHeightEnd: 100 + - _FogHeightFalloff: 2 + - _FogHeightStart: 0 + - _FogIntensity: 1 + - _FogLayersMode: 0 + - _IsHeightFogPreset: 1 - _IsHeightFogShader: 1 + - _JitterIntensity: 1 - _NoiseCat: 1 + - _NoiseDistanceEnd: 50 + - _NoiseIntensity: 1 + - _NoiseMax: 1 + - _NoiseMin: 0 + - _NoiseModeBlend: 1 + - _NoiseScale: 30 - _SkyboxCat: 1 - m_Colors: [] + - _SkyboxFogBottom: 0 + - _SkyboxFogFalloff: 1 + - _SkyboxFogFill: 1 + - _SkyboxFogHeight: 1 + - _SkyboxFogIntensity: 1 + - _SkyboxFogOffset: 0 + m_Colors: + - _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1} + - _DirectionalDir: {r: 0, g: 0, b: 0, a: 0} + - _FogAxisOption: {r: 0, g: 0, b: 0, a: 0} + - _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1} + - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} + - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} m_BuildTextureStacks: [] --- !u!1 &1592191233 GameObject: @@ -1455,4 +1455,4 @@ SceneRoots: - {fileID: 803395388} - {fileID: 1093616925} - {fileID: 413261807} - - {fileID: 2895990127247051527} \ No newline at end of file + - {fileID: 2895990127247051527} diff --git a/l2-unity/Assets/Scripts/Game/Item/ItemInstance.cs b/l2-unity/Assets/Scripts/Game/Item/ItemInstance.cs index 6417f0951..f58636f66 100644 --- a/l2-unity/Assets/Scripts/Game/Item/ItemInstance.cs +++ b/l2-unity/Assets/Scripts/Game/Item/ItemInstance.cs @@ -13,6 +13,7 @@ public class ItemInstance [SerializeField] private ItemCategory _category; [SerializeField] private bool _equipped; [SerializeField] private ItemSlot _bodyPart; + [SerializeField] private int _enchantLevel; [SerializeField] private long _remainingTime; public AbstractItem ItemData { get { return _itemData; } } @@ -24,9 +25,10 @@ public class ItemInstance public int Count { get { return _count; } } public ItemCategory Category { get { return _category; } } public ItemSlot BodyPart { get { return _bodyPart; } } + public int EnchantLevel { get { return _enchantLevel; } } public long RemainingTime { get { return _remainingTime; } } - public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, int count, ItemCategory category, bool equipped, ItemSlot bodyPart, long remainingTime) { + public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, int count, ItemCategory category, bool equipped, ItemSlot bodyPart, int enchantLevel, long remainingTime) { _objectId = objectId; _itemId = itemId; _location = location; @@ -36,6 +38,7 @@ public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, i _equipped = equipped; _bodyPart = bodyPart; _remainingTime = remainingTime; + _enchantLevel = enchantLevel; if (_category == ItemCategory.Weapon) { _itemData = ItemTable.Instance.GetWeapon(_itemId); @@ -48,6 +51,13 @@ public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, i } else { _itemData = ItemTable.Instance.GetEtcItem(_itemId); } + + Debug.Log(this.ToString()); + } + + public override string ToString() { + return $"New item: ServerId:{_objectId} ItemId:{_itemId} Location:{_location} Slot:{_slot} Count:{_count} " + + $"Cat:{_category} Equipped:{_equipped} Bodypart:{_bodyPart}"; } // Packet data diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryOpenPacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryOpenPacket.cs new file mode 100644 index 000000000..f4c7e444d --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryOpenPacket.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RequestInventoryOpenPacket : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryOpenPacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryOpenPacket.cs.meta new file mode 100644 index 000000000..e63fe3906 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryOpenPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 16d37e111364bef488e8eb43ceb77b7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryUpdateOrderPacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryUpdateOrderPacket.cs new file mode 100644 index 000000000..9c016c765 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryUpdateOrderPacket.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RequestInventoryUpdateOrderPacket : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryUpdateOrderPacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryUpdateOrderPacket.cs.meta new file mode 100644 index 000000000..040263604 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestInventoryUpdateOrderPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b3680d6badfcc944a1e91afc3f83c38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs index 67ebc6def..340e0c409 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs @@ -12,5 +12,7 @@ public enum GameClientPacketType : byte RequestMoveDirection = 0x09, RequestSetTarget = 0x0A, RequestAutoAttack = 0x0B, - RequestCharSelect = 0x0C + RequestCharSelect = 0x0C, + RequestInventoryOpen = 0x0D, + RequestInventoryUpdateOrder = 0x0E } diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameServerPacketType.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameServerPacketType.cs index 721a19ea7..e03049449 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameServerPacketType.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameServerPacketType.cs @@ -23,5 +23,7 @@ public enum GameServerPacketType : byte ActionFailed = 0x14, ServerClose=0x15, StatusUpdate = 0x16, - ActionAllowed = 0x17 + ActionAllowed = 0x17, + InventoryItemList = 0x18, + InventoryUpdate = 0x19 } diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AbstractItemPacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AbstractItemPacket.cs new file mode 100644 index 000000000..70c660949 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AbstractItemPacket.cs @@ -0,0 +1,41 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class AbstractItemPacket : ServerPacket +{ + protected AbstractItemPacket(byte[] d) : base(d) { + } + + + /* + protected void writeItem(ItemInfo item) { + writeI(item.getObjectId()); // ObjectId + writeI(item.getItem().getId()); // ItemId + writeB((byte) item.getLocation()); // Inventory? Warehouse? + writeI(item.getSlot()); // Slot + writeL(item.getCount()); // Quantity + writeB(item.getCategory()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item + writeB(item.getEquipped()); // Equipped : 00-No, 01-yes + writeI(item.getItem().getBodyPart().getValue()); + writeI(item.getEnchant()); // Enchant level + writeL(item.getTime()); + } + */ + protected ItemInstance ReadItem() { + int objectId = ReadI(); + int itemId = ReadI(); + ItemLocation itemLocation = (ItemLocation) ReadB(); + int slot = ReadI(); + int count = ReadI(); + ItemCategory itemCategory = (ItemCategory) ReadB(); + bool equipped = ReadB() == 1; + ItemSlot bodyPart = (ItemSlot) ReadI(); + int enchantLevel = ReadI(); + long remainingTime = ReadL(); + + return new ItemInstance( + objectId, itemId, itemLocation, slot, count, itemCategory, + equipped, bodyPart, enchantLevel, remainingTime); + } +} diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AbstractItemPacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AbstractItemPacket.cs.meta new file mode 100644 index 000000000..9feedad49 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/AbstractItemPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d576dc32dea1881439d3014d1b28e5d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryItemListPacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryItemListPacket.cs new file mode 100644 index 000000000..5c0d2f77d --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryItemListPacket.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class InventoryItemListPacket : AbstractItemPacket +{ + private ItemInstance[] _items; + public ItemInstance[] Items { get { return _items; } } + + public InventoryItemListPacket(byte[] d) : base(d){ + } + + public override void Parse() { + // writeB((byte) (showWindow ? 0x01 : 0x00)); + // writeI(items.size()); + bool openWindow = ReadB() == 1; + int itemListSize = ReadI(); + + _items = new ItemInstance[itemListSize]; + for(int i = 0; i < itemListSize; i++) { + _items[i] = ReadItem(); + } + } +} diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryItemListPacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryItemListPacket.cs.meta new file mode 100644 index 000000000..df5c01e4c --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryItemListPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7270b672838ef1445a9a578b332df68b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryUpdatePacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryUpdatePacket.cs new file mode 100644 index 000000000..8127ed802 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryUpdatePacket.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class InventoryUpdatePacket : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryUpdatePacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryUpdatePacket.cs.meta new file mode 100644 index 000000000..6ba9f9aad --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ServerPackets/InventoryUpdatePacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7c56ecc9274d144d852c390e3ea30ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs index ab4174752..753a63e08 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs @@ -84,6 +84,12 @@ public override void HandlePacket(byte[] data) { case GameServerPacketType.ActionAllowed: OnActionAllowed(data); break; + case GameServerPacketType.InventoryItemList: + OnInventoryItemList(data); + break; + case GameServerPacketType.InventoryUpdate: + OnInventoryUpdate(data); + break; } } @@ -299,4 +305,12 @@ private void OnStatusUpdate(byte[] data) { StatusUpdatePacket packet = new StatusUpdatePacket(data); World.Instance.StatusUpdate(packet.ObjectId, packet.Attributes); } + + private void OnInventoryItemList(byte[] data) { + InventoryItemListPacket packet = new InventoryItemListPacket(data); + } + + private void OnInventoryUpdate(byte[] data) { + + } } diff --git a/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs b/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs index e15ea4c82..27d14035d 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs @@ -55,56 +55,56 @@ private void Awake() { Destroy(this); } - /* TO REMOVE FOR TESTING ONLY */ - ItemTable.Instance.Initialize(); - ItemNameTable.Instance.Initialize(); - ItemStatDataTable.Instance.Initialize(); - ArmorgrpTable.Instance.Initialize(); - EtcItemgrpTable.Instance.Initialize(); - WeapongrpTable.Instance.Initialize(); - ItemTable.Instance.CacheItems(); - IconManager.Instance.Initialize(); - IconManager.Instance.CacheIcons(); - - /* TO REMOVE FOR TESTING ONLY */ - _playerItems = new List (); - - _playerItems.Add(new ItemInstance(0, 28, ItemLocation.Inventory, 1, 1, ItemCategory.ShieldArmor, false, ItemSlot.legs, 0)); - _playerItems.Add(new ItemInstance(0, 48, ItemLocation.Inventory, 2, 1, ItemCategory.ShieldArmor, false, ItemSlot.gloves, 0)); - _playerItems.Add(new ItemInstance(0, 45, ItemLocation.Inventory, 3, 1, ItemCategory.ShieldArmor, false, ItemSlot.head, 0)); - _playerItems.Add(new ItemInstance(0, 35, ItemLocation.Inventory, 4, 1, ItemCategory.ShieldArmor, false, ItemSlot.feet, 0)); - _playerItems.Add(new ItemInstance(0, 21, ItemLocation.Inventory, 5, 1, ItemCategory.ShieldArmor, false, ItemSlot.chest, 0)); - _playerItems.Add(new ItemInstance(0, 2, ItemLocation.Inventory, 6, 1, ItemCategory.Weapon, false, ItemSlot.rhand, 0)); - _playerItems.Add(new ItemInstance(0, 20, ItemLocation.Inventory, 7, 1, ItemCategory.ShieldArmor, false, ItemSlot.lhand, 0)); - - _playerItems.Add(new ItemInstance(0, 57, ItemLocation.Inventory, 14, 69420, ItemCategory.Adena, false, ItemSlot.none, 0)); - _playerItems.Add(new ItemInstance(0, 1835, ItemLocation.Inventory, 15, 69420, ItemCategory.Item, false, ItemSlot.none, 0)); - _playerItems.Add(new ItemInstance(0, 3947, ItemLocation.Inventory, 16, 69420, ItemCategory.Item, false, ItemSlot.none, 0)); - _playerItems.Add(new ItemInstance(0, 2509, ItemLocation.Inventory, 17, 69420, ItemCategory.Item, false, ItemSlot.none, 0)); - _playerItems.Add(new ItemInstance(0, 736, ItemLocation.Inventory, 18, 69420, ItemCategory.Item, false, ItemSlot.none, 0)); - - _playerItems.Add(new ItemInstance(0, 118, ItemLocation.Inventory, 45, 1, ItemCategory.ShieldArmor, false, ItemSlot.neck, 0)); - _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Inventory, 46, 1, ItemCategory.ShieldArmor, false, ItemSlot.lear, 0)); - _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Inventory, 47, 1, ItemCategory.ShieldArmor, false, ItemSlot.rear, 0)); - _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Inventory, 48, 1, ItemCategory.ShieldArmor, false, ItemSlot.rfinger, 0)); - _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Inventory, 49, 1, ItemCategory.ShieldArmor, false, ItemSlot.lfinger, 0)); - - - - // gear - _playerItems.Add(new ItemInstance(0, 28, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.legs, 0)); - _playerItems.Add(new ItemInstance(0, 48, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.gloves, 0)); - _playerItems.Add(new ItemInstance(0, 45, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.head, 0)); - _playerItems.Add(new ItemInstance(0, 35, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.feet, 0)); - _playerItems.Add(new ItemInstance(0, 21, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.chest, 0)); - _playerItems.Add(new ItemInstance(0, 4, ItemLocation.Equipped, 0, 1, ItemCategory.Weapon, true, ItemSlot.rhand, 0)); - _playerItems.Add(new ItemInstance(0, 20, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.lhand, 0)); - - _playerItems.Add(new ItemInstance(0, 118, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.neck, 0)); - _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.lear, 0)); - _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.rear, 0)); - _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.rfinger, 0)); - _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.lfinger, 0)); + // /* TO REMOVE FOR TESTING ONLY */ + // ItemTable.Instance.Initialize(); + // ItemNameTable.Instance.Initialize(); + // ItemStatDataTable.Instance.Initialize(); + // ArmorgrpTable.Instance.Initialize(); + // EtcItemgrpTable.Instance.Initialize(); + // WeapongrpTable.Instance.Initialize(); + // ItemTable.Instance.CacheItems(); + // IconManager.Instance.Initialize(); + // IconManager.Instance.CacheIcons(); + + // /* TO REMOVE FOR TESTING ONLY */ + // _playerItems = new List (); + + // _playerItems.Add(new ItemInstance(0, 28, ItemLocation.Inventory, 1, 1, ItemCategory.ShieldArmor, false, ItemSlot.legs, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 48, ItemLocation.Inventory, 2, 1, ItemCategory.ShieldArmor, false, ItemSlot.gloves, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 45, ItemLocation.Inventory, 3, 1, ItemCategory.ShieldArmor, false, ItemSlot.head, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 35, ItemLocation.Inventory, 4, 1, ItemCategory.ShieldArmor, false, ItemSlot.feet, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 21, ItemLocation.Inventory, 5, 1, ItemCategory.ShieldArmor, false, ItemSlot.chest, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 2, ItemLocation.Inventory, 6, 1, ItemCategory.Weapon, false, ItemSlot.rhand, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 20, ItemLocation.Inventory, 7, 1, ItemCategory.ShieldArmor, false, ItemSlot.lhand, 0, 0)); + + // _playerItems.Add(new ItemInstance(0, 57, ItemLocation.Inventory, 14, 69420, ItemCategory.Adena, false, ItemSlot.none, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 1835, ItemLocation.Inventory, 15, 69420, ItemCategory.Item, false, ItemSlot.none, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 3947, ItemLocation.Inventory, 16, 69420, ItemCategory.Item, false, ItemSlot.none, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 2509, ItemLocation.Inventory, 17, 69420, ItemCategory.Item, false, ItemSlot.none, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 736, ItemLocation.Inventory, 18, 69420, ItemCategory.Item, false, ItemSlot.none, 0, 0)); + + // _playerItems.Add(new ItemInstance(0, 118, ItemLocation.Inventory, 45, 1, ItemCategory.ShieldArmor, false, ItemSlot.neck, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Inventory, 46, 1, ItemCategory.ShieldArmor, false, ItemSlot.lear, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Inventory, 47, 1, ItemCategory.ShieldArmor, false, ItemSlot.rear, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Inventory, 48, 1, ItemCategory.ShieldArmor, false, ItemSlot.rfinger, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Inventory, 49, 1, ItemCategory.ShieldArmor, false, ItemSlot.lfinger, 0, 0)); + + + + // // gear + // _playerItems.Add(new ItemInstance(0, 28, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.legs, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 48, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.gloves, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 45, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.head, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 35, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.feet, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 21, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.chest, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 4, ItemLocation.Equipped, 0, 1, ItemCategory.Weapon, true, ItemSlot.rhand, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 20, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.lhand, 0, 0)); + + // _playerItems.Add(new ItemInstance(0, 118, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.neck, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.lear, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 112, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.rear, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.rfinger, 0, 0)); + // _playerItems.Add(new ItemInstance(0, 116, ItemLocation.Equipped, 0, 1, ItemCategory.ShieldArmor, true, ItemSlot.lfinger, 0, 0)); } private void OnDestroy() { @@ -159,7 +159,6 @@ protected override IEnumerator BuildWindow(VisualElement root) { yield return new WaitForEndOfFrame(); - /* TO REMOVE FOR TESTING ONLY */ UpdateItemList(_playerItems); } @@ -288,6 +287,10 @@ public bool SwitchTab(InventoryTab switchTo) { public void UpdateItemList(List items) { _playerItems = items; + if(items == null) { + _playerItems = new List(); + } + // Slot count _slotCount = PLAYER_INVENTORY_SIZE; _usedSlots = items.Where(o => o.Location == ItemLocation.Inventory).Count(); diff --git a/l2-unity/UserSettings/EditorUserSettings.asset b/l2-unity/UserSettings/EditorUserSettings.asset index 0bddd71cd..a2202205c 100644 --- a/l2-unity/UserSettings/EditorUserSettings.asset +++ b/l2-unity/UserSettings/EditorUserSettings.asset @@ -30,10 +30,10 @@ EditorUserSettings: value: 510652550602510f0c5e557140720f4415161b7d7c2974337e7f4863b1b8366d flags: 0 RecentlyUsedSceneGuid-8: - value: 5500505106040c0e0e5c087645740a44174f4879287023357b714c36e3b8663a + value: 52000d555300590d5d585877422606444e154f73797074697a7c1837e7b93160 flags: 0 RecentlyUsedSceneGuid-9: - value: 52000d555300590d5d585877422606444e154f73797074697a7c1837e7b93160 + value: 5500505106040c0e0e5c087645740a44174f4879287023357b714c36e3b8663a flags: 0 UnityEditor.ShaderGraph.Blackboard: value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4baf5e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1b7968e93e2ffcbc3e7e2f0b3ffe0e8b0be9af8f8a7ffff8e85dd8390e593948899daa7