#!/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 IpyGameDataPY import ShareDefine import ChConfig #--------------------------------------------------------------------- #Âß¼­ÊµÏÖ ## GMÃüÁîÖ´ÐÐÈë¿Ú # @param curPlayer µ±Ç°Íæ¼Ò # @param list ²ÎÊýÁбí [npcID] # @return None # @remarks º¯ÊýÏêϸ˵Ã÷. def OnExec(curPlayer, msgList): if not msgList: __PrintHelp(curPlayer) return if msgList[0] == "b": zoneID = msgList[1] if len(msgList) > 1 else 0 seasonID = msgList[2] if len(msgList) > 2 else 0 danLV = msgList[3] if len(msgList) > 3 else 0 pkScore = msgList[4] if len(msgList) > 4 else 0 cWinCount = msgList[5] if len(msgList) > 5 else None danIpyData = IpyGameDataPY.GetIpyGameData("CrossRealmPKDan", danLV) if not danIpyData: GameWorld.DebugAnswer(curPlayer, "²»´æÔڸöÎλ:%s" % danLV) return if pkScore <= 0: pkScore = danIpyData.GetLVUpScore() errorMsg = PlayerCrossRealmPK.GMSetPlayerCrossPKData(curPlayer, danLV, pkScore, cWinCount, zoneID=zoneID, seasonID=seasonID) if errorMsg: GameWorld.DebugAnswer(curPlayer, "·ÖÇøÈü¼¾Òì³£!") else: GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÉϰñ·ÖÇø:%s,Èü¼¾:%s,¶Îλ:%s,»ý·Ö:%s" % (zoneID, seasonID, danLV, pkScore)) 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_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_CLoseCount, 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_RefreshCount, 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_SeasonScore % 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, "»ý·Ö"], 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_CLoseCount, "Á¬°Ü´ÎÊý"], 7:[ChConfig.Def_PDict_CrossPK_TodayPKCount, "½ñÈÕPK´ÎÊý"], 8:[ChConfig.Def_PDict_CrossPK_TodayWinCount, "½ñÈÕʤÀû´ÎÊý"], 9:[ChConfig.Def_PDict_CrossPK_TodayBuyCount, "½ñÈÕ¹ºÂò´ÎÊý"], 10:[ChConfig.Def_PDict_CrossPK_RefreshCount, "½ñÈÕˢдÎÊý"], } 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_SeasonScore, "»ý·Ö"], 3:[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-»ý·Ö,2-¶Îλ,3-PK´ÎÊý,4-ʤÀû´ÎÊý,5-Á¬Ê¤´ÎÊý,6-Á¬°Ü´ÎÊý") GameWorld.DebugAnswer(curPlayer, "7-½ñÈÕPK´ÎÊý,8-½ñÈÕʤÀû´ÎÊý,9-½ñÈÕ¹ºÂò´ÎÊý,10-½ñÈÕˢдÎÊý") GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÀúÊ·¼Ç¼: SetCrossPK Èü¼¾ID ÀàÐÍ ÊýÖµ") GameWorld.DebugAnswer(curPlayer, "ÀàÐÍ:0-¶Îλ,1-Ãû´Î,2-»ý·Ö,3-½±ÀøµÈ¼¶") GameWorld.DebugAnswer(curPlayer, "µ±Ç°Á¬°Ü´ÎÊý£º %s" % curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_CLoseCount)) GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÉϰñ: SetCrossPK b ·ÖÇø Èü¼¾ ¶Îλ [»ý·Ö Á¬Ê¤]") return