| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package GM.Commands.SetPetInfo  | 
| #  | 
| # @todo:ÉèÖóèÎïÊôÐÔ  | 
| # @author hxp  | 
| # @date 2017-03-09  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: ÉèÖóèÎïÊôÐÔ  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2017-03-09 12:00"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
| import ShareDefine  | 
| import PlayerPet  | 
| import GameWorld  | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖóèÎï״̬.  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param cmdList ²ÎÊýÁÐ±í  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ÉèÖóèÎï״̬  | 
| def OnExec(curPlayer, cmdList):  | 
|       | 
|     if len(cmdList) != 3:  | 
|         GameWorld.DebugAnswer(curPlayer, 'ÉèÖóèÎï½×¼¶: SetPetInfo %s ³èÎïID ½×¼¶' % ShareDefine.Def_IudetPet_ClassLV)  | 
|         return  | 
|       | 
|     petDataPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)  | 
|     petCnt = petDataPack.GetCount()  | 
|     if petCnt <= 0:  | 
|         GameWorld.DebugAnswer(curPlayer, 'Íæ¼ÒÎÞ³èÎï')  | 
|         return  | 
|       | 
|     infoType, petNPCID, value = cmdList  | 
|     for petIndex in range(petDataPack.GetCount()):  | 
|         petItem = petDataPack.GetAt(petIndex)  | 
|         if petItem.IsEmpty():  | 
|             continue  | 
|           | 
|         if petNPCID != petItem.GetUserAttr(ShareDefine.Def_IudetPet_NPCID):  | 
|             continue  | 
|           | 
|         if infoType == ShareDefine.Def_IudetPet_ClassLV:  | 
|             petItem.SetUserAttr(ShareDefine.Def_IudetPet_ClassLV, value)  | 
|               | 
|         PlayerPet.RefreshPetItemAddAttr(curPlayer, True)  | 
|         GameWorld.DebugAnswer(curPlayer, 'ÉèÖóèÎïÊôÐÔOK!')  | 
|         return  | 
|       | 
|     GameWorld.DebugAnswer(curPlayer, 'Íæ¼Òδ¼¤»î¸Ã³èÎïID: %s' % petNPCID)  | 
|     return  | 
|       | 
|      |