From a7ab0247c7b8eff06ad104bee39bc035384ca43e Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 23 七月 2025 12:08:22 +0800 Subject: [PATCH] 80 【常规】背包-服务端(增加背包购买格子;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetPack.py | 35 +++++++++++++---------------------- 1 files changed, 13 insertions(+), 22 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetPack.py index 936994e..603a3c2 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetPack.py @@ -2,26 +2,23 @@ # -*- coding: GBK -*- #------------------------------------------------------------------------------- # -#------------------------------------------------------------------------------- -# ##@package GM.Commands.ResetPack # # @todo:重置背包购买 # @author hxp -# @date 2015-1-10 +# @date 2025-07-23 # @version 1.0 # # 详细描述: 重置背包购买 # -#--------------------------------------------------------------------- -"""Version = 2015-1-10 23:00""" +#------------------------------------------------------------------------------- +#"""Version = 2025-07-23 12:00""" +#------------------------------------------------------------------------------- -import IPY_GameWorld -import PlayerControl -import ChConfig import GameWorld - -#--------------------------------------------------------------------- +import PlayerControl +import ItemCommon +import ChConfig ## 执行逻辑 # @param curPlayer 当前玩家 @@ -30,22 +27,16 @@ # @remarks 函数详细说明. def OnExec(curPlayer, cmdList): if len(cmdList) <= 0: - GameWorld.DebugAnswer(curPlayer, "ResetPack 背包类型[5-仓库]") + GameWorld.DebugAnswer(curPlayer, "ResetPack 背包类型") return packType = cmdList[0] - if packType not in ChConfig.Def_Type_CanBuyPack_PlayerDict.keys(): - GameWorld.DebugAnswer(curPlayer, "背包类型错误") + if not curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PackBuyCnt % packType): + GameWorld.DebugAnswer(curPlayer, "背包未购买过: %s" % packType) return - keyName = ChConfig.Def_Type_CanBuyPack_PlayerDict[packType][ChConfig.Def_PlayerPackDict_Index_Key] - - if packType == IPY_GameWorld.rptWarehouse: - PlayerControl.NomalDictSetProperty(curPlayer, keyName, 0) - #仓库刷新 - PlayerControl.Init_Warehouse(curPlayer) - else: - return - + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_PackBuyCnt % packType, 0) + PlayerControl.Init_PackCount(curPlayer, packType) + ItemCommon.SyncPackBuyCnt(curPlayer, packType) GameWorld.DebugAnswer(curPlayer, "ResetPack OK") return -- Gitblit v1.8.0