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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/python
# -*- coding: GBK -*-
 
##@package PrintBuff
# Êä³öÍæ¼ÒÉíÉϵÄbuff
#
# @author mark
# @date 2010-4-23
# @version 1.4
#
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
# @change: "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ
# @change: "2010-06-07 17:33" adaws GMÃüÁîPrintBuffÔö¼Ó±»¶¯¼¼ÄÜbuff
# @change: "2010-12-07 12:00" Alee ´òÓ¡ÐÐΪBUFF
# @change: "2010-12-31 17:00" Alee Ìí¼Ó¹ÜÀíÆ÷¸ü¸Ä
#
# Ä£¿éÏêϸ˵Ã÷
# ½Ó¿ÚС֪ʶ£ºFindNPCByID »ñµÃ»¹ÊǸ¸ÀàµÄNPCʵÀý£¬Òª¾ßÌåת»»Îª¾ßÌåµÄNPCʵÀý£¬²Å¿ÉÒÔÓ¦ÓÃÏàÓ¦½Ó¿Ú
 
"""Version = 2010-12-31 17:00"""
 
 
import IPY_GameWorld
import GMCommon 
import GameWorld
import SkillCommon
 
## ´òÓ¡buffState
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param buffState ÊÇbuffµÄ¼¯ºÏ£¬¶øÒ»¸öObjÓÖ¾ßÓÐn¸öBuffState
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def PrintBuffState(curPlayer, tagObj, buffType):
    GameWorld.DebugAnswer(curPlayer, "---------" + GMCommon.BuffNameList[buffType])
    buffTuple = SkillCommon.GetBuffManagerByBuffType(tagObj, buffType)
    
    if buffTuple == ():
        return
    buffState = buffTuple[0]
    
    for i in range(0, buffState.GetBuffCount()):
        curBuff = buffState.GetBuff(i)
        curSkill = curBuff.GetSkill()
        if curSkill.GetSkillID() == 0:
            continue
        
        name = curSkill.GetSkillName()
        remainTime = curBuff.GetRemainTime() / 1000
        remainTimeStr = __GetRemainTimeStr(remainTime)
        GameWorld.DebugAnswer(curPlayer, "%s,ID=%s,TypeID=%s,%s,Layer=%s" 
                              % (name, curSkill.GetSkillID(), curSkill.GetSkillTypeID(), remainTimeStr, curBuff.GetLayer()))
        effectStr = ""
        for j in range(0, curSkill.GetEffectCount()):
            curEffect = curSkill.GetEffect(j)
            effectID = curEffect.GetEffectID()
            if effectID == 0:
                continue
            
            effectStr += "¼¼ÄÜЧ¹û%s ID = %s" % (j, effectID)
            
        GameWorld.DebugAnswer(curPlayer, effectStr)
    return
    
def __GetRemainTimeStr(remainTime):
    day = 3600 * 24
    days = remainTime / day
    remainTime -= (days * day)
    hours = remainTime / 3600
    remainTime -= (hours * 3600)
    minutes = remainTime / 60
    seconds = remainTime % 60
    remainTimeStr = ""
    if days:
        remainTimeStr = "%sÌì" % (days)
    if hours:
        remainTimeStr = "%s%sʱ" % (remainTimeStr, hours)
    if minutes:
        remainTimeStr = "%s%s·Ö" % (remainTimeStr, minutes)
    if seconds:
        remainTimeStr = "%s%sÃë" % (remainTimeStr, seconds)
    return remainTimeStr
 
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [npcID]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, cmdList):
    GameWorld.DebugAnswer(curPlayer, "¿ªÊ¼´òÓ¡buffÁбí,ÈçÎÞ´òÓ¡,¼ÈÎÞBuff")
    curTagPlayer = None
    
    if len(cmdList) == 0 or cmdList[0] == 0:
        curTagPlayer = curPlayer
    else:
        curTagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(cmdList[0])
    
    if curTagPlayer != None:
        GameWorld.DebugAnswer(curPlayer, "Íæ¼ÒÐÅÏ¢£º%s" % (curTagPlayer.GetID()))
        if len(cmdList) > 1:
            buffTypeStr = ""
            for i, buffName in enumerate(GMCommon.BuffNameList):
                buffTypeStr += "%s:%s," % (i, buffName)
            GameWorld.DebugAnswer(curPlayer, "%s" % buffTypeStr)
            buffType = cmdList[1]
            PrintBuffState(curPlayer, curTagPlayer, buffType)
            return
        for buffType in range(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax):
            PrintBuffState(curPlayer, curTagPlayer, buffType)
        return
 
    #Êä³öNPCBuff
    curNPC = GameWorld.GetNPCManager().FindNPCByID(cmdList[0])
 
    if curNPC == None:
        GameWorld.DebugAnswer(curPlayer, "error²ÎÊý£º²»ÊÇNPCID Ò²²»ÊÇÍæ¼ÒID")
        return
    
    curNPC = GameWorld.GetObjDetail(curNPC)
    GameWorld.DebugAnswer(curPlayer, "NPCÐÅÏ¢ %s %s" % (curNPC.GetName(), curNPC.GetID()))
    
    for buffType in GMCommon.GetNPCBuffTypeList(curNPC):
        PrintBuffState(curPlayer, curNPC, buffType)