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 GM.Commands.SetCrossPK
#
# @todo:ÉèÖÃÍæ¼Ò¿ç·þPK»î¶¯Êý¾Ý
# @author hxp
# @date 2018-12-25
# @version 1.0
#
# ÏêϸÃèÊö: ÉèÖÃÍæ¼Ò¿ç·þPK»î¶¯Êý¾Ý
#
#-------------------------------------------------------------------------------
#"""Version = 2018-12-25 21:30"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PlayerControl
import PlayerCrossRealmPK
import ShareDefine
import ChConfig
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [npcID]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, msgList):
    
    if not msgList:
        __PrintHelp(curPlayer)
        return
    
    if len(msgList) == 1:
        if msgList[0] != 0:
            __PrintHelp(curPlayer)
            return
        
        # ÖØÖÃÊý¾Ý
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TotalScore, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_OnDayScore, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLV, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_PKCount, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_WinCount, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CWinCount, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayPKCount, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayBuyCount, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayPKCountAwardState, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayWinCountAwardState, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLVAwardState, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonAwardState, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ZoneID, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonID, 0)
        for i in xrange(1, 20):
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonDanLV % i, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonOrder % i, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonAwardLV % i, 0)
            
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÿç·þPKÊý¾ÝOK£¡")
        PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)
        PlayerCrossRealmPK.SyncCrossRealmPKAwardState(curPlayer)
        PlayerCrossRealmPK.SyncCrossRealmPKHisSeasonInfo(curPlayer)
        return
    
    if len(msgList) == 2 or len(msgList) % 2 == 0:
        setTypeDict = {0:[ChConfig.Def_PDict_CrossPK_TotalScore, "»ý·Ö"],
                       1:[ChConfig.Def_PDict_CrossPK_OnDayScore, "¹ýÌì»ý·Ö"],
                       2:[ChConfig.Def_PDict_CrossPK_DanLV, "¶Îλ"],
                       3:[ChConfig.Def_PDict_CrossPK_PKCount, "PK´ÎÊý"],
                       4:[ChConfig.Def_PDict_CrossPK_WinCount, "ʤÀû´ÎÊý"],
                       5:[ChConfig.Def_PDict_CrossPK_CWinCount, "Á¬Ê¤´ÎÊý"],
                       6:[ChConfig.Def_PDict_CrossPK_TodayPKCount, "½ñÈÕPK´ÎÊý"],
                       7:[ChConfig.Def_PDict_CrossPK_TodayWinCount, "½ñÈÕʤÀû´ÎÊý"],
                       8:[ChConfig.Def_PDict_CrossPK_TodayBuyCount, "½ñÈÕ¹ºÂò´ÎÊý"],
                       }
        indexList = range(len(msgList))
        for i in indexList[::2]:
            setType, value = msgList[i:i+2]
            if setType not in setTypeDict:
                continue
            dictName, chName = setTypeDict[setType]
            PlayerControl.NomalDictSetProperty(curPlayer, dictName, value)
            GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ%s: %s" % (chName, value))
            
        mapZoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
        mapSeasonID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ZoneID, mapZoneID)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonID, mapSeasonID)
        PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)
        return
    
    if len(msgList) == 3:
        seasonID, setType, value = msgList
        setTypeDict = {0:[ChConfig.Def_PDict_CrossPK_SeasonDanLV, "¶Îλ"],
                       1:[ChConfig.Def_PDict_CrossPK_SeasonOrder, "Ãû´Î"],
                       2:[ChConfig.Def_PDict_CrossPK_SeasonAwardLV, "½±ÀøµÈ¼¶"],
                       }
        if setType not in setTypeDict:
            __PrintHelp(curPlayer)
            return
        dictName, chName = setTypeDict[setType]
        PlayerControl.NomalDictSetProperty(curPlayer, dictName % seasonID, value)
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÈü¼¾%s%s: %s" % (seasonID, chName, value))
        return
    
    __PrintHelp(curPlayer)
    return
 
def __PrintHelp(curPlayer):
    GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÊý¾Ý: SetCrossPK 0")
    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÊý¾Ý: SetCrossPK ÀàÐÍ  Öµ")
    GameWorld.DebugAnswer(curPlayer, "ÀàÐÍ:0-»ý·Ö,1-¹ýÌì»ý·Ö,2-¶Îλ,3-PK´ÎÊý,4-ʤÀû´ÎÊý,5-Á¬Ê¤´ÎÊý")
    GameWorld.DebugAnswer(curPlayer, "6-½ñÈÕPK´ÎÊý,7-½ñÈÕʤÀû´ÎÊý,8-½ñÈÕ¹ºÂò´ÎÊý")
    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÀúÊ·¼Ç¼: SetCrossPK Èü¼¾ID ÀàÐÍ ÊýÖµ")
    GameWorld.DebugAnswer(curPlayer, "ÀàÐÍ:0-¶Îλ,1-Ãû´Î,2-½±ÀøµÈ¼¶")
    return