6341 【后端】【2.0】境界改版开发单(修为池)
| | |
| | | list AddAttrNum; //境界加成属性值
|
| | | DWORD BossID; //渡劫bossid
|
| | | DWORD BuffID; //给全服在线玩家增加buff
|
| | | DWORD ExpRate; //修为池经验速率
|
| | | DWORD ExpLimit; //修为池经验上限
|
| | | };
|
| | |
|
| | | //神兵表 #tagGodWeapon
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 0C 使用道具减少渡劫打坐时间 #tagCMReduceSitTime
|
| | |
|
| | | class tagCMReduceSitTime(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemCnt", c_ushort), # 道具数量
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x0C
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x0C
|
| | | self.ItemCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMReduceSitTime)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 0C 使用道具减少渡劫打坐时间 //tagCMReduceSitTime:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMReduceSitTime=tagCMReduceSitTime()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMReduceSitTime.Cmd,m_NAtagCMReduceSitTime.SubCmd))] = m_NAtagCMReduceSitTime
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 74 刷新悬赏任务 #tagCMRefreshArrestTask
|
| | |
|
| | | class tagCMRefreshArrestTask(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 21 境界修为池提取 #tagCMTakeOutRealmExp
|
| | |
|
| | | class tagCMTakeOutRealmExp(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x21
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x21
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMTakeOutRealmExp)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 21 境界修为池提取 //tagCMTakeOutRealmExp:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMTakeOutRealmExp=tagCMTakeOutRealmExp()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTakeOutRealmExp.Cmd,m_NAtagCMTakeOutRealmExp.SubCmd))] = m_NAtagCMTakeOutRealmExp
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 11 试用首充武器 #tagCMTryFirstGoldItem
|
| | |
|
| | | class tagCMTryFirstGoldItem(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 27 境界修为池信息 #tagMCRealmExpInfo
|
| | |
|
| | | class tagMCRealmExpInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("BeginTime", c_int), #开始计时时间
|
| | | ("CurExp", c_int), #当前总经验
|
| | | ("CurExpPoint", c_int), #当前总经验点
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x27
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x27
|
| | | self.BeginTime = 0
|
| | | self.CurExp = 0
|
| | | self.CurExpPoint = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCRealmExpInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 27 境界修为池信息 //tagMCRealmExpInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | BeginTime:%d,
|
| | | CurExp:%d,
|
| | | CurExpPoint:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.BeginTime,
|
| | | self.CurExp,
|
| | | self.CurExpPoint
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCRealmExpInfo=tagMCRealmExpInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRealmExpInfo.Cmd,m_NAtagMCRealmExpInfo.SubCmd))] = m_NAtagMCRealmExpInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 49 资源找回次数 #tagMCRecoverNum
|
| | |
|
| | | class tagMCRecoverNumInfo(Structure):
|
| | |
| | | PacketCallFunc_1 = OpenRealmFB
|
| | |
|
| | | PacketCMD_2 = 0xA5
|
| | | PacketSubCMD_2 = 0x0C
|
| | | PacketCallFunc_2 = OnReduceSitTime
|
| | | PacketSubCMD_2 = 0x21
|
| | | PacketCallFunc_2 = OnTakeOutRealmExp
|
| | |
|
| | | PacketCMD_3 = 0xA5
|
| | | PacketSubCMD_3 = 0x23
|
| | |
| | | #境界
|
| | | Def_PDict_RealmFBIsOpen = "RealmFBIsOpen" #渡劫副本是否开启 0未开启 1已开启 2可升级境界
|
| | | Def_PDict_RealmFBAttrAdd = "RealmFBAttrAdd_%s" #渡劫副本属性加成 参数属性ID
|
| | | Def_PDict_RealmSitAllTime = "RealmSitAllTime" #打坐总时间
|
| | | Def_PDict_RealmSitRemainTime = "RealmSitRemainTime" #开始打坐前剩余时间秒
|
| | | Def_PDict_RealmSitStartTime = "RealmSitStartTime" #开始打坐时间
|
| | | Def_PDict_RealmSitStopTime = "RealmSitStopTime" #离线时是否在打坐
|
| | |
|
| | | Def_PDict_RealmExp = "RealmExp" #境界修为池总经验
|
| | | Def_PDict_RealmExpPoint = "RealmExpPoint" #境界修为池总经验点
|
| | | Def_PDict_RealmExpBeginTime = "RealmExpBeginTime" #境界修为池经验开始计时时间
|
| | |
|
| | | #法宝
|
| | | Def_PDict_MagicWeaponExp = "MagicWeaponExp_%s" #法宝经验 参数法宝ID
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 0C 使用道具减少渡劫打坐时间 #tagCMReduceSitTime
|
| | |
|
| | | class tagCMReduceSitTime(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemCnt", c_ushort), # 道具数量
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x0C
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x0C
|
| | | self.ItemCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMReduceSitTime)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 0C 使用道具减少渡劫打坐时间 //tagCMReduceSitTime:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMReduceSitTime=tagCMReduceSitTime()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMReduceSitTime.Cmd,m_NAtagCMReduceSitTime.SubCmd))] = m_NAtagCMReduceSitTime
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 74 刷新悬赏任务 #tagCMRefreshArrestTask
|
| | |
|
| | | class tagCMRefreshArrestTask(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 21 境界修为池提取 #tagCMTakeOutRealmExp
|
| | |
|
| | | class tagCMTakeOutRealmExp(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x21
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x21
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMTakeOutRealmExp)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 21 境界修为池提取 //tagCMTakeOutRealmExp:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMTakeOutRealmExp=tagCMTakeOutRealmExp()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTakeOutRealmExp.Cmd,m_NAtagCMTakeOutRealmExp.SubCmd))] = m_NAtagCMTakeOutRealmExp
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 11 试用首充武器 #tagCMTryFirstGoldItem
|
| | |
|
| | | class tagCMTryFirstGoldItem(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 27 境界修为池信息 #tagMCRealmExpInfo
|
| | |
|
| | | class tagMCRealmExpInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("BeginTime", c_int), #开始计时时间
|
| | | ("CurExp", c_int), #当前总经验
|
| | | ("CurExpPoint", c_int), #当前总经验点
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x27
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x27
|
| | | self.BeginTime = 0
|
| | | self.CurExp = 0
|
| | | self.CurExpPoint = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCRealmExpInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 27 境界修为池信息 //tagMCRealmExpInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | BeginTime:%d,
|
| | | CurExp:%d,
|
| | | CurExpPoint:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.BeginTime,
|
| | | self.CurExp,
|
| | | self.CurExpPoint
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCRealmExpInfo=tagMCRealmExpInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRealmExpInfo.Cmd,m_NAtagMCRealmExpInfo.SubCmd))] = m_NAtagMCRealmExpInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 49 资源找回次数 #tagMCRecoverNum
|
| | |
|
| | | class tagMCRecoverNumInfo(Structure):
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.GetRealmExp
|
| | | #
|
| | | # @todo:获取当前境界修为经验
|
| | | # @author xdh
|
| | | # @date 2019-03-20
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 获取当前境界修为经验
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2019-03-20 11:30"""
|
| | |
|
| | | import PlayerPrestigeSys
|
| | | import GameWorld
|
| | | #---------------------------------------------------------------------
|
| | | #逻辑实现
|
| | | ## GM命令执行入口
|
| | | # @param curPlayer 当前玩家
|
| | | # @param list 参数列表 [npcID]
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, list):
|
| | | curTotalRealmExp = PlayerPrestigeSys.UpdateRealmExp(curPlayer, isNotify=True)
|
| | | GameWorld.DebugAnswer(curPlayer, "curTotalRealmExp=%s" % curTotalRealmExp)
|
| | | return
|
| | |
|
| | |
| | | ("list", "AddAttrNum", 0),
|
| | | ("DWORD", "BossID", 0),
|
| | | ("DWORD", "BuffID", 0),
|
| | | ("DWORD", "ExpRate", 0),
|
| | | ("DWORD", "ExpLimit", 0),
|
| | | ),
|
| | |
|
| | | "GodWeapon":(
|
| | |
| | | self.AddAttrType = []
|
| | | self.AddAttrNum = []
|
| | | self.BossID = 0
|
| | | self.BuffID = 0 |
| | | self.BuffID = 0
|
| | | self.ExpRate = 0
|
| | | self.ExpLimit = 0 |
| | | return |
| | | |
| | | def GetLv(self): return self.Lv # 境界等级
|
| | |
| | | def GetAddAttrType(self): return self.AddAttrType # 境界加成属性类型
|
| | | def GetAddAttrNum(self): return self.AddAttrNum # 境界加成属性值
|
| | | def GetBossID(self): return self.BossID # 渡劫bossid
|
| | | def GetBuffID(self): return self.BuffID # 给全服在线玩家增加buff |
| | | def GetBuffID(self): return self.BuffID # 给全服在线玩家增加buff
|
| | | def GetExpRate(self): return self.ExpRate # 修为池经验速率
|
| | | def GetExpLimit(self): return self.ExpLimit # 修为池经验上限 |
| | | |
| | | # 神兵表 |
| | | class IPY_GodWeapon(): |
| | |
| | | import EventShell
|
| | | import DataRecordPack
|
| | |
|
| | | import time
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | |
|
| | |
| | | # DoRealmLVUpLogic(curPlayer)
|
| | | return True
|
| | |
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | SyncRealmFBState(curPlayer)
|
| | | UpdateRealmExp(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def GetRealmIpyData(realmLV): return IpyGameDataPY.GetIpyGameData("Realm", realmLV)
|
| | |
|
| | |
|
| | | #// A5 24 开启渡劫 #tagCMOpenRealmFB
|
| | | #
|
| | |
| | | sendPack.IsPass = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmFBIsOpen)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | |
|
| | | ## 计算爵位属性
|
| | | # @param curPlayer 玩家
|
| | |
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | |
|
| | | #// A5 23 提升境界等级 # tagCMRealmLVUp
|
| | | #
|
| | | #struct tagCMRealmLVUp
|
| | |
| | | #扣除物品
|
| | | ItemCommon.ReduceItem(curPlayer, curPack, itemIndexList, needItemCount, True, "Realm")
|
| | |
|
| | | |
| | | DoRealmLVUpLogic(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def DoRealmLVUpLogic(curPlayer, needSys=True):
|
| | | curRealmLV = curPlayer.GetOfficialRank()
|
| | | nextRealmLv = curRealmLV + 1
|
| | | GameWorld.DebugLog(' 升级境界nextRealmLv=%s'%nextRealmLv)
|
| | | GameWorld.DebugLog(' 升级境界nextRealmLv=%s' % nextRealmLv)
|
| | | nextRealmIpyData = GetRealmIpyData(nextRealmLv)
|
| | | if not nextRealmIpyData:
|
| | | return
|
| | |
| | | RefreshOfficialAttr(curPlayer)
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | | SyncRealmFBState(curPlayer)
|
| | | #更新修为速率
|
| | | UpdateRealmExp(curPlayer)
|
| | | #境界提升成就
|
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_RealmlvUp, nextRealmLv)
|
| | | #更新排行榜
|
| | |
| | | DataRecordPack.DR_RealmLVUp(curPlayer, nextRealmLv)
|
| | | return True
|
| | |
|
| | |
|
| | | def DologicDujieFBPass(curPlayer, realmLV, star):
|
| | | #渡劫通过后处理
|
| | | realmIpyData = GetRealmIpyData(realmLV)
|
| | |
| | | #DoRealmLVUpLogic(curPlayer)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmFBIsOpen, 1)
|
| | | SyncRealmFBState(curPlayer)
|
| | |
|
| | |
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | | #// A5 0C 使用道具减少渡劫打坐时间 #tagCMReduceSitTime
|
| | | #// A5 21 境界修为池提取 #tagCMTakeOutRealmExp
|
| | | #
|
| | | #struct tagCMReduceSitTime
|
| | | #struct tagCMTakeOutRealmExp
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD ItemCnt; // 道具数量
|
| | | #};
|
| | | def OnReduceSitTime(index, clientData, tick):
|
| | | # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | # itemCnt = clientData.ItemCnt
|
| | | # reduceSitTimeItemID = IpyGameDataPY.GetFuncCfg('ReduceSitTimeItemID')
|
| | | # |
| | | # remainTime = __GetRemainSitTime(curPlayer)
|
| | | # if remainTime <= 0:
|
| | | # GameWorld.DebugLog('使用道具减少渡劫打坐时间 remainTime=%s' % remainTime)
|
| | | # return
|
| | | # curItem = GameWorld.GetGameData().GetItemByTypeID(reduceSitTimeItemID)
|
| | | # curEff = curItem.GetEffectByIndex(0)
|
| | | # singleReduceTime = curEff.GetEffectValue(0)
|
| | | # useCnt = min(itemCnt, remainTime/singleReduceTime)
|
| | | # if not useCnt:
|
| | | # GameWorld.DebugLog('使用道具减少渡劫打坐时间 useCnt=%s' % useCnt)
|
| | | # return
|
| | | # |
| | | # itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | # hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(reduceSitTimeItemID, itemPack, useCnt)
|
| | | # if not hasEnough:
|
| | | # GameWorld.DebugLog('使用道具减少渡劫打坐时间 道具不足%s' % useCnt)
|
| | | # return
|
| | | # |
| | | # ItemCommon.ReduceItem(curPlayer, itemPack, itemList, useCnt, False)
|
| | | # |
| | | # reduceTime = useCnt * singleReduceTime
|
| | | # sitRemainTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmSitRemainTime)
|
| | | # newRemainTime = max(0, sitRemainTime-reduceTime)
|
| | | # PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmSitRemainTime, newRemainTime)
|
| | | # GameWorld.DebugLog('使用道具减少渡劫打坐时间 使用道具%s,减少打坐时间%s秒' % (useCnt, reduceTime))
|
| | | # SyncRealmFBState(curPlayer)
|
| | | def OnTakeOutRealmExp(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetID()
|
| | | curTotalRealmExp = UpdateRealmExp(curPlayer, False)
|
| | | if curTotalRealmExp <= 0:
|
| | | GameWorld.DebugLog('境界修为池提取 没有经验可提取', playerID)
|
| | | return
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.AddExp(curTotalRealmExp)
|
| | | PlayerControl.NotifyCode(curPlayer, 'TakeOutRealmExp', [curTotalRealmExp])
|
| | | #
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExpBeginTime, int(time.time()))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExp, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExpPoint, 0)
|
| | |
|
| | | NotifyRealmExpInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def UpdateRealmExp(curPlayer, isNotify=True):
|
| | | ##更新境界修为池
|
| | | ipyData = GetRealmIpyData(curPlayer.GetOfficialRank())
|
| | | if not ipyData:
|
| | | return 0
|
| | | if not ipyData.GetExpRate():
|
| | | return 0
|
| | | curTime = int(time.time())
|
| | | beginTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmExpBeginTime)
|
| | | if not beginTime:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExpBeginTime, curTime)
|
| | | return 0
|
| | | curRealmExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmExp)
|
| | | curRealmExpPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmExpPoint)
|
| | | curTotalExp = curRealmExpPoint * ChConfig.Def_PerPointValue + curRealmExp
|
| | | if curTotalExp >= ipyData.GetExpLimit():
|
| | | return curTotalExp
|
| | | passSeconds = curTime - beginTime
|
| | | if passSeconds <= 0:
|
| | | return curTotalExp
|
| | | ipyData = GetRealmIpyData(curPlayer.GetOfficialRank())
|
| | | if not ipyData:
|
| | | return curTotalExp
|
| | | addExp = passSeconds / 5 * ipyData.GetExpRate()
|
| | | if addExp <= 0:
|
| | | return curTotalExp
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExpBeginTime, curTime)
|
| | | |
| | | updTotalExp = min(curTotalExp + addExp, ipyData.GetExpLimit())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExp, updTotalExp % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmExpPoint, updTotalExp / ChConfig.Def_PerPointValue)
|
| | | #֪ͨ
|
| | | if isNotify:
|
| | | NotifyRealmExpInfo(curPlayer)
|
| | | return updTotalExp
|
| | |
|
| | |
|
| | | def NotifyRealmExpInfo(curPlayer):
|
| | | ##通知修为池信息
|
| | | sendPack = ChPyNetSendPack.tagMCRealmExpInfo()
|
| | | sendPack.BeginTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmExpBeginTime)
|
| | | sendPack.CurExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmExp)
|
| | | sendPack.CurExpPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmExpPoint)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|