#!/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
|