From e8b1e5b9381740a5ab19088df6a98e2869e4b288 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 12 九月 2018 11:36:30 +0800
Subject: [PATCH] fix:3474 【后端】【主干】【1.0.15】炼丹界面新增付费项目
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAttrFruit.py | 15 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 48 ++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 56 +++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py | 103 +++++++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 48 ++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 3
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 56 +++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 5
9 files changed, 338 insertions(+), 2 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 9976369..ff5f5b4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -9394,6 +9394,54 @@
#------------------------------------------------------
+# 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):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 8ced94f..9ba4a46 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -13827,6 +13827,62 @@
#------------------------------------------------------
+# 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):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 7945d0c..9da8278 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1138,12 +1138,16 @@
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
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 671c1f7..aac5540 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3771,6 +3771,7 @@
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" # 被动功法选中页数
@@ -4432,6 +4433,7 @@
Def_Cost_FreeGoods, # 极品白拿
Def_Cost_DogzEquipPlus, # 神兽装备强化
Def_Cost_RuneHole, # 符印孔解锁
+Def_Cost_AlchemyPray, # 丹药祈福
#-----------以下为暂时没用的,先不删除,如有新增消费点则放在这些之前------------
Def_Cost_RefreshArrestTask, # 刷新悬赏任务
Def_Cost_OffLineExp, # 兑换离线经验
@@ -4453,7 +4455,7 @@
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
@@ -4535,6 +4537,7 @@
Def_Cost_FreeGoods:"FreeGoods",
Def_Cost_DogzEquipPlus:"DogzEquipPlus",
Def_Cost_RuneHole:"RuneHole",
+Def_Cost_AlchemyPray:"AlchemyPray",
}
## -----------------------------------------------------
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 9976369..ff5f5b4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -9394,6 +9394,54 @@
#------------------------------------------------------
+# 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):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 8ced94f..9ba4a46 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -13827,6 +13827,62 @@
#------------------------------------------------------
+# 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):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAttrFruit.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAttrFruit.py
index ae2525b..f92a2e0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAttrFruit.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAttrFruit.py
@@ -468,3 +468,18 @@
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
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
index 1d6e6af..d17f023 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -90,6 +90,7 @@
import PlayerBossReborn
import PlayerFlashGiftbag
import PlayerFairyCeremony
+import PlayerRefineStove
import PlayerVip
import PlayerDiceEx
import IpyGameDataPY
@@ -513,6 +514,8 @@
#法宝
PlayerMagicWeapon.OnDay(curPlayer)
PlayerGoldGift.OnDay(curPlayer)
+ #炼丹
+ PlayerRefineStove.OnDay(curPlayer)
# 特殊时间点X点过天
elif onEventType == ShareDefine.Def_OnEventTypeEx:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py
index 22f2be1..9a4d58e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py
@@ -33,6 +33,7 @@
import copy
+
##功能开启
def DoRefineStoveOpen(curPlayer):
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyLV, 1)
@@ -43,8 +44,13 @@
##登录处理
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
#
@@ -312,3 +318,100 @@
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
\ No newline at end of file
--
Gitblit v1.8.0