xdh
2019-03-14 c409f8d2d3ac5530b7dc1f14c15715beb3bb1da7
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetEquipPartStar.py
@@ -20,6 +20,8 @@
import ChEquip
import GameWorld
import IpyGameDataPY
import ChConfig
import IPY_GameWorld
#---------------------------------------------------------------------
#逻辑实现
## GM命令执行入口
@@ -31,7 +33,36 @@
    if not cmdList:
        __GMHelpAnswer(curPlayer)
        return
    if len(cmdList) == 1:
        starLV = cmdList[0]
        equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
        for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
            for classlv in xrange(1, equipMaxClasslv+1):
                ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
                if not ipyData:
                    continue
                equipPackIndex = ipyData.GetGridIndex()
                ChEquip.SetEquipPartStar(curPlayer, equipPackIndex, starLV)
        ChEquip.NotifyEquipPartStar(curPlayer)
        ChEquip.RefreshPlayerEquipAttribute(curPlayer)
        playControl = PlayerControl.PlayerControl(curPlayer)
        playControl.RefreshPlayerAttrState()
        GameWorld.DebugAnswer(curPlayer, "设置所有部位星数为: %s" % (starLV))
    elif len(cmdList) == 2:
        classLV, starLV = cmdList
        for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
            ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
            if not ipyData:
                continue
            equipPackIndex = ipyData.GetGridIndex()
            ChEquip.SetEquipPartStar(curPlayer, equipPackIndex, starLV)
        ChEquip.NotifyEquipPartStar(curPlayer)
        ChEquip.RefreshPlayerEquipAttribute(curPlayer, classLV)
        playControl = PlayerControl.PlayerControl(curPlayer)
        playControl.RefreshPlayerAttrState()
        GameWorld.DebugAnswer(curPlayer, "设置%s阶所有部位星数为: %s" % (classLV, starLV))
    if len(cmdList) != 3:
        return
    classlv, equipPlace, starLV = cmdList
@@ -45,12 +76,15 @@
    ChEquip.RefreshPlayerEquipAttribute(curPlayer, classlv)
    playControl = PlayerControl.PlayerControl(curPlayer)
    playControl.RefreshPlayerAttrState()
    GameWorld.DebugAnswer(curPlayer, "设置%s阶%s部位星数为: %s" % (classLV, equipPlace, starLV))
    return
def __GMHelpAnswer(curPlayer, errorMsg="参数列表 [classlv, equipPlace, starLV]"):
def __GMHelpAnswer(curPlayer, errorMsg=""):
    if errorMsg:
        GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
        GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar 星数")
        GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar 阶级 星数")
        GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar 阶级 部位 星数")
    
    return