1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package GM.Commands.SetEquipPartStar
#
# @todo:ÉèÖÃ×°±¸²¿Î»¹«¹²ÐÇÊý
# @author xdh
# @date 2019-3-2
# @version 1.0
#
# ÏêϸÃèÊö: ÉèÖÃ×°±¸²¿Î»¹«¹²ÐÇÊý
#
#---------------------------------------------------------------------
"""Version = 2019-3-2 17:00"""
#---------------------------------------------------------------------
import PlayerControl
import ChEquip
import GameWorld
import IpyGameDataPY
import ChConfig
import IPY_GameWorld
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param cmdList ²ÎÊýÁбí [classlv, equipPlace, starLV]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, cmdList):
    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)
    if not ipyData:
        __GMHelpAnswer(curPlayer)
        return
    equipPackIndex = ipyData.GetGridIndex()
    ChEquip.SetEquipPartStar(curPlayer, equipPackIndex, starLV)
    ChEquip.NotifyEquipPartStar(curPlayer, equipPackIndex)
    ChEquip.RefreshPlayerEquipAttribute(curPlayer, classLV)
    playControl = PlayerControl.PlayerControl(curPlayer)
    playControl.RefreshPlayerAttrState()
    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ%s½×%s²¿Î»ÐÇÊýΪ: %s" % (classLV, equipPlace, starLV))
    return
 
 
def __GMHelpAnswer(curPlayer, errorMsg=""):
    if errorMsg:
        GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
    GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar ÐÇÊý")
    GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar ½×¼¶ ÐÇÊý")
    GameWorld.DebugAnswer(curPlayer, "SetEquipPartStar ½×¼¶ ²¿Î» ÐÇÊý")
    
    return