From 97fef842ed56dfd7c7dd73f9c7acf20df55b9a23 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 05 九月 2025 11:35:20 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化主线掉落装备:改为按Boss类型掉落,祝福树区分不同的Boss类型掉落概率;分解装备按消耗的战锤进行均分计算分解所得;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py                        |    9 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py                       |    4 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py |  244 +++++++++++++++++++++++-----------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                                |   62 ++++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py                              |    2 
 PySysDB/PySysDBPY.h                                                                                                 |    8 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py                         |   24 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py                              |   10 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                     |    2 
 9 files changed, 237 insertions(+), 128 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 5300ab1..d19eff1 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -37,6 +37,7 @@
 	BYTE		AtkDistType;	//远近类型;1-近战;2-远程
 	BYTE		Sex;	//性别;1-男,2-女
 	WORD		LV;	//等级
+	BYTE		BossType;	//Boss类型
 	DWORD		Atk;	//攻击力
 	DWORD		Def;	//防御值
 	DWORD		MaxHP;	//最大生命值,可超过20E
@@ -632,7 +633,6 @@
 struct EquipColor
 {
 	BYTE		_ItemColor;	//装备品质
-	DWORD		MoneyBase;	//分解货币
 	DWORD		AtkStep;	//攻击步长
 	DWORD		DefStep;	//防御步长
 	DWORD		HPStep;	//生命步长
@@ -3249,14 +3249,16 @@
 	list		AwardItemList;	//奖励物品列表
 };
 
-//仙树等级表
+//祝福树
 
 struct tagTreeLV
 {
 	BYTE		_TreeLV;	//仙树等级
 	DWORD		LVUPNeedMoney;	//升到下一级所需货币数
 	DWORD		LVUPNeedTime;	//升级下一级所需所需秒
-	list		EquipColorRateList;	//产出装备品质概率列表,[0品质万分率, 1品质万分率, ...]
+	list		EquipColorRateList;	//小怪产出装备品质概率列表,[0品质万分率, 1品质万分率, ...]
+	list		EquipColorRateList1;	//精英产出装备品质概率列表,[0品质万分率, 1品质万分率, ...]
+	list		EquipColorRateList2;	//boss产出装备品质概率列表,[0品质万分率, 1品质万分率, ...]
 };
 
 //淘金营地表
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 3a5998d..a915e37 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4160,7 +4160,7 @@
 
 #主线
 Def_PDict_UnXiantaoCntExp = "UnXiantaoCntExp" # 累计未结算经验的战锤数
-Def_PDict_UnXiantaoCntEquip = "UnXiantaoCntEquip" # 累计未结算装备掉落的战锤数
+Def_PDict_UnXiantaoCntEquip = "UnXiantaoCntEquip" # 累计未结算装备掉落的战锤数,有3位小数,即 1234 实际为 1.234
 Def_PDict_UnXiantaoCntBooty = "UnXiantaoCntBooty_%s" # 累计未结算战利品掉落的战锤数,参数(itemID)
 Def_PDict_BootyDropToday = "BootyDropToday_%s" # 今日已累计掉落战利品数量,参数(itemID)
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py
index 62016fd..70916dc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py
@@ -28,13 +28,18 @@
     if not gmList:
         GameWorld.DebugAnswer(curPlayer, "重置主线: MainLevel 0")
         GameWorld.DebugAnswer(curPlayer, "设置主线: MainLevel 章节 关卡 波")
-        GameWorld.DebugAnswer(curPlayer, "测试掉落: MainLevel d 战锤数")
+        GameWorld.DebugAnswer(curPlayer, "测试击杀: MainLevel k 消耗战锤数")
         GameWorld.DebugAnswer(curPlayer, "重置掉落: MainLevel d 0 [是否清掉落背包]")
         GameWorld.DebugAnswer(curPlayer, "重置战利: MainLevel b 0")
         GameWorld.DebugAnswer(curPlayer, "设置战利: MainLevel b 战利品ID 已掉落个数")
         return
     
     value = gmList[0]
+    
+    if value == "k":
+        useXiantao = gmList[1] if len(gmList) > 1 else 1
+        GameLogic_MainLevel.GMTestKill(curPlayer, useXiantao)
+        return
     
     if value == "d":
         unXiantao = gmList[1] if len(gmList) > 1 else 1
@@ -47,8 +52,6 @@
                 ClearPack.__DoLogic_Clear_Pack(curPlayer, IPY_GameWorld.rptIdentify)
             GameWorld.DebugAnswer(curPlayer, "重置未结算战锤掉落OK!")
             return
-        
-        GameLogic_MainLevel.GMTestKillDrop(curPlayer, unXiantao)
         return
     
     if value == "b":
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
index 8aa2f91..5d3fe75 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -2400,14 +2400,14 @@
     
     return callFunc(curPlayer, mapID, funcLineID)
 
-def OnPlayerLineupAttackResult(curPlayer, atkObj, killObjIDList, useSkill, mapID, funcLineID):
+def OnPlayerLineupAttackResult(curPlayer, atkObj, killObjList, useSkill, mapID, funcLineID):
     ## 回合战斗主动发起的玩家阵容攻击结果额外处理 ,一般处理副本相关的掉落、奖励等
     do_FBLogic_ID = __GetFBLogic_MapID(mapID)
     
     callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnPlayerLineupAttackResult"))
     
     if callFunc:
-        callFunc(curPlayer, atkObj, killObjIDList, useSkill, mapID, funcLineID)
+        callFunc(curPlayer, atkObj, killObjList, useSkill, mapID, funcLineID)
         
     return
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
index cef5c8b..123be33 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
@@ -28,6 +28,7 @@
 import ItemCommon
 import PlayerTask
 import NPCCommon
+import BattleObj
 import ChEquip
 import ObjPool
 
@@ -66,17 +67,17 @@
     ipyData = ipyDataMgr.GetMainChapterByIndex(chapterCount - 1)
     return [booty[0] for booty in ipyData.GetDailyBootyUpperList()]
 
-def OnPlayerLineupAttackResult(curPlayer, atkObj, killObjIDList, useSkill, mapID, funcLineID):
+def OnPlayerLineupAttackResult(curPlayer, atkObj, killObjList, useSkill, mapID, funcLineID):
     ## 回合战斗主动发起的玩家阵容攻击结果额外处理 ,一般处理副本相关的掉落、奖励等
     
     if mapID == ChConfig.Def_FBMapID_Main:
-        __doKillAward(curPlayer, atkObj, killObjIDList)
+        __doKillAward(curPlayer, atkObj, killObjList)
         
     return
 
-def __doKillAward(curPlayer, atkObj, killObjIDList):
+def __doKillAward(curPlayer, atkObj, killObjList):
     ## 计算击杀奖励
-    if not killObjIDList:
+    if not killObjList:
         GameWorld.DebugLog("没有击杀不需要处理!")
         return
     # 结算经验
@@ -88,12 +89,12 @@
         GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s" % (totalExp, unXiantaoCntExp))
         PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
         
-    __doMainDrop(curPlayer)
+    __doMainDrop(curPlayer, killObjList)
     return
 
-def __doMainDrop(curPlayer):
+def __doMainDrop(curPlayer, killObjList):
     # 装备掉落
-    if __doDropEquip(curPlayer) == -1:
+    if __doDropEquip(curPlayer, killObjList) == -1:
         return
     
     playerID = curPlayer.GetPlayerID()
@@ -161,15 +162,36 @@
         
     return
 
-def __doDropEquip(curPlayer):
+def __doDropEquip(curPlayer, killObjList):
     ## 主线掉落装备
     playerID = curPlayer.GetPlayerID()
-    unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip)
-    dropOneNeed = IpyGameDataPY.GetFuncCfg("MainEquipDrop", 1) # 每消耗X个战锤掉落一件装备
-    dropEquipCnt = unXiantaoCntEquip / dropOneNeed
+    unXiantaoCntEquip = PlayerControl.GetUnXiantaoCntEquip(curPlayer)
+    bossTypeDropInfo = IpyGameDataPY.GetFuncCfg("MainEquipDrop", 1) # 每消耗X个战锤掉落一件装备
+    fightPoint = max(curPlayer.GetFightPoint(), 1) # 消耗倍率也是掉落倍率
+    dropEquipCnt = 0
+    objDropCntDict = {}
+    for tagObj in killObjList:
+        tagID = tagObj.GetID()
+        npcID = tagObj.GetNPCID()
+        if not npcID:
+            continue
+        npcData = NPCCommon.GetNPCDataPy(npcID)
+        if not npcData:
+            continue
+        bossType = npcData.GetBossType()
+        if bossType not in bossTypeDropInfo:
+            continue
+        dropCnt = GameWorld.GetResultByRandomList(bossTypeDropInfo[bossType])
+        if not dropCnt:
+            continue
+        dropCnt *= fightPoint # 多倍掉落
+        objDropCntDict[tagID] = [tagObj, dropCnt, bossType]
+        dropEquipCnt += dropCnt
+        
     if dropEquipCnt <= 0:
-        GameWorld.DebugLog("主线暂不能掉落! unXiantaoCntEquip=%s,dropOneNeed=%s,dropEquipCnt=%s" % (unXiantaoCntEquip, dropOneNeed, dropEquipCnt), playerID)
+        GameWorld.DebugLog("主线暂不能掉落! unXiantaoCntEquip=%s,dropEquipCnt=%s" % (unXiantaoCntEquip, dropEquipCnt), playerID)
         return
+    # 根据掉落背包空间修正最终可掉落装备数
     dropEquipCnt = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptIdentify, dropEquipCnt)
     if not dropEquipCnt:
         GameWorld.DebugLog("掉落背包已满!", playerID)
@@ -179,52 +201,101 @@
     ipyData = IpyGameDataPY.GetIpyGameData("TreeLV", treeLV)
     if not ipyData:
         return
-    equipColorRateList = ipyData.GetEquipColorRateList()
-    GameWorld.DebugLog("主线掉落装备: unXiantaoCntEquip=%s,dropEquipCnt=%s,treeLV=%s,equipColorRateList=%s" % (unXiantaoCntEquip, dropEquipCnt, treeLV, equipColorRateList), playerID)
+    GameWorld.DebugLog("主线掉落装备: unXiantaoCntEquip=%s,dropEquipCnt=%s,treeLV=%s,objDropCntDict=%s" 
+                       % (unXiantaoCntEquip, dropEquipCnt, treeLV, objDropCntDict), playerID)
     
-    maxRate = 10000
-    totalRate = 0
-    colorRateList = []
-    for equipColor, colorRate in enumerate(equipColorRateList, 1):
-        if not colorRate:
-            continue
-        totalRate += colorRate
-        colorRateList.append([totalRate, equipColor])
-        
-    if totalRate != maxRate:
-        GameWorld.SendGameError("GameWarning", "CutTreeTotalRateError:%s!=%s,treeLV=%s" % (totalRate, maxRate, treeLV))    
-    if not colorRateList:
-        return
-    GameWorld.DebugLog("    colorRateList=%s,totalRate=%s" % (colorRateList, totalRate), playerID)
-    
-    for _ in range(dropEquipCnt):
-        itemColor = GameWorld.GetResultByRandomList(colorRateList)
-        if not itemColor:
-            continue
-        equipIDList = NPCCommon.__GetEquipIDList(0, color=itemColor, placeList=ChConfig.Def_MainEquipPlaces, findType="MainEquipDrop")
-        if not equipIDList:
-            continue
-        randEquipID = random.choice(equipIDList)
-        
-        curItem = ItemControler.GetOutPutItemObj(randEquipID, 1, False, curPlayer=curPlayer)
-        if curItem == None:
-            continue
-        curItem.SetIsBind(1) # 为1时代表是掉落
-        
-        #GameWorld.DebugLog("掉落装备: randEquipID=%s,%s" % (randEquipID, curItem.GetGUID()), playerID)
-        if not ItemControler.DoLogic_PutItemInPack(curPlayer, curItem, packIndexList=[IPY_GameWorld.rptIdentify]):
+    for tagID, dropInfo in objDropCntDict.items():
+        tagObj, dropCnt, bossType = dropInfo
+        if hasattr(ipyData, "GetEquipColorRateList%s" % bossType):
+            equipColorRateList = getattr(ipyData, "GetEquipColorRateList%s" % bossType)()
+        else:
+            equipColorRateList = ipyData.GetEquipColorRateList()
+            
+        GameWorld.DebugLog("tagID=%s,bossType=%s,dropCnt=%s,treeLV=%s,equipColorRateList=%s" 
+                           % (tagID, bossType, dropCnt, treeLV, equipColorRateList), playerID)
+        if not equipColorRateList:
             continue
         
-        unXiantaoCntEquip -= dropOneNeed
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
+        totalRate = 0
+        colorRateList = []
+        for equipColor, colorRate in enumerate(equipColorRateList, 1):
+            if not colorRate:
+                continue
+            totalRate += colorRate
+            colorRateList.append([totalRate, equipColor])
+            
+        #maxRate = 10000
+        #if totalRate != maxRate:
+        #    GameWorld.SendGameError("GameWarning", "CutTreeTotalRateError:%s!=%s,treeLV=%s" % (totalRate, maxRate, treeLV))    
+        if not colorRateList:
+            return
+        GameWorld.DebugLog("    colorRateList=%s,totalRate=%s" % (colorRateList, totalRate), playerID)
         
+        for _ in range(dropCnt):
+            if dropEquipCnt <= 0:
+                break
+            itemColor = GameWorld.GetResultByRandomList(colorRateList)
+            if not itemColor:
+                continue
+            equipIDList = NPCCommon.__GetEquipIDList(0, color=itemColor, placeList=ChConfig.Def_MainEquipPlaces, findType="MainEquipDrop")
+            if not equipIDList:
+                continue
+            randEquipID = random.choice(equipIDList)
+            
+            curItem = ItemControler.GetOutPutItemObj(randEquipID, 1, False, curPlayer=curPlayer)
+            if curItem == None:
+                continue
+            curItem.SetIsBind(1) # 为1时代表是掉落
+            #GameWorld.DebugLog("掉落装备: randEquipID=%s,%s" % (randEquipID, curItem.GetGUID()), playerID)
+            if not ItemControler.DoLogic_PutItemInPack(curPlayer, curItem, packIndexList=[IPY_GameWorld.rptIdentify]):
+                continue
+            
+            dropEquipCnt -= 1
+            
     return
 
-def GMTestKillDrop(curPlayer, unXiantao):
-    ## GM测试掉落
-    unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) + unXiantao
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
-    GameWorld.DebugAnswer(curPlayer, "未结算装备战锤数: %s" % unXiantaoCntEquip)
+def GMTestKill(curPlayer, useXiantao):
+    ## GM测试击杀
+    
+    mainFightMgr = TurnAttack.GetMainFightMgr(curPlayer)
+    turnFight = mainFightMgr.turnFight
+    if not turnFight.isInFight():
+        GameWorld.DebugAnswer(curPlayer, "非主线战斗中!")
+        return
+    
+    useSkill = None
+    batObjMgr = BattleObj.GetBatObjMgr()
+    
+    # 随便取一个武将击杀对方所有怪物即可
+    atkObj = None
+    batFactionA = turnFight.getBatFaction(ChConfig.Def_FactionA)
+    batLineup = batFactionA.getBatlineup(1)
+    for objID in batLineup.posObjIDDict.values():
+        atkObj = batObjMgr.getBatObj(objID)
+        if atkObj.IsAlive():
+            break
+        
+    if not atkObj:
+        GameWorld.DebugAnswer(curPlayer, "主阵容没有存活武将!")
+        return
+    
+    clientPack = ChPyNetSendPack.tagSCTurnFightReportSign()
+    clientPack.Sign = 0
+    NetPackCommon.SendFakePack(curPlayer, clientPack) # 标记开始
+    
+    killObjList = []
+    batFactionB = turnFight.getBatFaction(ChConfig.Def_FactionB)
+    batLineup = batFactionB.getBatlineup(1)
+    for objID in batLineup.posObjIDDict.values():
+        tagObj = batObjMgr.getBatObj(objID)
+        if tagObj.IsAlive():
+            killObjList.append(tagObj)
+            TurnAttack.SetObjKilled(turnFight, tagObj, atkObj, useSkill)
+            
+    unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp) + useXiantao
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, unXiantaoCntExp)
+    GameWorld.DebugAnswer(curPlayer, "未结算经验战锤数: %s" % unXiantaoCntExp)
+    GameWorld.DebugAnswer(curPlayer, "未结算装备战锤数: %s" % PlayerControl.AddUnXiantaoCntEquip(curPlayer, useXiantao))
     chapterID = PlayerControl.GetMainLevelNowInfo(curPlayer)[0]
     chapterIpyData = IpyGameDataPY.GetIpyGameData("MainChapter", chapterID)
     if chapterIpyData:
@@ -232,11 +303,16 @@
         for itemID, upperCnt in DailyBootyUpperList:
             if upperCnt <= 0:
                 continue
-            unXiantaoCntBooty = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntBooty % itemID) + unXiantao
+            unXiantaoCntBooty = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntBooty % itemID) + useXiantao
             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntBooty % itemID, unXiantaoCntBooty)
             GameWorld.DebugAnswer(curPlayer, "未结算战利品(%s)战锤数: %s" % (itemID, unXiantaoCntBooty))
             
-    __doMainDrop(curPlayer)
+    OnPlayerLineupAttackResult(curPlayer, atkObj, killObjList, useSkill, turnFight.mapID, turnFight.funcLineID)
+    turnFight.checkOverByKilled()
+    
+    # 标记结束
+    clientPack.Sign = 1
+    NetPackCommon.SendFakePack(curPlayer, clientPack)
     return
 
 #// B4 15 主线掉落物品操作 #tagCSMainDropItemOP
@@ -316,50 +392,58 @@
 def __doDecomposeMainEquip(curPlayer, itemIndexList):
     playerID = curPlayer.GetPlayerID()
     GameWorld.DebugLog("分解主线装备: itemIndexList=%s" % (itemIndexList), playerID)
-    IdentifyPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptIdentify)
-    
-    moneyType = IpyGameDataPY.GetFuncCfg("MainEquipDrop", 2)
-    if not moneyType:
+    moneyType, moneyBase = IpyGameDataPY.GetFuncEvalCfg("MainEquipDrop", 2)
+    if not moneyType or not moneyBase:
         return
+    
+    equipDict = {}
+    IdentifyPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptIdentify)
+    for index in range(IdentifyPack.GetCount()):
+        curEquip = IdentifyPack.GetAt(index)
+        if not ItemCommon.CheckItemCanUse(curEquip):
+            #GameWorld.DebugLog("物品为空或不可用: index=%s" % index, playerID)
+            continue
+        if not ItemCommon.GetIsMainEquip(curEquip):
+            #GameWorld.DebugLog("非主线装备: index=%s" % index, playerID)
+            continue
+        equipDict[index] = curEquip
+            
+    if not equipDict:
+        return
+    
+    equipCnt = len(equipDict)
+    unXiantaoCntEquip = PlayerControl.GetUnXiantaoCntEquip(curPlayer)
+    perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip
+    decomposeMoney = max(1, moneyBase * perEquipXiantao) # 至少1个
+    GameWorld.DebugLog("unXiantaoCntEquip=%s,equipCnt=%s,perEquipXiantao=%s,equipIndexList=%s" 
+                       % (unXiantaoCntEquip, equipCnt, perEquipXiantao, equipDict.keys()), playerID)
+    GameWorld.DebugLog("moneyBase=%s,decomposeMoney=%s" % (moneyBase, decomposeMoney), playerID)
     
     moneyTotal = 0
     
     decomposeCnt = 0
     decomposeIndexList = []
     for itemIndex in itemIndexList:
-        if itemIndex < 0 or itemIndex >= IdentifyPack.GetCount():
+        if itemIndex not in equipDict:
             continue
-        curEquip = IdentifyPack.GetAt(itemIndex)
-        if not ItemCommon.CheckItemCanUse(curEquip):
-            GameWorld.DebugLog("物品为空或不可用: itemIndex=%s" % itemIndex, playerID)
-            continue
-        
-        if not ItemCommon.GetIsMainEquip(curEquip):
-            GameWorld.DebugLog("非主线装备: itemIndex=%s" % itemIndex, playerID)
-            continue
-        itemColor = curEquip.GetItemColor()
-        
-        colorIpyData = IpyGameDataPY.GetIpyGameData("EquipColor", itemColor)
-        if not colorIpyData:
-            return
-        moneyBase = colorIpyData.GetMoneyBase() # 分解货币基础
-        if not moneyBase:
-            return
-        # 可以处理一些加成
-        
-        decomposeMoney = moneyBase
+        curEquip = equipDict[itemIndex]
         
         moneyTotal += decomposeMoney
-        GameWorld.DebugLog("    itemIndex=%s,itemColor=%s,moneyBase=%s,decomposeMoney=%s,%s" 
-                           % (itemIndex, itemColor, moneyBase, decomposeMoney, moneyTotal), playerID)
+        GameWorld.DebugLog("    itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,总:%s" 
+                           % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, moneyTotal), playerID)
         
         ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
         decomposeIndexList.append(itemIndex)
         decomposeCnt += 1
+        unXiantaoCntEquip -= perEquipXiantao
         
     if not moneyTotal:
         return
     
+    moneyTotal = int(round(moneyTotal)) # 四舍五入取整
+    unXiantaoCntEquip = PlayerControl.SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip)
+    GameWorld.DebugLog("moneyTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, unXiantaoCntEquip), playerID)
+            
     PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
     PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
     return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index e9a3861..861ba0c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -64,6 +64,7 @@
                         ("BYTE", "AtkDistType", 0),
                         ("BYTE", "Sex", 0),
                         ("WORD", "LV", 0),
+                        ("BYTE", "BossType", 0),
                         ("DWORD", "Atk", 0),
                         ("DWORD", "Def", 0),
                         ("DWORD", "MaxHP", 0),
@@ -545,7 +546,6 @@
 
                 "EquipColor":(
                         ("BYTE", "ItemColor", 1),
-                        ("DWORD", "MoneyBase", 0),
                         ("DWORD", "AtkStep", 0),
                         ("DWORD", "DefStep", 0),
                         ("DWORD", "HPStep", 0),
@@ -2540,6 +2540,8 @@
                         ("DWORD", "LVUPNeedMoney", 0),
                         ("DWORD", "LVUPNeedTime", 0),
                         ("list", "EquipColorRateList", 0),
+                        ("list", "EquipColorRateList1", 0),
+                        ("list", "EquipColorRateList2", 0),
                         ),
 
                 "GoldRushCamp":(
@@ -2616,25 +2618,26 @@
     def GetAtkDistType(self): return self.attrTuple[4] # 远近类型;1-近战;2-远程 BYTE
     def GetSex(self): return self.attrTuple[5] # 性别;1-男,2-女 BYTE
     def GetLV(self): return self.attrTuple[6] # 等级 WORD
-    def GetAtk(self): return self.attrTuple[7] # 攻击力 DWORD
-    def GetDef(self): return self.attrTuple[8] # 防御值 DWORD
-    def GetMaxHP(self): return self.attrTuple[9] # 最大生命值,可超过20E DWORD
-    def GetSkillIDList(self): return self.attrTuple[10] # 技能ID列表 list
-    def GetFinalDamPer(self): return self.attrTuple[11] # 最终增伤 DWORD
-    def GetFinalDamPerDef(self): return self.attrTuple[12] # 最终减伤 DWORD
-    def GetMissRate(self): return self.attrTuple[13] # 闪避概率 DWORD
-    def GetMissRateDef(self): return self.attrTuple[14] # 抗闪避概率 DWORD
-    def GetSuperHitRate(self): return self.attrTuple[15] # 暴击概率 DWORD
-    def GetSuperHitRateDef(self): return self.attrTuple[16] # 抗暴击概率 DWORD
-    def GetStunRate(self): return self.attrTuple[17] # 击晕概率 DWORD
-    def GetStunRateDef(self): return self.attrTuple[18] # 抗击晕概率 DWORD
-    def GetComboRate(self): return self.attrTuple[19] # 连击概率 DWORD
-    def GetComboRateDef(self): return self.attrTuple[20] # 抗连击概率 DWORD
-    def GetParryRate(self): return self.attrTuple[21] # 格挡概率 DWORD
-    def GetParryRateDef(self): return self.attrTuple[22] # 抗格挡概率 DWORD
-    def GetSuckHPPer(self): return self.attrTuple[23] # 吸血比率 DWORD
-    def GetSuckHPPerDef(self): return self.attrTuple[24] # 抗吸血比率 DWORD
-    def GetSpecAttrInfo(self): return self.attrTuple[25] # 特殊属性信息 {"属性ID":值, ...} dict
+    def GetBossType(self): return self.attrTuple[7] # Boss类型 BYTE
+    def GetAtk(self): return self.attrTuple[8] # 攻击力 DWORD
+    def GetDef(self): return self.attrTuple[9] # 防御值 DWORD
+    def GetMaxHP(self): return self.attrTuple[10] # 最大生命值,可超过20E DWORD
+    def GetSkillIDList(self): return self.attrTuple[11] # 技能ID列表 list
+    def GetFinalDamPer(self): return self.attrTuple[12] # 最终增伤 DWORD
+    def GetFinalDamPerDef(self): return self.attrTuple[13] # 最终减伤 DWORD
+    def GetMissRate(self): return self.attrTuple[14] # 闪避概率 DWORD
+    def GetMissRateDef(self): return self.attrTuple[15] # 抗闪避概率 DWORD
+    def GetSuperHitRate(self): return self.attrTuple[16] # 暴击概率 DWORD
+    def GetSuperHitRateDef(self): return self.attrTuple[17] # 抗暴击概率 DWORD
+    def GetStunRate(self): return self.attrTuple[18] # 击晕概率 DWORD
+    def GetStunRateDef(self): return self.attrTuple[19] # 抗击晕概率 DWORD
+    def GetComboRate(self): return self.attrTuple[20] # 连击概率 DWORD
+    def GetComboRateDef(self): return self.attrTuple[21] # 抗连击概率 DWORD
+    def GetParryRate(self): return self.attrTuple[22] # 格挡概率 DWORD
+    def GetParryRateDef(self): return self.attrTuple[23] # 抗格挡概率 DWORD
+    def GetSuckHPPer(self): return self.attrTuple[24] # 吸血比率 DWORD
+    def GetSuckHPPerDef(self): return self.attrTuple[25] # 抗吸血比率 DWORD
+    def GetSpecAttrInfo(self): return self.attrTuple[26] # 特殊属性信息 {"属性ID":值, ...} dict
 
 # NPC成长表
 class IPY_NPCStronger():
@@ -3312,13 +3315,12 @@
         return
         
     def GetItemColor(self): return self.attrTuple[0] # 装备品质 BYTE
-    def GetMoneyBase(self): return self.attrTuple[1] # 分解货币 DWORD
-    def GetAtkStep(self): return self.attrTuple[2] # 攻击步长 DWORD
-    def GetDefStep(self): return self.attrTuple[3] # 防御步长 DWORD
-    def GetHPStep(self): return self.attrTuple[4] # 生命步长 DWORD
-    def GetAttrLibCntList(self): return self.attrTuple[5] # 库属性条数列表 list
-    def GetAttrRange(self): return self.attrTuple[6] # 通用属性范围,下限|上限 list
-    def GetAttrRangeDict(self): return self.attrTuple[7] # 指定属性范围字典,{指定属性ID:[范围下限, 上限], ...} dict
+    def GetAtkStep(self): return self.attrTuple[1] # 攻击步长 DWORD
+    def GetDefStep(self): return self.attrTuple[2] # 防御步长 DWORD
+    def GetHPStep(self): return self.attrTuple[3] # 生命步长 DWORD
+    def GetAttrLibCntList(self): return self.attrTuple[4] # 库属性条数列表 list
+    def GetAttrRange(self): return self.attrTuple[5] # 通用属性范围,下限|上限 list
+    def GetAttrRangeDict(self): return self.attrTuple[6] # 指定属性范围字典,{指定属性ID:[范围下限, 上限], ...} dict
 
 # 装备部位表
 class IPY_EquipPlace():
@@ -6336,7 +6338,7 @@
     def GetNeedQiyun(self): return self.attrTuple[1] # 所需气运值 DWORD
     def GetAwardItemList(self): return self.attrTuple[2] # 奖励物品列表 list
 
-# 仙树等级表
+# 祝福树
 class IPY_TreeLV():
     
     def __init__(self):
@@ -6346,7 +6348,9 @@
     def GetTreeLV(self): return self.attrTuple[0] # 仙树等级 BYTE
     def GetLVUPNeedMoney(self): return self.attrTuple[1] # 升到下一级所需货币数 DWORD
     def GetLVUPNeedTime(self): return self.attrTuple[2] # 升级下一级所需所需秒 DWORD
-    def GetEquipColorRateList(self): return self.attrTuple[3] # 产出装备品质概率列表,[0品质万分率, 1品质万分率, ...] list
+    def GetEquipColorRateList(self): return self.attrTuple[3] # 小怪产出装备品质概率列表,[0品质万分率, 1品质万分率, ...] list
+    def GetEquipColorRateList1(self): return self.attrTuple[4] # 精英产出装备品质概率列表,[0品质万分率, 1品质万分率, ...] list
+    def GetEquipColorRateList2(self): return self.attrTuple[5] # boss产出装备品质概率列表,[0品质万分率, 1品质万分率, ...] list
 
 # 淘金营地表
 class IPY_GoldRushCamp():
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 e20ab95..f8a8fff 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -806,6 +806,8 @@
     # 那么在DoPlayerLogin 中设置的数据将不会被保存, 如会导致第一个任务重复触发问题,记录多次发送
     EventReport.WriteEvent_Entry(curPlayer, 4)
     #EventReport.EventReport(ShareDefine.Def_UserAction_FirstLogin, "", curPlayer)
+     
+    curPlayer.SetFightPoint(1) # 初始化为1倍消耗
     
     #---补满血满魔---
     GameObj.SetHP(curPlayer, GameObj.GetMaxHP(curPlayer))
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 b74e0cb..d35a1a2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -2499,6 +2499,20 @@
     NetPackCommon.SendFakePack(curPlayer, clientPack)
     return
 
+def GetUnXiantaoCntEquip(curPlayer):
+    '''因为战锤对应装备是1个战锤可能对应多个装备掉落,所以分解装备的时候1个战锤需要支持可拆分
+    所以需要支持小数存储,暂定以支持3位小数存储
+    '''
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) / 1000.0
+def AddUnXiantaoCntEquip(curPlayer, addCnt):
+    unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) + addCnt * 1000
+    return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
+def SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip):
+    ## 保存装备未结算战锤数,保留3位小数
+    # @param unXiantaoCntEquip: 实际的未结算数量,支持小数
+    unXiantaoCntEquip = int(round(unXiantaoCntEquip, 3) * 1000) # 保留3为小数
+    return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
+
 ##玩家是否有钱款
 # @param curPlayer 玩家实例
 # @param TYPE_Price ,货币类型
@@ -2789,8 +2803,7 @@
         unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp)
         NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, unXiantaoCntExp + price)
         # 累加未结算战锤 - 装备
-        unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip)
-        NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip + price)
+        AddUnXiantaoCntEquip(curPlayer, price)
         # 累加未结算战锤 - 战利品
         chapterID = GetMainLevelNowInfo(curPlayer)[0]
         chapterIpyData = IpyGameDataPY.GetIpyGameData("MainChapter", chapterID)
@@ -4950,10 +4963,11 @@
         
     if value == 0:
         curPlayer.NomalDictDelProperty(key, dType)
-        return
+        return 0
     # 2^31 - 1
-    curPlayer.NomalDictAddProperty(key, min(value, ChConfig.Def_UpperLimit_DWordEx), dType)
-    return
+    value = max(0, min(value, ChConfig.Def_UpperLimit_DWordEx))
+    curPlayer.NomalDictAddProperty(key, value, dType)
+    return value
 
 ## 通知祝福值
 def Sync_BlessValue(curPlayer, blessType, value, multiple=0):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
index a5e2276..e9f1b23 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -692,13 +692,13 @@
             TurnBuff.SyncBuffRefresh(turnFight, buffObj, buff, relatedSkillID)
             
     # 统计击杀
-    killObjIDList = [] # 击杀的目标ID列表
+    killObjList = [] # 击杀其他阵营目标列表
     for tagObj in useSkill.GetTagObjList():
         tagID = tagObj.GetID()
-        if tagObj.IsAlive() and tagObj.GetHP() <= 0:
-            killObjIDList.append(tagID)
+        if tagObj.IsAlive() and tagObj.GetHP() <= 0 and tagObj.GetFaction() != curObj.GetFaction():
+            killObjList.append(tagObj)
             TurnAttack.SetObjKilled(turnFight, tagObj, curObj, useSkill)
-    if curObj and curObj.IsAlive() and curObj.GetHP() <= 0:
+    if curObj.IsAlive() and curObj.GetHP() <= 0:
         TurnAttack.SetObjKilled(turnFight, curObj)
         
     # 统计伤血,可能单个技能对同一目标造成多次伤害
@@ -716,7 +716,7 @@
     # 结算副本相关的攻击结果,仅主动发起玩家阵容武将触发
     curPlayer = turnFight.curPlayer
     if curPlayer and curObj and curObj.GetOwnerID() == curPlayer.GetPlayerID():
-        FBLogic.OnPlayerLineupAttackResult(curPlayer, curObj, killObjIDList, useSkill, turnFight.mapID, turnFight.funcLineID)
+        FBLogic.OnPlayerLineupAttackResult(curPlayer, curObj, killObjList, useSkill, turnFight.mapID, turnFight.funcLineID)
         
     # 优先触发本技能额外效果,注:仅该技能释放后该技能的额外效果视为主技能的效果,优先级最高
     if isUseSkill:

--
Gitblit v1.8.0