hxp
2025-06-12 edc3910a9d090e5df4deb2dbc37709a740375938
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.ClearFuncSysPrivilege
#
# @todo:ÖØÖù¦ÄÜÏµÍ³ÌØÈ¨
# @author hxp
# @date 2021-04-13
# @version 1.0
#
# ÏêϸÃèÊö: ÖØÖù¦ÄÜÏµÍ³ÌØÈ¨
#
#-------------------------------------------------------------------------------
#"""Version = 2021-04-13 16:00"""
#-------------------------------------------------------------------------------
 
import ChConfig
import PlayerControl
import PlayerFuncSysPrivilege
import IpyGameDataPY
import GameWorld
 
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [npcID]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, paramList):
    
    if not paramList:
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃËùÓÐ: ClearFuncSysPrivilege 0")
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÖ¸¶¨: ClearFuncSysPrivilege ¹¦ÄÜϵͳID")
        return
    
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    lastIpyData = ipyDataMgr.GetFuncSysPrivilegeByIndex(ipyDataMgr.GetFuncSysPrivilegeCount() - 1)
    maxFuncID = lastIpyData.GetFuncSysID()
    
    resetID = paramList[0]
    if resetID == 0:
        resetIDList = range(1, maxFuncID + 1)
    elif resetID > maxFuncID:
        GameWorld.DebugAnswer(curPlayer, "¸Ã¹¦ÄÜϵͳID²»´æÔÚ!")
        return
    else:
        resetIDList = [resetID]
        
    for funcSysID in resetIDList:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FuncSysPrivilegeActTime % funcSysID, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FuncSysPrivilegeAward % funcSysID, 0)
        
    GameWorld.DebugAnswer(curPlayer, "ÖØÖù¦ÄÜÏµÍ³ÌØÈ¨OK!%s" % resetIDList)
    PlayerFuncSysPrivilege.Sync_FuncSysPrivilege(curPlayer, resetIDList)
    return