Merge branch 'develop' into feature/hp_interact_npc

# Conflicts:
#	Assets/PerfectWorld/Scripts/Managers/EC_Inventory.cs
#	Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs
#	Assets/Scripts/CECHostPlayer.cs
This commit is contained in:
Tungdv
2025-11-20 18:37:00 +07:00
109 changed files with 4807 additions and 49544 deletions
@@ -25,6 +25,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 4b6364e18e35c47aab298e1d0a1c0def
m_Address: "models/npcs/\u602A\u7269/\u91CE\u517D/\u72FC/\u70BD\u7130\u72FC\u738B.ecm"
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: 070edb522e6e54c14a99055900003890, type: 2}
m_SchemaSet:
@@ -254,7 +254,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 03e5dab5f51374e55904db72229b775e
m_Address: "models/npcs/npc/2014\u65B0\u79CD\u65CF\u9886\u8896/2014\u65B0\u79CD\u65CF\u9886\u8896/2014\u65B0\u79CD\u65CF\u9886\u8896.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u79CD\u65CF\u9886\u8896/2014\u65B0\u79CD\u65CF\u9886\u8896.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -330,7 +330,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 04e8f383637dd42a58a6a23c48c64eb5
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u8D27\u90CE/2014\u65B0\u624B\u6751\u8D27\u90CE/2014\u65B0\u624B\u6751\u8D27\u90CE.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u8D27\u90CE/2014\u65B0\u624B\u6751\u8D27\u90CE.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -749,7 +749,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 09a50785f77bc43369476f9ab93a9b3a
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u88C1\u7F1D/2014\u65B0\u624B\u6751\u88C1\u7F1D/2014\u65B0\u624B\u6751\u88C1\u7F1D.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u88C1\u7F1D/2014\u65B0\u624B\u6751\u88C1\u7F1D.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -1252,7 +1252,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 0fb08f2ce83384471ac95b41dc602ace
m_Address: "models/npcs/\u602A\u7269/2014/\u5251\u80CC\u72FC/\u5251\u80CC\u72FC/\u5251\u80CC\u72FC.ecm"
m_Address: "models/npcs/\u602A\u7269/2014/\u5251\u80CC\u72FC/\u5251\u80CC\u72FC.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -1468,7 +1468,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 12e232ba9bff147e3bc0cc208f8b78a0
m_Address: "models/npcs/\u602A\u7269/38\u9972\u517B\u517D/\u5154\u5E7C\u5E74/\u5154\u5E7C\u5E74/\u5154\u5E7C\u5E74.ecm"
m_Address: "models/npcs/\u602A\u7269/38\u9972\u517B\u517D/\u5154\u5E7C\u5E74/\u5154\u5E7C\u5E74.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -2055,7 +2055,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 19ef711ad91474765a847a631f5da9ca
m_Address: "models/npcs/npc/2014\u65B0\u79CD\u65CF\u5DE7\u5320/2014\u65B0\u79CD\u65CF\u5DE7\u5320/2014\u65B0\u79CD\u65CF\u5DE7\u5320.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u79CD\u65CF\u5DE7\u5320/2014\u65B0\u79CD\u65CF\u5DE7\u5320.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -3223,7 +3223,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 28a9794edd04941a6ba1ab1a6e87bbd4
m_Address: "models/npcs/npc/2011\u5723\u7075\u4F7F\u8005/\u5723\u7075\u4F7F\u8005/\u5723\u7075\u4F7F\u8005.ecm"
m_Address: "models/npcs/npc/2011\u5723\u7075\u4F7F\u8005/\u5723\u7075\u4F7F\u8005.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -4629,7 +4629,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 39e34e0b093c74c65a24bcfa1a655c51
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u5546\u57CE\u7BA1\u7406\u5458\u84DD\u8272/2014\u65B0\u624B\u6751\u5546\u57CE\u7BA1\u7406\u5458\u84DD\u8272/2014\u65B0\u624B\u6751\u5546\u57CE\u7BA1\u7406\u5458\u84DD\u8272.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u5546\u57CE\u7BA1\u7406\u5458\u84DD\u8272/2014\u65B0\u624B\u6751\u5546\u57CE\u7BA1\u7406\u5458\u84DD\u8272.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -5754,7 +5754,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 46453b542df6540ae817c89b1dfff21e
m_Address: "models/npcs/npc/\u7075\u65CF\u5973\u738B/\u7075\u65CF\u5973\u738B/\u7075\u65CF\u5973\u738B.ecm"
m_Address: "models/npcs/npc/\u7075\u65CF\u5973\u738B/\u7075\u65CF\u5973\u738B.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -5816,7 +5816,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 47002ca46d55c4938b9315f763d1d66c
m_Address: "models/npcs/npc/npc\u4ED9\u5973/npc\u4ED9\u5973/npc\u7FBD\u7075.ecm"
m_Address: "models/npcs/npc/npc\u4ED9\u5973/npc\u7FBD\u7075.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -6403,7 +6403,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 4dcc3634bebc24bebb88a7ba3e23753c
m_Address: "models/npcs/npc/2014\u62FF\u6247\u5B50\u7684\u4EBA/2014\u62FF\u6247\u5B50\u7684\u4EBA/2014\u62FF\u6247\u5B50\u7684\u4EBA.ecm"
m_Address: "models/npcs/npc/2014\u62FF\u6247\u5B50\u7684\u4EBA/2014\u62FF\u6247\u5B50\u7684\u4EBA.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -7088,7 +7088,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 576e84b3fd877477eb7f0a424f30d5df
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u51E4\u7FBD\u9E7F/\u96C4\u6027\u51E4\u7FBD\u9E7F/\u96CC\u6027\u51E4\u7FBD\u9E7F.ecm"
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u51E4\u7FBD\u9E7F/\u96CC\u6027\u51E4\u7FBD\u9E7F.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -7689,7 +7689,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 5e76cb69b081a4673a5816fd9da89533
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u4E09\u4E2A\u8774\u8776/\u4E09\u4E2A\u8774\u8776/\u4E09\u4E2A\u8774\u8776.ecm"
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u4E09\u4E2A\u8774\u8776/\u4E09\u4E2A\u8774\u8776.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -8017,7 +8017,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 62555210fd2944f329f43aa25b44d2c4
m_Address: "models/npcs/npc/2014\u94B1\u5E84\u8001\u677F/2014\u94B1\u5E84\u8001\u677F/2014\u94B1\u5E84\u8001\u677F.ecm"
m_Address: "models/npcs/npc/2014\u94B1\u5E84\u8001\u677F/2014\u94B1\u5E84\u8001\u677F.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -8240,7 +8240,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 64b5a0083181a4d30911efb9c3059678
m_Address: "models/npcs/npc/2011\u725B\u9996\u5996\u738B/\u725B\u9996\u5996\u738B/\u725B\u9996\u5996\u738B.ecm"
m_Address: "models/npcs/npc/2011\u725B\u9996\u5996\u738B/\u725B\u9996\u5996\u738B.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -8798,7 +8798,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 6be116f35d3d446c7b8d3d61ca617690
m_Address: "models/npcs/npc/2014npc\u94C1\u5320/2014npc\u94C1\u5320/2014npc\u94C1\u5320.ecm"
m_Address: "models/npcs/npc/2014npc\u94C1\u5320/2014npc\u94C1\u5320.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -9189,7 +9189,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 70f8fa699f9ed4f88b1c335f2ccbb198
m_Address: "models/npcs/npc/2011\u6C34\u884C\u8005/\u6C34\u884C\u8005/\u6C34\u884C\u8005.ecm"
m_Address: "models/npcs/npc/2011\u6C34\u884C\u8005/\u6C34\u884C\u8005.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -10253,7 +10253,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 7cc56a2fa301a46db92681b17c10d6b0
m_Address: "models/npcs/npc/2014\u5439\u7B1B\u5B50\u7684\u4EBA\u7EA2\u8272/2014\u5439\u7B1B\u5B50\u7684\u4EBA\u7EA2\u8272/\u5439\u7B1B\u5B50\u7684\u4EBA\u7EA2\u8272\u8774\u8776.ecm"
m_Address: "models/npcs/npc/2014\u5439\u7B1B\u5B50\u7684\u4EBA\u7EA2\u8272/\u5439\u7B1B\u5B50\u7684\u4EBA\u7EA2\u8272\u8774\u8776.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -10294,7 +10294,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 7daa10b47beb04798927c05cc7148951
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u677E\u9F20/\u7EA2\u8272\u677E\u9F20/\u7EFF\u8272\u677E\u9F20.ecm"
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u677E\u9F20/\u7EFF\u8272\u677E\u9F20.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -13323,7 +13323,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: a32fc20843e62442ab1494d8a8e48794
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u4F20\u9001\u5E08/2014\u65B0\u624B\u6751\u4F20\u9001\u5E08/2014\u65B0\u624B\u6751\u4F20\u9001\u5E08.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u4F20\u9001\u5E08/2014\u65B0\u624B\u6751\u4F20\u9001\u5E08.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -13532,7 +13532,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: a5922b6b6f63f46e7b047300c07948fa
m_Address: "models/npcs/\u602A\u7269/2014/\u5C0F\u661F\u661F/\u5C0F\u661F\u661F/\u5C0F\u661F\u661F.ecm"
m_Address: "models/npcs/\u602A\u7269/2014/\u5C0F\u661F\u661F/\u5C0F\u661F\u661F.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -14435,7 +14435,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: b058f8968d5aa4a8f9285fa891b7b9ba
m_Address: "models/npcs/npc/\u5973npc14/\u5973npc14/\u5973npc14.ecm"
m_Address: "models/npcs/npc/\u5973npc14/\u5973npc14.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -14581,7 +14581,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: b2aa264cdbd9d4fb18f8df100175f4c3
m_Address: "models/npcs/npc/\u7537npc21/\u7537npc21/\u7537npc21.ecm"
m_Address: "models/npcs/npc/\u7537npc21/\u7537npc21.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -15329,7 +15329,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: bc0279413de8f43fb899a8761a22f4f3
m_Address: "models/npcs/npc/2014\u6559\u4E66\u5148\u751F/2014\u6559\u4E66\u5148\u751F/2014\u6559\u4E66\u5148\u751F.ecm"
m_Address: "models/npcs/npc/2014\u6559\u4E66\u5148\u751F/2014\u6559\u4E66\u5148\u751F.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -16532,7 +16532,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: c9c25f71f361f43f1aa0510d4f96312d
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u957F\u7FCE\u8D64\u7FBD\u9E1F/\u957F\u7FCE\u8D64\u7FBD\u9E1F/\u957F\u7FCE\u8D64\u7FBD\u9E1F.ecm"
m_Address: "models/\u573A\u666F\u6D3B\u7269/\u957F\u7FCE\u8D64\u7FBD\u9E1F/\u957F\u7FCE\u8D64\u7FBD\u9E1F.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -17231,7 +17231,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: d14e87db729e843a4b31c7b1065ab677
m_Address: "models/npcs/npc/2014\u90AE\u7BB1/2014\u90AE\u7BB1/2014\u90AE\u7BB1.ecm"
m_Address: "models/npcs/npc/2014\u90AE\u7BB1/2014\u90AE\u7BB1.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -17783,7 +17783,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: d865ad4bc902a4a299da74aaba68e9eb
m_Address: "models/npcs/npc/2014\u836F\u5E08/2014\u836F\u5E08/2014\u836F\u5E08.ecm"
m_Address: "models/npcs/npc/2014\u836F\u5E08/2014\u836F\u5E08.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -19413,7 +19413,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: ed84be8c5044746ca895fb75aca9bc66
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u5BFB\u5B9D\u4E13\u5458/2014\u65B0\u624B\u6751\u5BFB\u5B9D\u4E13\u5458/2014\u65B0\u624B\u6751\u5BFB\u5B9D\u4E13\u5458.ecm"
m_Address: "models/npcs/npc/2014\u65B0\u624B\u6751\u5BFB\u5B9D\u4E13\u5458/2014\u65B0\u624B\u6751\u5BFB\u5B9D\u4E13\u5458.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -20784,7 +20784,7 @@ MonoBehaviour:
- models
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: fd4b330a3588f40a18d44e22798e3ddc
m_Address: "models/npcs/npc/\u9B45\u7075\u9996\u9886/\u9B45\u7075\u9996\u9886/\u9B45\u7075\u9996\u9886.ecm"
m_Address: "models/npcs/npc/\u9B45\u7075\u9996\u9886/\u9B45\u7075\u9996\u9886.ecm"
m_ReadOnly: 0
m_SerializedLabels:
- models
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fcd0228b5a1c74e7c8fbc864a85d4f19
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 512e6bbef110649d7b0f65d8ea23aadc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4b6364e18e35c47aab298e1d0a1c0def
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 93ac07bf320ff415fa4f117af5bcaeed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 392f2ca7ced4a44ef9b8889bac5437a3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2434784017964201499
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u72FC_0_skin"
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHATEST_ON
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 8606c1ed0181c499aaa2b21800e6ea44, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 8606c1ed0181c499aaa2b21800e6ea44, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 1
- _AlphaToMask: 1
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.001
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f86d72b2ca36644078e46455c5f6f181
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -1650,6 +1650,7 @@ GameObject:
m_Component:
- component: {fileID: 3698356007416754653}
- component: {fileID: 6067755730919934559}
- component: {fileID: 3868169875372232445}
m_Layer: 0
m_Name: "\u6B66\u4FA0\u7537"
m_TagString: Untagged
@@ -1689,6 +1690,22 @@ Animation:
m_AnimatePhysics: 0
m_UpdateMode: 0
m_CullingType: 0
--- !u!114 &3868169875372232445
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2132400081078426141}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1863d89e9a45e43febda13d0579ec149, type: 3}
m_Name:
m_EditorClassIdentifier:
DefaultUpper: {fileID: 8430371236677961775}
DefaultLower: {fileID: 6678266945479460665}
DefaultWirst: {fileID: 9001778602091940592}
DefaultFoot: {fileID: 6501297086449185112}
--- !u!1 &2170371384673563007
GameObject:
m_ObjectHideFlags: 0
@@ -7765,7 +7782,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6501297086449185112}
m_Mesh: {fileID: 4300000, guid: 945e884eb4e674b8e82612a8a0d8def1, type: 2}
m_Mesh: {fileID: 4300000, guid: 830fb1ca82e68b446a18f9bba585aaff, type: 2}
--- !u!137 &4853797815422182967
SkinnedMeshRenderer:
m_ObjectHideFlags: 0
@@ -7789,7 +7806,7 @@ SkinnedMeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: b192c7dbc771d45448c834b4b19ee0ec, type: 2}
- {fileID: 2100000, guid: d452b4350e3f0bc42b897ce43cd195e9, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -7814,7 +7831,7 @@ SkinnedMeshRenderer:
m_Quality: 0
m_UpdateWhenOffscreen: 0
m_SkinnedMotionVectors: 1
m_Mesh: {fileID: 4300000, guid: 945e884eb4e674b8e82612a8a0d8def1, type: 2}
m_Mesh: {fileID: 4300000, guid: 830fb1ca82e68b446a18f9bba585aaff, type: 2}
m_Bones:
- {fileID: 420018222253717266}
- {fileID: 6323388249193786065}
@@ -8084,7 +8101,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6678266945479460665}
m_Mesh: {fileID: 4300000, guid: 3854f4881f8494ab593fcc78341863f9, type: 2}
m_Mesh: {fileID: 4300000, guid: 0a925a00d466f9144883c16480382261, type: 2}
--- !u!137 &5798515900539372327
SkinnedMeshRenderer:
m_ObjectHideFlags: 0
@@ -8108,7 +8125,7 @@ SkinnedMeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 8a14fd68048d746618454c38ab860e83, type: 2}
- {fileID: 2100000, guid: cd397b72ff7ec2346bada1faea11369c, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -8133,7 +8150,7 @@ SkinnedMeshRenderer:
m_Quality: 0
m_UpdateWhenOffscreen: 0
m_SkinnedMotionVectors: 1
m_Mesh: {fileID: 4300000, guid: 3854f4881f8494ab593fcc78341863f9, type: 2}
m_Mesh: {fileID: 4300000, guid: 0a925a00d466f9144883c16480382261, type: 2}
m_Bones:
- {fileID: 420018222253717266}
- {fileID: 6323388249193786065}
@@ -10053,7 +10070,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8430371236677961775}
m_Mesh: {fileID: 4300000, guid: e8ab6aad2d46a4a33a67cbd498f91cd2, type: 2}
m_Mesh: {fileID: 4300000, guid: 17b5241013460ec4d894c0698279b161, type: 2}
--- !u!137 &7115614618712792175
SkinnedMeshRenderer:
m_ObjectHideFlags: 0
@@ -10077,7 +10094,7 @@ SkinnedMeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 1ed3803c8b8834e78bf4ce0237739120, type: 2}
- {fileID: 2100000, guid: 85bd2bceb7c666341880474e43db8d5b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -10102,7 +10119,7 @@ SkinnedMeshRenderer:
m_Quality: 0
m_UpdateWhenOffscreen: 0
m_SkinnedMotionVectors: 1
m_Mesh: {fileID: 4300000, guid: e8ab6aad2d46a4a33a67cbd498f91cd2, type: 2}
m_Mesh: {fileID: 4300000, guid: 17b5241013460ec4d894c0698279b161, type: 2}
m_Bones:
- {fileID: 420018222253717266}
- {fileID: 6323388249193786065}
@@ -10697,7 +10714,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9001778602091940592}
m_Mesh: {fileID: 4300000, guid: 113bc85d93d8f402c8b99da2f35a11b5, type: 2}
m_Mesh: {fileID: 4300000, guid: dd7f01cc9e10db248893d28bd2abb7e3, type: 2}
--- !u!137 &8633905170266012228
SkinnedMeshRenderer:
m_ObjectHideFlags: 0
@@ -10721,7 +10738,7 @@ SkinnedMeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 8b5c7dfbac0134930a6436538a6b5f86, type: 2}
- {fileID: 2100000, guid: 4acebea1068de5840a7e0a5556d154a5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -10746,7 +10763,7 @@ SkinnedMeshRenderer:
m_Quality: 0
m_UpdateWhenOffscreen: 0
m_SkinnedMotionVectors: 1
m_Mesh: {fileID: 4300000, guid: 113bc85d93d8f402c8b99da2f35a11b5, type: 2}
m_Mesh: {fileID: 4300000, guid: dd7f01cc9e10db248893d28bd2abb7e3, type: 2}
m_Bones:
- {fileID: 420018222253717266}
- {fileID: 6323388249193786065}
@@ -63,7 +63,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: b2b9661888c43c34bbd96954aa4c8fee, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -63,7 +63,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: b2b9661888c43c34bbd96954aa4c8fee, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -50,7 +50,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: b02ac52609e429b4c90e9d53574cedc3, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -63,7 +63,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 080fbb07d32e9ee488b2e81f051efcae, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -50,7 +50,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 8cb741a34a51f3b469007a5e2950b1c0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -50,7 +50,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 13c7be92bd4cb6142b6b1c78475d7123, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ecac28cde74908d468a23c46e5bdde40
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1245c17e27c47cc4089a033096f127d3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69f7c71c5067cf64d996b39ac9891ea3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 80241b0e5ab92c14ab291155c50abc96
guid: 8606c1ed0181c499aaa2b21800e6ea44
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@@ -106,6 +106,19 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: VisionOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
@@ -3,63 +3,68 @@ namespace BrewMonster.Scripts
public class InventoryConst
{
// Index of item in equipment inventory
public static int EQUIPIVTR_WEAPON = 0;
public static int EQUIPIVTR_HEAD = 1;
public static int EQUIPIVTR_NECK = 2;
public static int EQUIPIVTR_SHOULDER = 3;
public static int EQUIPIVTR_BODY = 4;
public static int EQUIPIVTR_WAIST = 5;
public static int EQUIPIVTR_LEG = 6;
public static int EQUIPIVTR_FOOT = 7;
public static int EQUIPIVTR_WRIST = 8;
public static int EQUIPIVTR_FINGER1 = 9;
public static int EQUIPIVTR_FINGER2 = 10;
public static int EQUIPIVTR_PROJECTILE = 11;
public static int EQUIPIVTR_FLYSWORD = 12;
public static int EQUIPIVTR_FASHION_BODY = 13;
public static int EQUIPIVTR_FASHION_LEG = 14;
public static int EQUIPIVTR_FASHION_FOOT = 15;
public static int EQUIPIVTR_FASHION_WRIST = 16;
public static int EQUIPIVTR_RUNE = 17;
public static int EQUIPIVTR_BIBLE = 18;
public static int EQUIPIVTR_SPEAKER = 19;
public static int EQUIPIVTR_AUTOHP = 20;
public static int EQUIPIVTR_AUTOMP = 21;
public static int EQUIPIVTR_POCKET = 22;
public static int EQUIPIVTR_GOBLIN = 23;
public static int EQUIPIVTR_CERTIFICATE = 24;
public static int EQUIPIVTR_FASHION_HEAD = 25;
public static int EQUIPIVTR_FORCE_TOKEN = 26;
public static int EQUIPIVTR_DYNSKILLEQUIP1 = 27;
public static int EQUIPIVTR_DYNSKILLEQUIP2 = 28;
public static int EQUIPIVTR_FASHION_WEAPON = 29;
public static int SIZE_EQUIPIVTR = 30;
public static int EQUIPIVTR_UNUSED1 = 30;
public static int EQUIPIVTR_UNUSED2 = 31;
public static int EQUIPIVTR_GENERALCARD1 = 32;
public static int EQUIPIVTR_GENERALCARD2 = 33;
public static int EQUIPIVTR_GENERALCARD3 = 34;
public static int EQUIPIVTR_GENERALCARD4 = 35;
public static int EQUIPIVTR_GENERALCARD5 = 36;
public static int EQUIPIVTR_GENERALCARD6 = 37;
public static int SIZE_ALL_EQUIPIVTR = 38;
public static int SIZE_GENERALCARD_EQUIPIVTR = 6; // SIZE_ALL_EQUIPIVTR - EQUIPIVTR_GENERALCARD1
public const int EQUIPIVTR_WEAPON = 0;
public const int EQUIPIVTR_HEAD = 1;
public const int EQUIPIVTR_NECK = 2;
public const int EQUIPIVTR_SHOULDER = 3;
public const int EQUIPIVTR_BODY = 4;
public const int EQUIPIVTR_WAIST = 5;
public const int EQUIPIVTR_LEG = 6;
public const int EQUIPIVTR_FOOT = 7;
public const int EQUIPIVTR_WRIST = 8;
public const int EQUIPIVTR_FINGER1 = 9;
public const int EQUIPIVTR_FINGER2 = 10;
public const int EQUIPIVTR_PROJECTILE = 11;
public const int EQUIPIVTR_FLYSWORD = 12;
public const int EQUIPIVTR_FASHION_BODY = 13;
public const int EQUIPIVTR_FASHION_LEG = 14;
public const int EQUIPIVTR_FASHION_FOOT = 15;
public const int EQUIPIVTR_FASHION_WRIST = 16;
public const int EQUIPIVTR_RUNE = 17;
public const int EQUIPIVTR_BIBLE = 18;
public const int EQUIPIVTR_SPEAKER = 19;
public const int EQUIPIVTR_AUTOHP = 20;
public const int EQUIPIVTR_AUTOMP = 21;
public const int EQUIPIVTR_POCKET = 22;
public const int EQUIPIVTR_GOBLIN = 23;
public const int EQUIPIVTR_CERTIFICATE = 24;
public const int EQUIPIVTR_FASHION_HEAD = 25;
public const int EQUIPIVTR_FORCE_TOKEN = 26;
public const int EQUIPIVTR_DYNSKILLEQUIP1 = 27;
public const int EQUIPIVTR_DYNSKILLEQUIP2 = 28;
public const int EQUIPIVTR_FASHION_WEAPON = 29;
public const int SIZE_EQUIPIVTR = 30;
public const int EQUIPIVTR_UNUSED1 = 30;
public const int EQUIPIVTR_UNUSED2 = 31;
public const int EQUIPIVTR_GENERALCARD1 = 32;
public const int EQUIPIVTR_GENERALCARD2 = 33;
public const int EQUIPIVTR_GENERALCARD3 = 34;
public const int EQUIPIVTR_GENERALCARD4 = 35;
public const int EQUIPIVTR_GENERALCARD5 = 36;
public const int EQUIPIVTR_GENERALCARD6 = 37;
public const int SIZE_ALL_EQUIPIVTR = 38;
public const int SIZE_GENERALCARD_EQUIPIVTR = 6; // SIZE_ALL_EQUIPIVTR - EQUIPIVTR_GENERALCARD1
// Inventory size constants
public static int IVTRSIZE_EQUIPPACK = 32; // Equipment (SIZE_ALL_EQUIPIVTR)
public static int IVTRSIZE_TASKPACK = 32; // Task pack
public static int IVTRSIZE_DEALPACK = 24; // Deal pack
public static int IVTRSIZE_NPCPACK = 32; // NPC pack
public static int IVTRSIZE_TRASHBOX = 16; // Trash box
public static int IVTRSIZE_BUYPACK = 12; // Buy pack
public static int IVTRSIZE_SELLPACK = 12; // Sell pack
public static int IVTRSIZE_BOOTHSPACK = 12; // Default booth pack for selling
public static int IVTRSIZE_BOOTHBPACK = 12; // Default booth pack for buying
public static int IVTRSIZE_BOOTHSPACK_MAX = 20; // Max booth pack for selling (player may use certificate...)
public static int IVTRSIZE_BOOTHBPACK_MAX = 20; // Max booth pack for buying
public const int IVTRSIZE_EQUIPPACK = 32; // Equipment (SIZE_ALL_EQUIPIVTR)
public const int IVTRSIZE_TASKPACK = 32; // Task pack
public const int IVTRSIZE_DEALPACK = 24; // Deal pack
public const int IVTRSIZE_NPCPACK = 32; // NPC pack
public const int IVTRSIZE_TRASHBOX = 16; // Trash box
public const int IVTRSIZE_BUYPACK = 12; // Buy pack
public const int IVTRSIZE_SELLPACK = 12; // Sell pack
public const int IVTRSIZE_BOOTHSPACK = 12; // Default booth pack for selling
public const int IVTRSIZE_BOOTHBPACK = 12; // Default booth pack for buying
public const int IVTRSIZE_BOOTHSPACK_MAX = 20; // Max booth pack for selling (player may use certificate...)
public const int IVTRSIZE_BOOTHBPACK_MAX = 20; // Max booth pack for buying
public static int IVTRSIZE_CLIENTCARDPACK = 32; // Client pack for general card collection
public const int IVTRSIZE_CLIENTCARDPACK = 32; // Client pack for general card collection
public static int NUM_NPCIVTR = 8; // NPC inventory number
public const int NUM_NPCIVTR = 8; // NPC inventory number
// Inventory package types (match legacy C++ IVTRTYPE_*)
public const byte IVTRTYPE_PACK = 0;
public const byte IVTRTYPE_EQUIPPACK = 1;
public const byte IVTRTYPE_TASKPACK = 2;
}
}
@@ -4,408 +4,320 @@ using UnityEngine;
namespace BrewMonster.Scripts.Managers
{
/// <summary>
/// C# mirror of C++ CECInventory (EC_Inventory.h / EC_Inventory.cpp).
/// Instance-based inventory core plus static helpers used by existing client code.
/// </summary>
public class EC_Inventory
{
// ===== Instance-based inventory (per-pack) =====
public static class EC_Inventory
{
private static readonly Dictionary<byte, int> _packSizeByPackage = new Dictionary<byte, int>();
private static readonly Dictionary<byte, Dictionary<int, EC_IvtrItem>> _itemsByPackage = new Dictionary<byte, Dictionary<int, EC_IvtrItem>>();
private const int MaxContentHexToLog = 64;
// Item array: index is slot, null means empty.
private EC_IvtrItem[] m_aItems = Array.Empty<EC_IvtrItem>();
// Package constants to mirror legacy C++ names
public const byte IVTRTYPE_PACK = 0;
public const byte IVTRTYPE_EQUIPPACK = 1;
public const byte IVTRTYPE_TASKPACK = 2;
private static string GetPackageName(byte pkg)
{
switch (pkg)
{
case 0: return "IVTRTYPE_PACK";
case 1: return "IVTRTYPE_EQUIPPACK";
case 2: return "IVTRTYPE_TASKPACK";
default: return "PACK_UNKNOWN";
}
}
private static string BytesToHex(byte[] bytes, int max)
{
if (bytes == null || bytes.Length == 0) return "";
int len = Math.Min(bytes.Length, max);
string hex = BitConverter.ToString(bytes, 0, len);
if (bytes.Length > len) hex += "-...";
return hex;
}
public static Dictionary<int, EC_IvtrItem> GetPack(byte byPackage)
{
return _itemsByPackage[byPackage];
}
public static EC_IvtrItem GetItem(int iSlot, bool bRemove)
{
// Backward-compatible overload defaulting to inventory package
return GetItem(IVTRTYPE_PACK, iSlot, bRemove);
}
public static EC_IvtrItem GetItem(byte byPackage, int slot, bool remove)
{
if (!_itemsByPackage.TryGetValue(byPackage, out var slots) || slot < 0)
return null;
if (!slots.TryGetValue(slot, out var item))
return null;
if (remove)
slots.Remove(slot);
return item;
}
private static Dictionary<int, EC_IvtrItem> EnsureSlots(byte byPackage)
{
if (!_itemsByPackage.TryGetValue(byPackage, out var slots) || slots == null)
{
slots = new Dictionary<int, EC_IvtrItem>();
_itemsByPackage[byPackage] = slots;
}
return slots;
}
public static void Resize(byte byPackage, int newSize)
{
_packSizeByPackage[byPackage] = Math.Max(0, newSize);
EnsureSlots(byPackage);
}
public static EC_IvtrItem PutItem(byte byPackage, int slot, EC_IvtrItem item)
{
var slots = EnsureSlots(byPackage);
if (slot < 0) return null;
slots.TryGetValue(slot, out var oldItem);
slots[slot] = item;
return oldItem;
}
public static void SetItem(byte byPackage, int slot, EC_IvtrItem item)
{
var slots = EnsureSlots(byPackage);
if (slot < 0) return;
slots[slot] = item;
}
public static void ExchangeItem(byte byPackage, int slot1, int slot2)
{
if (slot1 == slot2) return;
var slots = EnsureSlots(byPackage);
slots.TryGetValue(slot1, out var i1);
slots.TryGetValue(slot2, out var i2);
if (i1 != null) slots[slot2] = i1; else slots.Remove(slot2);
if (i2 != null) slots[slot1] = i2; else slots.Remove(slot1);
}
public static bool RemoveItem(byte byPackage, int slot, int amount)
{
var slots = EnsureSlots(byPackage);
if (!slots.TryGetValue(slot, out var item) || item == null)
return true;
int newCount = Math.Max(0, item.m_iCount - Math.Max(0, amount));
item.m_iCount = newCount;
if (newCount <= 0)
slots.Remove(slot);
else
slots[slot] = item;
return true;
}
public static void RemoveAllItems(byte byPackage)
{
var slots = EnsureSlots(byPackage);
slots.Clear();
}
public static int SearchEmpty(byte byPackage)
{
int size = _packSizeByPackage.TryGetValue(byPackage, out var s) ? s : 0;
var slots = EnsureSlots(byPackage);
for (int i = 0; i < size; i++)
if (!slots.ContainsKey(i)) return i;
return -1;
}
public static int GetEmptySlotNum(byte byPackage)
{
int size = _packSizeByPackage.TryGetValue(byPackage, out var s) ? s : 0;
int occupied = EnsureSlots(byPackage).Count;
int empty = Math.Max(0, size - occupied);
return empty;
}
public static int FindItem(byte byPackage, int templateId, int baseIdx = 0)
{
var slots = EnsureSlots(byPackage);
int size = _packSizeByPackage.TryGetValue(byPackage, out var s) ? s : 0;
if (baseIdx < 0) baseIdx = 0;
for (int i = baseIdx; i < size; i++)
{
if (slots.TryGetValue(i, out var it) && it != null && it.m_tid == templateId)
return i;
}
return -1;
}
public static int GetItemTotalNum(byte byPackage, int templateId)
{
int total = 0;
foreach (var kv in EnsureSlots(byPackage))
{
var it = kv.Value;
if (it != null && it.m_tid == templateId)
total += Math.Max(0, it.m_iCount);
}
return total;
}
public static int GetItemCanPileCount(byte byPackage, int templateId)
{
int ret = 0;
foreach (var kv in EnsureSlots(byPackage))
{
var it = kv.Value;
if (it != null && it.m_tid == templateId)
{
int pileLimit = Math.Max(1, EC_IvtrItemUtils.GetPileLimit(templateId));
ret += Math.Max(0, pileLimit - Math.Max(0, it.m_iCount));
}
}
return ret;
}
public static int CanAddItem(byte byPackage, int templateId, int amount, bool tryPile)
{
int firstEmpty = -1;
int pileLimit = Math.Max(1, EC_IvtrItemUtils.GetPileLimit(templateId));
int size = _packSizeByPackage.TryGetValue(byPackage, out var s) ? s : 0;
var slots = EnsureSlots(byPackage);
for (int i = 0; i < size; i++)
{
if (!slots.TryGetValue(i, out var it) || it == null)
{
if (!tryPile) return i;
if (firstEmpty < 0) firstEmpty = i;
}
else if (it.m_tid == templateId && it.m_iCount + amount <= pileLimit)
{
return i;
}
}
return firstEmpty;
}
public static bool MergeItem(byte byPackage, int templateId, int expireDate, int amount, out int lastSlot, out int slotAmount)
{
lastSlot = -1;
slotAmount = 0;
var slots = EnsureSlots(byPackage);
int pileLimit = Math.Max(1, EC_IvtrItemUtils.GetPileLimit(templateId));
int firstEmpty = -1;
int size = _packSizeByPackage.TryGetValue(byPackage, out var s) ? s : 0;
for (int i = 0; i < size && amount > 0; i++)
{
slots.TryGetValue(i, out var slotItem);
if (slotItem == null)
{
if (firstEmpty < 0) firstEmpty = i;
continue;
}
if (slotItem.m_tid != templateId) continue;
int canAdd = Math.Max(0, pileLimit - Math.Max(0, slotItem.m_iCount));
if (canAdd <= 0) continue;
int add = Math.Min(canAdd, amount);
slotItem.m_iCount += add;
amount -= add;
lastSlot = i;
slotAmount = slotItem.m_iCount;
}
if (amount <= 0) return true;
if (firstEmpty < 0) return false;
var newItem = new EC_IvtrItem
{
Package = byPackage,
Slot = firstEmpty,
m_tid = templateId,
m_expire_date = expireDate,
State = 0,
m_iCount = amount,
Crc = 0,
Content = null
};
slots[firstEmpty] = newItem;
lastSlot = firstEmpty;
slotAmount = amount;
return true;
}
public static bool MoveItem(byte byPackage, int src, int dest, int amount)
{
if (src == dest) return false;
if (amount <= 0) return false;
int size = _packSizeByPackage.TryGetValue(byPackage, out var s) ? s : 0;
if (src < 0 || src >= size || dest < 0 || dest >= size) return false;
var slots = EnsureSlots(byPackage);
if (!slots.TryGetValue(src, out var srcItem) || srcItem == null) return false;
slots.TryGetValue(dest, out var dstItem);
if (dstItem == null)
{
var clone = new EC_IvtrItem
{
Package = byPackage,
Slot = dest,
m_tid = srcItem.m_tid,
m_expire_date = srcItem.m_expire_date,
State = srcItem.State,
m_iCount = amount,
Crc = srcItem.Crc,
Content = srcItem.Content != null ? (byte[])srcItem.Content.Clone() : null
};
slots[dest] = clone;
}
else
{
if (dstItem.m_tid != srcItem.m_tid) return false;
int pileLimit = Math.Max(1, EC_IvtrItemUtils.GetPileLimit(dstItem.m_tid));
int canAdd = Math.Max(0, pileLimit - Math.Max(0, dstItem.m_iCount));
int add = Math.Min(canAdd, amount);
if (add <= 0) return false;
dstItem.m_iCount += add;
amount = add;
}
RemoveItem(byPackage, src, amount);
return true;
}
public static void UpdatePack(byte byPackage, int ivtrSize, IEnumerable<EC_IvtrItem> items)
{
_packSizeByPackage[byPackage] = ivtrSize;
if (!_itemsByPackage.TryGetValue(byPackage, out var slots))
{
slots = new Dictionary<int, EC_IvtrItem>();
_itemsByPackage[byPackage] = slots;
}
slots.Clear();
if (items != null)
{
foreach (var it in items)
{
if (it != null && it.Slot >= 0)
{
slots[it.Slot] = it;
}
}
}
// Log this pack's items
LogPackInternal(byPackage, ivtrSize, slots);
}
public static bool ResetWithDetailData(byte byPackage, int ivtrSize, byte[] data)
{
// Uses EC_IvtrItem.TryParseInventoryDetail format
if (data == null)
{
Resize(byPackage, ivtrSize);
RemoveAllItems(byPackage);
return true;
}
if (!EC_IvtrItemUtils.TryParseInventoryDetail(data, out var pkg, out var size, out var items))
return false;
// Prefer header values when valid
byte finalPkg = byPackage;
if (pkg == byPackage) finalPkg = pkg;
int finalSize = ivtrSize > 0 ? ivtrSize : size;
UpdatePack(finalPkg, finalSize, items);
return true;
}
private static void LogPackInternal(byte byPackage, int ivtrSize, IReadOnlyDictionary<int, EC_IvtrItem> slots)
{
//Debug.Log($"[Inventory] === Pack {GetPackageName(byPackage)}({byPackage}) size={ivtrSize}, items={(slots?.Count ?? 0)} ===");
if (slots == null || slots.Count == 0)
{
//Debug.Log("[Inventory] (empty)");
return;
}
foreach (var kv in slots)
{
var it = kv.Value;
string itemName = EC_IvtrItemUtils.ResolveItemName(it.m_tid);
string extraHex = it.Content != null && it.Content.Length > 0 ? EC_IvtrItemUtils.BytesToHex(it.Content, MaxContentHexToLog) : "";
//int extraLen = it.Content?.Length ?? 0;
//Debug.Log(
// $"[Inventory] pkg={GetPackageName(it.Package)}({it.Package}) slot={it.Slot} tid={it.TemplateId}{(string.IsNullOrEmpty(itemName) ? "" : " \"" + itemName + "\"")} count={it.Count} state={it.State} expire={it.ExpireDate} crc={it.Crc} content_len={extraLen}{(extraLen > 0 ? ", content_hex=" + extraHex : "")}"
//);
}
}
public static void LogInventoryPacket(string tag, byte[] buffer, int hostId)
{
if (buffer == null)
{
return;
}
int index = 0;
if (buffer.Length < 6)
{
//LogInventoryRaw(tag, buffer);
return;
}
byte byPackage = buffer[index++];
byte ivtrSize = buffer[index++];
uint contentLength = BitConverter.ToUInt32(buffer, index); index += 4;
int remaining = buffer.Length - index;
int contentBytes = remaining;
if (contentLength < (uint)remaining)
{
contentBytes = (int)contentLength;
}
if (contentBytes > 0)
{
byte[] content = new byte[contentBytes];
Buffer.BlockCopy(buffer, index, content, 0, contentBytes);
}
int trailing = buffer.Length - (index + contentBytes);
if (trailing > 0)
{
byte[] tail = new byte[trailing];
Buffer.BlockCopy(buffer, index + contentBytes, tail, 0, trailing);
}
}
public static void LogInventoryRaw(string tag, byte[] buffer)
{
Debug.Log($"[Inventory] {tag}: RAW HEX (len={buffer?.Length ?? 0})=\n{(buffer == null ? "<null>" : BitConverter.ToString(buffer))}");
}
// Inventory type
public static class Inventory_type
{
public const int IVTRTYPE_PACK = 0, // Normal pack
IVTRTYPE_EQUIPPACK = 1, // Equipment
IVTRTYPE_TASKPACK = 2, // Task pack
IVTRTYPE_TRASHBOX = 3, // Trash box
IVTRTYPE_TRASHBOX2 = 4, // Trash box - material box
IVTRTYPE_TRASHBOX3 = 5, // Trash box - fashion box
IVTRTYPE_ACCOUNT_BOX = 6, // User account box
IVTRTYPE_GENERALCARD_BOX = 7; // 卡牌包裹
public const int IVTRTYPE_PACK = 0, // Normal pack
IVTRTYPE_EQUIPPACK = 1, // Equipment
IVTRTYPE_TASKPACK = 2, // Task pack
IVTRTYPE_TRASHBOX = 3, // Trash box
IVTRTYPE_TRASHBOX2 = 4, // Trash box - material box
IVTRTYPE_TRASHBOX3 = 5, // Trash box - fashion box
IVTRTYPE_ACCOUNT_BOX = 6, // User account box
IVTRTYPE_GENERALCARD_BOX = 7; // 卡牌包裹
};
// 注意 IVTRTYPE_CLIENT_GENERALCARD_PACK 枚举值不能喝上面的 Inventory type 值重复!!
public static class IVTRTYPE_PACK_CLIENT_GENERALCAR
{
public const int IVTRTYPE_CLIENT_GENERALCARD_PACK = 1024; // 客户端本地包裹, 由于卡牌图鉴要求对已获得卡牌通过聊天发送。为了统一处理聊天窗口的物品,添加本地包裹。
public const int IVTRTYPE_CLIENT_GENERALCARD_PACK = 1024; // 客户端本地包裹, 由于卡牌图鉴要求对已获得卡牌通过聊天发送。为了统一处理聊天窗口的物品,添加本地包裹。
};
public EC_Inventory()
{
}
public bool Init(int iSize)
{
Resize(iSize);
return true;
}
public void Release()
{
// In C++ this deletes all heap-allocated items.
// Here we simply clear references so GC can collect them.
RemoveAllItems();
m_aItems = Array.Empty<EC_IvtrItem>();
}
public void RemoveAllItems()
{
for (int i = 0; i < m_aItems.Length; i++)
{
m_aItems[i] = null;
}
}
public void Resize(int iNewSize)
{
int oldSize = m_aItems.Length;
if (iNewSize < 0) iNewSize = 0;
if (iNewSize == oldSize)
return;
var newArray = iNewSize > 0 ? new EC_IvtrItem[iNewSize] : Array.Empty<EC_IvtrItem>();
if (oldSize > 0 && iNewSize > 0)
{
Array.Copy(m_aItems, newArray, Math.Min(oldSize, iNewSize));
}
m_aItems = newArray;
}
public EC_IvtrItem PutItem(int iSlot, EC_IvtrItem pItem)
{
if (iSlot < 0 || iSlot >= m_aItems.Length)
{
return null;
}
var old = m_aItems[iSlot];
m_aItems[iSlot] = pItem;
return old;
}
public void SetItem(int iSlot, EC_IvtrItem pItem)
{
if (iSlot < 0 || iSlot >= m_aItems.Length)
{
return;
}
m_aItems[iSlot] = pItem;
}
public EC_IvtrItem GetItem(int iSlot, bool bRemove = false)
{
if (iSlot < 0 || iSlot >= m_aItems.Length)
{
return null;
}
var pItem = m_aItems[iSlot];
if (bRemove)
m_aItems[iSlot] = null;
return pItem;
}
public void ExchangeItem(int iSlot1, int iSlot2)
{
if (iSlot1 < 0 || iSlot1 >= m_aItems.Length ||
iSlot2 < 0 || iSlot2 >= m_aItems.Length)
{
return;
}
if (iSlot1 == iSlot2)
return;
var tmp = m_aItems[iSlot1];
m_aItems[iSlot1] = m_aItems[iSlot2];
m_aItems[iSlot2] = tmp;
}
public bool MergeItem(int tid, int iExpireDate, int iAmount, out int piLastSlot, out int piLastAmount)
{
piLastSlot = -1;
piLastAmount = 0;
int firstEmpty = -1;
for (int i = 0; i < m_aItems.Length; i++)
{
var slotItem = m_aItems[i];
if (slotItem != null)
{
if (slotItem.GetTemplateID() != tid)
continue;
int pileLimit = Math.Max(1, EC_IvtrItem.GetPileLimit(tid));
int canAdd = Math.Max(0, pileLimit - Math.Max(0, slotItem.GetCount()));
if (canAdd <= 0) continue;
int add = Math.Min(canAdd, iAmount);
slotItem.AddAmount(add);
iAmount -= add;
if (iAmount == 0)
{
piLastSlot = i;
piLastAmount = slotItem.GetCount();
return true;
}
}
else if (firstEmpty < 0)
{
firstEmpty = i;
}
}
if (firstEmpty < 0 || iAmount <= 0)
{
return false;
}
var newItem = new EC_IvtrItem(tid, iExpireDate)
{
Slot = firstEmpty,
State = 0,
Crc = 0,
Content = null
};
newItem.SetCount(iAmount);
m_aItems[firstEmpty] = newItem;
piLastSlot = firstEmpty;
piLastAmount = iAmount;
return true;
}
public bool MoveItem(int iSrc, int iDest, int iAmount)
{
if (iSrc < 0 || iSrc >= m_aItems.Length ||
iDest < 0 || iDest >= m_aItems.Length)
{
return false;
}
var pSrc = m_aItems[iSrc];
var pDst = m_aItems[iDest];
if (pSrc == null)
return false;
if (iAmount == 0)
return false;
if (pDst == null)
{
var clone = new EC_IvtrItem(pSrc.GetTemplateID(), pSrc.GetExpireDate())
{
Slot = iDest,
Package = pSrc.Package,
State = pSrc.State,
Crc = pSrc.Crc,
Content = pSrc.Content != null ? (byte[])pSrc.Content.Clone() : null
};
clone.SetCount(iAmount);
m_aItems[iDest] = clone;
}
else
{
if (pSrc.GetTemplateID() != pDst.GetTemplateID())
return false;
int pileLimit = Math.Max(1, EC_IvtrItem.GetPileLimit(pDst.GetTemplateID()));
int canAdd = Math.Max(0, pileLimit - Math.Max(0, pDst.GetCount()));
int add = Math.Min(canAdd, iAmount);
if (add <= 0) return false;
pDst.AddAmount(add);
iAmount = add;
}
RemoveItem(iSrc, iAmount);
return true;
}
public bool RemoveItem(int iSlot, int iAmount)
{
if (iSlot < 0 || iSlot >= m_aItems.Length)
{
return false;
}
var pItem = m_aItems[iSlot];
if (pItem == null)
return true;
int newCount = pItem.AddAmount(-Math.Max(0, iAmount));
if (newCount <= 0)
m_aItems[iSlot] = null;
return true;
}
public int FindItem(int idItem, int baseIdx = 0)
{
if (baseIdx < 0) baseIdx = 0;
for (int i = baseIdx; i < m_aItems.Length; i++)
{
var pItem = m_aItems[i];
if (pItem != null && pItem.GetTemplateID() == idItem)
return i;
}
return -1;
}
public int GetItemTotalNum(int idItem)
{
int count = 0;
for (int i = 0; i < m_aItems.Length; i++)
{
var pItem = m_aItems[i];
if (pItem != null && pItem.GetTemplateID() == idItem)
count += Math.Max(0, pItem.GetCount());
}
return count;
}
public int SearchEmpty()
{
for (int i = 0; i < m_aItems.Length; i++)
{
if (m_aItems[i] == null)
return i;
}
return -1;
}
public int GetEmptySlotNum()
{
int count = 0;
for (int i = 0; i < m_aItems.Length; i++)
{
if (m_aItems[i] == null)
count++;
}
return count;
}
public int CanAddItem(int idItem, int iAmount, bool tryPile)
{
int foundEmpty = -1;
for (int i = 0; i < m_aItems.Length; i++)
{
var pItem = m_aItems[i];
if (pItem == null)
{
if (!tryPile) return i;
if (foundEmpty < 0) foundEmpty = i;
}
else if (pItem.GetTemplateID() == idItem)
{
int pileLimit = Math.Max(1, EC_IvtrItem.GetPileLimit(idItem));
if (pItem.GetCount() + iAmount <= pileLimit)
return i;
}
}
return foundEmpty;
}
public int GetSize()
{
return m_aItems.Length;
}
}
}
@@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: b060723330d7f49409ca241f4e460bed
guid: 0632a4edec7d56543a1bfea4c263ba81
@@ -10,6 +10,7 @@ using BrewMonster;
using BrewMonster.Common;
using ModelRenderer.Scripts.GameData;
using PerfectWorld.Scripts.Managers;
using BrewMonster.Scripts;
namespace BrewMonster.Scripts.Managers
{
@@ -384,7 +385,7 @@ namespace BrewMonster.Scripts.Managers
{
return string.Empty;
}
string itemName = EC_IvtrItemUtils.ResolveItemName(itemData.m_tid);
string itemName = EC_IvtrItemUtils.Instance.ResolveItemName(itemData.m_tid);
string displayText = string.IsNullOrEmpty(itemName) ? $"Item {itemData.m_tid}" : itemName;
if (itemData.m_iCount > 1)
{
@@ -654,34 +655,23 @@ namespace BrewMonster.Scripts.Managers
// === MVC: Model ===
private class InventoryModel
{
private readonly FieldInfo itemsByPackageField;
public InventoryModel()
{
var inventoryType = typeof(EC_Inventory);
itemsByPackageField = inventoryType.GetField("_itemsByPackage", BindingFlags.NonPublic | BindingFlags.Static);
if (itemsByPackageField == null)
{
Debug.LogError("[InventoryUI] Could not access _itemsByPackage field from EC_Inventory");
}
}
public Dictionary<int, EC_IvtrItem> GetInventoryData(byte package)
{
if (itemsByPackageField == null)
// Read from host player's per-package CECInventory instance
var host = CECGameRun.Instance?.GetHostPlayer();
var inv = host?.GetInventory(package);
var result = new Dictionary<int, EC_IvtrItem>();
if (inv == null)
return result;
int size = inv.GetSize();
for (int i = 0; i < size; i++)
{
return new Dictionary<int, EC_IvtrItem>();
var item = inv.GetItem(i, false);
if (item != null)
result[i] = item;
}
var itemsByPackage = itemsByPackageField.GetValue(null) as Dictionary<byte, Dictionary<int, EC_IvtrItem>>;
if (itemsByPackage == null)
{
return new Dictionary<int, EC_IvtrItem>();
}
if (itemsByPackage.TryGetValue(package, out var packageItems))
{
return packageItems;
}
return new Dictionary<int, EC_IvtrItem>();
return result;
}
}
@@ -723,7 +713,7 @@ namespace BrewMonster.Scripts.Managers
// Set icon sprite based on item TemplateId
if (hasItem && itemData != null && itemData.m_iCount > 0)
{
var sprite = EC_IvtrItemUtils.ResolveItemIconSprite(itemData.m_tid);
var sprite = EC_IvtrItemUtils.Instance.ResolveItemIconSprite(itemData.m_tid);
image.sprite = sprite;
image.enabled = true;
}
@@ -906,7 +896,7 @@ namespace BrewMonster.Scripts.Managers
}
// Get user-friendly text from string tables
string itemName = EC_IvtrItemUtils.ResolveItemName(item.m_tid);
string itemName = EC_IvtrItemUtils.Instance.ResolveItemName(item.m_tid);
string itemDescription = GetItemDescription(item.m_tid);
string itemExtendedDesc = GetItemExtendedDescription(item.m_tid);
@@ -1075,7 +1065,7 @@ namespace BrewMonster.Scripts.Managers
foreach (int holeTid in currentSelectedEquipment.Holes)
{
if (holeTid == 0) continue;
string stoneName = EC_IvtrItemUtils.ResolveItemName(holeTid);
string stoneName = EC_IvtrItemUtils.Instance.ResolveItemName(holeTid);
// Try to fetch a description from string tables; fallback to name if unavailable
string stoneDesc = GetItemDescription(holeTid) ?? stoneName;
if (!string.IsNullOrEmpty(stoneName))
@@ -735,7 +735,7 @@ namespace PerfectWorld.Scripts.Managers
/// </summary>
public string GetName()
{
return EC_IvtrItemUtils.ResolveItemName(TemplateId);
return EC_IvtrItemUtils.Instance.ResolveItemName(TemplateId);
}
/// <summary>
@@ -2386,7 +2386,7 @@ namespace PerfectWorld.Scripts.Managers
continue;
// Get item name
string itemName = EC_IvtrItemUtils.ResolveItemName(hole);
string itemName = EC_IvtrItemUtils.Instance.ResolveItemName(hole);
string descText = "null";
// This would normally check if it's a stone and get its description
@@ -10,30 +10,27 @@ using UnityEngine;
namespace BrewMonster.Scripts.Managers
{
public class EC_IvtrItem
// NOTE: The original lightweight EC_IvtrItem packet struct has been merged into the
// EC_IvtrItem class below (which mirrors C++ CECIvtrItem). Network-only fields such as
// Package / Slot / State / Crc / Content are now stored on that class.
/// <summary>
/// Non-static UI/data helper for inventory items.
/// This holds caches and helpers for names, icons, pile limits, etc.
/// </summary>
public class EC_IvtrItemUtils
{
public byte Package;
public int Slot;
// Simple singleton-style access so existing systems can use it globally.
public static readonly EC_IvtrItemUtils Instance = new EC_IvtrItemUtils();
public int m_tid;
public int m_expire_date;
public int State;
public int m_iCount;
public ushort Crc;
public byte[] Content; // variable-length item-specific payload (can be null)
}
public static class EC_IvtrItemUtils
{
private static readonly Dictionary<int, string> _tidNameCache = new Dictionary<int, string>();
private static readonly Dictionary<int, int> _pileLimitCache = new Dictionary<int, int>();
private static readonly Dictionary<int, string> _tidIconKeyCache = new Dictionary<int, string>();
private static readonly Dictionary<string, Sprite> _iconSpriteCache = new Dictionary<string, Sprite>(StringComparer.OrdinalIgnoreCase);
private static Sprite[] _multiSpriteAtlas = null;
private static readonly Dictionary<string, int> _spriteNameToIndexCache = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
private readonly Dictionary<int, string> _tidNameCache = new Dictionary<int, string>();
private readonly Dictionary<int, int> _pileLimitCache = new Dictionary<int, int>();
private readonly Dictionary<int, string> _tidIconKeyCache = new Dictionary<int, string>();
private readonly Dictionary<string, Sprite> _iconSpriteCache = new Dictionary<string, Sprite>(StringComparer.OrdinalIgnoreCase);
private Sprite[] _multiSpriteAtlas = null;
private readonly Dictionary<string, int> _spriteNameToIndexCache = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
private const int MaxContentHexToLog = 64;
public static string ResolveItemName(int templateId)
public string ResolveItemName(int templateId)
{
if (templateId <= 0) return "";
//if (_tidNameCache.TryGetValue(templateId, out var cached)) return cached;
@@ -61,7 +58,7 @@ namespace BrewMonster.Scripts.Managers
/// <summary>
/// Resolve and load the item's icon Sprite from Resources/UI/IconSprites based on its element data file_icon (DDS) name.
/// </summary>
public static Sprite ResolveItemIconSprite(int templateId)
public Sprite ResolveItemIconSprite(int templateId)
{
if (templateId <= 0) return null;
if (_tidIconKeyCache.TryGetValue(templateId, out var cachedKey))
@@ -105,7 +102,7 @@ namespace BrewMonster.Scripts.Managers
return spriteLoaded;
}
private static Sprite LoadIconSpriteByKey(string key)
private Sprite LoadIconSpriteByKey(string key)
{
if (string.IsNullOrEmpty(key)) return null;
@@ -148,7 +145,7 @@ namespace BrewMonster.Scripts.Managers
return null;
}
private static void LoadMultiSpriteAtlas()
private void LoadMultiSpriteAtlas()
{
try
{
@@ -183,7 +180,7 @@ namespace BrewMonster.Scripts.Managers
}
}
private static object TryFindElementByScanningArrays(object edm, uint id)
private object TryFindElementByScanningArrays(object edm, uint id)
{
if (edm == null) return null;
try
@@ -213,7 +210,7 @@ namespace BrewMonster.Scripts.Managers
return null;
}
private static string ExtractIconPathFromElement(object data)
private string ExtractIconPathFromElement(object data)
{
if (data == null) return string.Empty;
var t = data.GetType();
@@ -255,7 +252,7 @@ namespace BrewMonster.Scripts.Managers
return string.Empty;
}
private static string NormalizeIconResourceKeyFromPath(string iconPath)
private string NormalizeIconResourceKeyFromPath(string iconPath)
{
if (string.IsNullOrEmpty(iconPath)) return string.Empty;
try
@@ -274,13 +271,13 @@ namespace BrewMonster.Scripts.Managers
return string.Empty;
}
private static string CacheAndReturn(int tid, string name)
private string CacheAndReturn(int tid, string name)
{
_tidNameCache[tid] = name ?? "";
return name ?? "";
}
private static string ExtractNameFromElement(object data)
private string ExtractNameFromElement(object data)
{
if (data == null) return "";
var t = data.GetType();
@@ -344,7 +341,7 @@ namespace BrewMonster.Scripts.Managers
return "";
}
private static string TryFindNameByScanningArrays(object edm, uint id)
private string TryFindNameByScanningArrays(object edm, uint id)
{
try
{
@@ -376,7 +373,7 @@ namespace BrewMonster.Scripts.Managers
return "";
}
public static bool TryParseInventoryDetail(byte[] buffer, out byte byPackage, out byte ivtrSize, out List<EC_IvtrItem> items)
public bool TryParseInventoryDetail(byte[] buffer, out byte byPackage, out byte ivtrSize, out List<EC_IvtrItem> items)
{
byPackage = 0;
ivtrSize = 0;
@@ -460,24 +457,22 @@ namespace BrewMonster.Scripts.Managers
ci += extraLen;
}
var item = new EC_IvtrItem
var item = new EC_IvtrItem(tid, expireDate)
{
Package = byPackage,
Slot = slotIndex,
m_tid = tid,
m_expire_date = expireDate,
State = state,
m_iCount = amount,
Crc = crc,
Content = extra
};
item.SetCount(amount);
items.Add(item);
}
return true;
}
public static string BytesToHex(byte[] bytes, int max)
public string BytesToHex(byte[] bytes, int max)
{
if (bytes == null || bytes.Length == 0) return "";
int len = Math.Min(bytes.Length, max);
@@ -486,7 +481,7 @@ namespace BrewMonster.Scripts.Managers
return hex;
}
public static int GetPileLimit(int templateId)
public int GetPileLimit(int templateId)
{
if (templateId <= 0) return 1;
if (_pileLimitCache.TryGetValue(templateId, out var cached)) return cached;
@@ -508,7 +503,7 @@ namespace BrewMonster.Scripts.Managers
return limit;
}
private static int ExtractPileLimitFromElement(object data)
private int ExtractPileLimitFromElement(object data)
{
if (data == null) return 1;
var t = data.GetType();
@@ -542,7 +537,783 @@ namespace BrewMonster.Scripts.Managers
catch { }
}
}
return 1;
}
return 1;
}
}
/// <summary>
/// C# mirror of C++ <c>CECIvtrItem</c> (defined in <c>EC_IvtrItem.h / EC_IvtrItem.cpp</c>).
/// This class intentionally keeps C++-style naming and layout so other C++ systems
/// can be ported over with minimal friction.
/// </summary>
public class EC_IvtrItem
{
// NOTE: The nested enums and fields mirror the original C++ names and values.
// Inventory item class ID
public enum InventoryClassId
{
ICID_ITEM = -100,
ICID_EQUIP = -101,
ICID_ARMOR = 0,
ICID_ARMORRUNE,
ICID_ARROW,
ICID_DECORATION,
ICID_DMGRUNE,
ICID_ELEMENT,
ICID_FASHION,
ICID_FLYSWORD,
ICID_MATERIAL,
ICID_MEDICINE,
ICID_REVSCROLL,
ICID_SKILLTOME,
ICID_TOSSMAT,
ICID_TOWNSCROLL,
ICID_UNIONSCROLL,
ICID_WEAPON,
ICID_TASKITEM,
ICID_STONE,
ICID_WING,
ICID_TASKDICE,
ICID_TASKNMMATTER,
ICID_ERRORITEM,
ICID_FACETICKET,
ICID_FACEPILL,
ICID_GM_GENERATOR,
ICID_RECIPE,
ICID_PETEGG,
ICID_PETFOOD,
ICID_PETFACETICKET,
ICID_FIREWORK,
ICID_TANKCALLIN,
ICID_SKILLMATTER,
ICID_REFINETICKET,
ICID_DESTROYINGESSENCE,
ICID_BIBLE,
ICID_SPEAKER,
ICID_AUTOHP,
ICID_AUTOMP,
ICID_DOUBLEEXP,
ICID_TRANSMITSCROLL,
ICID_DYETICKET,
ICID_GOBLIN,
ICID_GOBLIN_EQUIP,
ICID_GOBLIN_EXPPILL,
ICID_CERTIFICATE,
ICID_TARGETITEM,
ICID_LOOKINFOITEM,
ICID_INCSKILLABILITY,
ICID_WEDDINGBOOKCARD,
ICID_WEDDINGINVITECARD,
ICID_SHARPENER,
ICID_FACTIONMATERIAL,
ICID_CONGREGATE,
ICID_FORCETOKEN,
ICID_DYNSKILLEQUIP,
ICID_MONEYCONVERTIBLE,
ICID_MONSTERSPIRIT,
ICID_GENERALCARD,
ICID_GENERALCARD_DICE,
ICID_SHOPTOKEN,
ICID_UNIVERSAL_TOKEN,
}
// Item price scale type
public enum ScaleType
{
SCALE_BUY = 1, // Buy from NPC
SCALE_SELL, // Sell to NPC
SCALE_BOOTH, // Booth item
SCALE_MAKE, // Make item
SCALE_OFFLINESHOP, // Offline shop
}
// Description type
public enum DescType
{
DESC_NORMAL = 0,
DESC_BOOTHBUY,
DESC_REPAIR,
DESC_REWARD,
DESC_PRODUCE,
}
// Item use conditions (bit flags)
[Flags]
public enum UseCondition
{
USE_ATKTARGET = 0x0001, // Attack target
USE_PERSIST = 0x0002, // Persist some time
USE_TARGET = 0x0004, // Normal target
}
// Proc-type (bit flags)
[Flags]
public enum ProcType
{
PROC_DROPWHENDIE = 0x0001,
PROC_DROPPABLE = 0x0002,
PROC_SELLABLE = 0x0004,
PROC_LOG = 0x0008,
PROC_TRADEABLE = 0x0010,
PROC_TASK = 0x0020,
PROC_BIND = 0x0040,
PROC_UNBINDABLE = 0x0080,
PROC_DISAPEAR = 0x0100,
PROC_USE = 0x0200,
PROC_DEADDROP = 0x0400,
PROC_OFFLINE = 0x0800,
PROC_UNREPAIRABLE = 0x1000,
PROC_DESTROYING = 0x2000,
PROC_NO_USER_TRASH = 0x4000,
PROC_BINDING = 0x8000,
PROC_CAN_WEBTRADE = 0x10000,
}
// Network / UI metadata (from S2C::cmd_own_ivtr_detail_info etc.)
// These did not exist in the original C++ class but are useful on the client.
public byte Package;
public int Slot;
public int State;
public ushort Crc;
public byte[] Content; // variable-length item-specific payload (can be null)
// Fields mirror the original C++ layout.
// NOTE: These are public so that legacy ported code can access them directly,
// matching the original C-style struct usage. Prefer using accessors where possible.
public int m_iCID; // Class ID
public int m_tid; // Template id
public int m_expire_date; // Expiration date
public int m_iCount; // Item count
public int m_iPileLimit; // Pile limit number
public int m_iPrice; // Item unit price
public int m_iShopPrice; // Shop price
public long m_i64EquipMask; // Equip mask
public bool m_bEmbeddable; // true, embeddable item
public bool m_bUseable; // true, item can be used
public bool m_bFrozen; // Frozen flag set by local reason
public bool m_bNetFrozen; // Frozen flag set by net reason
public uint m_dwUseFlags; // Use condition flags
public int m_iProcType; // proc-type flag
public int m_iScaleType; // Item price scale type
public float m_fPriceScale; // Price scale
public bool m_bNeedUpdate; // true, detail data needs to be updated
public bool m_bUpdating; // true, being updating detail data
public uint m_dwUptTime; // Time when updating request was sent (ms)
public string m_strDesc; // Item description
public bool m_bIsInNPCPack; // true, this item is in NPC package
public bool m_bLocalDetailData; // true, data from GetDetailDataFromLocal
public EC_Inventory m_pDescIvtr; // Inventory only used to get item description
#region Constructors
public EC_IvtrItem()
{
// Default constructor for object-initializer scenarios;
// mirrors the main constructor but with tid/expire_date = 0.
m_iCID = (int)InventoryClassId.ICID_ITEM;
m_tid = 0;
m_expire_date = 0;
m_iCount = 0;
m_iPileLimit = 1;
m_iPrice = 1;
m_iShopPrice = 1;
m_bNeedUpdate = true;
m_bUpdating = false;
m_dwUptTime = 0;
m_i64EquipMask = 0;
m_bEmbeddable = false;
m_bUseable = false;
m_bFrozen = false;
m_bNetFrozen = false;
m_dwUseFlags = 0;
m_iProcType = 0;
m_iScaleType = (int)ScaleType.SCALE_SELL;
m_fPriceScale = 1.0f; // PLAYER_PRICE_SCALE equivalent
m_strDesc = string.Empty;
m_bIsInNPCPack = false;
m_bLocalDetailData = false;
m_pDescIvtr = null;
}
public EC_IvtrItem(int tid, int expire_date)
{
m_iCID = (int)InventoryClassId.ICID_ITEM;
m_tid = tid;
m_expire_date = expire_date;
m_iCount = 0;
m_iPileLimit = 1;
m_iPrice = 1;
m_iShopPrice = 1;
m_bNeedUpdate = true;
m_bUpdating = false;
m_dwUptTime = 0;
m_i64EquipMask = 0;
m_bEmbeddable = false;
m_bUseable = false;
m_bFrozen = false;
m_bNetFrozen = false;
m_dwUseFlags = 0;
m_iProcType = 0;
m_iScaleType = (int)ScaleType.SCALE_SELL;
m_fPriceScale = 1.0f; // PLAYER_PRICE_SCALE equivalent
m_strDesc = string.Empty;
m_bIsInNPCPack = false;
m_bLocalDetailData = false;
m_pDescIvtr = null;
}
public EC_IvtrItem(EC_IvtrItem s)
{
if (s == null) throw new ArgumentNullException(nameof(s));
m_iCID = s.m_iCID;
m_tid = s.m_tid;
m_expire_date = s.m_expire_date;
m_iCount = s.m_iCount;
m_iPileLimit = s.m_iPileLimit;
m_iPrice = s.m_iPrice;
m_iShopPrice = s.m_iShopPrice;
m_i64EquipMask = s.m_i64EquipMask;
m_bEmbeddable = s.m_bEmbeddable;
m_bUseable = s.m_bUseable;
m_bFrozen = false;
m_bNetFrozen = false;
m_dwUseFlags = s.m_dwUseFlags;
m_iProcType = s.m_iProcType;
m_iScaleType = s.m_iScaleType;
m_fPriceScale = s.m_fPriceScale;
m_bNeedUpdate = s.m_bNeedUpdate;
m_bUpdating = false;
m_dwUptTime = 0;
m_strDesc = s.m_strDesc;
m_bIsInNPCPack = s.m_bIsInNPCPack;
m_bLocalDetailData = s.m_bLocalDetailData;
m_pDescIvtr = s.m_pDescIvtr;
}
#endregion
#region Static helpers (mirror C++)
/// <summary>
/// Create an inventory item. For now this returns the base type.
/// Later this can be expanded to instantiate specific subclasses (weapon, armor, etc.)
/// based on element data type, mirroring the C++ switch in <c>CreateItem</c>.
/// </summary>
public static EC_IvtrItem CreateItem(int tid, int expire_date, int iCount, int idSpace = 0)
{
var pItem = new EC_IvtrItem(tid, expire_date);
pItem.SetCount(iCount);
return pItem;
}
/// <summary>
/// Get pile limit for a given template id.
/// C++ implementation creates a temporary item and calls its GetPileLimit().
/// Here we read directly from element data, mirroring EC_IvtrItemUtils logic.
/// </summary>
public static int GetPileLimit(int tid)
{
if (tid <= 0) return 1;
// Reuse the same cache as EC_IvtrItemUtils to avoid duplicate lookups.
// We keep this small helper inside the item class so gameplay code
// does not depend on UI helpers.
var utils = EC_IvtrItemUtils.Instance;
return utils.GetPileLimit(tid);
}
// Check whether item2 is item1's candidate (only medicines have candidates).
// Porting the full logic requires medicine essence structures; for now keep the
// signature and return false so code can be wired up later.
public static bool IsCandidate(int tid1, int tid2)
{
return false;
}
public static bool IsCandidate(int tid1, EC_IvtrItem pItem2)
{
return false;
}
/// <summary>
/// Get scaled price of specified count of items.
/// Exact port of the C++ price scaling logic.
/// </summary>
public static int GetScaledPrice(int iUnitPrice, int iCount, int iScaleType, float fScale)
{
if (iCount == 0)
return 0;
int iPrice = 0;
switch ((ScaleType)iScaleType)
{
case ScaleType.SCALE_BUY:
iPrice = (int)(iUnitPrice * fScale + 0.5f);
if (iPrice >= 1000)
iPrice = ((iPrice + 99) / 100) * 100;
else if (iPrice >= 100)
iPrice = ((iPrice + 9) / 10) * 10;
iPrice *= iCount;
break;
case ScaleType.SCALE_SELL:
iPrice = (int)(iUnitPrice * iCount * fScale + 0.5f);
break;
case ScaleType.SCALE_BOOTH:
case ScaleType.SCALE_MAKE:
iPrice = iUnitPrice * iCount;
break;
default:
iPrice = iUnitPrice * iCount;
break;
}
return iPrice;
}
public static bool IsSharpenerProperty(byte propertyType)
{
return propertyType >= 100 && propertyType <= 115;
}
#endregion
#region Virtual operations (instance side)
/// <summary>
/// Set item detail information.
/// C++ default just clears update flags; detail parsing happens in derived types.
/// </summary>
public virtual bool SetItemInfo(byte[] pInfoData, int iDataLen)
{
m_bNeedUpdate = false;
m_bUpdating = false;
m_strDesc = string.Empty;
return true;
}
/// <summary>Get item default information from database (no-op base, like C++).</summary>
public virtual void DefaultInfo()
{
}
/// <summary>Get item icon file name (C++ default returns "Unknown.dds").</summary>
public virtual string GetIconFile()
{
return "Unknown.dds";
}
/// <summary>
/// Get item name. In C++ this uses string tables; here we go through
/// <see cref="EC_IvtrItemUtils.ResolveItemName(int)"/> which already mirrors that logic.
/// </summary>
public virtual string GetName()
{
return EC_IvtrItemUtils.Instance.ResolveItemName(m_tid);
}
/// <summary>
/// Get item name color. The original returns an <c>A3DCOLOR</c>;
/// here we return ARGB packed into a <see cref="uint"/>; default is white.
/// </summary>
public virtual uint GetNameColor()
{
return 0xFFFFFFFFu;
}
/// <summary>Use item. Base class just returns true.</summary>
public virtual bool Use()
{
return true;
}
/// <summary>Get scaled price of this item instance.</summary>
public virtual int GetScaledPrice()
{
int iPrice = m_iScaleType == (int)ScaleType.SCALE_BUY ? m_iShopPrice : m_iPrice;
return GetScaledPrice(iPrice, m_iCount, m_iScaleType, m_fPriceScale);
}
/// <summary>Clone item (shallow copy, same as C++ default).</summary>
public virtual EC_IvtrItem Clone()
{
return new EC_IvtrItem(this);
}
/// <summary>Get item cool time in milliseconds (0 by default).</summary>
public virtual int GetCoolTime(out int? piMax)
{
piMax = null;
return 0;
}
public virtual bool CheckUseCondition()
{
return IsUseable();
}
/// <summary>Get drop model for showing in world.</summary>
public virtual string GetDropModel()
{
return "Models\\Error\\Error.ecm";
}
/// <summary>Get item quality level. Base returns -1 (unknown).</summary>
public virtual int GetItemLevel()
{
return -1;
}
/// <summary>
/// Get item description text (normal / booth-buy / reward / repair).
/// Mirrors the inline C++ <c>GetDesc</c>.
/// </summary>
public string GetDesc(DescType iDescType = DescType.DESC_NORMAL, EC_Inventory pInventory = null)
{
m_pDescIvtr = pInventory;
switch (iDescType)
{
case DescType.DESC_BOOTHBUY:
return GetBoothBuyDesc();
case DescType.DESC_REWARD:
return GetRewardDesc();
default:
return GetNormalDesc(iDescType == DescType.DESC_REPAIR);
}
}
/// <summary>
/// Merge item amount with another same kind item.
/// Returns the number of items actually merged.
/// </summary>
public int MergeItem(int tid, int iAmount)
{
if (tid != m_tid || m_iCount >= m_iPileLimit)
return 0;
int iNumAdd = iAmount;
if (m_iCount + iNumAdd > m_iPileLimit)
iNumAdd = m_iPileLimit - m_iCount;
m_iCount += iNumAdd;
return iNumAdd;
}
/// <summary>Add item amount. Returns new amount of item.</summary>
public int AddAmount(int iAmount)
{
m_iCount += iAmount;
if (m_iCount < 0) m_iCount = 0;
if (m_iCount > m_iPileLimit) m_iCount = m_iPileLimit;
return m_iCount;
}
public void SetAmount(int iAmount)
{
m_iCount = iAmount;
}
public void SetExpireDate(int iExpireDate)
{
m_expire_date = iExpireDate;
}
/// <summary>
/// Can this item be equipped to specified position?
/// Uses the same bitmask test as C++.
/// </summary>
public bool CanEquippedTo(int iSlot)
{
return (m_i64EquipMask & (1L << iSlot)) != 0;
}
/// <summary>
/// Get first slot index starting from <paramref name="iStartSlot"/> where this item can be equipped.
/// </summary>
public int GetEquippedSlot(int iStartSlot = 0)
{
if (!IsEquipment())
return -1;
// C++ uses SIZE_EQUIPIVTR constant; here caller should limit range if needed.
for (int i = iStartSlot; i < 64; ++i)
{
if (CanEquippedTo(i))
return i;
}
return -1;
}
/// <summary>
/// Can this item be put into account box?
/// Full C++ logic depends on config data; here we mirror the simple local flag check
/// and leave server-side blacklist for future porting.
/// </summary>
public bool CanPutIntoAccBox()
{
if ((m_iProcType & (int)ProcType.PROC_NO_USER_TRASH) != 0)
return false;
return true;
}
#endregion
#region Simple property-style accessors (1:1 with C++)
public int GetClassID() => m_iCID;
public int GetTemplateID() => m_tid;
public int GetExpireDate() => m_expire_date;
public int GetCount() => m_iCount;
public void SetCount(int iCount) => m_iCount = iCount;
public int GetPileLimitInstance() => m_iPileLimit;
public int GetUnitPrice() => m_iPrice;
public void SetUnitPrice(int iPrice) => m_iPrice = iPrice;
public int GetShopPrice() => m_iShopPrice;
public long GetEquipMask() => m_i64EquipMask;
public void SetPriceScale(int iType, float fScale)
{
m_iScaleType = iType;
m_fPriceScale = fScale;
}
public bool IsInNPCPack() => m_bIsInNPCPack;
public void SetInNPCPack(bool bInNPCPack) => m_bIsInNPCPack = bInNPCPack;
public int GetProcType() => m_iProcType;
public void SetProcType(int iType) => m_iProcType = iType;
public bool IsEmbeddable() => m_bEmbeddable;
public bool IsUseable() => m_bUseable;
public bool IsEquipment() => m_i64EquipMask != 0;
public bool IsFrozen() => m_bFrozen || m_bNetFrozen;
public virtual bool IsTradeable()
{
bool tradeableFlag = (m_iProcType & (int)ProcType.PROC_TRADEABLE) != 0;
bool bindingFlag = (m_iProcType & (int)ProcType.PROC_BINDING) != 0;
return !(tradeableFlag || bindingFlag);
}
public virtual bool IsWebTradeable()
{
return IsTradeable() || (m_iProcType & (int)ProcType.PROC_CAN_WEBTRADE) != 0;
}
public bool IsBinding()
{
bool binding = (m_iProcType & (int)ProcType.PROC_BINDING) != 0;
bool canWebTrade = (m_iProcType & (int)ProcType.PROC_CAN_WEBTRADE) != 0;
return binding && !canWebTrade;
}
public bool IsSellable()
{
return (m_iProcType & (int)ProcType.PROC_SELLABLE) == 0;
}
public bool IsRepairable()
{
return (m_iProcType & (int)ProcType.PROC_UNREPAIRABLE) == 0;
}
public virtual bool IsRare()
{
return GetUnitPrice() >= 10000 || m_iCID == (int)InventoryClassId.ICID_MONEYCONVERTIBLE;
}
public bool NeedUpdate() => m_bNeedUpdate;
public void GetDetailDataFromSev(int iPack, int iSlot)
{
// Full network request logic will be wired when the session layer is ported.
// We keep the state flags to mirror C++ behavior.
if (!m_bNeedUpdate)
return;
if (m_bUpdating)
{
// In C++ this checks a timer and can resend; here we just early-out.
return;
}
m_bUpdating = true;
// m_dwUptTime could be set from a game time provider when available.
}
public void GetDetailDataFromLocal()
{
// Placeholder: when itemdataman is ported, this will read default item content.
SetItemInfo(null, 0);
m_bLocalDetailData = true;
}
public bool IsDataFromLocal() => m_bLocalDetailData;
public void Freeze(bool bFreeze) => m_bFrozen = bFreeze;
public void NetFreeze(bool bFreeze) => m_bNetFrozen = bFreeze;
public uint GetUseFlags() => m_dwUseFlags;
public bool Use_AtkTarget() => (m_dwUseFlags & (uint)UseCondition.USE_ATKTARGET) != 0;
public bool Use_Persist() => (m_dwUseFlags & (uint)UseCondition.USE_PERSIST) != 0;
public bool Use_Target() => (m_dwUseFlags & (uint)UseCondition.USE_TARGET) != 0;
#endregion
#region Protected description helpers (simplified stubs)
/// <summary>
/// Base implementation: just returns current description string.
/// Derived item types can override and build rich description like in C++.
/// </summary>
protected virtual string GetNormalDesc(bool bRepair)
{
return string.IsNullOrEmpty(m_strDesc) ? null : m_strDesc;
}
protected virtual string GetBoothBuyDesc()
{
return GetNormalDesc(false);
}
protected virtual string GetRewardDesc()
{
return GetNormalDesc(false);
}
protected virtual void AddPriceDesc(int col, bool bRepair)
{
// Full text/color building uses string tables; keep a minimal stub for now.
}
protected virtual void AddProfReqDesc(int iProfReq)
{
}
protected virtual int DecideNameCol()
{
return -1;
}
protected virtual void SetLocalProps()
{
}
protected void AddDescText(int iCol, bool bRet, string szText, params object[] args)
{
string line = (args != null && args.Length > 0) ? string.Format(szText, args) : szText;
m_strDesc += line;
if (bRet)
m_strDesc += "\n";
}
protected void AddExtDescText()
{
// Extension description comes from game configs; keep stubbed for now.
}
protected void AddExpireTimeDesc()
{
}
protected void AddExpireTimeDesc(int expire_date)
{
}
protected void AddIDDescText()
{
}
protected void AddBindDescText()
{
}
protected void AddActionTypeDescText(int action_type)
{
}
protected void TrimLastReturn()
{
if (string.IsNullOrEmpty(m_strDesc))
return;
if (m_strDesc.EndsWith("\n", StringComparison.Ordinal))
m_strDesc = m_strDesc.Substring(0, m_strDesc.Length - 1);
}
protected void BuildPriceNumberStr(int iPrice, out string str)
{
str = iPrice.ToString();
}
protected void BuildPriceNumberStr(uint iPrice, out string str)
{
str = iPrice.ToString();
}
protected int GetColorStrID(int tid)
{
return -1;
}
protected int VisualizeFloatPercent(int p)
{
var bytes = BitConverter.GetBytes(p);
float f = BitConverter.ToSingle(bytes, 0);
return (int)(f * 100.0f + 0.5f);
}
#endregion
}
/// <summary>
/// C# mirror of C++ <c>CECIvtrUnknown</c> (fallback item type).
/// </summary>
public class CECIvtrUnknown : EC_IvtrItem
{
public CECIvtrUnknown(int tid) : base(tid, 0)
{
m_iCID = (int)InventoryClassId.ICID_ERRORITEM;
m_bNeedUpdate = false;
m_bUpdating = false;
}
public CECIvtrUnknown(CECIvtrUnknown s) : base(s)
{
}
public override string GetIconFile()
{
return "Unknown.dds";
}
public override string GetName()
{
// In C++ this pulls from ITEMDESC_ERRORITEM string table.
return "Unknown Item";
}
public override EC_IvtrItem Clone()
{
return new CECIvtrUnknown(this);
}
protected override string GetNormalDesc(bool bRepair)
{
// Minimal mirror of C++: show an error item description with id.
m_strDesc = string.Empty;
AddDescText(0, false, "Error Item ({0})", m_tid);
return m_strDesc;
}
}
}
@@ -442,15 +442,18 @@ namespace BrewMonster.Scripts.Managers
/// </summary>
private static IndexOfIteminEquipmentInventory GetAvailableFingerSlot()
{
var host = CECGameRun.Instance?.GetHostPlayer();
var equipInv = host?.GetInventory(InventoryConst.IVTRTYPE_EQUIPPACK);
// Check if FINGER1 slot is empty
var finger1Item = EC_Inventory.GetItem(EC_Inventory.IVTRTYPE_EQUIPPACK, (int)IndexOfIteminEquipmentInventory.EQUIPIVTR_FINGER1, false);
var finger1Item = equipInv?.GetItem((int)IndexOfIteminEquipmentInventory.EQUIPIVTR_FINGER1, false);
if (finger1Item == null)
{
return IndexOfIteminEquipmentInventory.EQUIPIVTR_FINGER1;
}
// Check if FINGER2 slot is empty
var finger2Item = EC_Inventory.GetItem(EC_Inventory.IVTRTYPE_EQUIPPACK, (int)IndexOfIteminEquipmentInventory.EQUIPIVTR_FINGER2, false);
var finger2Item = equipInv?.GetItem((int)IndexOfIteminEquipmentInventory.EQUIPIVTR_FINGER2, false);
if (finger2Item == null)
{
return IndexOfIteminEquipmentInventory.EQUIPIVTR_FINGER2;
+61 -59
View File
@@ -35,6 +35,8 @@ public abstract partial class CECPlayer : CECObject
[SerializeField] internal int m_idCurHover; // ID of object under cursor
protected int m_iShape; // 聶簣礙繕ID
protected uint m_dwStates; // Player's basic states
// 敶枏餃稬 // Action type for attack animation
protected uint m_uAttackType;
protected int[] m_aEquips;
protected ROLEEXTPROP m_ExtProps; // Extend properties
@@ -199,7 +201,7 @@ public abstract partial class CECPlayer : CECObject
public static async Task<bool> LoadPlayerSkin(GameObject aSkins, int index, string szFile)
{
// these are LOD suffix
string[] suffix1 = {"一级", "二级", "三级"};
string[] suffix1 = {"蝥?", "鈭𣬚漣", "銝厩漣"};
string[] suffix2 = {"", "鈭𣬚漣", "銝厩漣"};
string szSkinFile = "";
@@ -366,72 +368,72 @@ public abstract partial class CECPlayer : CECObject
{
// 0
ACT_STAND = 0, // 廙姊g
ACT_FIGHTSTAND, // Đứng chiến đấu
ACT_WALK, // Đi b
ACT_RUN, // Chy
ACT_JUMP_START, // Bắt đầu nhy
ACT_FIGHTSTAND, // 廙姊g chi廕積 廕?u
ACT_WALK, // i b廙?
ACT_RUN, // Ch廕?y
ACT_JUMP_START, // B廕眩 廕?u nh廕?y
// 5
ACT_JUMP_LOOP, // Nhy trên không lặp lại
ACT_JUMP_LAND, // Nhy tiếp đất
ACT_JUMP_LOOP, // Nh廕?y trn khng l廕搆 l廕?i
ACT_JUMP_LAND, // Nh廕?y ti廕穆 廕?t
ACT_SWIM, // B①i
ACT_HANGINWATER, // L① l廙要g trong n⑹廙𢲷
ACT_TAKEOFF, // Ct cánh (should be ACT_TAKEOFF_WING)
ACT_TAKEOFF, // C廕?t cnh (should be ACT_TAKEOFF_WING)
// 10
ACT_HANGINAIR, // Treo tr礙n kh繫ng (should be ACT_HANGINAIR_WING)
ACT_FLY, // Bay (should be ACT_FLY_WING)
ACT_FLYDOWN, // Bay xu廙𤉋g cao (should be ACT_FLYDOWN_WING_HIGH)
ACT_FLYDOWN_WING_LOW, // Bay xuống thp (should be ACT_FLYDOWN_WING_LOW)
ACT_LANDON, // H cánh (should be ACT_LAND_WING)
ACT_FLYDOWN_WING_LOW, // Bay xu廙𤉋g th廕?p (should be ACT_FLYDOWN_WING_LOW)
ACT_LANDON, // H廕? cnh (should be ACT_LAND_WING)
// 15
ACT_TAKEOFF_SWORD, // Kiếm bay - ct cánh
ACT_TAKEOFF_SWORD, // Ki廕禦 bay - c廕?t cnh
ACT_HANGINAIR_SWORD, // Ki廕禦 bay - treo kh繫ng trung
ACT_FLY_SWORD, // Ki廕禦 bay - ti廕積 t廙𢹂
ACT_FLYDOWN_SWORD_HIGH, // Ki廕禦 bay - r①i cao
ACT_FLYDOWN_SWORD_LOW, // Kiếm bay - rơi thp
ACT_FLYDOWN_SWORD_LOW, // Ki廕禦 bay - ri th廕?p
// 20
ACT_LANDON_SWORD, // Kiếm bay - h cánh
ACT_LANDON_SWORD, // Ki廕禦 bay - h廕? cnh
ACT_SITDOWN, // Ng廙𧗽
ACT_SITDOWN_LOOP, // Ngồi lặp lại
ACT_SITDOWN_LOOP, // Ng廙𧗽 l廕搆 l廕?i
ACT_STANDUP, // 廙姊g d廕軌
ACT_WOUNDED, // B thương
ACT_WOUNDED, // B廙? th⑹①ng
// 25
ACT_GROUNDDIE, // Chết trên mặt đất
ACT_GROUNDDIE_LOOP, // Chết trên đất (loop)
ACT_GROUNDDIE, // Ch廕篙 trn m廕暗 廕?t
ACT_GROUNDDIE_LOOP, // Ch廕篙 trn 廕?t (loop)
ACT_WATERDIE, // Ch廕篙 trong n⑹廙𢲷
ACT_WATERDIE_LOOP, // Ch廕篙 trong n⑹廙𢲷 (loop)
ACT_AIRDIE_ST, // Chết trên không (bắt đầu)
ACT_AIRDIE_ST, // Ch廕篙 trn khng (b廕眩 廕?u)
// 30
ACT_AIRDIE, // Ch廕篙 tr礙n kh繫ng (loop r①i)
ACT_AIRDIE_ED, // Chết trên không (chạm đất)
ACT_AIRDIE_LAND_LOOP, // Chết rơi đất (loop)
ACT_AIRDIE_ED, // Ch廕篙 trn khng (ch廕?m 廕?t)
ACT_AIRDIE_LAND_LOOP, // Ch廕篙 ri 廕?t (loop)
ACT_REVIVE, // H廙𧗽 sinh
ACT_CUSTOMIZE, // 廙㷌g t獺c t羅y ch廙纤h
// 35
ACT_STRIKEBACK, // Bị đánh lùi
ACT_STRIKEDOWN, // Bị đánh ngã
ACT_STRIKEDOWN_LOOP, // Bị đánh ngã (loop)
ACT_STRIKEDOWN_STANDUP, // Bị đánh ngã rồi đứng dậy
ACT_PICKUP, // Nhặt đồ
ACT_STRIKEBACK, // B廙? nh li
ACT_STRIKEDOWN, // B廙? nh ng
ACT_STRIKEDOWN_LOOP, // B廙? nh ng (loop)
ACT_STRIKEDOWN_STANDUP, // B廙? nh ng r廙𧗽 廙姊g d廕軌
ACT_PICKUP, // Nh廕暗 廙?
// 40
ACT_PICKUP_LOOP, // Nhặt đồ (loop)
ACT_PICKUP_STANDUP, // Nhặt đồ đứng dậy
ACT_PICKUP_MATTER, // Nhặt vật th
ACT_PICKUP_LOOP, // Nh廕暗 廙? (loop)
ACT_PICKUP_STANDUP, // Nh廕暗 廙? 廙姊g d廕軌
ACT_PICKUP_MATTER, // Nh廕暗 v廕負 th廙?
ACT_GAPE, // H獺 mi廙𡵞g
ACT_LOOKAROUND, // Nh穫n quanh
// 45
ACT_PLAYWEAPON, // Vung v觼 kh穩
ACT_EXP_WAVE, // V廕咳 tay
ACT_EXP_NOD, // Gật đầu
ACT_EXP_SHAKEHEAD, // Lắc đầu
ACT_EXP_NOD, // G廕負 廕?u
ACT_EXP_SHAKEHEAD, // L廕畚 廕?u
ACT_EXP_SHRUG, // Nh繳n vai
// 50
@@ -442,14 +444,14 @@ public abstract partial class CECPlayer : CECObject
ACT_EXP_KISSHAND, // H繫n tay
// 55
ACT_EXP_SHY, // Ngi ngùng
ACT_EXP_SHY, // Ng廕?i ngng
ACT_EXP_SALUTE, // Cho
ACT_EXP_SITDOWN, // Ng廙𧗽 xu廙𤉋g
ACT_EXP_SITDOWN_LOOP, // Ng廙𧗽 xu廙𤉋g (loop)
ACT_EXP_SITDOWN_STANDUP, // Ng廙𧗽 xu廙𤉋g r廙𧗽 廙姊g d廕軌
// 60
ACT_EXP_ASSAULT, // Tn công
ACT_EXP_ASSAULT, // T廕?n cng
ACT_EXP_THINK, // Suy ngh藺
ACT_EXP_DEFIANCE, // Th獺ch th廙妾
ACT_EXP_VICTORY, // Chi廕積 th廕疸g
@@ -458,44 +460,44 @@ public abstract partial class CECPlayer : CECObject
// 65
ACT_EXP_KISS_LOOP, // H繫n (loop)
ACT_EXP_KISS_END, // K廕篙 th繳c h繫n
ACT_ATTACK_1, // Tn công 1
ACT_ATTACK_2, // Tn công 2
ACT_ATTACK_3, // Tn công 3
ACT_ATTACK_1, // T廕?n cng 1
ACT_ATTACK_2, // T廕?n cng 2
ACT_ATTACK_3, // T廕?n cng 3
// 70
ACT_ATTACK_4, // Tn công 4
ACT_ATTACK_4, // T廕?n cng 4
ACT_ATTACK_TOSS, // N矇m v觼 kh穩
ACT_TRICK_RUN, // Chiêu khi chy
ACT_TRICK_JUMP, // Chiêu khi nhy
ACT_FLY_GLIDE, // Lượn
ACT_TRICK_RUN, // Chiu khi ch廕?y
ACT_TRICK_JUMP, // Chiu khi nh廕?y
ACT_FLY_GLIDE, // L⑹廙?n
// 75
ACT_FLY_GLIDE_SWORD, // Kiếm bay - lượn
ACT_EXP_FIGHT, // Tư thế chiến đấu
ACT_EXP_ATTACK1, // Tn công diễn xut 1
ACT_EXP_ATTACK2, // Tn công diễn xut 2
ACT_EXP_ATTACK3, // Tn công diễn xut 3
ACT_FLY_GLIDE_SWORD, // Ki廕禦 bay - l⑹廙?n
ACT_EXP_FIGHT, // T th廕? chi廕積 廕?u
ACT_EXP_ATTACK1, // T廕?n cng di xu廕?t 1
ACT_EXP_ATTACK2, // T廕?n cng di xu廕?t 2
ACT_EXP_ATTACK3, // T廕?n cng di xu廕?t 3
// 80
ACT_EXP_ATTACK4, // Tn công diễn xut 4
ACT_EXP_DEFENCE, // Phòng th
ACT_EXP_ATTACK4, // T廕?n cng di xu廕?t 4
ACT_EXP_DEFENCE, // Phng th廙?
ACT_EXP_FALL, // T矇 ng瓊
ACT_EXP_FALLONGROUND, // Ngã xuống đất
ACT_EXP_FALLONGROUND, // Ng xu廙𤉋g 廕?t
ACT_EXP_LOOKAROUND, // Nh穫n quanh
// 85
ACT_EXP_DANCE, // Nhy múa
ACT_EXP_DANCE, // Nh廕?y ma
ACT_EXP_FASHIONWEAPON, // 廙㷌g t獺c v觼 kh穩 th廙𩥉 trang
ACT_USEITEM, // D羅ng item
ACT_USEITMELOOP, // D羅ng item (loop)
ACT_TWO_KISS, // H繫n 繫i
// 90
ACT_USING_TARGET_ITEM, // Dùng đạo c
ACT_USING_TARGET_ITEM, // Dng 廕?o c廙?
ACT_SWIM_FOR_MOVESKILL, // B①i trong l繳c d羅ng skill di chuy廙
ACT_MAX,
ACT_CASTSKILL // Ch là placeholder cho skill actions
ACT_CASTSKILL // Ch廙? l placeholder cho skill actions
}
public void PlayAttackEffect(int idTarget, int idSkill, int skillLevel, int nDamage,
@@ -655,10 +657,10 @@ public abstract partial class CECPlayer : CECObject
if (GetMoveEnv() == (int)MoveEnvironment.MOVEENV_GROUND)
{
// “起” 动作(挥起)
szAct = EC_Utility.BuildActionName(action, weapon_type, "Æð");
// 𡏭絲? 泿韏瘀
szAct = EC_Utility.BuildActionName(action, weapon_type, "");
EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szAct));
szAct = EC_Utility.BuildActionName(action, weapon_type, "Âä");
szAct = EC_Utility.BuildActionName(action, weapon_type, "");
queueActionEvent.SetData(szAct, SetApplyDamage, true, attackEvent);
EventBus.PublishChannelClass(m_PlayerInfo.cid, queueActionEvent);
//PlayNonSkillActionWithName(iAction, szAct, true, 200, true, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);gag獺ga
@@ -668,7 +670,7 @@ public abstract partial class CECPlayer : CECObject
nTime1 = _pPlayerModel.GetComActTimeSpanByName(szAct);
// “收” 动作(挥下)
// 𨀣𤣰? 泿銝页
szAct = $"{action.data.action_prefix}_{action.data.action_weapon_suffix[weapon_type].suffix}瓣";
QueueNonSkillActionWithName(iAction, szAct, 0, false, bHideFX);
@@ -690,7 +692,7 @@ public abstract partial class CECPlayer : CECObject
GetProfession() == PROF_MONK ||
GetProfession() == PROF_GHOST)
{
szActionMiddleName = "¿ÕÖгá°ò"; // tn công trên không
szActionMiddleName = "糧獺簞簷"; // t廕?n cng trn khng
}
else
{
@@ -728,7 +730,7 @@ public abstract partial class CECPlayer : CECObject
pRightHandWeapon.QueueAction(_GenWeaponActionName(szAct, m_iGender), 300, iAction, false, false, bHideFX, true);*/
// ==============================
// Điều chỉnh tốc độ phát animation theo tốc độ tấn công
// i廙 ch廙纤h t廙倴 廙? pht animation theo t廙倴 廙? t廕?n cng
// ==============================
/* if (nAttackSpeed > 0)
{
@@ -745,7 +747,7 @@ public abstract partial class CECPlayer : CECObject
attackTime = nTime1 + nTime2;*/
// ==============================
// Cập nhật vị trí weapon hanger (vũ khí)
// C廕計 nh廕負 v廙? tr weapon hanger (v kh)
// ==============================
//UpdateWeaponHangerPosByAction(iAction);
@@ -955,10 +957,10 @@ public abstract partial class CECPlayer : CECObject
int turnSpeed = 5;
if (direction.sqrMagnitude > 0.001f)
{
// To rotation mới hướng tới target
// T廕?o rotation m廙𢹂 h⑹廙𣌟g t廙𢹂 target
Quaternion targetRotation = Quaternion.LookRotation(direction, Vector3.up);
// Xoay mượt t rotation hiện tại sang rotation mc tiêu
// Xoay m⑹廙?t t廙? rotation hi廙𡵞 t廕?i sang rotation m廙?c tiu
//transform.rotation = Quaternion.Slerp(
// transform.rotation,
// targetRotation,
@@ -29,7 +29,7 @@ public class NPCBuilder : MonoSingleton<NPCBuilder>
public async Task<GameObject> GetModelByPath(string path)
{
return await AddressableManager.Instance.LoadPrefabAsync(path);
return await AddressableManager.Instance.LoadPrefabAsync(AFile.NormalizePath(path));
}
#if UNITY_EDITOR
@@ -774,7 +774,7 @@ namespace CSNetwork.S2CCommand
TEAM_MEMBER_DATA,
TEAM_MEMBER_POS, // 65
EQUIP_DATA, // ûװݣӰ
EQUIP_DATA, // 锟矫伙拷锟斤拷装锟斤拷锟斤拷锟捷o拷影锟斤拷锟斤拷锟?
EQUIP_DATA_CHANGED,
EQUIP_DAMAGED, // 装锟斤拷锟斤拷
TEAM_MEMBER_PICKUP, // 锟斤拷锟窖硷拷锟斤拷装锟斤拷
@@ -1091,8 +1091,8 @@ namespace CSNetwork.S2CCommand
PRODUCE4_ITEM_INFO,
ONLINE_AWARD_DATA, //锟斤拷锟竭斤拷锟斤拷
TOGGLE_ONLINE_AWARD, // 330 л߽Ŀ״̬
PLAYER_PROFIT_TIME, // ʱ
TOGGLE_ONLINE_AWARD, // 330 锟斤拷锟斤拷谢锟斤拷锟斤拷锟斤拷呓锟斤拷锟斤拷目锟斤拷锟阶刺?
PLAYER_PROFIT_TIME, // 锟斤拷锟斤拷锟斤拷锟绞憋拷锟?
ENTER_NONPENALTY_PVP_STATE, // PK锟睫惩凤拷
SELF_COUNTRY_NOTIFY,
PLAYER_COUNTRY_CHANGED,
@@ -1119,12 +1119,12 @@ namespace CSNetwork.S2CCommand
PET_REBUILD_NATURE_START,
PET_REBUILD_NATURE_INFO,
PET_REBUILD_NATURE_END,
EQUIP_ADDON_UPDATE_NOTIFY, //354 ֪ͨװʯ
EQUIP_ADDON_UPDATE_NOTIFY, //354 通知装锟斤拷锟斤拷石锟斤拷锟?
SELF_KING_NOTIFY, // 355
PLAYER_KING_CHANGED,
MERIDIANS_NOTIFY, // Ϣ
MERIDIANS_RESULT, // Ѩ
MERIDIANS_NOTIFY, // 锟斤拷锟斤拷锟斤拷息锟斤拷锟?
MERIDIANS_RESULT, // 锟斤拷锟斤拷锟斤拷穴锟斤拷锟?
COUNTRYBATTLE_STRONGHOND_STATE_NOTIFY,
QUERY_TOUCH_POINT, // 360
@@ -1136,32 +1136,32 @@ namespace CSNetwork.S2CCommand
MODIFY_TITLE_NOFIFY, // 365
REFRESH_SIGNIN, // 签锟斤拷状态
PARALLEL_WORLD_INFO,
PLAYER_REINCARNATION, // ת
PLAYER_REINCARNATION, // 锟斤拷锟阶?锟斤拷
REINCARNATION_TOME_INFO, // 转锟斤拷锟斤拷锟斤拷锟斤拷息
ACTIVATE_REINCARNATION_TOME, // 370 转锟斤拷锟斤拷锟斤拷锟角否激伙拷
UNIQUE_DATA_NOTIFY, // 锟斤拷史锟狡斤拷 锟斤拷全锟斤拷锟斤拷锟斤拷
USE_GIFTCARD_RESULT,
REALM_EXP, // 锟斤拷锟界经锟斤拷
REALM_LEVEL, // ȼ
REALM_LEVEL, // 锟斤拷锟斤拷燃锟?
ENTER_TRICKBATTLE, // 375 锟斤拷锟斤拷战锟斤拷 锟斤拷锟藉含锟斤拷同锟斤拷战锟斤拷锟斤拷战锟斤拷
TRICKBATTLE_PERSONAL_SCORE, // 战锟斤拷锟皆硷拷锟矫凤拷
TRICKBATTLE_CHARIOT_INFO, // 战锟斤拷锟斤拷息
PLAYER_LEADERSHIP, // ͳ
PLAYER_LEADERSHIP, // 锟斤拷锟酵筹拷锟斤拷锟?
GENERALCARD_COLLECTION_DATA, // 锟戒将锟斤拷图锟斤拷锟斤拷锟斤拷
ADD_GENERALCARD_COLLECTION, // 380 锟秸藏匡拷锟斤拷
REFRESH_MONSTERSPIRIT_LEVEL, // 锟斤拷锟斤拷
MINE_GATHERED, // ɹɼ
PLAYER_IN_OUT_BATTLE, // ҽ/ս״̬
MINE_GATHERED, // 锟斤拷锟斤拷晒锟斤拷杉锟斤拷悴?
PLAYER_IN_OUT_BATTLE, // 锟斤拷锟斤拷锟斤拷医锟斤拷锟?/锟斤拷锟斤拷战锟斤拷状态
PLAYER_QUERY_CHARIOTS, // 战锟斤拷锟斤拷锟斤拷锟斤拷询
COUNTRYBATTLE_LIVE_SHOW_RESULT, // 385 锟斤拷战战锟斤拷rank锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
RANDOM_MALL_SHOPPING_RES, // ̳Dzѯ
RANDOM_MALL_SHOPPING_RES, // 锟斤拷锟斤拷坛遣锟窖?锟斤拷锟斤拷
FACTION_PVP_MASK_MODIFY, // 锟斤拷锟斤拷PVP状态锟侥憋拷
PLAYER_WORLD_CONTRIBUTION, // 锟斤拷锟界贡锟阶讹拷
RANDOM_MAP_ORDER, // ͼ
RANDOM_MAP_ORDER, // 锟斤拷锟斤拷锟酵?
SCENE_SERVICE_NPC_LIST, // 390锟斤拷前锟斤拷锟斤拷锟斤拷学习锟斤拷锟杰碉拷NPC锟叫憋拷
NPC_VISIBLE_TID_NOTIFY, // 锟姐播通知锟斤拷野锟斤拷npc锟戒换锟斤拷锟斤拷模锟斤拷
@@ -1170,7 +1170,7 @@ namespace CSNetwork.S2CCommand
COMBO_SKILL_PREPARE,
INSTANCE_REENTER_NOTIFY, // 395 锟斤拷锟斤拷锟斤拷锟斤拷通知
PRAY_DISTANCE_CHANGE, //
PRAY_DISTANCE_CHANGE, // 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟?
};
public struct CMD_GetAllData
@@ -1071,7 +1071,7 @@ namespace CSNetwork.GPDataType
struct cmd_host_start_attack
{
public int idTarget; // target id
public uint ammo_remain;
public ushort ammo_remain;
public byte attack_speed;
};
@@ -396,7 +396,6 @@ namespace CSNetwork
}
#endif
int iHostID = _selectedRole.roleid;
BMLogger.LogError($"### GameDataSend: CMDID {pCmdHeader}");
switch (pCmdHeader)
{
case CommandID.PLAYER_INFO_2:
@@ -707,6 +706,10 @@ namespace CSNetwork
case CommandID.HOST_STOPATTACK:
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_STOPATTACK, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize);
break;
case CommandID.CHANGE_FACE_START:
case CommandID.CHANGE_FACE_END:
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_CHANGEFACE, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize);
break;
}
}
@@ -0,0 +1,13 @@
using UnityEngine;
namespace BrewMonster.Scripts
{
// this script holds reference to the default equipments for the player model
public class PlayerDefaultEquipments : MonoBehaviour
{
public GameObject DefaultUpper;
public GameObject DefaultLower;
public GameObject DefaultWirst;
public GameObject DefaultFoot;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1863d89e9a45e43febda13d0579ec149
@@ -454,12 +454,10 @@ namespace BrewMonster.Scripts.Task
public int GetCommonItemCount(uint ulCommonItem)
{
// CECInventory pPack = m_pHost.GetPack();
//EC_Inventory pPack = m_pHost.GetPack();
// return pPack != null ? EC_Inventory.GetItemTotalNum( 0, (int)ulCommonItem) : 0;
// return pPack != null ? pPack.GetItemTotalNum((int)ulCommonItem) : 0;
// paramater 1 to get type inventory (0:inventoty, 1:equip,...)
return EC_Inventory.GetItemTotalNum(EC_Inventory.IVTRTYPE_PACK, (int)ulCommonItem);
var inv = m_pHost?.GetInventory(InventoryConst.IVTRTYPE_PACK);
return inv != null ? inv.GetItemTotalNum((int)ulCommonItem) : 0;
}
public int GetTaskItemCount(uint ulTaskItem)
@@ -467,7 +465,8 @@ namespace BrewMonster.Scripts.Task
// CECInventory* pPack = m_pHost.GetTaskPack();
// return pPack ? pPack.GetItemTotalNum((int)ulTaskItem) : 0;
return EC_Inventory.GetItemTotalNum(EC_Inventory.IVTRTYPE_TASKPACK, (int)ulTaskItem);
var inv = m_pHost?.GetInventory(InventoryConst.IVTRTYPE_TASKPACK);
return inv != null ? inv.GetItemTotalNum((int)ulTaskItem) : 0;
}
private ATaskTemplMan GetTaskTemplMan()
@@ -725,7 +724,8 @@ namespace BrewMonster.Scripts.Task
public uint GetInvEmptySlot()
{
return (uint)EC_Inventory.GetEmptySlotNum(EC_Inventory.IVTRTYPE_PACK);
var inv = m_pHost?.GetInventory(InventoryConst.IVTRTYPE_PACK);
return inv != null ? (uint)inv.GetEmptySlotNum() : 0u;
}
public int GetFactionContrib()
@@ -815,7 +815,7 @@ namespace BrewMonster.PerfectWorld.Scripts.Task.UI
{
var img = m_pImg_Item[i];
if (img == null) continue;
var sprite = EC_IvtrItemUtils.ResolveItemIconSprite((int)award.m_ItemsId[i]);
var sprite = EC_IvtrItemUtils.Instance.ResolveItemIconSprite((int)award.m_ItemsId[i]);
if (sprite != null) img.sprite = sprite;
img.color = Color.white;
img.gameObject.SetActive(true);
@@ -1198,7 +1198,7 @@ namespace BrewMonster.PerfectWorld.Scripts.Task.UI
// Resolve item name
// 解析物品名称
int itemTid = unchecked((int)tsi.m_ItemsWanted[i].m_ulItemId);
string itemName = EC_IvtrItemUtils.ResolveItemName(itemTid);
string itemName = EC_IvtrItemUtils.Instance.ResolveItemName(itemTid);
if (string.IsNullOrEmpty(itemName)) itemName = $"Item {itemTid}";
// Compose line: name and progress (gained/toGet)
@@ -149,7 +149,7 @@ namespace BrewMonster.UI
object pData = m_pLst_Main.GetItemDataPtr(i, 0, "");
uint iService = m_pLst_Main.GetItemData(i, 0, "");
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
EC_Game.GetElementDataMan().get_data_ptr(iService, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
ElementDataManProvider.GetElementDataMan().get_data_ptr(iService, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
if (DataType == DATA_TYPE.DT_NPC_TASK_IN_SERVICE ||
DataType == DATA_TYPE.DT_NPC_TASK_OUT_SERVICE ||
DataType == DATA_TYPE.DT_NPC_TASK_MATTER_SERVICE)
@@ -227,7 +227,7 @@ namespace BrewMonster.UI
object pData;
DATA_TYPE DataType = new DATA_TYPE();
string strText = GetStringFromTable(249);
elementdataman pDataMan = EC_Game.GetElementDataMan();
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
Show(true);
@@ -1009,7 +1009,7 @@ namespace BrewMonster.UI
object pData;
DATA_TYPE DataType = new DATA_TYPE();
string strText = GetStringFromTable(249);
elementdataman pDataMan = EC_Game.GetElementDataMan();
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
// flag if this NPC contains task related service
uint validTaskService = 0;
@@ -1116,7 +1116,7 @@ namespace BrewMonster.UI
pEssence.id_task_matter_service // ÈÎÎñÏà¹ØµÄ·þÎñID: ·¢·ÅÈÎÎñÎïÆ··þÎñ
};
int idLastTask = 0, nLastTaskTime = 0, nFinishTime;
elementdataman pDataMan = EC_Game.GetElementDataMan();
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
List<TASK_ITEM> taskIn = new List<TASK_ITEM>(),
taskOut = new List<TASK_ITEM>(),
taskMatter = new List<TASK_ITEM>();
@@ -1710,7 +1710,7 @@ namespace BrewMonster.UI
if (pShow1)
{
DATA_TYPE DataType = new DATA_TYPE();
elementdataman pDataMan = EC_Game.GetElementDataMan();
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
pDataMan.get_data_ptr((uint)iService, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
@@ -3040,7 +3040,7 @@ namespace BrewMonster.UI
if (id_dialog > 0)
{
object result = EC_Game.GetElementDataMan()
object result = ElementDataManProvider.GetElementDataMan()
.get_data_ptr((uint)id_dialog, ID_SPACE.ID_SPACE_TALK, ref DataType);
if (result != null)
{
@@ -3358,7 +3358,7 @@ namespace BrewMonster.UI
if (pShow1)
{
DATA_TYPE DataType = new DATA_TYPE();
elementdataman pDataMan = EC_Game.GetElementDataMan();
elementdataman pDataMan = ElementDataManProvider.GetElementDataMan();
pDataMan.get_data_ptr((uint)iService, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);

Some files were not shown because too many files have changed in this diff Show More