diff --git a/l2-unity/Assets/Scenes/Menu.unity b/l2-unity/Assets/Scenes/Menu.unity index 0d1be2e05..01c75185b 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.029895507, g: 0.06798504, b: 0.08975239, 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 &402365597 -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 @@ -241,6 +172,41 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!21 &453888385 +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 &461980325 PrefabInstance: m_ObjectHideFlags: 0 @@ -251,7 +217,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 842763773635486120, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _autoLogin - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4644061901774829026, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: m_LocalPosition.x @@ -295,7 +261,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] @@ -303,11 +269,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[1] - value: 17_24 + value: 16_24 objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[2] - value: 16_25 + value: 16_24 objectReference: {fileID: 0} - target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _mapList.Array.data[3] @@ -325,6 +291,75 @@ PrefabInstance: insertIndex: -1 addedObject: {fileID: 1859807133} m_SourcePrefab: {fileID: 100100000, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} +--- !u!21 &589058360 +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 &803395386 GameObject: m_ObjectHideFlags: 0 @@ -840,41 +875,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3} ---- !u!21 &1214314565 -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!21 &1337740698 Material: serializedVersion: 8 diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestUnEquipPacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestUnEquipPacket.cs new file mode 100644 index 000000000..160dbd85c --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestUnEquipPacket.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RequestUnEquipPacket : ClientPacket { + public RequestUnEquipPacket(int slot) : base((byte)GameClientPacketType.RequestUnEquip) { + WriteI(slot); + BuildPacket(); + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestUnEquipPacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestUnEquipPacket.cs.meta new file mode 100644 index 000000000..4e211f370 --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/RequestUnEquipPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8bbfce3b8b27194a91ec1d6d4e6e0c9 +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/UseItemPacket.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/UseItemPacket.cs new file mode 100644 index 000000000..fa7cfb86a --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/UseItemPacket.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UseItemPacket : ClientPacket { + public UseItemPacket(int itemObjectId) : base((byte)GameClientPacketType.UseItem) { + WriteI(itemObjectId); + BuildPacket(); + } +} diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/UseItemPacket.cs.meta b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/UseItemPacket.cs.meta new file mode 100644 index 000000000..e46fbd5cf --- /dev/null +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/ClientPackets/UseItemPacket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a9298311e72eba469ffcb0cea2dca71 +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 340e0c409..34339bcf8 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/Packet/Gameserver/GameClientPacketType.cs @@ -14,5 +14,7 @@ public enum GameClientPacketType : byte RequestAutoAttack = 0x0B, RequestCharSelect = 0x0C, RequestInventoryOpen = 0x0D, - RequestInventoryUpdateOrder = 0x0E + RequestInventoryUpdateOrder = 0x0E, + UseItem = 0x0F, + RequestUnEquip = 0x10 } diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameClientPacketHandler.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameClientPacketHandler.cs index 52b2d99a4..8bb125731 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameClientPacketHandler.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameClientPacketHandler.cs @@ -1,4 +1,5 @@ -using System.Threading; +using System; +using System.Threading; using UnityEngine; public class GameClientPacketHandler : ClientPacketHandler @@ -109,5 +110,15 @@ public override void SendPacket(ClientPacket packet) { _client.SendPacket(packet); } + + public void UseItem(int objectId) { + UseItemPacket packet = new UseItemPacket(objectId); + SendPacket(packet); + } + + public void UnEquipItem(int position) { + RequestUnEquipPacket packet = new RequestUnEquipPacket(position); + SendPacket(packet); + } } diff --git a/l2-unity/Assets/Scripts/UI/Game/Inventory/GearSlot.cs b/l2-unity/Assets/Scripts/UI/Game/Inventory/GearSlot.cs index d26861842..7c7306347 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Inventory/GearSlot.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Inventory/GearSlot.cs @@ -7,11 +7,8 @@ public class GearSlot : InventorySlot { public GearSlot(int position, VisualElement slotElement, InventoryGearTab tab) : base(position, slotElement, tab) { } - - public GearSlot(int position, AbstractItem item, VisualElement slotElement, InventoryGearTab tab) : base(position, item, slotElement, tab) { - } protected override void HandleRightClick() { - + GameClient.Instance.ClientPacketHandler.UnEquipItem(_position); } } diff --git a/l2-unity/Assets/Scripts/UI/Game/Inventory/InventorySlot.cs b/l2-unity/Assets/Scripts/UI/Game/Inventory/InventorySlot.cs index 4f8b6903a..52825f912 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Inventory/InventorySlot.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Inventory/InventorySlot.cs @@ -9,16 +9,11 @@ public class InventorySlot : L2Slot private int _count; private long _remainingTime; private TooltipManipulator _tooltipManipulator; + private int _objectId; public int Count { get { return _count; } } public long RemainingTime { get { return _remainingTime; } } - public InventorySlot(int position, AbstractItem item, VisualElement slotElement, L2Tab tab) - : base(slotElement, position, item.Id, item.ItemName.Name, item.ItemName.Description, item.Icon) { - _currentTab = tab; - _slotElement.AddToClassList("inventory-slot"); - } - public InventorySlot(int position, VisualElement slotElement, L2Tab tab) : base(slotElement, position) { _currentTab = tab; @@ -31,12 +26,14 @@ public void AssignItem(ItemInstance item) { _name = item.ItemData.ItemName.Name; _description = item.ItemData.ItemName.Description; _icon = item.ItemData.Icon; + _objectId = item.ObjectId; } else { Debug.LogWarning($"Item data is null for item {item.ItemId}."); _id = 0; _name = "Unkown"; _description = "Unkown item."; _icon = ""; + _objectId = -1; } _count = item.Count; _remainingTime = item.RemainingTime; @@ -63,7 +60,7 @@ protected override void HandleLeftClick() { } protected override void HandleRightClick() { - + GameClient.Instance.ClientPacketHandler.UseItem(_objectId); } public void SetSelected() {