From c3935a93e6be5457f7d1e90bbe91845abf3943f4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 05 九月 2025 17:37:18 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(去除0407通知;修复5011触发被动报错;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhenbaoge.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 49 insertions(+), 10 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhenbaoge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhenbaoge.py
index 2933ce4..6bb58c2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhenbaoge.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhenbaoge.py
@@ -15,10 +15,13 @@
#"""Version = 2024-10-29 17:30"""
#-------------------------------------------------------------------------------
+import ChConfig
import GameWorld
import PlayerControl
+import PlayerFamilyZhenbaoge
import PlayerFamily
-import ChConfig
+import DBDataMgr
+import random
import time
## GM命令执行入口
@@ -36,20 +39,24 @@
GameWorld.DebugAnswer(curPlayer, "AB值没有填则按常规砍价价格计算")
return
- if not curPlayer.GetFamilyID():
+ familyID = curPlayer.GetFamilyID()
+ if not familyID:
GameWorld.DebugAnswer(curPlayer, "没有仙盟")
return
-
- isSendGameServer = False
+ curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
+ if not curFamily:
+ return
value1 = msgList[0]
if value1 == 0:
- isSendGameServer = True
+ PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily)
+ GameWorld.DebugAnswer(curPlayer, "重置仙盟珍宝阁OK")
+ return
elif value1 == "d":
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeCut, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeBuy, 0)
- PlayerFamily.Sync_ZhenbaogeInfo(curPlayer)
+ PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer)
GameWorld.DebugAnswer(curPlayer, "重置珍宝阁玩家今日状态OK")
return
@@ -60,8 +67,40 @@
GameWorld.DebugAnswer(curPlayer, "设置退仙盟时间:%s" % GameWorld.ChangeTimeNumToStr(leaveFamilyTimeEx))
return
- else:
- isSendGameServer = True
+ #添加假砍价
+ gActionData = PlayerFamilyZhenbaoge.GetZhenbaogeActionData(familyID, PlayerFamilyZhenbaoge.ActionGlobalID)
+ if not gActionData:
+ GameWorld.DebugAnswer(curPlayer, "请先重置珍宝阁")
+ return
+
+ familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, PlayerFamilyZhenbaoge.ActionType)
+ actionCount = familyAction.Count()
+
+ 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):
- return isSendGameServer
-
+ 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:
+ continue
+
+ 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))
+
+ PlayerFamily.SendFamilyAction(syncActionDataList)
+ nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
+ GameWorld.DebugAnswer(curPlayer, "添加假砍价数:%s,总砍价数:%s,当前价格:%s" % (fackCount, familyAction.Count() - 1, nowPrice))
+ return
--
Gitblit v1.8.0