From c38e918b531d7d524f7c38117928d1822795876b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 18 一月 2019 11:14:34 +0800
Subject: [PATCH] 5722 【后端】【1.5】跨服BOSS开发(同步玩家等级、称号变更到跨服,增加读写try,增加同步CD配置开关)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

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 56f28aa..b72d16e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoat.py
@@ -60,12 +60,12 @@
     needCntList = ipyData.GetCostItemCnt()
     if curSkinLV >= len(needCntList):
         return
-    plusCost = needCntList[curSkinLV + 1]
+    plusCost = needCntList[curSkinLV]
     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))
+        GameWorld.DebugLog("OnPlayerCoatUp() 时装升级材料不足, coatIndex=%s, costItemID=%s, needCnt=%s" % (coatIndex, costItemID, plusCost))
         return
 
     reduceCnt = plusCost
@@ -101,6 +101,7 @@
     playerID = curPlayer.GetPlayerID()
     indexList = clientData.IndexList
     ItemIDList = clientData.ItemIDList
+
     itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
     addExp = 0
     for i, index in enumerate(indexList):
@@ -109,6 +110,7 @@
             continue
         eatItemID = eatItem.GetItemTypeID()
         if eatItemID != ItemIDList[i]:
+            GameWorld.Log('时装分解 发的物品ID不对应index=%s eatItemID=%s,ItemIDList[i]=%s'%(index, eatItemID, ItemIDList[i]), playerID)
             continue
         itemData = GameWorld.GetGameData().GetItemByTypeID(eatItemID)
         if not itemData:
@@ -119,12 +121,13 @@
         if not ipyData:
             continue
         curSkinLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesSkinLV % coatID)
-        if curSkinLV >= ipyData.GetMaxLV():
+        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:
+        GameWorld.Log(' 时装分解, 没有可分解的ItemIDList=%s'%ItemIDList, playerID)
         return
     totalExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestEXP) + addExp
     curChestLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestLV)
@@ -167,6 +170,13 @@
             continue
         for attrID, attrValue in starAttrDict[str(skinLV)].items():
             PlayerControl.CalcAttrDict_Type(int(attrID), attrValue, allAttrList)
+    #时装柜属性
+    curChestLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ClothesChestLV)
+    ipyData = IpyGameDataPY.GetIpyGameDataNotLog('CoatChestUp', curChestLV)
+    if ipyData:
+        for attrID, attrValue in ipyData.GetAddAttr().items():
+            PlayerControl.CalcAttrDict_Type(int(attrID), attrValue, allAttrList)
+    
     # 保存计算值
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Coat, allAttrList)
     return
@@ -204,7 +214,7 @@
         ipyData = IpyGameDataPY.GetIpyGameData('Coat', srcIndex)
         if not ipyData:
             return True
-        EquipItemIDList = ipyData.GetEquipItemID
+        EquipItemIDList = ipyData.GetEquipItemID()
         job = curPlayer.GetJob()
         if job > len(EquipItemIDList):
             GameWorld.Log("找不到该职业时装配置,不能穿!srcIndex=%s,job=%s" % (srcIndex, job), playerID)
@@ -224,12 +234,11 @@
         destIndex = 0
     
     isOK = ItemCommon.DoLogicSwitchItemEx(curPlayer, srcBackpack, desBackPack, srcIndex, destIndex)
-    ItemControler.ClearPack(curPlayer, ShareDefine.rptTempSwap)
     # 下发周围玩家时装穿戴状态
     if isOK:
         if desBackPack == IPY_GameWorld.rptEquip:
             packIndex = IPY_GameWorld.rptEquip
-            itemPlace = IPY_GameWorld.retClothesCoat
+            itemPlace = destIndex
             itemPack = curPlayer.GetItemManager().GetPack(packIndex)
             curItem = itemPack.GetAt(itemPlace)
             itemId = curItem.GetItemTypeID()
@@ -243,7 +252,7 @@
             itemPack = curPlayer.GetItemManager().GetPack(packIndex)
             curItem = itemPack.GetAt(0)
             if curItem:
-                curPlayer.Sync_UnEquipItem(curItem.GetItemTypeID(), IPY_GameWorld.retClothesCoat)
+                curPlayer.Sync_UnEquipItem(curItem.GetItemTypeID(), srcIndex)
     GameWorld.DebugLog("SwitchCoat isOK=%s" % isOK)
     return True
 

--
Gitblit v1.8.0