| #!/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  | 
|   |