From a451e68aed69b3c936d4afe50a0cf3c43680e90c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 27 十月 2025 11:01:10 +0800
Subject: [PATCH] 302 【公会】BOSS讨伐-服务端(Taofa命令增加添加家成员讨伐数据)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py |   67 ++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 35 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py
index e4405c1..e1c3150 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Taofa.py
@@ -17,8 +17,9 @@
 
 import ChConfig
 import GameWorld
+import ShareDefine
+import CreateFamily
 import PlayerControl
-import PlayerFamilyZhenbaoge
 import PlayerFamilyTaofa
 import PlayerFamily
 import DBDataMgr
@@ -36,8 +37,7 @@
         GameWorld.DebugAnswer(curPlayer, "设置宝箱领取: Taofa b 已领取宝箱 未领取")
         GameWorld.DebugAnswer(curPlayer, "设置宝箱时间: Taofa t 几秒前统计的")
         GameWorld.DebugAnswer(curPlayer, "设置宝箱贡献: Taofa g 已贡献宝箱 [累计伤害 历史伤害]")
-        #GameWorld.DebugAnswer(curPlayer, "新增成员讨伐: Taofa m 人数 [每人攻击次数 怒气次数 伤害值A 到B]")
-        #GameWorld.DebugAnswer(curPlayer, "AB值没有填则按常规砍价价格计算")
+        GameWorld.DebugAnswer(curPlayer, "增加成员讨伐: Taofa m 人数 [伤害值A 到B 怒攻概率]")
         GameWorld.DebugAnswer(curPlayer, "创建仙盟相关使用命令: CreateFamily")
         return
     
@@ -70,8 +70,7 @@
     
     # 新增成员讨伐
     if value1 == "m":
-        memCnt = msgList[1] if len(msgList) > 1 else 0
-        GameWorld.DebugAnswer(curPlayer, "成员讨伐:%s" % (memCnt))
+        __AddMemTaofaAtk(curPlayer, curFamily, msgList)
         return
     
     elif value1 == "a":
@@ -121,40 +120,38 @@
     PlayerFamilyTaofa.SyncTaofaInfo(curPlayer)
     return
 
-    #添加假砍价
-    gActionData = PlayerFamilyZhenbaoge.GetZhenbaogeActionData(familyID, PlayerFamilyZhenbaoge.ActionGlobalID)
-    if not gActionData:
-        GameWorld.DebugAnswer(curPlayer, "请先重置珍宝阁")
-        return
+def __AddMemTaofaAtk(curPlayer, curFamily, msgList):
+    #新增成员讨伐: Taofa m 人数 [伤害值A 到B]
     
-    familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, PlayerFamilyZhenbaoge.ActionType)
-    actionCount = familyAction.Count()
+    GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
+    memCnt = msgList[1] if len(msgList) > 1 else curFamily.GetCount()
+    hurtTotalA = msgList[2] if len(msgList) > 2 else 0
+    hurtTotalB = msgList[3] if len(msgList) > 3 else hurtTotalA
+    angerRate = msgList[4] if len(msgList) > 4 else 5000
+    hurtTotalB = max(hurtTotalA, hurtTotalB)
     
-    fackCount = value1
-    randValue1 = msgList[1] if len(msgList) > 1 else 0
-    randValue2 = msgList[2] if len(msgList) > 2 else 0
-    syncActionDataList = [gActionData]
-    startFackID = 1000 + actionCount
-    FakeName = GameWorld.GbkToCode("假名字")
-    for fackID in range(startFackID, startFackID + fackCount):
+    if curFamily.GetCount() <= memCnt:
+        addMemCnt = memCnt - curFamily.GetCount() + 1
+        GameWorld.DebugAnswer(curPlayer, "添加缺少成员: %s" % addMemCnt)
+        CreateFamily.OnExec(curPlayer, ["m", addMemCnt])
+        GameWorld.DebugAnswer(curPlayer, "当前总成员数: %s" % curFamily.GetCount())
         
-        playerID = fackID
-        playerName = "%s%s" % (FakeName, fackID)
-        
-        if randValue1 and randValue2 and randValue1 <= randValue2:     
-            cutPrice = random.randint(randValue1, randValue2)
-        else:
-            cutPrice = PlayerFamilyZhenbaoge.CalcCutPrice(curFamily, gActionData, playerID)
-            
-        if not cutPrice:
+    actionDataList = []
+    for index in range(curFamily.GetCount()):
+        if memCnt <= 0:
+            break
+        member = curFamily.GetAt(index)
+        memID = member.GetPlayerID()
+        if memID >= ShareDefine.RealPlayerIDStart:
+            # 不包括真实玩家
             continue
+        memCnt -= 1
+        hurtValue = random.randint(hurtTotalA, hurtTotalB)
+        isAnger = GameWorld.CanHappen(angerRate) # 概率设置为怒气攻击
         
-        actionData = PlayerFamilyZhenbaoge.AddCutPrice(familyID, playerID, playerName, cutPrice, gActionData, False)
-        syncActionDataList.append(actionData)
-        nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
-        GameWorld.DebugAnswer(curPlayer, "砍价人次:%s,砍价:%s,现价:%s" % (fackID % 1000, cutPrice, nowPrice))
+        actionData = PlayerFamilyTaofa.GMAddMemTaofaAtk(curPlayer, curFamily, memID, hurtValue, isAnger)
+        actionDataList.append(actionData)
         
-    PlayerFamily.SendFamilyAction(syncActionDataList)
-    nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
-    GameWorld.DebugAnswer(curPlayer, "添加假砍价数:%s,总砍价数:%s,当前价格:%s" % (fackCount, familyAction.Count() - 1, nowPrice))
+    PlayerFamilyTaofa.RefreshPlayerAwardBoxCnt(curFamily)
+    PlayerFamily.SendFamilyAction(actionDataList)
     return

--
Gitblit v1.8.0