fix:3474 【后端】【主干】【1.0.15】炼丹界面新增付费项目
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 14 祈福丹药 #tagCMPrayElixir
|
| | |
|
| | | class tagCMPrayElixir(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x14
|
| | | 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 = 0x14
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMPrayElixir)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 14 祈福丹药 //tagCMPrayElixir:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMPrayElixir=tagCMPrayElixir()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMPrayElixir.Cmd,m_NAtagCMPrayElixir.SubCmd))] = m_NAtagCMPrayElixir
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A5 34 查询天梯竞技场状态#tagCMQueryHighLadderState
|
| | |
|
| | | class tagCMQueryHighLadderState(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 21 祈福丹药结果 #tagMCPrayElixirResult
|
| | |
|
| | | class tagMCPrayElixirResult(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("PrayCnt", c_ubyte), # 今日祈福次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x21
|
| | | self.ItemID = 0
|
| | | self.PrayCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPrayElixirResult)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 21 祈福丹药结果 //tagMCPrayElixirResult:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemID:%d,
|
| | | PrayCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemID,
|
| | | self.PrayCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCPrayElixirResult=tagMCPrayElixirResult()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPrayElixirResult.Cmd,m_NAtagMCPrayElixirResult.SubCmd))] = m_NAtagMCPrayElixirResult
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 49 资源找回次数 #tagMCRecoverNum
|
| | |
|
| | | class tagMCRecoverNumInfo(Structure):
|
| | |
| | | Writer = sgj
|
| | | Releaser = sgj
|
| | | RegType = 0
|
| | | RegisterPackCount = 1
|
| | | RegisterPackCount = 2
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x76
|
| | | PacketCallFunc_1=PlayerRefineItem
|
| | |
|
| | | PacketCMD_2=0xA5
|
| | | PacketSubCMD_2=0x14
|
| | | PacketCallFunc_2=PlayerPrayElixir
|
| | |
|
| | |
|
| | | [PassiveBuffEffMng]
|
| | | ScriptName = Skill\PassiveBuffEffMng.py
|
| | |
| | | Def_PDict_AlchemyCount = "AlchemyCount_%s" #特殊炼丹次数产出设定已累计次数, 参数(配方ID)
|
| | | Def_PDict_AlchemyCountSpec = "AlchemyCountSpec_%s" #特殊炼丹次数产出设定已累计次数, 参数(配方ID)
|
| | | Def_PDict_AlchemyOutputCount = "AlchemyOutputCount_%s" #炼丹特殊产出物品已产出次数,参数(物品ID)
|
| | | Def_PDict_AlchemyPrayCnt = "AlchemyPrayCnt" #炼丹祈福次数
|
| | |
|
| | | Def_PDict_GFPassiveIndex = "GFP_%s_%s" # 被动功法 页数-索引
|
| | | Def_PDict_GFPassivePage = "GFPPage" # 被动功法选中页数
|
| | |
| | | Def_Cost_FreeGoods, # 极品白拿
|
| | | Def_Cost_DogzEquipPlus, # 神兽装备强化
|
| | | Def_Cost_RuneHole, # 符印孔解锁
|
| | | Def_Cost_AlchemyPray, # 丹药祈福
|
| | | #-----------以下为暂时没用的,先不删除,如有新增消费点则放在这些之前------------
|
| | | Def_Cost_RefreshArrestTask, # 刷新悬赏任务
|
| | | Def_Cost_OffLineExp, # 兑换离线经验
|
| | |
| | | Def_Cost_Trade, # 交易
|
| | | Def_Cost_Rename, # 改名
|
| | | Def_Cost_SkillLvUp, # 技能升级
|
| | | ) = range(2000, 2000 + 54)
|
| | | ) = range(2000, 2000 + 55)
|
| | |
|
| | | Def_Cost_Reason_SonKey = "reason_name_son" # 消费点原因子类说明key
|
| | |
|
| | |
| | | Def_Cost_FreeGoods:"FreeGoods",
|
| | | Def_Cost_DogzEquipPlus:"DogzEquipPlus",
|
| | | Def_Cost_RuneHole:"RuneHole",
|
| | | Def_Cost_AlchemyPray:"AlchemyPray",
|
| | | }
|
| | | ## -----------------------------------------------------
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 14 祈福丹药 #tagCMPrayElixir
|
| | |
|
| | | class tagCMPrayElixir(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x14
|
| | | 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 = 0x14
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMPrayElixir)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 14 祈福丹药 //tagCMPrayElixir:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMPrayElixir=tagCMPrayElixir()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMPrayElixir.Cmd,m_NAtagCMPrayElixir.SubCmd))] = m_NAtagCMPrayElixir
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A5 34 查询天梯竞技场状态#tagCMQueryHighLadderState
|
| | |
|
| | | class tagCMQueryHighLadderState(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 21 祈福丹药结果 #tagMCPrayElixirResult
|
| | |
|
| | | class tagMCPrayElixirResult(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("PrayCnt", c_ubyte), # 今日祈福次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x21
|
| | | self.ItemID = 0
|
| | | self.PrayCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPrayElixirResult)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 21 祈福丹药结果 //tagMCPrayElixirResult:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemID:%d,
|
| | | PrayCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemID,
|
| | | self.PrayCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCPrayElixirResult=tagMCPrayElixirResult()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPrayElixirResult.Cmd,m_NAtagMCPrayElixirResult.SubCmd))] = m_NAtagMCPrayElixirResult
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 49 资源找回次数 #tagMCRecoverNum
|
| | |
|
| | | class tagMCRecoverNumInfo(Structure):
|
| | |
| | |
|
| | | return eatCntDict
|
| | |
|
| | | def IsFruitEatFull(curPlayer, itemID):
|
| | | #使用次数是否已满
|
| | | ipyData = GetAttrFruitIpyData(itemID)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | maxEatCnt = ipyData.GetMaxUseCnt()
|
| | | eatCntKey = ChConfig.Def_PDict_AttrFruitEatCnt % itemID
|
| | | limitType = Def_LimitType_Cnt
|
| | | if limitType == Def_LimitType_Attr:
|
| | | eatCntKey = ChConfig.Def_PDict_AttrFruitAddValue % itemID
|
| | | eatCnt = curPlayer.NomalDictGetProperty(eatCntKey) # 已吃次数/属性值
|
| | | if eatCnt >= maxEatCnt:
|
| | | return True
|
| | | return |
| | |
| | | import PlayerBossReborn
|
| | | import PlayerFlashGiftbag
|
| | | import PlayerFairyCeremony
|
| | | import PlayerRefineStove
|
| | | import PlayerVip
|
| | | import PlayerDiceEx
|
| | | import IpyGameDataPY
|
| | |
| | | #法宝
|
| | | PlayerMagicWeapon.OnDay(curPlayer)
|
| | | PlayerGoldGift.OnDay(curPlayer)
|
| | | #炼丹
|
| | | PlayerRefineStove.OnDay(curPlayer)
|
| | |
|
| | | # 特殊时间点X点过天
|
| | | elif onEventType == ShareDefine.Def_OnEventTypeEx:
|
| | |
| | |
|
| | | import copy
|
| | |
|
| | |
|
| | | ##功能开启
|
| | | def DoRefineStoveOpen(curPlayer):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyLV, 1)
|
| | |
| | | ##登录处理
|
| | | def DoOnLogin(curPlayer, tick):
|
| | | Sycn_AlchemyMsg(curPlayer)
|
| | | Sycn_AlchemyPrayMsg(curPlayer)
|
| | | return
|
| | |
|
| | | def OnDay(curPlayer):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyPrayCnt, 0)
|
| | | Sycn_AlchemyPrayMsg(curPlayer)
|
| | | return
|
| | |
|
| | | #// A5 76 玩家炼丹 #tagCMPlayerRefine
|
| | | #
|
| | |
| | |
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Stove, allAttrList)
|
| | | return
|
| | |
|
| | | g_needAlchemyLVDict = {}
|
| | | def GetIsCanOutByAlchemyLV(curPlayer, itemID):
|
| | | #判断当前丹炉等级是否可产出该丹药
|
| | | global g_needAlchemyLVDict
|
| | | if not g_needAlchemyLVDict:
|
| | | ipyMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyMgr.GetAlchemyCount()):
|
| | | ipyData = ipyMgr.GetAlchemyByIndex(i)
|
| | | needAlchemyLV = ipyData.GetNeedAlchemyLV()
|
| | | itemList = ipyData.GetAlchemyItem()
|
| | | for itemInfo in itemList:
|
| | | g_needAlchemyLVDict[itemInfo[1]] = needAlchemyLV
|
| | | for i in xrange(ipyMgr.GetAlchemySpecCount()):
|
| | | ipyData = ipyMgr.GetAlchemySpecByIndex(i)
|
| | | needAlchemyLV = ipyData.GetNeedAlchemyLV()
|
| | | itemList = ipyData.GetAlchemyItem()
|
| | | for itemInfo in itemList:
|
| | | g_needAlchemyLVDict[itemInfo[1]] = needAlchemyLV
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV) >= g_needAlchemyLVDict.get(itemID, 0)
|
| | |
|
| | |
|
| | | #// A5 14 祈福丹药 #tagCMPrayElixir
|
| | | #
|
| | | #struct tagCMPrayElixir
|
| | | #
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def PlayerPrayElixir(index, clientPack, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | prayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyPrayCnt)
|
| | | limitCnt = IpyGameDataPY.GetFuncCfg('GodAlchemy', 3)
|
| | | if limitCnt and prayCnt >= limitCnt:
|
| | | GameWorld.DebugLog('今日祈福丹药次数已满!prayCnt=%s'%prayCnt)
|
| | | return
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1) |
| | | if not packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | |
| | | alchemyItemList = IpyGameDataPY.GetFuncEvalCfg('GodAlchemy')
|
| | | |
| | | newItemInfoList = []
|
| | | for itemInfo in alchemyItemList:
|
| | | itemID = itemInfo[1]
|
| | | if not GetIsCanOutByAlchemyLV(curPlayer, itemID):
|
| | | #GameWorld.DebugLog('祈福丹药,炼丹等级未达到,移除产出库!itemID=%s'%itemID)
|
| | | continue
|
| | | if PlayerAttrFruit.IsFruitEatFull(curPlayer, itemID):
|
| | | #GameWorld.DebugLog('祈福丹药,使用次数已满,移除产出库!itemID=%s'%itemID)
|
| | | continue
|
| | | newItemInfoList.append(itemInfo)
|
| | | if not newItemInfoList:
|
| | | GameWorld.DebugLog('祈福丹药,没有丹药可产出!!')
|
| | | return
|
| | | |
| | | makeItemInfo = GameWorld.GetResultByWeightList(newItemInfoList)
|
| | | if not makeItemInfo:
|
| | | GameWorld.DebugLog("祈福丹药, 结果错误!")
|
| | | return
|
| | | |
| | | makeItemID, itemCount = makeItemInfo
|
| | | makeItemData = GameWorld.GetGameData().GetItemByTypeID(makeItemID)
|
| | | if not makeItemData:
|
| | | return
|
| | | |
| | | costMoney = IpyGameDataPY.GetFuncCfg('GodAlchemy', 2)
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney, ChConfig.Def_Cost_AlchemyPray):
|
| | | return
|
| | | #给物品
|
| | | ItemControler.GivePlayerItem(curPlayer, makeItemID, itemCount, True, [IPY_GameWorld.rptItem], |
| | | event=[ChConfig.ItemGive_Refine, False, {}])
|
| | | #GameWorld.DebugLog('makeItemID=%s,newItemInfoList=%s'%(makeItemID, newItemInfoList))
|
| | | |
| | | |
| | | #紫色及以上全服广播
|
| | | notifyColor = IpyGameDataPY.GetFuncCfg("AlchemyNotify", 1)
|
| | | needNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 2)
|
| | | notNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 3)
|
| | | if makeItemID not in notNotifyItemIDList and (makeItemID in needNotifyItemIDList or makeItemData.GetItemColor() >= notifyColor):
|
| | | PlayerControl.WorldNotify(0, "BlastfurnaceBlessing", [curPlayer.GetPlayerName(), makeItemID])
|
| | | |
| | | #更新次数
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyPrayCnt, prayCnt+1)
|
| | | Sycn_AlchemyPrayMsg(curPlayer, makeItemID)
|
| | | return
|
| | |
|
| | | def Sycn_AlchemyPrayMsg(curPlayer, itemID=0):
|
| | | #祈福丹药结果
|
| | | if not itemID and not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_RefineStove):
|
| | | return
|
| | | pack = ChPyNetSendPack.tagMCPrayElixirResult()
|
| | | pack.PrayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyPrayCnt)
|
| | | pack.ItemID = itemID
|
| | | NetPackCommon.SendFakePack(curPlayer, pack)
|
| | | return |