hzr
2025-04-21 2d9d117228fd281aeeb0f3c173f538744f8dffd7
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.AddLegendAttr
#
# @todo:Ìí¼Ó/ÖØÐÂÉú³É´«ÆæÊôÐÔ
# @author hxp
# @date 2017-08-23
# @version 1.0
#
# ÏêϸÃèÊö: Ìí¼Ó/ÖØÐÂÉú³É´«ÆæÊôÐÔ
#
#-------------------------------------------------------------------------------
#"""Version = 2017-08-23 23:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import ItemCommon
import ItemControler
import IPY_GameWorld
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param cmdList ²ÎÊýÁбí [index£¬attrIndexList]
#  @return None
def OnExec(curPlayer, cmdList):
    cmdlen = len(cmdList)
    if cmdlen < 1:
        GameWorld.DebugAnswer(curPlayer, "ÖØÐÂËæ»ú´«ÆæÊôÐÔ: AddLegendAttr ±³°ü¸ñ×ÓË÷Òý")
        GameWorld.DebugAnswer(curPlayer, "²¿Î»ËùÓд«ÆæÊôÐÔ: AddLegendAttr ±³°ü¸ñ×ÓË÷Òý 1")
        return
    
    #»ñÈ¡ÎïÆ·
    index = cmdList[0]
    curItem = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem).GetAt(index)
    if not ItemCommon.CheckItemIsEquip(curItem):
        GameWorld.DebugAnswer(curPlayer, "·Ç×°±¸ÎÞ·¨»ñµÃ´«ÆæÊôÐÔ!")
        return
    
    isAllAttr = cmdList[1] if len(cmdList) > 1 else 0
    legendAttrInfo = ItemControler.GetAddEquipLegendAttr(curItem, curPlayer, isAllAttr)
    if not legendAttrInfo:
        GameWorld.DebugAnswer(curPlayer, "»ñÈ¡¸Ã×°±¸´«ÆæÊôÐÔʧ°Ü»òûÓд«ÆæÊôÐÔ!")
        return
    ItemControler.SetEquipLegendAttr(curItem, legendAttrInfo)
    
    if legendAttrInfo[2]:
        GameWorld.DebugAnswer(curPlayer, "Éñ´«ÆæÊôÐÔ:%s %s" % (legendAttrInfo[2], legendAttrInfo[3]))
    if legendAttrInfo[4]:
        GameWorld.DebugAnswer(curPlayer, "ÏÉ´«ÆæÊôÐÔ:%s %s" % (legendAttrInfo[4], legendAttrInfo[5]))
    if legendAttrInfo[6]:
        GameWorld.DebugAnswer(curPlayer, "¼«´«ÆæÊôÐÔ:%s %s" % (legendAttrInfo[6], legendAttrInfo[7]))
    if legendAttrInfo[0]:
        GameWorld.DebugAnswer(curPlayer, "´«ÆæÊôÐÔ:%s %s" % (legendAttrInfo[0], legendAttrInfo[1]))
        
    return