hxp
4 天以前 a7ab0247c7b8eff06ad104bee39bc035384ca43e
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