hxp
2019-07-18 a3298b238480ffc7f8e4d5a95df10c2702ca8921
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,26 +33,58 @@
    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
    ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
    classLV, equipPlace, starLV = cmdList
    ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
    if not ipyData:
        __GMHelpAnswer(curPlayer)
        return
    equipPackIndex = ipyData.GetGridIndex()
    ChEquip.SetEquipPartStar(curPlayer, equipPackIndex, starLV)
    ChEquip.NotifyEquipPartStar(curPlayer, equipPackIndex)
    ChEquip.RefreshPlayerEquipAttribute(curPlayer, classlv)
    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