From b2e2ebd12c8d1754ebfcee7f38f59f68b25c91c8 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 07 一月 2019 17:07:27 +0800
Subject: [PATCH] 5730 【后端】【1.5】时装功能开发

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py                |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py                 |    8 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py                 |   79 ++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py             |   35 +-
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py                                      |   79 ++++++
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py                                  |   35 +-
 /dev/null                                                                                          |   68 -----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintFightPower.py |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini                         |    6 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py               |   55 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py             |    3 
 PySysDB/PySysDBPY.h                                                                                |   21 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py           |  337 ++++++++++---------------
 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py                                      |    9 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py        |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                    |   24 +
 16 files changed, 452 insertions(+), 313 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 57996d1..6ab6cee 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1481,4 +1481,25 @@
 	DWORD		_MWID;	//法宝ID
 	BYTE		_AwardMark;	//赛季奖励等级
 	dict		AddAttr;	//属性
+};
+
+//时装表
+
+struct tagCoat
+{
+	DWORD		_CoatID;	//时装编号
+	list		EquipItemID;	//装备物品ID(按职业顺序)
+	DWORD		UnlockItemID;	//材料物品ID
+	DWORD		MaxLV;	//最大星级
+	list		CostItemCnt;	//材料数量
+	dict		StarAttr;	//属性
+};
+
+//时装柜升级表
+
+struct tagCoatChestUp
+{
+	DWORD		_LV;	//等级
+	BYTE		NeedExp;	//升级所需经验
+	dict		AddAttr;	//属性
 };
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 990f186..b6f4ae5 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -8176,6 +8176,83 @@
 
 
 #------------------------------------------------------
+# A5 20 时装分解 #tagCMCoatDecompose
+
+class  tagCMCoatDecompose(Structure):
+    Head = tagHead()
+    Count = 0    #(BYTE Count)//材料所在背包索引的数量
+    IndexList = list()    #(vector<WORD> IndexList)//材料所在背包索引列表
+    ItemIDList = list()    #(vector<DWORD> ItemIDList)//材料所在背包物品ID列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA5
+        self.Head.SubCmd = 0x20
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+            self.IndexList.append(value)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+            self.ItemIDList.append(value)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA5
+        self.Head.SubCmd = 0x20
+        self.Count = 0
+        self.IndexList = list()
+        self.ItemIDList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += 2 * self.Count
+        length += 4 * self.Count
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.Count)
+        for i in range(self.Count):
+            data = CommFunc.WriteWORD(data, self.IndexList[i])
+        for i in range(self.Count):
+            data = CommFunc.WriteDWORD(data, self.ItemIDList[i])
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Count:%d,
+                                IndexList:%s,
+                                ItemIDList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Count,
+                                "...",
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagCMCoatDecompose=tagCMCoatDecompose()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCoatDecompose.Head.Cmd,m_NAtagCMCoatDecompose.Head.SubCmd))] = m_NAtagCMCoatDecompose
+
+
+#------------------------------------------------------
 # A5 0B 玩家时装升级 #tagCMCoatUp
 
 class  tagCMCoatUp(Structure):
@@ -8183,7 +8260,7 @@
     _fields_ = [
                   ("Cmd", c_ubyte),
                   ("SubCmd", c_ubyte),
-                  ("CoatIndex", c_ubyte),    # 时装索引
+                  ("CoatIndex", c_int),    # 时装索引
                   ]
 
     def __init__(self):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index b085017..c16f2b3 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -23995,7 +23995,6 @@
                   ("SubCmd", c_ubyte),
                   ("CoatIndex", c_int),    #时装索引
                   ("CoatLV", c_ubyte),    #时装等级
-                  ("CoatExp", c_int),    #时装祝福值经验
                   ]
 
     def __init__(self):
@@ -24014,7 +24013,6 @@
         self.SubCmd = 0x02
         self.CoatIndex = 0
         self.CoatLV = 0
-        self.CoatExp = 0
         return
 
     def GetLength(self):
@@ -24028,23 +24026,22 @@
                                 Cmd:%s,
                                 SubCmd:%s,
                                 CoatIndex:%d,
-                                CoatLV:%d,
-                                CoatExp:%d
+                                CoatLV:%d
                                 '''\
                                 %(
                                 self.Cmd,
                                 self.SubCmd,
                                 self.CoatIndex,
-                                self.CoatLV,
-                                self.CoatExp
+                                self.CoatLV
                                 )
         return DumpString
 
 
 class  tagMCClothesCoatSkinState(Structure):
     Head = tagHead()
-    SkinOpenState = 0    #(DWORD SkinOpenState)//时装激活状态, 按索引表示激活状态
-    CoatNum = 0    #(BYTE CoatNum)//时装个数
+    CoatChestLV = 0    #(DWORD CoatChestLV)//时装柜等级
+    CoatChestExp = 0    #(DWORD CoatChestExp)//时装柜经验
+    CoatNum = 0    #(WORD CoatNum)//时装个数
     CoatInfoList = list()    #(vector<tagMCClothesCoatLVInfo> CoatInfoList)// 时装数据列表
     data = None
 
@@ -24057,8 +24054,9 @@
     def ReadData(self, _lpData, _pos=0, _Len=0):
         self.Clear()
         _pos = self.Head.ReadData(_lpData, _pos)
-        self.SkinOpenState,_pos = CommFunc.ReadDWORD(_lpData, _pos)
-        self.CoatNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.CoatChestLV,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.CoatChestExp,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.CoatNum,_pos = CommFunc.ReadWORD(_lpData, _pos)
         for i in range(self.CoatNum):
             temCoatInfoList = tagMCClothesCoatLVInfo()
             _pos = temCoatInfoList.ReadData(_lpData, _pos)
@@ -24070,7 +24068,8 @@
         self.Head.Clear()
         self.Head.Cmd = 0xB1
         self.Head.SubCmd = 0x02
-        self.SkinOpenState = 0
+        self.CoatChestLV = 0
+        self.CoatChestExp = 0
         self.CoatNum = 0
         self.CoatInfoList = list()
         return
@@ -24079,7 +24078,8 @@
         length = 0
         length += self.Head.GetLength()
         length += 4
-        length += 1
+        length += 4
+        length += 2
         for i in range(self.CoatNum):
             length += self.CoatInfoList[i].GetLength()
 
@@ -24088,8 +24088,9 @@
     def GetBuffer(self):
         data = ''
         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
-        data = CommFunc.WriteDWORD(data, self.SkinOpenState)
-        data = CommFunc.WriteBYTE(data, self.CoatNum)
+        data = CommFunc.WriteDWORD(data, self.CoatChestLV)
+        data = CommFunc.WriteDWORD(data, self.CoatChestExp)
+        data = CommFunc.WriteWORD(data, self.CoatNum)
         for i in range(self.CoatNum):
             data = CommFunc.WriteString(data, self.CoatInfoList[i].GetLength(), self.CoatInfoList[i].GetBuffer())
         return data
@@ -24097,13 +24098,15 @@
     def OutputString(self):
         DumpString = '''
                                 Head:%s,
-                                SkinOpenState:%d,
+                                CoatChestLV:%d,
+                                CoatChestExp:%d,
                                 CoatNum:%d,
                                 CoatInfoList:%s
                                 '''\
                                 %(
                                 self.Head.OutputString(),
-                                self.SkinOpenState,
+                                self.CoatChestLV,
+                                self.CoatChestExp,
                                 self.CoatNum,
                                 "..."
                                 )
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 3c04664..b1b8424 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1260,6 +1260,7 @@
 Def_IudetWingProgressValue = 42 #羽翼精炼值
 Def_IudetCreateTime = 44 # 时效物品的创建时间
 Def_IudetGatherSoulLV = 46  # 聚魂等级
+Def_IudetExpireTime = 48 # 时效物品指定有效时间,时间单位由时效类型决定
 # 200~300 宠物数据用
 Def_IudetPet_NPCID = 200  # npcID
 Def_IudetPet_ClassLV = 202  # 阶级
@@ -1321,7 +1322,7 @@
 )=range(5)
 
 # 战斗力模块类型
-Def_MFPType_Max = 27
+Def_MFPType_Max = 28
 ModuleFightPowerTypeList = (
 Def_MFPType_Role, # 角色 0
 Def_MFPType_Equip, # 装备(基本装备位) 1
@@ -1347,6 +1348,7 @@
 Def_MFPType_Dogz, # 神兽 21
 Def_MFPType_GatherSoul, # 聚魂 22
 Def_MFPType_MagicWeapon4, # 王者法宝 23
+Def_MFPType_Coat, # 时装 24
 Def_MFPType_Other, # 其他
 
 #以下暂时没用到,改时再处理
@@ -1703,8 +1705,11 @@
     retBaldric5,     #17 佩饰
     retBaldric6,     #18 佩饰
     retHorse,        #19 坐骑
+    retWeaponSkin,   #20 时装武器
+    retClothesSkin,  #21 时装衣服
+    retWeapon2Skin,  #22 时装副手
     retMax,
-) = range(1, 21)
+) = range(1, 24)
 
 
 # 神兽装备位定义
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index e6a178d..923646a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1007,12 +1007,16 @@
 Writer = xdh
 Releaser = xdh
 RegType = 0
-RegisterPackCount = 1
+RegisterPackCount = 2
 
 PacketCMD_1=0xA5
 PacketSubCMD_1=0x0B
 PacketCallFunc_1=OnPlayerCoatUp
 
+PacketCMD_2=0xA5
+PacketSubCMD_2=0x20
+PacketCallFunc_2=OnCoatDecompose
+
 ;悬赏任务
 [PlayerArrestTask]
 ScriptName = Player\PlayerArrestTask.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 7cbb27b..9f58909 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -2383,7 +2383,13 @@
 Type_Equip_CanTake = ShareDefine.RoleEquipType
 
 #装备物品位置,不需要重刷属性
-EquipItemNoRefreshState = []
+EquipItemNoRefreshState = [
+    ShareDefine.retHorse,        #19 坐骑
+    ShareDefine.retWing,        #11 翅膀
+    ShareDefine.retWeaponSkin,   #20 时装武器
+    ShareDefine.retClothesSkin,  #21 时装衣服
+    ShareDefine.retWeapon2Skin,  #22 时装副手
+                           ]
 
 # 需要广播外观的装备部位
 Def_SyncEquipStateByIndex = [
@@ -3540,9 +3546,9 @@
 Def_PDict_GodWeaponExp = "GodWeaponExp_%s" # 神器等级对应祝福值经验, 参数神器索引
 Def_PDict_GodWeaponState = "GodWeaponState" # 神器是否已经激活, 按索引位存储神器是否激活
 
-Def_PDict_ClothesSkinOpenState = "ClothesSkinOpenState"  # 时装皮肤激活状态
 Def_PDict_ClothesSkinLV = "ClothesSkinLV_%s"  # 时装皮肤等级,参数时装索引
-Def_PDict_ClothesSkinCurBless = "ClothesSkinCurBless_%s"  # 时装皮肤祝福值,参数时装索引
+Def_PDict_ClothesChestLV = "ClothesChestLV"  # 时装柜等级
+Def_PDict_ClothesChestEXP = "ClothesChestEXP"  # 时装柜经验
 
 Def_PDict_CostVIPExp = "CostVIPExp"  # 消费VIP经验
 Def_PDict_CostVIPLVReward = "CostVIPLVReward"  # 消费VIP等级奖励
@@ -4321,8 +4327,9 @@
 Def_CalcAttrFunc_DogzEquip, # 神兽装备37
 Def_CalcAttrFunc_DogzEquipPlus, # 神兽装备强化38
 Def_CalcAttrFunc_GatherSoul, # 聚魂39
-Def_CalcAttrFunc_MagicWeapon4 # 王者法宝40
-) = range(41)
+Def_CalcAttrFunc_MagicWeapon4, # 王者法宝40
+Def_CalcAttrFunc_Coat, # 时装41
+) = range(42)
 
 
 # 在此列表中的功能属性,不享受百分比加成,--属性参与战力计算
@@ -4363,6 +4370,7 @@
                             ShareDefine.Def_MFPType_StoveYao:[Def_CalcAttrFunc_StoveYao],
                             ShareDefine.Def_MFPType_MagicWeaponSoul:[Def_CalcAttrFunc_MagicWeaponSoul],
                             ShareDefine.Def_MFPType_GatherSoul:[Def_CalcAttrFunc_GatherSoul],
+                            ShareDefine.Def_MFPType_Coat:[Def_CalcAttrFunc_Coat],
                             # 神兽战力同装备模块战力一致,受评分影响,装备评分相关的战力另外算
                             ShareDefine.Def_MFPType_Dogz:[Def_CalcAttrFunc_Dogz, Def_CalcAttrFunc_DogzEquipPlus],
                             ShareDefine.Def_MFPType_Other:[Def_CalcAttrFunc_Success, Def_CalcAttrFunc_FamilyTech, Def_CalcAttrFunc_EquipDecompose],
@@ -4804,7 +4812,8 @@
 ItemDel_DogzEquipPlus, # 神兽装备强化
 ItemDel_ChatBubbleBox, # 激活聊天气泡框
 ItemDel_GatherSoul, # 聚魂分解
-) = range(2000, 2000 + 36)
+ItemDel_CoatDecompose, # 时装分解
+) = range(2000, 2000 + 37)
 
 # 物品扣除类型对应信息 {类型:eventName, ...}
 ItemDelTypeDict = {
@@ -4842,6 +4851,9 @@
                    ItemDel_AddFBCnt:"AddFBCnt",
                    ItemDel_AddKillBossCnt:"AddKillBossCnt",
                    ItemDel_DogzEquipPlus:"DogzEquipPlus",
+                   ItemDel_ChatBubbleBox:"ChatBubbleBox",
+                   ItemDel_GatherSoul:"GatherSoul",
+                   ItemDel_CoatDecompose:"CoatDecompose",
                    }
 
 ##==================================================================================================
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 990f186..b6f4ae5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -8176,6 +8176,83 @@
 
 
 #------------------------------------------------------
+# A5 20 时装分解 #tagCMCoatDecompose
+
+class  tagCMCoatDecompose(Structure):
+    Head = tagHead()
+    Count = 0    #(BYTE Count)//材料所在背包索引的数量
+    IndexList = list()    #(vector<WORD> IndexList)//材料所在背包索引列表
+    ItemIDList = list()    #(vector<DWORD> ItemIDList)//材料所在背包物品ID列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA5
+        self.Head.SubCmd = 0x20
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+            self.IndexList.append(value)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+            self.ItemIDList.append(value)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA5
+        self.Head.SubCmd = 0x20
+        self.Count = 0
+        self.IndexList = list()
+        self.ItemIDList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += 2 * self.Count
+        length += 4 * self.Count
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.Count)
+        for i in range(self.Count):
+            data = CommFunc.WriteWORD(data, self.IndexList[i])
+        for i in range(self.Count):
+            data = CommFunc.WriteDWORD(data, self.ItemIDList[i])
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Count:%d,
+                                IndexList:%s,
+                                ItemIDList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Count,
+                                "...",
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagCMCoatDecompose=tagCMCoatDecompose()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCoatDecompose.Head.Cmd,m_NAtagCMCoatDecompose.Head.SubCmd))] = m_NAtagCMCoatDecompose
+
+
+#------------------------------------------------------
 # A5 0B 玩家时装升级 #tagCMCoatUp
 
 class  tagCMCoatUp(Structure):
@@ -8183,7 +8260,7 @@
     _fields_ = [
                   ("Cmd", c_ubyte),
                   ("SubCmd", c_ubyte),
-                  ("CoatIndex", c_ubyte),    # 时装索引
+                  ("CoatIndex", c_int),    # 时装索引
                   ]
 
     def __init__(self):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index b085017..c16f2b3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -23995,7 +23995,6 @@
                   ("SubCmd", c_ubyte),
                   ("CoatIndex", c_int),    #时装索引
                   ("CoatLV", c_ubyte),    #时装等级
-                  ("CoatExp", c_int),    #时装祝福值经验
                   ]
 
     def __init__(self):
@@ -24014,7 +24013,6 @@
         self.SubCmd = 0x02
         self.CoatIndex = 0
         self.CoatLV = 0
-        self.CoatExp = 0
         return
 
     def GetLength(self):
@@ -24028,23 +24026,22 @@
                                 Cmd:%s,
                                 SubCmd:%s,
                                 CoatIndex:%d,
-                                CoatLV:%d,
-                                CoatExp:%d
+                                CoatLV:%d
                                 '''\
                                 %(
                                 self.Cmd,
                                 self.SubCmd,
                                 self.CoatIndex,
-                                self.CoatLV,
-                                self.CoatExp
+                                self.CoatLV
                                 )
         return DumpString
 
 
 class  tagMCClothesCoatSkinState(Structure):
     Head = tagHead()
-    SkinOpenState = 0    #(DWORD SkinOpenState)//时装激活状态, 按索引表示激活状态
-    CoatNum = 0    #(BYTE CoatNum)//时装个数
+    CoatChestLV = 0    #(DWORD CoatChestLV)//时装柜等级
+    CoatChestExp = 0    #(DWORD CoatChestExp)//时装柜经验
+    CoatNum = 0    #(WORD CoatNum)//时装个数
     CoatInfoList = list()    #(vector<tagMCClothesCoatLVInfo> CoatInfoList)// 时装数据列表
     data = None
 
@@ -24057,8 +24054,9 @@
     def ReadData(self, _lpData, _pos=0, _Len=0):
         self.Clear()
         _pos = self.Head.ReadData(_lpData, _pos)
-        self.SkinOpenState,_pos = CommFunc.ReadDWORD(_lpData, _pos)
-        self.CoatNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.CoatChestLV,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.CoatChestExp,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.CoatNum,_pos = CommFunc.ReadWORD(_lpData, _pos)
         for i in range(self.CoatNum):
             temCoatInfoList = tagMCClothesCoatLVInfo()
             _pos = temCoatInfoList.ReadData(_lpData, _pos)
@@ -24070,7 +24068,8 @@
         self.Head.Clear()
         self.Head.Cmd = 0xB1
         self.Head.SubCmd = 0x02
-        self.SkinOpenState = 0
+        self.CoatChestLV = 0
+        self.CoatChestExp = 0
         self.CoatNum = 0
         self.CoatInfoList = list()
         return
@@ -24079,7 +24078,8 @@
         length = 0
         length += self.Head.GetLength()
         length += 4
-        length += 1
+        length += 4
+        length += 2
         for i in range(self.CoatNum):
             length += self.CoatInfoList[i].GetLength()
 
@@ -24088,8 +24088,9 @@
     def GetBuffer(self):
         data = ''
         data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
-        data = CommFunc.WriteDWORD(data, self.SkinOpenState)
-        data = CommFunc.WriteBYTE(data, self.CoatNum)
+        data = CommFunc.WriteDWORD(data, self.CoatChestLV)
+        data = CommFunc.WriteDWORD(data, self.CoatChestExp)
+        data = CommFunc.WriteWORD(data, self.CoatNum)
         for i in range(self.CoatNum):
             data = CommFunc.WriteString(data, self.CoatInfoList[i].GetLength(), self.CoatInfoList[i].GetBuffer())
         return data
@@ -24097,13 +24098,15 @@
     def OutputString(self):
         DumpString = '''
                                 Head:%s,
-                                SkinOpenState:%d,
+                                CoatChestLV:%d,
+                                CoatChestExp:%d,
                                 CoatNum:%d,
                                 CoatInfoList:%s
                                 '''\
                                 %(
                                 self.Head.OutputString(),
-                                self.SkinOpenState,
+                                self.CoatChestLV,
+                                self.CoatChestExp,
                                 self.CoatNum,
                                 "..."
                                 )
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintFightPower.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintFightPower.py
index f717c6a..7e7c431 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintFightPower.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintFightPower.py
@@ -53,6 +53,7 @@
                    ShareDefine.Def_MFPType_HorseSoul:"骑魂",
                    ShareDefine.Def_MFPType_MagicWeaponSoul:"法宝之魂",
                    ShareDefine.Def_MFPType_Dogz:"神兽",
+                   ShareDefine.Def_MFPType_Coat:"时装",
                    ShareDefine.Def_MFPType_Other:"其他",
                    }
     
@@ -95,6 +96,7 @@
                      ChConfig.Def_CalcAttrFunc_PetSign:"宠物签到",
                      ChConfig.Def_CalcAttrFunc_MagicWeaponSoul:"法宝之魂",
                      ChConfig.Def_CalcAttrFunc_Dogz:"神兽",
+                     ChConfig.Def_CalcAttrFunc_Coat:"时装",
                      }
     
     GameWorld.DebugAnswer(curPlayer, "PrintFightPower 模块类型(可选)")
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 5b262c9..683dc1c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1167,6 +1167,21 @@
                         ("BYTE", "AwardMark", 1),
                         ("dict", "AddAttr", 0),
                         ),
+
+                "Coat":(
+                        ("DWORD", "CoatID", 1),
+                        ("list", "EquipItemID", 0),
+                        ("DWORD", "UnlockItemID", 0),
+                        ("DWORD", "MaxLV", 0),
+                        ("list", "CostItemCnt", 0),
+                        ("dict", "StarAttr", 0),
+                        ),
+
+                "CoatChestUp":(
+                        ("DWORD", "LV", 1),
+                        ("BYTE", "NeedExp", 0),
+                        ("dict", "AddAttr", 0),
+                        ),
                 }
 
 
@@ -3551,6 +3566,38 @@
     def GetMWID(self): return self.MWID # 法宝ID
     def GetAwardMark(self): return self.AwardMark # 赛季奖励等级
     def GetAddAttr(self): return self.AddAttr # 属性
+
+# 时装表
+class IPY_Coat():
+    
+    def __init__(self):
+        self.CoatID = 0
+        self.EquipItemID = []
+        self.UnlockItemID = 0
+        self.MaxLV = 0
+        self.CostItemCnt = []
+        self.StarAttr = {}
+        return
+        
+    def GetCoatID(self): return self.CoatID # 时装编号
+    def GetEquipItemID(self): return self.EquipItemID # 装备物品ID(按职业顺序)
+    def GetUnlockItemID(self): return self.UnlockItemID # 材料物品ID
+    def GetMaxLV(self): return self.MaxLV # 最大星级
+    def GetCostItemCnt(self): return self.CostItemCnt # 材料数量
+    def GetStarAttr(self): return self.StarAttr # 属性
+
+# 时装柜升级表
+class IPY_CoatChestUp():
+    
+    def __init__(self):
+        self.LV = 0
+        self.NeedExp = 0
+        self.AddAttr = {}
+        return
+        
+    def GetLV(self): return self.LV # 等级
+    def GetNeedExp(self): return self.NeedExp # 升级所需经验
+    def GetAddAttr(self): return self.AddAttr # 属性
 
 
 def Log(msg, playerID=0, par=0):
@@ -3796,6 +3843,10 @@
         self.ipyGatherSoulAttrLen = len(self.ipyGatherSoulAttrCache)
         self.ipyMagicWeaponOfKingCache = self.__LoadFileData("MagicWeaponOfKing", IPY_MagicWeaponOfKing)
         self.ipyMagicWeaponOfKingLen = len(self.ipyMagicWeaponOfKingCache)
+        self.ipyCoatCache = self.__LoadFileData("Coat", IPY_Coat)
+        self.ipyCoatLen = len(self.ipyCoatCache)
+        self.ipyCoatChestUpCache = self.__LoadFileData("CoatChestUp", IPY_CoatChestUp)
+        self.ipyCoatChestUpLen = len(self.ipyCoatChestUpCache)
         Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
         Log("IPY_DataMgr InitOK!")
         return
@@ -4182,6 +4233,10 @@
     def GetGatherSoulAttrByIndex(self, index): return self.ipyGatherSoulAttrCache[index]
     def GetMagicWeaponOfKingCount(self): return self.ipyMagicWeaponOfKingLen
     def GetMagicWeaponOfKingByIndex(self, index): return self.ipyMagicWeaponOfKingCache[index]
+    def GetCoatCount(self): return self.ipyCoatLen
+    def GetCoatByIndex(self, index): return self.ipyCoatCache[index]
+    def GetCoatChestUpCount(self): return self.ipyCoatChestUpLen
+    def GetCoatChestUpByIndex(self, index): return self.ipyCoatChestUpCache[index]
 
 IPYData = IPY_DataMgr()
 def IPY_Data(): return IPYData
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index cbdfd75..35ad822 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -462,7 +462,7 @@
             continue
         
         # 翅膀属性在翅膀功能单独刷新
-        if equipIndex == ShareDefine.retWing:
+        if equipIndex in ChConfig.EquipItemNoRefreshState:
             continue
         
         curEquip = playerEquip.GetAt(equipIndex)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ClothesCoatSkin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ClothesCoatSkin.py
deleted file mode 100644
index 1c6e4c8..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ClothesCoatSkin.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-#
-##@package UseItem.Item_ClothesCoatSkin
-#
-# @todo:激活时装
-# @author hxp
-# @date 2015-6-17
-# @version 1.0
-#
-# 详细描述: 激活时装
-#
-#---------------------------------------------------------------------
-"""Version = 2015-6-17 15:00"""
-#---------------------------------------------------------------------
-
-#导入
-import GameWorld
-import PlayerCoat
-import ItemCommon
-import ChConfig
-
-#---------------------------------------------------------------------
-#全局变量
-#---------------------------------------------------------------------
-
-#---------------------------------------------------------------------
-##使用物品,触发物品附加技能
-# @param curPlayer 玩家实例
-# @param curRoleItem 物品实例
-# @param tick 时间戳
-# @return 是否使用物品成功
-def UseItem(curPlayer, curRoleItem, tick):
-    itemTypeID = curRoleItem.GetItemTypeID()
-    jobType = ChConfig.JOB_TYPE_DICT[curPlayer.GetJob()]
-    
-    clothesCoatSkinID = 0
-    for i in range(curRoleItem.GetEffectCount()):
-        curEffect = curRoleItem.GetEffectByIndex(i)
-        if not curEffect:
-            continue
-        
-        effectID = curEffect.GetEffectID()
-        # 时装效果ID
-        if effectID != ChConfig.Def_Effect_ClothesCoatSkin:
-            continue
-        
-        itemJobType = curEffect.GetEffectValue(0)
-        if itemJobType == jobType:
-            clothesCoatSkinID = curEffect.GetEffectValue(1)
-            break
-                
-    if clothesCoatSkinID <= 0:
-        GameWorld.ErrLog('策划填表错误,物品 = %s,激活时装皮肤效果值错误 = %s' % (itemTypeID, clothesCoatSkinID))
-        return False
-    
-    isOK = PlayerCoat.ActivateClothesCoatSkinItem(curPlayer, clothesCoatSkinID)
-    
-    if isOK:
-        #物品减少
-        saveDataDict = {"ClothesCoatSkinID":clothesCoatSkinID}
-        ItemCommon.DelItem(curPlayer, curRoleItem, 1, True, ChConfig.ItemDel_ClothesCoatSkin, saveDataDict)
-        
-    return isOK
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 2212d32..47b0c39 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -108,6 +108,7 @@
 import PlayerCoin
 import PlayerGeTui
 import PlayerDogz
+import PlayerCoat
 
 import datetime
 import time
@@ -481,7 +482,7 @@
     PlayerRecover.RecoverOnLogin(curPlayer)
 #
 #    # 时装
-#    PlayerCoat.OnLogin_Coat(curPlayer)
+    PlayerCoat.OnLogin_Coat(curPlayer)
     
     # 跨服PK
     PlayerCrossRealmPK.DoPlayerLogin(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py
index 8a879f7..56f28aa 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py
@@ -7,18 +7,16 @@
 ##@package Player.PlayerCoat
 #
 # @todo:玩家时装外套
-# @author hxp
-# @date 2015-6-15
-# @version 1.1
+# @author xdh
+# @date 2019-01-07
+# @version 1.0
 #
-# @change: "2015-08-10 10:00" ljd 下发周围玩家时装穿戴状态
 # 详细描述: 玩家时装外套
 #
 #---------------------------------------------------------------------
-"""Version = 2015-08-10 10:00"""
+"""Version = 2019-01-07 10:00"""
 #---------------------------------------------------------------------
 
-import ReadChConfig
 import NetPackCommon
 import IPY_GameWorld
 import PlayerControl
@@ -26,10 +24,10 @@
 import ChPyNetSendPack
 import ShareDefine
 import ItemCommon
-import EventReport
+import DataRecordPack
+import IpyGameDataPY
 import GameWorld
 import ChConfig
-import ChEquip
 
 import math
 
@@ -39,83 +37,6 @@
 def OnLogin_Coat(curPlayer):
     Sync_ClothesCoatSkinInfo(curPlayer)
     return
-
-
-## 激活时装衣服皮肤
-#  @param curPlayer
-#  @return None
-def ActivateClothesCoatSkinItem(curPlayer, clothesCoatSkinID):
-    
-    playerID = curPlayer.GetPlayerID()
-    
-    clothesCoatSkinDict = ReadChConfig.GetEvalChConfig("ClothesCoatSkin")
-    if clothesCoatSkinID not in clothesCoatSkinDict:
-        GameWorld.ErrLog("激活时装皮肤异常,无该时装皮肤物品信息!ClothesCoatSkin.txt! ID=%s" % clothesCoatSkinID, playerID)
-        return False
-    
-    clotherSkinInfo = clothesCoatSkinDict[clothesCoatSkinID]
-    if not clotherSkinInfo:
-        return False
-
-    curSkinIndex = clotherSkinInfo[0]
-    skinOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinOpenState)
-    curSkinState = skinOpenState & pow(2, curSkinIndex)
-    
-    if curSkinState:
-#        GameWorld.Log("该时装皮肤已经激活过!clothesCoatSkinID=%s,index=%s,skinOpenState=%s" 
-#                      % (clothesCoatSkinID, curSkinIndex, skinOpenState), playerID)
-#        PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_850801")
-        #当使用已激活过的时装激活道具时,将获得一定数量的物品 返回Ture扣除物品
-        clothesCoatUpDict = ReadChConfig.GetEvalChConfig("ClothesCoatUp")
-        if curSkinIndex not in clothesCoatUpDict:
-            PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_850801")
-            return False
-        packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)
-        if packSpace < 1:
-            PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
-            return False
-        itemId, getItemCntList = clothesCoatUpDict[curSkinIndex]
-        if not getItemCntList:
-            return False
-        getItemCnt = getItemCntList[0]
-        
-        packIndexList = [IPY_GameWorld.rptItem]
-        ItemControler.GivePlayerItem(curPlayer, itemId, getItemCnt, True, packIndexList, True, showSysInfo=True)
-        return True
-
-    isOK = ItemControler.PutItemInTempSwap(curPlayer, clothesCoatSkinID)
-    if not isOK:
-        GameWorld.Log("时装放入临时交换背包失败!", playerID)
-        return False
-
-    #===========================================================================
-    # # 获得放入的时装
-    # clothesItem = ItemCommon.FindItemInPackByItemID(curPlayer, clothesCoatSkinID,
-    #                                                ShareDefine.rptTempSwap)
-    # if not clothesItem:
-    #    return False
-    # 
-    # tick = GameWorld.GetGameWorld().GetTick()
-    # ChEquip.DoPlayerEquipItem(curPlayer, clothesItem, IPY_GameWorld.retClothesCoat, tick)
-    #===========================================================================
-    
-    # 更新幻化状态
-    updSkinOpenState = skinOpenState | pow(2, curSkinIndex)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ClothesSkinOpenState, updSkinOpenState)
-    Sync_ClothesCoatSkinInfo(curPlayer, curSkinIndex)
-    GameWorld.Log("时装激活成功!clothesCoatSkinID=%s,index=%s,skinOpenState=%s,updSkinOpenState=%s" 
-                  % (clothesCoatSkinID, curSkinIndex, skinOpenState, updSkinOpenState), playerID)
-
-    # 刷属性
-    PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
-    
-    ClothesCoaSkinNotifyDict = ReadChConfig.GetEvalChConfig("ClothesCoaSkinNotify")
-    if clothesCoatSkinID in ClothesCoaSkinNotifyDict:
-        notifyMark = ClothesCoaSkinNotifyDict[clothesCoatSkinID]
-        PlayerControl.WorldNotify(0, notifyMark, [curPlayer.GetPlayerName(), clothesCoatSkinID])
-        
-    return True
-
 
 #// A5 0B 玩家时装升级 #tagCMCoatUp
 #
@@ -128,98 +49,126 @@
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     playerID = curPlayer.GetPlayerID()
     coatIndex = clientData.CoatIndex
-    clothesCoatUpDict = ReadChConfig.GetEvalChConfig("ClothesCoatUp")
-    if coatIndex not in clothesCoatUpDict:
-        GameWorld.DebugLog("clothesCoatUpDict.txt 未配置该索引 coatIndex=%s" % (coatIndex), playerID)
+    ipyData = IpyGameDataPY.GetIpyGameData('Coat', coatIndex)
+    if not ipyData:
         return
-    
-    skinOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinOpenState)
-    if not skinOpenState & pow(2, coatIndex):
-        GameWorld.DebugLog("该时装未激活, 无法升级! coatIndex=%s" % (coatIndex), playerID)
-        return
-    costItemID, needCntList = clothesCoatUpDict[coatIndex]
     
     curSkinLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % coatIndex)
-
-    
-    if curSkinLV >= len(needCntList) - 1:
+    if curSkinLV >= ipyData.GetMaxLV():
         GameWorld.DebugLog("该时装已满级,无法升级!coatIndex=%s,curSkinLV=%s" % (coatIndex, curSkinLV), playerID)
         return
-    plusCost = needCntList[curSkinLV + 1]
-    curBless = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinCurBless % coatIndex)
-    lackCnt = plusCost - curBless
-    
-    curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
-    hasEnough, itemIndexList = ItemCommon.GetItem_FromPack_ByID(costItemID, curPack, lackCnt)
-    if not itemIndexList:
-        GameWorld.DebugLog("OnPlayerCoatUp() 时装升级材料不足, needCnt=%s" % (lackCnt))
+    needCntList = ipyData.GetCostItemCnt()
+    if curSkinLV >= len(needCntList):
         return
-    if hasEnough:
-        reduceCnt = lackCnt
-        aftBless = 0 #升级后的经验值
-        aftlv = curSkinLV + 1
-    else:
-        reduceCnt = 0
-        for itemIndex in itemIndexList:
-            curItem = curPack.GetAt(itemIndex)
-            itemCount = curItem.GetCount()
-            reduceCnt += itemCount
-            
-        aftBless = curBless + reduceCnt
-        aftlv = curSkinLV
-        
+    plusCost = needCntList[curSkinLV + 1]
+    costItemID = ipyData.GetUnlockItemID()
+    curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+    hasEnough, itemIndexList = ItemCommon.GetItem_FromPack_ByID(costItemID, curPack, plusCost)
+    if not hasEnough:
+        GameWorld.DebugLog("OnPlayerCoatUp() 时装升级材料不足, needCnt=%s" % (plusCost))
+        return
+
+    reduceCnt = plusCost
+    aftlv = curSkinLV + 1
+      
     #扣除物品
-    ItemCommon.ReduceItem(curPlayer, curPack, itemIndexList, reduceCnt, True)
-    if aftlv != curSkinLV:
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ClothesSkinLV % coatIndex, aftlv)
-    if aftBless != curBless:
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ClothesSkinCurBless % coatIndex, aftBless)
-    
+    ItemCommon.ReduceItem(curPlayer, curPack, itemIndexList, reduceCnt, True, 'CoatUp')
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ClothesSkinLV % coatIndex, aftlv)
+       
     Sync_ClothesCoatSkinInfo(curPlayer, coatIndex)
     # 刷属性
+    CalcClothesCoatSkinAttr(curPlayer)
     PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
     
-    clothesID = GetClothesIDByIndex(coatIndex)
-    itemData = GameWorld.GetGameData().GetItemByTypeID(clothesID)
-    coatName = clothesID if not itemData else itemData.GetName()
-    EventReport.WriteEvent_coat_lv(curPlayer, coatName, curSkinLV, curBless, reduceCnt, aftlv, aftBless)
-    GameWorld.DebugLog("时装升级!coatIndex=%s,coatName=%s,curSkinLV=%s,curBless=%s,reduceCnt=%s,aftlv=%s,aftBless=%s" 
-                       % (coatIndex, coatName, curSkinLV, curBless, reduceCnt, aftlv, aftBless), playerID)
+    extraInfoDict = {"coatID":coatIndex}
+    DataRecordPack.DR_ClassUpSystem(curPlayer, "CoatUp", aftlv, extraInfoDict)
+    
+    GameWorld.DebugLog("时装升级!coatIndex=%s,curSkinLV=%s,reduceCnt=%s,aftlv=%s" 
+                       % (coatIndex, curSkinLV, reduceCnt, aftlv), playerID)
     return
 
+#// A5 20 时装分解 #tagCMCoatDecompose
+#
+#struct    tagCMCoatDecompose
+#{
+#    tagHead        Head;
+#    BYTE        Count;        //材料所在背包索引的数量
+#    WORD        IndexList[Count];    //材料所在背包索引列表
+#    DWORD        ItemIDList[Count];    //材料所在背包物品ID列表
+#};
+def OnCoatDecompose(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    playerID = curPlayer.GetPlayerID()
+    indexList = clientData.IndexList
+    ItemIDList = clientData.ItemIDList
+    itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+    addExp = 0
+    for i, index in enumerate(indexList):
+        eatItem = itemPack.GetAt(index)
+        if not eatItem or eatItem.IsEmpty():
+            continue
+        eatItemID = eatItem.GetItemTypeID()
+        if eatItemID != ItemIDList[i]:
+            continue
+        itemData = GameWorld.GetGameData().GetItemByTypeID(eatItemID)
+        if not itemData:
+            continue
+        curEff = itemData.GetEffectByIndex(0)
+        coatID = curEff.GetEffectValue(0)
+        ipyData = IpyGameDataPY.GetIpyGameData('Coat', coatID)
+        if not ipyData:
+            continue
+        curSkinLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % coatID)
+        if curSkinLV >= ipyData.GetMaxLV():
+            continue
+        itemCnt = eatItem.GetCount()
+        addExp += itemCnt * curEff.GetEffectValue(1)
+        ItemCommon.DelItem(curPlayer, eatItem, itemCnt, True, ChConfig.ItemDel_CoatDecompose)
+    if not addExp:
+        return
+    totalExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestEXP) + addExp
+    curChestLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestLV)
+    updChestLV = curChestLV
+    maxChestLV = IpyGameDataPY.IPY_Data().GetCoatChestUpByIndex(IpyGameDataPY.IPY_Data().GetCoatChestUpCount() - 1).GetLV()
+    for chestLV in xrange(curChestLV + 1, maxChestLV + 1):
+        ipyData = IpyGameDataPY.GetIpyGameData('CoatChestUp', chestLV)
+        if not ipyData:
+            break
+        needExp = ipyData.GetNeedExp()
+        if totalExp < needExp:
+            break
+        updChestLV = chestLV
+        totalExp -= needExp
+    if updChestLV != curChestLV:
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ClothesChestLV, updChestLV)
+        # 刷属性
+        CalcClothesCoatSkinAttr(curPlayer)
+        PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ClothesChestEXP, min(totalExp, ChConfig.Def_UpperLimit_DWord))
+        
+    Sync_ClothesCoatSkinInfo(curPlayer, coatID)
+    return
 
 ## 计算时装属性
 #  @param curPlayer 玩家
 #  @param allAttrList 属性列表
 #  @return None
-def CalcClothesCoatSkinAttr(curPlayer, allAttrList):
-    skinOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinOpenState)
-    
-    if not skinOpenState:
-        return
-    
-    clothesCoatSkinDict = ReadChConfig.GetEvalChConfig("ClothesCoatSkin")
-    clothesCoatUpDict = ReadChConfig.GetEvalChConfig("ClothesCoatUp")
-    for clothesInfo in clothesCoatSkinDict.values():
-        curIndex, attrDict = clothesInfo
-        
-        if not skinOpenState & pow(2, curIndex):
+def CalcClothesCoatSkinAttr(curPlayer):
+    allAttrList = [{} for _ in range(4)]
+    ipyMgr = IpyGameDataPY.IPY_Data()
+    for i in xrange(ipyMgr.GetCoatCount()):
+        ipyData = ipyMgr.GetCoatByIndex(i)
+        coatID = ipyData.GetCoatID()
+        skinLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % coatID)
+        if not skinLV:
             continue
-        skinLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % curIndex)
-        curExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinCurBless % curIndex)
-        if curIndex not in clothesCoatUpDict:
-            expPer = 0
-        else:
-            itemCntList = clothesCoatUpDict[curIndex][1]
-            maxExp = itemCntList[skinLV + 1] if skinLV + 1 < len(itemCntList) else 0
-            expPer = float(curExp) / maxExp if maxExp != 0 else 0
-        for attrName, attrLVList in attrDict.items():
-            attrValue = attrLVList[skinLV] if skinLV < len(attrLVList) else attrLVList[-1]
-            nextValue = attrLVList[skinLV + 1] if skinLV + 1 < len(attrLVList) else attrLVList[-1]
-            addValue = int(math.ceil((nextValue-attrValue) * expPer))
-            PlayerControl.CalcAttrDict_Type(attrName, attrValue + addValue, allAttrList)
-            GameWorld.DebugLog('    时装属性curIndex=%s attrName=%s,expPer=%s,attrValue=%s,addValue=%s' % (curIndex, attrName, expPer, attrValue, addValue))
-        
+        starAttrDict = ipyData.GetStarAttr()
+        if str(skinLV) not in starAttrDict:
+            continue
+        for attrID, attrValue in starAttrDict[str(skinLV)].items():
+            PlayerControl.CalcAttrDict_Type(int(attrID), attrValue, allAttrList)
+    # 保存计算值
+    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Coat, allAttrList)
     return
 
 
@@ -231,8 +180,9 @@
 # @param destIndex 目标索引
 # @return 
 def SwitchCoat(curPlayer, srcBackpack, desBackPack, srcIndex, destIndex):
-    if not ((desBackPack == IPY_GameWorld.rptEquip and srcBackpack == ShareDefine.rptTempSwap and destIndex == IPY_GameWorld.retClothesCoat) \
-    or (srcBackpack == IPY_GameWorld.rptEquip and desBackPack == ShareDefine.rptTempSwap and srcIndex == IPY_GameWorld.retClothesCoat)):
+    clothesPlaceList = [ShareDefine.retWeaponSkin, ShareDefine.retClothesSkin, ShareDefine.retWeapon2Skin]
+    if not ((desBackPack == IPY_GameWorld.rptEquip and srcBackpack == ShareDefine.rptTempSwap and destIndex in clothesPlaceList) \
+    or (srcBackpack == IPY_GameWorld.rptEquip and desBackPack == ShareDefine.rptTempSwap and srcIndex in clothesPlaceList)):
         return False
     
     #===============================================================================================
@@ -243,36 +193,38 @@
     #===============================================================================================
     
     playerID = curPlayer.GetPlayerID()
-    clothesIndex = IPY_GameWorld.retClothesCoat
     
     # 穿时装
     if desBackPack == IPY_GameWorld.rptEquip:
         # 穿的时候srcIndex代表时装的索引
-        skinOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinOpenState)
-        if not skinOpenState & pow(2, srcIndex):
-            GameWorld.Log("时装未激活,不能穿!state=%s,srcIndex=%s" % (skinOpenState, srcIndex), playerID)
+        skinLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV%srcIndex)
+        if skinLV <= 0:
+            GameWorld.Log("时装未激活,不能穿!srcIndex=%s" % (srcIndex), playerID)
             return True
-        
-        findSwichClothesID = GetClothesIDByIndex(srcIndex)
-            
-        if findSwichClothesID <= 0:
-            GameWorld.Log("找不到时装ID,不能穿!srcIndex=%s" % (srcIndex), playerID)
+        ipyData = IpyGameDataPY.GetIpyGameData('Coat', srcIndex)
+        if not ipyData:
             return True
-        
+        EquipItemIDList = ipyData.GetEquipItemID
+        job = curPlayer.GetJob()
+        if job > len(EquipItemIDList):
+            GameWorld.Log("找不到该职业时装配置,不能穿!srcIndex=%s,job=%s" % (srcIndex, job), playerID)
+            return True
+        equipItemID = EquipItemIDList[job-1]
         # 找到时装ID后,srcIndex转化为交换物品的格子索引,默认0
-        srcIndex, destIndex = 0, clothesIndex
+        srcIndex= 0
         
         # 给临时交换物品
-        if not ItemControler.PutItemInTempSwap(curPlayer, findSwichClothesID):
-            GameWorld.Log("时装ID(%s)放入临时交换背包失败!" % (findSwichClothesID), playerID)
+        if not ItemControler.PutItemInTempSwap(curPlayer, equipItemID):
+            GameWorld.Log("时装ID(%s)放入临时交换背包失败!" % (equipItemID), playerID)
             return True
         
     # 脱时装
     else:
         ItemControler.ClearPack(curPlayer, ShareDefine.rptTempSwap)
-        srcIndex, destIndex = clothesIndex, 0
+        destIndex = 0
     
     isOK = ItemCommon.DoLogicSwitchItemEx(curPlayer, srcBackpack, desBackPack, srcIndex, destIndex)
+    ItemControler.ClearPack(curPlayer, ShareDefine.rptTempSwap)
     # 下发周围玩家时装穿戴状态
     if isOK:
         if desBackPack == IPY_GameWorld.rptEquip:
@@ -295,16 +247,6 @@
     GameWorld.DebugLog("SwitchCoat isOK=%s" % isOK)
     return True
 
-## 根据索引获取装备时装ID
-def GetClothesIDByIndex(coatIndex):
-    findSwichClothesID = 0
-    clothesCoatSkinDict = ReadChConfig.GetEvalChConfig("ClothesCoatSkin")
-    for clothesID, clothesInfo in clothesCoatSkinDict.items():
-        index = clothesInfo[0]
-        if index == coatIndex:
-            findSwichClothesID = clothesID
-            break
-    return findSwichClothesID
 
 ## 通知客户端时装开启状态
 #  @param curPlayer
@@ -312,26 +254,25 @@
 def Sync_ClothesCoatSkinInfo(curPlayer, coatIndex= -1):
     stateData = ChPyNetSendPack.tagMCClothesCoatSkinState()
     stateData.Clear()
-    stateData.SkinOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinOpenState)
+    stateData.CoatChestExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestEXP)
+    stateData.CoatChestLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestLV)
     stateData.CoatInfoList = []
-
     if coatIndex == -1:
-        clothesCoatSkinDict = ReadChConfig.GetEvalChConfig("ClothesCoatSkin")
-        for index in range(len(clothesCoatSkinDict)):
-            coatInfo = ChPyNetSendPack.tagMCClothesCoatLVInfo()
-            coatInfo.Clear()
-            coatInfo.CoatIndex = index
-            coatInfo.CoatLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % index)
-            coatInfo.CoatExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinCurBless % index)
-            stateData.CoatInfoList.append(coatInfo)
+        coatIDList =[]
+        ipyMgr = IpyGameDataPY.IPY_Data()
+        for i in xrange(ipyMgr.GetCoatCount()):
+            ipyData = ipyMgr.GetCoatByIndex(i)
+            coatID = ipyData.GetCoatID()
+            coatIDList.append(coatID)
     else:
+        coatIDList = [coatIndex]
+        
+    for coatID in coatIDList:
         coatInfo = ChPyNetSendPack.tagMCClothesCoatLVInfo()
         coatInfo.Clear()
-        coatInfo.CoatIndex = coatIndex
-        coatInfo.CoatLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % coatIndex)
-        coatInfo.CoatExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinCurBless % coatIndex)
+        coatInfo.CoatIndex = coatID
+        coatInfo.CoatLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % coatID)
         stateData.CoatInfoList.append(coatInfo)
-    
     stateData.CoatNum = len(stateData.CoatInfoList)
     NetPackCommon.SendFakePack(curPlayer, stateData)
     return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index f0bf6af..815c4d8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -86,6 +86,7 @@
 import FunctionNPCCommon
 import CrossRealmPlayer
 import ChNetSendPack
+import PlayerCoat
 import PlayerState
 import QuestCommon
 import PlayerDogz
@@ -4064,6 +4065,7 @@
         PlayerEquipDecompose.RefreshEDAttr(curPlayer)
         PlayerDogz.RefreshDogzAttr(curPlayer)
         PlayerGatherSoul.RefreshGatherSoulAttr(curPlayer)
+        PlayerCoat.CalcClothesCoatSkinAttr(curPlayer)
         self.RefreshAllState(isForce=True)
         GameWorld.DebugLog("End ReCalcAllState!!!")
         return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index b79c61f..b1b8424 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1322,7 +1322,7 @@
 )=range(5)
 
 # 战斗力模块类型
-Def_MFPType_Max = 27
+Def_MFPType_Max = 28
 ModuleFightPowerTypeList = (
 Def_MFPType_Role, # 角色 0
 Def_MFPType_Equip, # 装备(基本装备位) 1
@@ -1348,6 +1348,7 @@
 Def_MFPType_Dogz, # 神兽 21
 Def_MFPType_GatherSoul, # 聚魂 22
 Def_MFPType_MagicWeapon4, # 王者法宝 23
+Def_MFPType_Coat, # 时装 24
 Def_MFPType_Other, # 其他
 
 #以下暂时没用到,改时再处理
@@ -1704,8 +1705,11 @@
     retBaldric5,     #17 佩饰
     retBaldric6,     #18 佩饰
     retHorse,        #19 坐骑
+    retWeaponSkin,   #20 时装武器
+    retClothesSkin,  #21 时装衣服
+    retWeapon2Skin,  #22 时装副手
     retMax,
-) = range(1, 21)
+) = range(1, 24)
 
 
 # 神兽装备位定义

--
Gitblit v1.8.0