hxp
2025-06-12 96c0ba31f74064e59c746921fcd1386cddf78d42
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.Shentong
#
# @todo:Éñͨ
# @author hxp
# @date 2023-01-08
# @version 1.0
#
# ÏêϸÃèÊö: Éñͨ
#
#-------------------------------------------------------------------------------
#"""Version = 2023-01-08 18:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import IpyGameDataPY
import PlayerShentong
import PlayerControl
import ChConfig
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
 
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param msgList ²ÎÊýÁбí
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, msgList):
    
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÉñͨ: Shentong 0")
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÉñͨ: Shentong ÉñͨID ½× µÈ¼¶")
        return
    
    syncIDList = []
    
    if len(msgList) == 1:
        if msgList[0] == 0:
            ipyDataMgr = IpyGameDataPY.IPY_Data()
            for index in range(ipyDataMgr.GetShentongCount()):
                ipyData = ipyDataMgr.GetShentongByIndex(index)
                shentongID = ipyData.GetShentongID()
                classLV, lv = PlayerShentong.GetShentongLVInfo(curPlayer, shentongID)
                if not classLV and not lv:
                    continue
                syncIDList.append(shentongID)
                PlayerShentong.SetShentongLVInfo(curPlayer, shentongID, 0, 0)
                
            ShentongSkillCountMax = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
            skillManager = curPlayer.GetSkillManager()
            playerCtl = PlayerControl.PlayerControl(curPlayer)
            for num in range(ShentongSkillCountMax):
                skillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num)
                if skillID and skillManager.FindSkillBySkillID(skillID):
                    skillManager.DeleteSkillBySkillID(skillID, True)
                    playerCtl.RefreshSkillFightPowerByDel(skillID)
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, 0)
            PlayerShentong.Sync_ShentongSkillInfo(curPlayer)
            
            GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÉñͨOK")
            
    elif len(msgList) == 3:
        shentongID, classLV, lv = msgList
        ipyData = IpyGameDataPY.GetIpyGameData("Shentong", shentongID)
        if not ipyData:
            GameWorld.DebugAnswer(curPlayer, "²»´æÔÚ¸ÃÉñͨ!shentongID=%s" % shentongID)
            return
        lvIpyData = IpyGameDataPY.GetIpyGameData("ShentongLV", shentongID, classLV, lv)
        if not lvIpyData:
            GameWorld.DebugAnswer(curPlayer, "²»´æÔÚ¸ÃÉñͨµÈ¼¶!shentongID=%s,classLV=%s,lv=%s" % (shentongID, classLV, lv))
            return
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÉñͨ:%s,½×(%s),µÈ¼¶(%s)" % (shentongID, classLV, lv))
        PlayerShentong.SetShentongLVInfo(curPlayer, shentongID, classLV, lv)
        syncIDList.append(shentongID)
    else:
        return
    
    PlayerShentong.RefreshShentongAttr(curPlayer)
    PlayerShentong.Sync_ShentongLVInfo(curPlayer, syncIDList)
    return