From 8d8cc593c3057c9b53a3678476f3dfc9cd83f67f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 30 一月 2019 18:52:16 +0800
Subject: [PATCH] 6105 【后端】【1.5.200】诛仙宝石开发

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/PrintFightPower.py       |    1 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py |  134 +++++++++++++++-----------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py                      |    8 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py                       |    5 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                     |   26 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py                 |   51 +++++++++
 PySysDB/PySysDBPY.h                                                                                      |   10 ++
 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py                                            |    5 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                          |    5 
 9 files changed, 181 insertions(+), 64 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index e0da52f..eaf0828 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1694,4 +1694,14 @@
 	DWORD		_Index;	//索引
 	DWORD		NeedPoint;	//需要点数
 	dict		Award;	//奖励 {"职业":[[物品ID,个数,是否绑定],...], ...}
+};
+
+//诛仙宝石共鸣属性表
+
+struct tagZhuXianStoneAttr
+{
+	BYTE		_SuitType;	//套装类型
+	BYTE		_ShareSoneLV;	//共鸣等级
+	list		AttrIDList;		//属性ID列表
+	list		AttrValueList;	//属性值列表
 };
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 6680a4f..75f8d7b 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -518,6 +518,11 @@
 Def_Effect_SkillReducePer6 = 114 # 受到技能伤害减少6
 Def_Effect_SkillReducePer7 = 115 # 受到技能伤害减少7
 
+Def_Effect_ZXWeaponAttrPer = 116 # 诛仙剑1属性加成百分比
+Def_Effect_LXWeaponAttrPer = 117 # 诛仙剑2属性加成百分比
+Def_Effect_XXWeaponAttrPer = 118 # 诛仙剑3属性加成百分比
+Def_Effect_JXWeaponAttrPer = 119 # 诛仙剑4属性加成百分比
+
 #增加%d物理伤害值,其中a值为伤害值
 Def_Effect_AddAtk = 1005
 #增加%d魔法伤害值,其中a值为伤害值
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 034e420..070e8a7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4415,7 +4415,8 @@
 Def_CalcAttrFunc_Coat, # 时装41
 Def_CalcAttrFunc_ZXEquip, # 诛仙装备42
 Def_CalcAttrFunc_ZXEquipSuit, # 诛仙装备套装43
-) = range(44)
+Def_CalcAttrFunc_ZXEquipStone, # 诛仙宝石属性44
+) = range(45)
 
 
 # 在此列表中的功能属性,不享受百分比加成,--属性参与战力计算
@@ -4459,7 +4460,7 @@
                             ShareDefine.Def_MFPType_Coat:[Def_CalcAttrFunc_Coat],
                             # 诛仙装备战力、神兽战力同装备模块战力一致,受评分影响,装备评分相关的战力另外算
                             ShareDefine.Def_MFPType_Dogz:[Def_CalcAttrFunc_Dogz, Def_CalcAttrFunc_DogzEquipPlus],
-                            ShareDefine.Def_MFPType_ZhuXian:[Def_CalcAttrFunc_ZXEquipSuit],
+                            ShareDefine.Def_MFPType_ZhuXian:[Def_CalcAttrFunc_ZXEquipSuit, Def_CalcAttrFunc_ZXEquipStone],
                             ShareDefine.Def_MFPType_Other:[Def_CalcAttrFunc_Success, Def_CalcAttrFunc_FamilyTech, Def_CalcAttrFunc_EquipDecompose],
                             }
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
index d416a88..94ead76 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
@@ -30,6 +30,7 @@
 import PlayerSuccess
 import PlayerWeekParty
 import ShareDefine
+import EquipZhuXian
 
 
 
@@ -47,8 +48,10 @@
     stoneCanPlaceList = []      
     for stoneTypeIndex in xrange(1, GemTypeCount + 1):
         #循环宝石类型对应的装备位
-        stoneCanPlaceList += IpyGameDataPY.GetFuncEvalCfg("GemType%s" % stoneTypeIndex, 1)
-    
+        placeList = IpyGameDataPY.GetFuncEvalCfg("GemType%s" % stoneTypeIndex, 1)
+        for place in placeList:
+            if place not in stoneCanPlaceList:
+                stoneCanPlaceList.append(place)
     return stoneCanPlaceList
 
 def GetAllEquipPlaceHoleIndex():
@@ -89,6 +92,17 @@
                                        changeStoneID * ChConfig.Def_Stone_SaveStoneInfoXNumber + isBind) 
     return
 
+def GetPackTypeByEquipPlace(equipPlace):
+    ##目前支持镶嵌普通装备、诛仙装备
+    if equipPlace in ShareDefine.ZhuXianEquipPlace:
+        equipPackType = ShareDefine.rptZhuXianEquip
+        stonePackType = ShareDefine.rptZhuXianItem
+        placeIndex = EquipZhuXian.GetZhuXianEquipIndexByPlace(equipPlace)
+    else:
+        equipPackType = IPY_GameWorld.rptEquip
+        stonePackType = IPY_GameWorld.rptItem
+        placeIndex = equipPlace
+    return equipPackType, stonePackType, placeIndex
 
 #//A3 04 宝石镶嵌或替换 #tagCMEquipEnchase
 #struct    tagCMEquipEnchase
@@ -103,22 +117,23 @@
     playerID = curPlayer.GetPlayerID()
     
     # 验证背包类型合法性
-    equipIndex = clientData.EquipIndex
+    equipPlace = clientData.EquipIndex
     stoneIndex = clientData.StoneIndex
     holeIndex = clientData.HoleIndex
     
-    GameWorld.DebugLog("宝石镶嵌: equipIndex=%s,stoneIndex=%s,holeIndex=%s" % (equipIndex, stoneIndex, holeIndex), playerID)
+    GameWorld.DebugLog("宝石镶嵌: equipPlace=%s,stoneIndex=%s,holeIndex=%s" % (equipPlace, stoneIndex, holeIndex), playerID)
+    equipPackType, stonePackType, placeIndex = GetPackTypeByEquipPlace(equipPlace)
     
     #获得装备位装备实例
-    equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
-    curEquip = equipPack.GetAt(equipIndex)
+    equipPack = curPlayer.GetItemManager().GetPack(equipPackType)
+    curEquip = equipPack.GetAt(placeIndex)
     
     if not ItemCommon.CheckItemCanUse(curEquip):
         GameWorld.Log("目标装备为空或不可用,无法镶嵌!", playerID)
         return
  
     #获得宝石实例
-    itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+    itemPack = curPlayer.GetItemManager().GetPack(stonePackType)
     curStone = itemPack.GetAt(stoneIndex)
     
     if not ItemCommon.CheckItemCanUse(curStone):
@@ -137,32 +152,32 @@
     stoneEffType = curStoneEff.GetEffectValue(0)
     stoneCanPlaceList = IpyGameDataPY.GetFuncEvalCfg("GemType%s" % stoneEffType, 1)
     
-    if equipIndex not in stoneCanPlaceList:
+    if equipPlace not in stoneCanPlaceList:
         GameWorld.Log("该宝石不可镶嵌在该装备位!stoneItemID=%s,stoneEffType=%s,stoneCanPlaceList=%s,equipPlace=%s" 
-                      % (stoneItemID, stoneEffType, stoneCanPlaceList, equipIndex), playerID)
+                      % (stoneItemID, stoneEffType, stoneCanPlaceList, equipPlace), playerID)
         return
     
     equipClassLV = ItemCommon.GetItemClassLV(curEquip)
-    if not __CheckStoneHoleCanUse(curPlayer, equipClassLV, holeIndex):
+    if not __CheckStoneHoleCanUse(curPlayer, equipClassLV, holeIndex, equipPackType):
         return
     
     # 扣除宝石
-    ItemCommon.DelItem(curPlayer, curStone, 1, True, ChConfig.ItemDel_EquipEnchase, {"EquipPlace":equipIndex, "HoleIndex":holeIndex})
+    ItemCommon.DelItem(curPlayer, curStone, 1, True, ChConfig.ItemDel_EquipEnchase, {"EquipPlace":equipPlace, "HoleIndex":holeIndex})
     
     isBind = 1 if isBind else 0
     
     # 变更宝石孔宝石信息
-    __DoChangeEquipHoleStone(curPlayer, equipIndex, holeIndex, stoneItemID, isBind, "EquipStone", True)
+    __DoChangeEquipHoleStone(curPlayer, equipPlace, holeIndex, stoneItemID, isBind, "EquipStone", True)
     
 #    #镶嵌成功
 #    if not curEquip.GetIsBind():
 #        ItemControler.SetItemIsBind(curEquip, True)
     
     # 刷新属性
-    RefreshAttrByStoneAction(curPlayer, IPY_GameWorld.rptEquip, True)
+    RefreshAttrByStoneAction(curPlayer, equipPackType, True)
     
     #同步客户端
-    Sycn_StoneHoleInfo(curPlayer, [equipIndex])
+    Sycn_StoneHoleInfo(curPlayer, [equipPlace])
     #成就
     DoStoneSuccess(curPlayer)
     return
@@ -213,36 +228,37 @@
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
     playerID = curPlayer.GetPlayerID()
     # 验证背包类型合法性
-    equipIndex = clientData.EquipIndex
+    equipPlace = clientData.EquipIndex
     holeIndex = clientData.HoleIndex
-    GameWorld.DebugLog("宝石摘除: equipIndex=%s,holeIndex=%s" % (equipIndex, holeIndex), playerID)
+    GameWorld.DebugLog("宝石摘除: equipPlace=%s,holeIndex=%s" % (equipPlace, holeIndex), playerID)
     
+    equipPackType, stonePackType, placeIndex = GetPackTypeByEquipPlace(equipPlace)
     #获得装备位装备实例
-    equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
-    curEquip = equipPack.GetAt(equipIndex)
+    equipPack = curPlayer.GetItemManager().GetPack(equipPackType)
+    curEquip = equipPack.GetAt(placeIndex)
     
     if not ItemCommon.CheckItemCanUse(curEquip):
         GameWorld.Log("目标装备为空或不可用,无法镶嵌!", playerID)
         return
     
     #验证背包空间
-    if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem, True):
+    if not ItemCommon.CheckPackHasSpace(curPlayer, stonePackType, True):
         return
     
     # 验证宝石
-    stoneID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
+    stoneID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipPlace, holeIndex)[0]
     
     if not stoneID:
         GameWorld.DebugLog("孔为空或不存在宝石!")
         return
     
-    __DoChangeEquipHoleStone(curPlayer, equipIndex, holeIndex, 0, 0, "StonePick", True)
+    __DoChangeEquipHoleStone(curPlayer, equipPlace, holeIndex, 0, 0, "StonePick", True)
     
     # 刷新属性
-    RefreshAttrByStoneAction(curPlayer, IPY_GameWorld.rptEquip, False)
+    RefreshAttrByStoneAction(curPlayer, equipPackType, False)
     
     #同步客户端
-    Sycn_StoneHoleInfo(curPlayer, [equipIndex])
+    Sycn_StoneHoleInfo(curPlayer, [equipPlace])
     
     totalStoneLV = GetTotalStoneLV(curPlayer)
     # 记录开服活动宝石总等级
@@ -283,21 +299,21 @@
     playerID = curPlayer.GetPlayerID()
     
     # 验证背包类型合法性
-    equipIndex = clientData.EquipIndex
+    equipPlace = clientData.EquipIndex
     holeIndex = clientData.HoleIndex
     upWay = clientData.UpWay
-    GameWorld.DebugLog("宝石升级: equipPlace=%s,holeIndex=%s" % (equipIndex, holeIndex), playerID)
-    
+    GameWorld.DebugLog("宝石升级: equipPlace=%s,holeIndex=%s" % (equipPlace, holeIndex), playerID)
+    equipPackType, stonePackType, placeIndex = GetPackTypeByEquipPlace(equipPlace)
     #获得装备位装备实例
-    equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
-    curEquip = equipPack.GetAt(equipIndex)
+    equipPack = curPlayer.GetItemManager().GetPack(equipPackType)
+    curEquip = equipPack.GetAt(placeIndex)
     
     if not ItemCommon.CheckItemCanUse(curEquip):
         GameWorld.Log("目标装备为空或不可用,无法镶嵌!", playerID)
         return
         
     #升级宝石ID
-    stoneID, stoneIsBind = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)
+    stoneID, stoneIsBind = GetEquipIndexStoneIDAndIsBand(curPlayer, equipPlace, holeIndex)
     if stoneID == 0:
         GameWorld.DebugLog("孔为空或不存在宝石!")      
         return      
@@ -349,25 +365,25 @@
             costIndexList = (costItemIndexList[0]+costItemIndexList[1])[:2]
         else:
             costIndexList = (costItemIndexList[1]+costItemIndexList[0])[:2]
-        itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+        itemPack = curPlayer.GetItemManager().GetPack(stonePackType)
         hasBind = ItemCommon.ReduceItem(curPlayer, itemPack, costIndexList, needCount-1, False, ChConfig.ItemDel_StoneUpgrade, 
-                                        {"EquipPlace":equipIndex, "HoleIndex":holeIndex})
+                                        {"EquipPlace":equipPlace, "HoleIndex":holeIndex})
         if hasBind:
             stoneIsBind = True
         
     
-    __DoChangeEquipHoleStone(curPlayer, equipIndex, holeIndex, upgradeStoneID, stoneIsBind, "StoneUpgrade", False)
+    __DoChangeEquipHoleStone(curPlayer, equipPlace, holeIndex, upgradeStoneID, stoneIsBind, "StoneUpgrade", False)
     
     # 刷新属性
-    RefreshAttrByStoneAction(curPlayer, IPY_GameWorld.rptEquip, False)
+    RefreshAttrByStoneAction(curPlayer, equipPackType, False)
     
     #同步客户端
-    Sycn_StoneHoleInfo(curPlayer, [equipIndex])
+    Sycn_StoneHoleInfo(curPlayer, [equipPlace])
     
     DoStoneSuccess(curPlayer)
     return
 
-def __CheckStoneHoleCanUse(curPlayer, equipClassLV, holeIndex):
+def __CheckStoneHoleCanUse(curPlayer, equipClassLV, holeIndex, equipPackType):
     ##验证孔合法性
     
     holeIndexList = GetAllEquipPlaceHoleIndex()
@@ -376,7 +392,10 @@
         return False
     
     openCommHoleCnt = 0 # 已经开放装备常规孔数
-    gemOpenClassLVList = IpyGameDataPY.GetFuncEvalCfg("GemOpen", 1)
+    if equipPackType == ShareDefine.rptZhuXianEquip:
+        gemOpenClassLVList = IpyGameDataPY.GetFuncEvalCfg("GemOpen", 2)
+    else:
+        gemOpenClassLVList = IpyGameDataPY.GetFuncEvalCfg("GemOpen", 1)
     for holeCnt, openClassLV in enumerate(gemOpenClassLVList, 1):
         if equipClassLV >= openClassLV:
             openCommHoleCnt = holeCnt
@@ -413,32 +432,33 @@
     
     return True
 
-def __DoChangeEquipHoleStone(curPlayer, equipIndex, holeIndex, changeStoneID, isBind, eventName, isPickoff):
+def __DoChangeEquipHoleStone(curPlayer, equipPlace, holeIndex, changeStoneID, isBind, eventName, isPickoff):
     ## 变更玩家装备孔宝石
     
     #获得装备位孔索引宝石存储信息
-    stoneID, stoneIsBind = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)
+    stoneID, stoneIsBind = GetEquipIndexStoneIDAndIsBand(curPlayer, equipPlace, holeIndex)
     #保存装备位孔位上宝石ID和绑定状态
-    SetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex, changeStoneID, isBind)
+    SetEquipIndexStoneIDAndIsBand(curPlayer, equipPlace, holeIndex, changeStoneID, isBind)
     
     if isPickoff and stoneID:
+        equipPackType, stonePackType, placeIndex = GetPackTypeByEquipPlace(equipPlace)
         itemCount = 1
         # 摘除的宝石都绑定
-        if ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
+        if ItemCommon.CheckPackHasSpace(curPlayer, stonePackType):
             ItemControler.GivePlayerItem(curPlayer, stoneID, itemCount, True if stoneIsBind else False,
-                                         [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], 
-                                         event=[ChConfig.ItemGive_StonePickoff, False, {"EquipPlace":equipIndex, "HoleIndex":holeIndex}])
+                                         [stonePackType], 
+                                         event=[ChConfig.ItemGive_StonePickoff, False, {"EquipPlace":equipPlace, "HoleIndex":holeIndex}])
         else:
             PlayerControl.SendMailByKey("GemToPlayer", [curPlayer.GetPlayerID()], [[stoneID, 1, stoneIsBind]])
             
-    DataRecordPack.DR_StoneItemChange(curPlayer, eventName, {'equipIndex':equipIndex,"holeIndex":holeIndex, "stoneID":stoneID, 'changeStoneID':changeStoneID})    
+    DataRecordPack.DR_StoneItemChange(curPlayer, eventName, {'equipPlace':equipPlace,"holeIndex":holeIndex, "stoneID":stoneID, 'changeStoneID':changeStoneID})    
     return
 
 
 def RefreshAttrByStoneAction(curPlayer, packType, isNeedNotify):
     ## 宝石刷新属性
     # 装备等级改变,判断是否为玩家身上的装备,如果是的话刷新玩家属性
-    if packType in [IPY_GameWorld.rptEquip, IPY_GameWorld.rptHorseEquip]:
+    if packType in [IPY_GameWorld.rptEquip]:
         #先刷装备BUFF 再计算属性
         if isNeedNotify:
             curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Stone)
@@ -447,14 +467,16 @@
         #刷新所有属性
         playControl = PlayerControl.PlayerControl(curPlayer)
         playControl.RefreshPlayerAttrState()
-        
+    elif packType == ShareDefine.rptZhuXianEquip:
+        EquipZhuXian.RefreshZhuXianAttr(curPlayer)
     return
 
 
-def DoMoveEquipStone(curPlayer, equipIndex): 
+def DoMoveEquipStone(curPlayer, equipPlace): 
     ###替换装备时宝石转移
-    equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
-    curEquip = equipPack.GetAt(equipIndex)
+    equipPackType, stonePackType, placeIndex = GetPackTypeByEquipPlace(equipPlace)
+    equipPack = curPlayer.GetItemManager().GetPack(equipPackType)
+    curEquip = equipPack.GetAt(placeIndex)
     if not ItemCommon.CheckItemCanUse(curEquip):
         return
     
@@ -475,10 +497,10 @@
     for holeIndex in xrange(maxEquipHoleCnt):      
         if holeIndex < openEquipHoleCnt:
             continue
-        curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
+        curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipPlace, holeIndex)[0]
         if curGemID == 0:
             continue       
-        pickoffHoleList.append([equipIndex, holeIndex])
+        pickoffHoleList.append([equipPlace, holeIndex])
         
     #没有开启普通装备孔,需摘除VIP孔
     if not openEquipHoleCnt:
@@ -487,13 +509,13 @@
         maxVipHoleCnt = len(gemOpenVipList)# 最大VIP开放孔数
         #判断VIP等级孔信息
         for holeIndex in xrange(ChConfig.Def_Stone_VipHole, ChConfig.Def_Stone_VipHole + maxVipHoleCnt): 
-            curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
+            curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipPlace, holeIndex)[0]
             if curGemID == 0:                             
                 continue
-            pickoffHoleList.append([equipIndex, holeIndex])
+            pickoffHoleList.append([equipPlace, holeIndex])
             
     # 脱装备的外层刷属性, 这里不刷
-    __DoSysPickoffEquipStone(curPlayer, pickoffHoleList, "EquipChange", False)
+    __DoSysPickoffEquipStone(curPlayer, equipPackType, stonePackType, pickoffHoleList, "EquipChange", False)
     return
 
 def OnVIPTimeOut(curPlayer):
@@ -519,7 +541,7 @@
     #===============================================================================================
     return  
 
-def __DoSysPickoffEquipStone(curPlayer, pickoffHoleList, eventName, isRefreshAttr):
+def __DoSysPickoffEquipStone(curPlayer, equipPackType, stonePackType, pickoffHoleList, eventName, isRefreshAttr):
     ## 系统摘除宝石
     
     if not pickoffHoleList:
@@ -529,7 +551,7 @@
     
     equipIndexList = []
     stoneCount = len(pickoffHoleList)
-    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, stoneCount)
+    packSpace = ItemCommon.GetItemPackSpace(curPlayer, stonePackType, stoneCount)
     if packSpace >= stoneCount:
         for equipIndex, holeIndex in pickoffHoleList:
             __DoChangeEquipHoleStone(curPlayer, equipIndex, holeIndex, 0, 0, eventName, True)
@@ -548,7 +570,7 @@
         PlayerControl.SendMailByKey("GemToPlayer", [curPlayer.GetPlayerID()], mailItemInfoList)
         
     if isRefreshAttr:
-        RefreshAttrByStoneAction(curPlayer, IPY_GameWorld.rptEquip, False)
+        RefreshAttrByStoneAction(curPlayer, equipPackType, False)
     
     if equipIndexList:
         Sycn_StoneHoleInfo(curPlayer, equipIndexList)
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 6a4209a..38316fd 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
@@ -100,6 +100,7 @@
                      ChConfig.Def_CalcAttrFunc_Coat:"时装",
                      ChConfig.Def_CalcAttrFunc_ZXEquip:"诛仙装备",
                      ChConfig.Def_CalcAttrFunc_ZXEquipSuit:"诛仙装备套装",
+                     ChConfig.Def_CalcAttrFunc_ZXEquipStone:"诛仙装备宝石",
                      }
     
     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 87e5e86..6b31701 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1329,6 +1329,13 @@
                         ("DWORD", "NeedPoint", 0),
                         ("dict", "Award", 0),
                         ),
+
+                "ZhuXianStoneAttr":(
+                        ("BYTE", "SuitType", 1),
+                        ("BYTE", "ShareSoneLV", 1),
+                        ("list", "AttrIDList", 0),
+                        ("list", "AttrValueList", 0),
+                        ),
                 }
 
 
@@ -4054,6 +4061,21 @@
     def GetIndex(self): return self.Index # 索引
     def GetNeedPoint(self): return self.NeedPoint # 需要点数
     def GetAward(self): return self.Award # 奖励 {"职业":[[物品ID,个数,是否绑定],...], ...}
+
+# 诛仙宝石共鸣属性表
+class IPY_ZhuXianStoneAttr():
+    
+    def __init__(self):
+        self.SuitType = 0
+        self.ShareSoneLV = 0
+        self.AttrIDList = []
+        self.AttrValueList = []
+        return
+        
+    def GetSuitType(self): return self.SuitType # 套装类型
+    def GetShareSoneLV(self): return self.ShareSoneLV # 共鸣等级
+    def GetAttrIDList(self): return self.AttrIDList # 属性ID列表
+    def GetAttrValueList(self): return self.AttrValueList # 属性值列表
 
 
 def Log(msg, playerID=0, par=0):
@@ -4333,6 +4355,8 @@
         self.ipyNewAllPeoplePartyLen = len(self.ipyNewAllPeoplePartyCache)
         self.ipyNewAllPeoplePartyAwardCache = self.__LoadFileData("NewAllPeoplePartyAward", IPY_NewAllPeoplePartyAward)
         self.ipyNewAllPeoplePartyAwardLen = len(self.ipyNewAllPeoplePartyAwardCache)
+        self.ipyZhuXianStoneAttrCache = self.__LoadFileData("ZhuXianStoneAttr", IPY_ZhuXianStoneAttr)
+        self.ipyZhuXianStoneAttrLen = len(self.ipyZhuXianStoneAttrCache)
         Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
         Log("IPY_DataMgr InitOK!")
         return
@@ -4753,6 +4777,8 @@
     def GetNewAllPeoplePartyByIndex(self, index): return self.ipyNewAllPeoplePartyCache[index]
     def GetNewAllPeoplePartyAwardCount(self): return self.ipyNewAllPeoplePartyAwardLen
     def GetNewAllPeoplePartyAwardByIndex(self, index): return self.ipyNewAllPeoplePartyAwardCache[index]
+    def GetZhuXianStoneAttrCount(self): return self.ipyZhuXianStoneAttrLen
+    def GetZhuXianStoneAttrByIndex(self, index): return self.ipyZhuXianStoneAttrCache[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 1f0c471..d0b6f3d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -803,7 +803,7 @@
     gameData = GameWorld.GetGameData()
 
     effIndexList = [1, 2, 3, 4] # 第一个效果值是类型等级效果值,非属性效果值
-  
+    gemLVList = []
     for holeIndex in Operate_EquipStone.GetAllEquipPlaceHoleIndex():
         
         curGemID = Operate_EquipStone.GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
@@ -818,8 +818,10 @@
             effectID, effectValue = curGemEffect.GetEffectID(), curGemEffect.GetEffectValue(0)
             if effectID and effectValue:
                 PlayerControl.CalcAttrDict_Type(effectID, effectValue, allAttrList)
-
-    return
+        gemEffect = curGem.GetEffectByIndex(0)
+        gemLV = gemEffect.GetEffectValue(1)
+        gemLVList.append(gemLV)
+    return gemLVList
 
 #---------------------------------------------------------------------
 ## 装备添加Buff 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py
index 77fcb45..c55b09d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py
@@ -28,6 +28,7 @@
 import SkillCommon
 import PyGameData
 import ChConfig
+import ChEquip
 
 import random
 
@@ -196,10 +197,11 @@
     
     allAttrList = [{} for _ in range(4)]
     allAttrListZXSuit = [{} for _ in range(4)]
+    allAttrListZXStone = [{} for _ in range(4)]
     equipScoreTotal = 0  #为解决装备评分、战力不一致的情况,装备战力改为由评分作为参数计算战力
     equipPlaceClassLVDict = {}  #装备位对应装备阶 {装备位:阶, ...}
     equipPlaceBaseAttrDict = {}  #装备位对应基础属性字典 {装备位:{属性ID:value, ...}, ...}
-    
+    equipPlaceStoneLVDict = {}  #装备位对应宝石等级 {装备位:[宝石等级,..], ...}
     attrIDSkillPlusDict = IpyGameDataPY.GetFuncEvalCfg("SkillPlusAttrID", 1, {})  # 属性ID对应影响的技能TypeID列表 {属性ID:[技能TypeID列表, ...], ...}
     addAttrIDList = range(ShareDefine.Def_Effect_SkillAddPer1, ShareDefine.Def_Effect_SkillAddPer7 + 1)
     reduceAttrIDList = range(ShareDefine.Def_Effect_SkillReducePer1, ShareDefine.Def_Effect_SkillReducePer7 + 1)
@@ -241,7 +243,11 @@
                     zxSkillPlusAttrDict[legendAttrID] = zxSkillPlusAttrDict.get(legendAttrID, 0) + legendAttrValue
                 else:
                     PlayerControl.CalcAttrDict_Type(legendAttrID, legendAttrValue, allAttrList)
-                    
+        #宝石属性
+        gemlvList = ChEquip.CalcEquipStone_Effect(curPlayer, equipIndex, allAttrListZXStone)
+        equipPlaceStoneLVDict[equipIndex] = gemlvList
+            
+        
 #    GameWorld.DebugLog("诛仙装备属性: allAttrList=%s" % (allAttrList))
 #    GameWorld.DebugLog("    zxSkillPlusAttrDict=%s" % (zxSkillPlusAttrDict))
 #    GameWorld.DebugLog("    equipPlaceClassLVDict=%s" % (equipPlaceClassLVDict))
@@ -272,6 +278,10 @@
                                ShareDefine.Def_Effect_ZXRuyiAttrPer:ShareDefine.zxetRuyi,
                                ShareDefine.Def_Effect_ZXPendantAttrPer:ShareDefine.zxetPendant,
                                ShareDefine.Def_Effect_ZXRingAttrPer:ShareDefine.zxetRing,
+                               ShareDefine.Def_Effect_ZXWeaponAttrPer:ShareDefine.zxetWeapon1,
+                               ShareDefine.Def_Effect_LXWeaponAttrPer:ShareDefine.zxetWeapon2,
+                               ShareDefine.Def_Effect_XXWeaponAttrPer:ShareDefine.zxetWeapon3,
+                               ShareDefine.Def_Effect_JXWeaponAttrPer:ShareDefine.zxetWeapon4,
                                }
     suitPlaceGroupDict = IpyGameDataPY.GetFuncEvalCfg("EquipZhuXian", 2, {})
     for suitType, placeGroupList in suitPlaceGroupDict.items():
@@ -314,10 +324,45 @@
                     PlayerControl.CalcAttrDict_Type(plusEffID, addValue, allAttrListZXSuit)
             else:
                 PlayerControl.CalcAttrDict_Type(suitEffID, suitEffValue, allAttrListZXSuit)
-                
+    #宝石共鸣属性
+    needStoneCnt = IpyGameDataPY.GetFuncCfg('GemResonance')
+    for suitType, placeGroupList in suitPlaceGroupDict.items():
+        suitType = int(suitType)
+        groupStoneLVList = []
+        for place in placeGroupList:
+            groupStoneLVList += equipPlaceStoneLVDict.get(place, [])
+        
+        if len(groupStoneLVList) < needStoneCnt:
+            continue
+        groupStoneLVList.sort(reverse=True)
+        shareStoneLV = min(groupStoneLVList[needStoneCnt:])
+        GameWorld.DebugLog("    激活诛仙宝石共鸣: suitType=%s, shareStoneLV=%s" % (suitType, shareStoneLV))
+        stoneAttrIpyData = IpyGameDataPY.GetIpyGameData("ZhuXianStoneAttr", suitType, shareStoneLV)
+        if not stoneAttrIpyData:
+            continue
+        attrIDList = stoneAttrIpyData.GetAttrIDList()
+        attrValueList = stoneAttrIpyData.GetAttrValueList()
+        if len(attrIDList) != len(attrValueList):
+            continue
+        for i, effID in enumerate(attrIDList):
+            effValue = attrValueList[i]
+            if effID in suitAttrIDPlusPlaceDict:
+                plusPlace = suitAttrIDPlusPlaceDict[effID]
+                if plusPlace not in equipPlaceBaseAttrDict:
+                    continue
+                plusEffDict = equipPlaceBaseAttrDict[plusPlace]
+                #GameWorld.DebugLog("            plusPlace=%s,plusEffDict=%s" % (plusPlace, plusEffDict))
+                for plusEffID, plusEffValue in plusEffDict.items():
+                    addValue = int(plusEffValue * (10000 + suitEffValue) / 10000.0)
+                    #GameWorld.DebugLog("                plusEffID=%s,plusEffValue=%s,addValue=%s" % (plusEffID, plusEffValue, addValue))
+                    PlayerControl.CalcAttrDict_Type(plusEffID, addValue, allAttrListZXStone)
+            else:
+                PlayerControl.CalcAttrDict_Type(effID, effValue, allAttrListZXStone)
+        
     # 保存计算值
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_ZXEquip, allAttrList)
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_ZXEquipSuit, allAttrListZXSuit)
+    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_ZXEquipStone, allAttrListZXStone)
     
     #计算装备基础属性附加战力 (目前组成: 评分战力 + ...)
     equipFightPowerEx = eval(IpyGameDataPY.GetFuncCompileCfg("FightpowerFormula", 2))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 6680a4f..75f8d7b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -518,6 +518,11 @@
 Def_Effect_SkillReducePer6 = 114 # 受到技能伤害减少6
 Def_Effect_SkillReducePer7 = 115 # 受到技能伤害减少7
 
+Def_Effect_ZXWeaponAttrPer = 116 # 诛仙剑1属性加成百分比
+Def_Effect_LXWeaponAttrPer = 117 # 诛仙剑2属性加成百分比
+Def_Effect_XXWeaponAttrPer = 118 # 诛仙剑3属性加成百分比
+Def_Effect_JXWeaponAttrPer = 119 # 诛仙剑4属性加成百分比
+
 #增加%d物理伤害值,其中a值为伤害值
 Def_Effect_AddAtk = 1005
 #增加%d魔法伤害值,其中a值为伤害值

--
Gitblit v1.8.0