From df2af1331d39ad7da3f833931c01e2391f575988 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期四, 09 五月 2019 14:33:51 +0800 Subject: [PATCH] 6705 【后端】【2.0】天星塔功能 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetBaseAttr.py | 62 +++++++++++++----------------- 1 files changed, 27 insertions(+), 35 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetBaseAttr.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetBaseAttr.py index 808b972..c9dc5fc 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetBaseAttr.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ResetBaseAttr.py @@ -2,52 +2,44 @@ # -*- coding: GBK -*- #------------------------------------------------------------------------------- # -#------------------------------------------------------------------------------- +##@package GM.Commands.ResetBaseAttr # -##@package ResetBaseAttr.py -# -# @todo: 重设玩家属性 -# @author wdb -# @date 2013-06-21 +# @todo:重置玩家灵根属性点 +# @author hxp +# @date 2019-3-25 # @version 1.0 # -# @note: -# 详细描述: -#------------------------------------------------------------------------------ +# 详细描述: 重置玩家灵根属性点 +# +#------------------------------------------------------------------------------- +#"""Version = 2019-3-25 下午7:50:30""" +#------------------------------------------------------------------------------- + +import Item_ResetAttrPoint import GameWorld -import PlayerControl -#------------------------------------------------------------------------------ -"""Version = 2013-06-21 14:30""" ## GM命令执行入口 # @param curPlayer 当前玩家 # @param list 参数列表 # @return None -def OnExec(curPlayer, cmdlist): +def OnExec(curPlayer, cmdlist): - if curPlayer.GetLV() > 1: - GameWorld.DebugAnswer(curPlayer, "LV can not greater than 1") + if not cmdlist: + GameWorld.DebugAnswer(curPlayer, "重置所有灵根: ResetBaseAttr 0") + GameWorld.DebugAnswer(curPlayer, "重置指定灵根: ResetBaseAttr ID 点数") return - playerJob = curPlayer.GetJob() - - initBaseAttrPoint = (0, 0, 0, 0) - # 获取创建时的基础属性 - baseSTR, basePNE, basePHY, baseCON = PlayerControl.GetPlayerBasePoint(playerJob) - - # 获取创建时的基础属性错误, 返回 - if (baseSTR, basePNE, basePHY, baseCON) == initBaseAttrPoint: - return initBaseAttrPoint - - curPlayer.SetBaseSTR(baseSTR) - curPlayer.SetBasePNE(basePNE) - curPlayer.SetBasePHY(basePHY) - curPlayer.SetBaseCON(baseCON) - - #刷新人物所有状态 - playerControl = PlayerControl.PlayerControl(curPlayer) - playerControl.RefreshAllState() + isOK = False + if len(cmdlist) == 1 and cmdlist[0] == 0: + isOK = Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, 0, 0) + elif len(cmdlist) >= 2: + resetID, resetPoint = cmdlist[:2] + isOK = Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, resetID, resetPoint) + + if not isOK: + GameWorld.DebugAnswer(curPlayer, "重置灵根失败!") + else: + GameWorld.DebugAnswer(curPlayer, "重置灵根成功!当前剩余点数: %s" % curPlayer.GetFreePoint()) + return - - \ No newline at end of file -- Gitblit v1.8.0