From 08c9ba65612f4eed3f7f60b5dbbdeefea166b299 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 23 九月 2022 14:35:09 +0800
Subject: [PATCH] 9701 【后端】【越南】【BT7】【主干】跨服竞技64位排位赛(仙官相关)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py | 44 ++++++++++++++++++++++++++++++++++++--------
1 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py
index 016aee6..b7666c4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetMoney.py
@@ -24,18 +24,41 @@
import ChConfig
import ShareDefine
import GameWorld
+
+moneyNameDict = {
+ 1:"仙玉", 2:"绑玉", 3:"铜钱", 6:"战盟贡献度", 10:"战盟仓库积分", 13:"境界修行点", 14:"符印融合石", 15:"仙盟活跃令",
+ 16:"助战积分", 18:"荣誉", 19:"Boss积分", 23:"符印精华", 24:"符印碎片", 25:"寻宝积分", 26:"集市额度", 27:"丹精", 28:"魂尘",
+ 29:"聚魂碎片", 30:"核心环", 31:"功能特权令", 32:"环保值", 33:"GM令", 34:"古神币", 35:"功德点"
+ }
+
## GM命令执行入口
# @param curPlayer 当前玩家
# @param list 参数列表 [ <钱币类型><数量>]
# @return None
# @remarks 函数详细说明.
def OnExec(curPlayer, List):
+
+ if len(List) == 1:
+ moneyType = List[0]
+ if moneyType == 0:
+ moneyList = moneyNameDict.keys()
+ moneyList.sort()
+ else:
+ moneyList = [moneyType]
+ for moneyType in moneyList:
+ GameWorld.DebugAnswer(curPlayer, "(%s) %s: %s" % (moneyType, moneyNameDict.get(moneyType, moneyType), PlayerControl.GetMoneyReal(curPlayer, moneyType)))
+ return
+
if len(List) != 2:
#参数不正确
GameWorld.DebugAnswer(curPlayer, Lang.GBText("参数不正确"))
- GameWorld.DebugAnswer(curPlayer, "1-仙玉;2-绑玉;3-铜钱;6-战盟贡献度;10-战盟仓库积分;13-境界修行点;14-符印融合石;15-仙盟活跃令")
- GameWorld.DebugAnswer(curPlayer, "16-助战积分;18-荣誉;23-符印精华;24-符印碎片;25-寻宝积分;26-集市额度;27-丹精;28-魂尘;")
- GameWorld.DebugAnswer(curPlayer, "29-聚魂碎片;30-核心环")
+ GameWorld.DebugAnswer(curPlayer, "设置货币: SetMoney 货币类型 数值")
+ GameWorld.DebugAnswer(curPlayer, "显示货币: SetMoney 货币类型")
+ helpStr = ""
+ moneyTypeList = moneyNameDict.keys()
+ for moneyType in moneyTypeList:
+ helpStr += "%s-%s;" % (moneyType, moneyNameDict[moneyType])
+ GameWorld.DebugAnswer(curPlayer, helpStr)
return
#钱币类型
moneyType = List[0]
@@ -46,17 +69,22 @@
GameWorld.DebugAnswer(curPlayer, Lang.GBText("参数不正确"))
return
#钱币类型范围
- if moneyType not in [1,2,3,4] and moneyType not in ShareDefine.TYPE_Price_CurrencyDict:
+ if moneyType not in [1, 2, 3, 4] and moneyType not in ShareDefine.TYPE_Price_CurrencyDict:
GameWorld.DebugAnswer(curPlayer, Lang.GBText("钱币类型不正确"))
return
#0文不处理
- if moneyCount < 0:
+ if moneyType not in ShareDefine.MoneyMinusRefreshDict and moneyCount < 0:
return
- playerMoney = PlayerControl.GetMoney(curPlayer, moneyType)
+ isOK = False
+ playerMoney = PlayerControl.GetMoneyReal(curPlayer, moneyType)
if playerMoney > moneyCount:
- PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"})
+ isOK = PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"}, isMinus=True)
elif playerMoney < moneyCount:
- PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount - playerMoney, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"SetMoney"})
+ isOK = PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount - playerMoney, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"SetMoney"})
+ else:
+ isOK = True
+ if not isOK:
+ GameWorld.DebugAnswer(curPlayer, "设置玩家货币失败,详见日志或流向")
return
--
Gitblit v1.8.0