hxp
2025-05-28 09fef77b16601ee5b0f53f34ccb23804b8448c8c
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.PrintPet
#
# @todo:ÏÔÊ¾Íæ¼ÒËùÓгèÎï
# @author hxp
# @date 2016-4-29
# @version 1.0
#
# ÏêϸÃèÊö: ÏÔÊ¾Íæ¼ÒËùÓгèÎï
#
#-------------------------------------------------------------------------------
#"""Version = 2016-4-29 18:00"""
#-------------------------------------------------------------------------------
 
import ShareDefine
import GameWorld
 
 
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [tagID£¬ExpValue]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, list):
 
    petDataPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)
    petCnt = petDataPack.GetCount()
    if petCnt <= 0:
        GameWorld.DebugAnswer(curPlayer, 'Íæ¼ÒÎÞ³èÎï')
        return
 
    showDataInfo = [
                    [ShareDefine.Def_IudetPet_ClassLV, "½×¼¶"],
                    [ShareDefine.Def_IudetPet_State, "״̬"],
                    [ShareDefine.Def_IudetPet_Skill, "¼¼ÄÜ"],
                   ]
    
    showPetCnt = 0
    for petIndex in range(petDataPack.GetCount()):
        petItem = petDataPack.GetAt(petIndex)
        if petItem.IsEmpty():
            continue
        
        showPetCnt += 1
        petNPCID = petItem.GetUserAttr(ShareDefine.Def_IudetPet_NPCID)
        petNPCData = GameWorld.GetGameData().FindNPCDataByID(petNPCID)
        petName = petNPCData.GetName()
        GameWorld.DebugAnswer(curPlayer, '--µÚ%sÖ»: Ë÷Òý=%s,npcID=%s,name=%s' % (showPetCnt, petIndex, petNPCID, petName))
    
        infoStr = ""
        for dataNum, dataName in showDataInfo:
            if dataNum % 2 == 0:
                value = petItem.GetUserAttr(dataNum)
                infoStr += " %s:%s" % (dataName, value)
            else:
                dataCnt = petItem.GetUserAttrCount(dataNum)
                valueList = []
                for i in xrange(dataCnt):
                    value = petItem.GetUserAttrByIndex(dataNum, i)
                    valueList.append(value)
                infoStr += " %s:%s" % (dataName, str(valueList))
        
        GameWorld.DebugAnswer(curPlayer, "%s" % infoStr)
                
    GameWorld.DebugAnswer(curPlayer, '------×ܳèÎïÊý: %s -------' % showPetCnt)
    return