From 6b3b8976f49b47754a57cc710bf20a0682a80f78 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 30 十月 2025 17:09:48 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(修复主线拾取掉落战利品为绑定的bug;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
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 60ad60c..28e5a25 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
@@ -27,6 +27,7 @@
import IPY_GameWorld
import NetPackCommon
import PlayerArena
+import PlayerLLMJ
import ItemCommon
import PlayerTask
import NPCCommon
@@ -80,17 +81,23 @@
def __doKillAward(curPlayer, atkObj, killObjList):
## 计算击杀奖励
if not killObjList:
- GameWorld.DebugLog("没有击杀不需要处理!")
+ #GameWorld.DebugLog("没有击杀不需要处理主线奖励!")
return
# 结算经验
unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp)
if unXiantaoCntExp:
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, 0)
perExp = IpyGameDataPY.GetFuncCfg("Mainline", 1) # 每个战锤增加经验
- totalExp = unXiantaoCntExp * perExp
- GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s" % (totalExp, unXiantaoCntExp))
- PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
-
+ baseExp = unXiantaoCntExp * perExp
+ mjExPer, exRemain = PlayerLLMJ.GetAddExpPerInfo(curPlayer)
+ mjEx = min(int(baseExp * mjExPer / 100.0), exRemain)
+ totalExp = baseExp + mjEx
+ GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s,baseExp=%s,mjEx=%s,mjExPer=%s,exRemain=%s"
+ % (totalExp, unXiantaoCntExp, baseExp, mjEx, mjExPer, exRemain))
+ finalAddExp = PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
+ if mjEx and finalAddExp:
+ PlayerLLMJ.AddExpEx(curPlayer, mjEx)
+
__doMainDrop(curPlayer, killObjList)
return
@@ -450,14 +457,16 @@
equipCnt = len(equipDict)
unXiantaoCntEquip = PlayerControl.GetUnXiantaoCntEquip(curPlayer)
- perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip
+ perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip # 均分支持小数
decomposeMoney = max(1, moneyBase * perEquipXiantao) # 至少1个
+ mjExPer, exRemain = PlayerLLMJ.GetAddDecomposePer(curPlayer)
+ mjEx = int(decomposeMoney * mjExPer / 100.0)
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)
+ GameWorld.DebugLog("moneyBase=%s,decomposeMoney=%s,mjExPer=%s,exRemain=%s,mjEx=%s" % (moneyBase, decomposeMoney, mjExPer, exRemain, mjEx), playerID)
moneyTotal = 0
-
+ mjExTotal = 0
decomposeCnt = 0
decomposeIndexList = []
for itemIndex in itemIndexList:
@@ -466,8 +475,13 @@
curEquip = equipDict[itemIndex]
moneyTotal += decomposeMoney
- GameWorld.DebugLog(" itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,总:%s"
- % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, moneyTotal), playerID)
+ if mjEx > 0:
+ mjEx = min(mjEx, exRemain)
+ exRemain -= mjEx
+ moneyTotal += mjEx
+ mjExTotal += mjEx
+ GameWorld.DebugLog(" itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,mjEx=%s,exRemain=%s,总:%s"
+ % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, mjEx, exRemain, moneyTotal), playerID)
ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
decomposeIndexList.append(itemIndex)
@@ -479,9 +493,10 @@
moneyTotal = int(round(moneyTotal)) # 四舍五入取整
unXiantaoCntEquip = PlayerControl.SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip)
- GameWorld.DebugLog("moneyTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, unXiantaoCntEquip), playerID)
-
+ GameWorld.DebugLog("moneyTotal=%s,mjExTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, mjExTotal, unXiantaoCntEquip), playerID)
+
PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
+ PlayerLLMJ.AddExpDecompose(curPlayer, mjExTotal)
PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_EquipDecompose, decomposeCnt)
return
@@ -506,6 +521,7 @@
continue
itemID = curItem.GetItemTypeID()
item = curItem.GetItem()
+ item.SetIsBind(0) # 拾取时重置,取源SingleItem修改不通知
itemCount = ItemControler.GetItemCount(curItem)
GameWorld.DebugLog("主线物品拾取: itemIndex=%s,itemID=%s,itemCount=%s" % (itemIndex, itemID, itemCount), playerID)
if not itemControl.PutInItem(IPY_GameWorld.rptItem, item):
--
Gitblit v1.8.0