From 3d7649c649a1b15f68e30bc3b622260ebd7fab19 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 29 一月 2021 11:22:49 +0800
Subject: [PATCH] 8716 【主干】【后端】【BT2】H.活动-节日祈愿(增加节日祝福);
---
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 44 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/FeastWish.py | 64 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 5
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 108 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 401 +++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 108 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py | 407 +++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 401 +++++++++++++
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini | 16
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 90 +++
ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py | 1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 3
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 6
PySysDB/PySysDBPY.h | 34 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py | 20
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 5
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4
PySysDB/PySysDBG.h | 16
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 5
20 files changed, 1,742 insertions(+), 5 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index 40fbec6..6074880 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -282,6 +282,22 @@
char EndDate; //结束日期
};
+//节日祝福时间表
+
+struct tagActFeastWish
+{
+ DWORD _CfgID; //配置ID
+ char ActMark; //活动组标记
+ list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有
+ list ServerGroupIDList; //服务器ID列表
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ BYTE ResetType; //重置类型,0-0点重置;1-5点重置
+ dict NotifyInfoStart; //全服提示信息 - 相对开始时间
+ dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
+ list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
+};
+
//等级开启功能 #tagFuncOpenLV
struct tagFuncOpenLV
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index df6d7c5..294ba85 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1882,6 +1882,40 @@
list LoginAwardItemList; //奖励列表[[物品ID,个数,是否拍品], ...]
};
+//节日祝福时间表
+
+struct tagActFeastWish
+{
+ DWORD _CfgID; //配置ID
+ char StartDate; //开启日期
+ char EndDate; //结束日期
+ dict TemplateIDInfo; //模板信息 {(世界等级A,B):模板编号, ...}
+};
+
+//节日祝福瓶模板表
+
+struct tagActFeastWishBottle
+{
+ BYTE _TemplateID; //模板ID
+ BYTE WishBottleNum; //祝福瓶编号
+ WORD NeedWishValue; //单次领奖所需祝福值
+ BYTE ChooseTimeMax; //最大可领奖次数
+ dict ChoosePrizeItem; //选择奖励物品信息,选完为止 {记录索引:[物品ID,个数,是否拍品], ...}
+ list GoodItemIDList; //需要广播的物品ID列表 [物品ID, ...]
+ char WorldNotifyKey; //全服广播key,参数(玩家名, 物品ID, 物品数据, 个数,)
+};
+
+//节日祝福池模板表
+
+struct tagActFeastWishPool
+{
+ BYTE _TemplateID; //模板ID
+ list WishPoolItemWeightInfo; //祝福池产出物品权重 [[权重, [物品ID,个数]], ..]
+ list WishPoolClientItemShow; //前端展示物品列表 [物品ID, ...]
+ list GoodItemIDList; //需要广播的物品ID列表 [物品ID, ...]
+ char WorldNotifyKey; //全服广播key,参数(玩家名, 物品ID, 物品数据, 个数,)
+};
+
//诛仙BOSS表
struct tagZhuXianBoss
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
index fe630dd..ef72280 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
@@ -534,6 +534,7 @@
ShareDefine.Def_UniversalGameRecType_DujieHelpRecord:10000, #渡劫副本护法详细记录
ShareDefine.Def_UniversalGameRecType_ZhuXianBossRecord:100, #诛仙BOSS结算记录
ShareDefine.Def_UniversalGameRecType_LuckyTreasure:5, #幸运鉴宝记录
+ ShareDefine.Def_UniversalGameRecType_FeastWish:30, #节日祝福大奖记录
}
#---------------------------------------------------------------------
#比较标识
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 1282455..1ee8a8d 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -13378,6 +13378,114 @@
#------------------------------------------------------
+# AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem
+
+class tagCMFeastWishBottleChooseItem(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("BottleNum", c_ubyte), #瓶子编号
+ ("RecordIndex", c_ubyte), #物品索引,用于选择及记录是否已选择
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x10
+ 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 = 0xAA
+ self.SubCmd = 0x10
+ self.BottleNum = 0
+ self.RecordIndex = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMFeastWishBottleChooseItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 10 节日祝福瓶选择奖励物品 //tagCMFeastWishBottleChooseItem:
+ Cmd:%s,
+ SubCmd:%s,
+ BottleNum:%d,
+ RecordIndex:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.BottleNum,
+ self.RecordIndex
+ )
+ return DumpString
+
+
+m_NAtagCMFeastWishBottleChooseItem=tagCMFeastWishBottleChooseItem()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFeastWishBottleChooseItem.Cmd,m_NAtagCMFeastWishBottleChooseItem.SubCmd))] = m_NAtagCMFeastWishBottleChooseItem
+
+
+#------------------------------------------------------
+# AA 11 节日祝福池祝福 #tagCMFeastWishPoolWish
+
+class tagCMFeastWishPoolWish(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("WishCount", c_ubyte), #祝福次数
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x11
+ 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 = 0xAA
+ self.SubCmd = 0x11
+ self.WishCount = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMFeastWishPoolWish)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 11 节日祝福池祝福 //tagCMFeastWishPoolWish:
+ Cmd:%s,
+ SubCmd:%s,
+ WishCount:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.WishCount
+ )
+ return DumpString
+
+
+m_NAtagCMFeastWishPoolWish=tagCMFeastWishPoolWish()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFeastWishPoolWish.Cmd,m_NAtagCMFeastWishPoolWish.SubCmd))] = m_NAtagCMFeastWishPoolWish
+
+
+#------------------------------------------------------
# AA 05 限时抢购预约 #tagCMFlashSaleAppointment
class tagCMFlashSaleAppointment(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index fc031ef..edf4da4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -27938,6 +27938,407 @@
#------------------------------------------------------
+# AA 43 节日祝福活动信息 #tagMCFeastWishInfo
+
+class tagMCFeastWishBottleItem(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("RecordIndex", c_ubyte), #物品索引,用于选择及记录是否已选择
+ ("ItemID", c_int),
+ ("ItemCount", c_ushort),
+ ("IsBind", c_ubyte),
+ ]
+
+ def __init__(self):
+ self.Clear()
+ 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.RecordIndex = 0
+ self.ItemID = 0
+ self.ItemCount = 0
+ self.IsBind = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCFeastWishBottleItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 43 节日祝福活动信息 //tagMCFeastWishInfo:
+ RecordIndex:%d,
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.RecordIndex,
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCFeastWishBottleInfo(Structure):
+ BottleNum = 0 #(BYTE BottleNum)//瓶子编号
+ NeedWishValue = 0 #(WORD NeedWishValue)//单次领奖所需祝福值
+ ChooseTimeMax = 0 #(BYTE ChooseTimeMax)//最大可领奖次数
+ ChoosePrizeCount = 0 #(BYTE ChoosePrizeCount)//可选择奖励个数
+ ChoosePrizeList = list() #(vector<tagMCFeastWishBottleItem> ChoosePrizeList)// 选择奖励物品列表,已选过的无法再选
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ self.BottleNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.NeedWishValue,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.ChooseTimeMax,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.ChoosePrizeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.ChoosePrizeCount):
+ temChoosePrizeList = tagMCFeastWishBottleItem()
+ _pos = temChoosePrizeList.ReadData(_lpData, _pos)
+ self.ChoosePrizeList.append(temChoosePrizeList)
+ return _pos
+
+ def Clear(self):
+ self.BottleNum = 0
+ self.NeedWishValue = 0
+ self.ChooseTimeMax = 0
+ self.ChoosePrizeCount = 0
+ self.ChoosePrizeList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ length += 2
+ length += 1
+ length += 1
+ for i in range(self.ChoosePrizeCount):
+ length += self.ChoosePrizeList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteBYTE(data, self.BottleNum)
+ data = CommFunc.WriteWORD(data, self.NeedWishValue)
+ data = CommFunc.WriteBYTE(data, self.ChooseTimeMax)
+ data = CommFunc.WriteBYTE(data, self.ChoosePrizeCount)
+ for i in range(self.ChoosePrizeCount):
+ data = CommFunc.WriteString(data, self.ChoosePrizeList[i].GetLength(), self.ChoosePrizeList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ BottleNum:%d,
+ NeedWishValue:%d,
+ ChooseTimeMax:%d,
+ ChoosePrizeCount:%d,
+ ChoosePrizeList:%s
+ '''\
+ %(
+ self.BottleNum,
+ self.NeedWishValue,
+ self.ChooseTimeMax,
+ self.ChoosePrizeCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCFeastWishInfo(Structure):
+ Head = tagHead()
+ StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ WishPoolShowCount = 0 #(BYTE WishPoolShowCount)//祝福池展示物品数
+ WishPoolShowItemList = list() #(vector<DWORD> WishPoolShowItemList)//祝福池展示物品ID列表
+ BottleCount = 0 #(BYTE BottleCount)// 祝福瓶个数
+ BottleInfoList = list() #(vector<tagMCFeastWishBottleInfo> BottleInfoList)// 祝福瓶信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x43
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.WishPoolShowCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.WishPoolShowCount):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.WishPoolShowItemList.append(value)
+ self.BottleCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.BottleCount):
+ temBottleInfoList = tagMCFeastWishBottleInfo()
+ _pos = temBottleInfoList.ReadData(_lpData, _pos)
+ self.BottleInfoList.append(temBottleInfoList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x43
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.WishPoolShowCount = 0
+ self.WishPoolShowItemList = list()
+ self.BottleCount = 0
+ self.BottleInfoList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 10
+ length += 10
+ length += 1
+ length += 4 * self.WishPoolShowCount
+ length += 1
+ for i in range(self.BottleCount):
+ length += self.BottleInfoList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteString(data, 10, self.StartDate)
+ data = CommFunc.WriteString(data, 10, self.EndtDate)
+ data = CommFunc.WriteBYTE(data, self.WishPoolShowCount)
+ for i in range(self.WishPoolShowCount):
+ data = CommFunc.WriteDWORD(data, self.WishPoolShowItemList[i])
+ data = CommFunc.WriteBYTE(data, self.BottleCount)
+ for i in range(self.BottleCount):
+ data = CommFunc.WriteString(data, self.BottleInfoList[i].GetLength(), self.BottleInfoList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ StartDate:%s,
+ EndtDate:%s,
+ WishPoolShowCount:%d,
+ WishPoolShowItemList:%s,
+ BottleCount:%d,
+ BottleInfoList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.StartDate,
+ self.EndtDate,
+ self.WishPoolShowCount,
+ "...",
+ self.BottleCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCFeastWishInfo=tagMCFeastWishInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFeastWishInfo.Head.Cmd,m_NAtagMCFeastWishInfo.Head.SubCmd))] = m_NAtagMCFeastWishInfo
+
+
+#------------------------------------------------------
+# AA 44 节日祝福活动玩家信息 #tagMCFeastWishPlayerInfo
+
+class tagMCFeastWishPlayerBottle(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("BottleNum", c_ubyte), #瓶子编号
+ ("WishValue", c_ushort), #当前可用祝福值
+ ("ChooseRecord", c_int), #已选物品索引记录,与记录索引位运算判断是否已选择;累计已选择次数前端自己计算,通过该值可算出
+ ]
+
+ def __init__(self):
+ self.Clear()
+ 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.BottleNum = 0
+ self.WishValue = 0
+ self.ChooseRecord = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCFeastWishPlayerBottle)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 44 节日祝福活动玩家信息 //tagMCFeastWishPlayerInfo:
+ BottleNum:%d,
+ WishValue:%d,
+ ChooseRecord:%d
+ '''\
+ %(
+ self.BottleNum,
+ self.WishValue,
+ self.ChooseRecord
+ )
+ return DumpString
+
+
+class tagMCFeastWishPlayerInfo(Structure):
+ Head = tagHead()
+ BottleCount = 0 #(BYTE BottleCount)// 祝福瓶个数
+ PlayerBottleInfo = list() #(vector<tagMCFeastWishPlayerBottle> PlayerBottleInfo)// 祝福瓶信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x44
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.BottleCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.BottleCount):
+ temPlayerBottleInfo = tagMCFeastWishPlayerBottle()
+ _pos = temPlayerBottleInfo.ReadData(_lpData, _pos)
+ self.PlayerBottleInfo.append(temPlayerBottleInfo)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x44
+ self.BottleCount = 0
+ self.PlayerBottleInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ for i in range(self.BottleCount):
+ length += self.PlayerBottleInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.BottleCount)
+ for i in range(self.BottleCount):
+ data = CommFunc.WriteString(data, self.PlayerBottleInfo[i].GetLength(), self.PlayerBottleInfo[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ BottleCount:%d,
+ PlayerBottleInfo:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.BottleCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCFeastWishPlayerInfo=tagMCFeastWishPlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFeastWishPlayerInfo.Head.Cmd,m_NAtagMCFeastWishPlayerInfo.Head.SubCmd))] = m_NAtagMCFeastWishPlayerInfo
+
+
+#------------------------------------------------------
+# AA 45 节日祝福祝福结果 #tagMCFeastWishResult
+
+class tagMCFeastWishResult(Structure):
+ Head = tagHead()
+ AddWishValue = 0 #(WORD AddWishValue)// 本次增加的祝福值
+ WishResultLen = 0 #(WORD WishResultLen)
+ WishResult = "" #(String WishResult)// 获得物品结果[[物品ID,个数,是否绑定], ...]
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x45
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.AddWishValue,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.WishResultLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.WishResult,_pos = CommFunc.ReadString(_lpData, _pos,self.WishResultLen)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x45
+ self.AddWishValue = 0
+ self.WishResultLen = 0
+ self.WishResult = ""
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 2
+ length += 2
+ length += len(self.WishResult)
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteWORD(data, self.AddWishValue)
+ data = CommFunc.WriteWORD(data, self.WishResultLen)
+ data = CommFunc.WriteString(data, self.WishResultLen, self.WishResult)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ AddWishValue:%d,
+ WishResultLen:%d,
+ WishResult:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.AddWishValue,
+ self.WishResultLen,
+ self.WishResult
+ )
+ return DumpString
+
+
+m_NAtagMCFeastWishResult=tagMCFeastWishResult()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFeastWishResult.Head.Cmd,m_NAtagMCFeastWishResult.Head.SubCmd))] = m_NAtagMCFeastWishResult
+
+
+#------------------------------------------------------
# AA 02 首充信息 #tagMCFirstGoldInfo
class tagMCFirstGoldInfo(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
index 475732f..4130ece 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -247,6 +247,19 @@
("char", "EndDate", 0),
),
+ "ActFeastWish":(
+ ("DWORD", "CfgID", 1),
+ ("char", "ActMark", 0),
+ ("list", "PlatformList", 0),
+ ("list", "ServerGroupIDList", 0),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("BYTE", "ResetType", 0),
+ ("dict", "NotifyInfoStart", 0),
+ ("dict", "NotifyInfoEnd", 0),
+ ("list", "NotifyInfoLoop", 0),
+ ),
+
"FuncOpenLV":(
("DWORD", "FuncId", 1),
("DWORD", "LimitLV", 0),
@@ -1148,6 +1161,33 @@
def GetServerGroupIDList(self): return self.ServerGroupIDList # 服务器ID列表
def GetStartDate(self): return self.StartDate # 开启日期
def GetEndDate(self): return self.EndDate # 结束日期
+
+# 节日祝福时间表
+class IPY_ActFeastWish():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.ActMark = ""
+ self.PlatformList = []
+ self.ServerGroupIDList = []
+ self.StartDate = ""
+ self.EndDate = ""
+ self.ResetType = 0
+ self.NotifyInfoStart = {}
+ self.NotifyInfoEnd = {}
+ self.NotifyInfoLoop = []
+ return
+
+ def GetCfgID(self): return self.CfgID # 配置ID
+ def GetActMark(self): return self.ActMark # 活动组标记
+ def GetPlatformList(self): return self.PlatformList # 活动平台列表["平台A", "平台A", ...],配[]代表所有
+ def GetServerGroupIDList(self): return self.ServerGroupIDList # 服务器ID列表
+ def GetStartDate(self): return self.StartDate # 开启日期
+ def GetEndDate(self): return self.EndDate # 结束日期
+ def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
+ def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
+ def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
+ def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
# 等级开启功能
class IPY_FuncOpenLV():
@@ -2153,6 +2193,8 @@
self.ipyActFeastRedPacketLen = len(self.ipyActFeastRedPacketCache)
self.ipyActFeastLoginCache = self.__LoadFileData("ActFeastLogin", IPY_ActFeastLogin)
self.ipyActFeastLoginLen = len(self.ipyActFeastLoginCache)
+ self.ipyActFeastWishCache = self.__LoadFileData("ActFeastWish", IPY_ActFeastWish)
+ self.ipyActFeastWishLen = len(self.ipyActFeastWishCache)
self.ipyFuncOpenLVCache = self.__LoadFileData("FuncOpenLV", IPY_FuncOpenLV)
self.ipyFuncOpenLVLen = len(self.ipyFuncOpenLVCache)
self.ipyChinNPCCache = self.__LoadFileData("ChinNPC", IPY_ChinNPC)
@@ -2445,6 +2487,8 @@
def GetActFeastRedPacketByIndex(self, index): return self.ipyActFeastRedPacketCache[index]
def GetActFeastLoginCount(self): return self.ipyActFeastLoginLen
def GetActFeastLoginByIndex(self, index): return self.ipyActFeastLoginCache[index]
+ def GetActFeastWishCount(self): return self.ipyActFeastWishLen
+ def GetActFeastWishByIndex(self, index): return self.ipyActFeastWishCache[index]
def GetFuncOpenLVCount(self): return self.ipyFuncOpenLVLen
def GetFuncOpenLVByIndex(self, index): return self.ipyFuncOpenLVCache[index]
def GetChinNPCCount(self): return self.ipyChinNPCLen
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py
index 2d3c890..865ffdb 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py
@@ -35,6 +35,7 @@
import ShareDefine
import ChPyNetSendPack
import NetPackCommon
+import PlayerControl
import time
#---------------------------------------------------------------------
@@ -45,7 +46,7 @@
@param recType: 记录类型
@param valueList: [Value1,...,Value5]
@param strValueList: [StrValue1, StrValue2, StrValue3]
- @param notifyType: 0-不通知; 1-通知本人; 2-通知全服
+ @param notifyType: 0-不通知; 1-通知本人; 2-通知全服;3-通知本人单条;4-通知全服单条
@param isSort: 删除时是否需要先排序, 默认是
'''
if recType not in ShareDefine.Def_UniversalGameRecTypeList:
@@ -109,6 +110,10 @@
SendUniversalGameRecInfo(curPlayer, recType)
elif notifyType == 2:
SendUniversalGameRecInfo(None, recType)
+ elif notifyType == 3:
+ SendUniversalGameRecSingle(curPlayer, recObj)
+ elif notifyType == 4:
+ SendUniversalGameRecSingle(None, recObj)
return recObj
@@ -271,7 +276,7 @@
playerManager = GameWorld.GetPlayerManager()
for i in range(0, playerManager.GetPlayerCount()):
curPlayer = playerManager.GetPlayerByIndex(i)
- if curPlayer == None or not curPlayer.GetInitOK():
+ if curPlayer == None or not curPlayer.GetInitOK() or PlayerControl.GetIsTJG(curPlayer):
continue
NetPackCommon.SendFakePack(curPlayer, universalGameRecInfo)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 3760fb6..fa2fc3f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -226,10 +226,12 @@
OperationActionName_RechargeRebateGold = "ActRechargeRebateGold" # 充值返利仙玉活动(活动结束邮件发放,节日活动)
OperationActionName_GrowupBuy = "ActGrowupBuy" # 成长必买活动
OperationActionName_FeastLogin = "ActFeastLogin" # 节日登录活动
+OperationActionName_FeastWish = "ActFeastWish" # 节日祝愿活动
#节日活动类型列表 - 该类型无视开服天,日期到了就开启
FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket,
OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy,
OperationActionName_FeastLogin, OperationActionName_TotalRecharge3,
+ OperationActionName_FeastWish,
]
#所有的运营活动列表,含节日活动
OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
@@ -252,6 +254,7 @@
OperationActionName_WeekParty,
OperationActionName_CollectWords, OperationActionName_CollectWords2,
OperationActionName_FeastLogin, OperationActionName_TotalRecharge3,
+ OperationActionName_FeastWish,
]
#所有的累计充值活动
@@ -1103,7 +1106,7 @@
Def_UniversalGameRecType_Reward, # 通用奖励表(TopBar)14
Def_UniversalGameRecType_ArenaBattleRecord, # 竞技场玩家挑战记录 15
Def_UniversalGameRecType_CrossActInfo, # 跨服运营活动信息记录 16
- Def_UniversalGameRecType_17,
+ Def_UniversalGameRecType_FeastWish, #节日祝福大奖记录17
Def_UniversalGameRecType_18,
Def_UniversalGameRecType_19,
Def_UniversalGameRecType_20,
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index fdd6096..3790a2b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1482,6 +1482,22 @@
PacketSubCMD_2=0x10
PacketCallFunc_2=OnArenaBattle
+;节日祝福
+[PlayerFeastWish]
+ScriptName = Player\PlayerFeastWish.py
+Writer = hxp
+Releaser = hxp
+RegType = 0
+RegisterPackCount = 2
+
+PacketCMD_1=0xAA
+PacketSubCMD_1=0x10
+PacketCallFunc_1=OnFeastWishBottleChooseItem
+
+PacketCMD_2=0xAA
+PacketSubCMD_2=0x11
+PacketCallFunc_2=OnFeastWishPoolWish
+
;缥缈仙域
[PlayerFairyDomain]
ScriptName = Player\PlayerFairyDomain.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 1e72123..4cfe90e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3829,6 +3829,11 @@
#节日登录活动
Def_PDict_FeastLoginID = "FeastLoginID" # 玩家身上的活动ID,唯一标识,取活动开始日期time值
Def_PDict_FeastLoginAwardState = "FeastLoginAwardState" # 活动登录领奖记录,按天编号-1为索引进行二进制位运算记录当天是否已领奖
+
+#节日祝福活动
+Def_PDict_FeastWishID = "FeastWishID" # 玩家身上的活动ID,唯一标识,取活动开始日期time值
+Def_PDict_FeastWishBottleValue = "FeastWishBottleValue_%s" # 祝福瓶当前祝福值,参数(瓶子编号)
+Def_PDict_FeastWishBottleGetState = "FeastWishBottleGetState_%s" # 祝福瓶已领取记录,参数(瓶子编号),按记录索引二进制位存储是否已领取
#-------------------------------------------------------------------------------
#开服活动,Def_PDictType_OpenServerCampaign
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 1282455..1ee8a8d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -13378,6 +13378,114 @@
#------------------------------------------------------
+# AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem
+
+class tagCMFeastWishBottleChooseItem(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("BottleNum", c_ubyte), #瓶子编号
+ ("RecordIndex", c_ubyte), #物品索引,用于选择及记录是否已选择
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x10
+ 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 = 0xAA
+ self.SubCmd = 0x10
+ self.BottleNum = 0
+ self.RecordIndex = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMFeastWishBottleChooseItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 10 节日祝福瓶选择奖励物品 //tagCMFeastWishBottleChooseItem:
+ Cmd:%s,
+ SubCmd:%s,
+ BottleNum:%d,
+ RecordIndex:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.BottleNum,
+ self.RecordIndex
+ )
+ return DumpString
+
+
+m_NAtagCMFeastWishBottleChooseItem=tagCMFeastWishBottleChooseItem()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFeastWishBottleChooseItem.Cmd,m_NAtagCMFeastWishBottleChooseItem.SubCmd))] = m_NAtagCMFeastWishBottleChooseItem
+
+
+#------------------------------------------------------
+# AA 11 节日祝福池祝福 #tagCMFeastWishPoolWish
+
+class tagCMFeastWishPoolWish(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("WishCount", c_ubyte), #祝福次数
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x11
+ 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 = 0xAA
+ self.SubCmd = 0x11
+ self.WishCount = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMFeastWishPoolWish)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 11 节日祝福池祝福 //tagCMFeastWishPoolWish:
+ Cmd:%s,
+ SubCmd:%s,
+ WishCount:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.WishCount
+ )
+ return DumpString
+
+
+m_NAtagCMFeastWishPoolWish=tagCMFeastWishPoolWish()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFeastWishPoolWish.Cmd,m_NAtagCMFeastWishPoolWish.SubCmd))] = m_NAtagCMFeastWishPoolWish
+
+
+#------------------------------------------------------
# AA 05 限时抢购预约 #tagCMFlashSaleAppointment
class tagCMFlashSaleAppointment(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index fc031ef..edf4da4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -27938,6 +27938,407 @@
#------------------------------------------------------
+# AA 43 节日祝福活动信息 #tagMCFeastWishInfo
+
+class tagMCFeastWishBottleItem(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("RecordIndex", c_ubyte), #物品索引,用于选择及记录是否已选择
+ ("ItemID", c_int),
+ ("ItemCount", c_ushort),
+ ("IsBind", c_ubyte),
+ ]
+
+ def __init__(self):
+ self.Clear()
+ 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.RecordIndex = 0
+ self.ItemID = 0
+ self.ItemCount = 0
+ self.IsBind = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCFeastWishBottleItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 43 节日祝福活动信息 //tagMCFeastWishInfo:
+ RecordIndex:%d,
+ ItemID:%d,
+ ItemCount:%d,
+ IsBind:%d
+ '''\
+ %(
+ self.RecordIndex,
+ self.ItemID,
+ self.ItemCount,
+ self.IsBind
+ )
+ return DumpString
+
+
+class tagMCFeastWishBottleInfo(Structure):
+ BottleNum = 0 #(BYTE BottleNum)//瓶子编号
+ NeedWishValue = 0 #(WORD NeedWishValue)//单次领奖所需祝福值
+ ChooseTimeMax = 0 #(BYTE ChooseTimeMax)//最大可领奖次数
+ ChoosePrizeCount = 0 #(BYTE ChoosePrizeCount)//可选择奖励个数
+ ChoosePrizeList = list() #(vector<tagMCFeastWishBottleItem> ChoosePrizeList)// 选择奖励物品列表,已选过的无法再选
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ self.BottleNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.NeedWishValue,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.ChooseTimeMax,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.ChoosePrizeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.ChoosePrizeCount):
+ temChoosePrizeList = tagMCFeastWishBottleItem()
+ _pos = temChoosePrizeList.ReadData(_lpData, _pos)
+ self.ChoosePrizeList.append(temChoosePrizeList)
+ return _pos
+
+ def Clear(self):
+ self.BottleNum = 0
+ self.NeedWishValue = 0
+ self.ChooseTimeMax = 0
+ self.ChoosePrizeCount = 0
+ self.ChoosePrizeList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += 1
+ length += 2
+ length += 1
+ length += 1
+ for i in range(self.ChoosePrizeCount):
+ length += self.ChoosePrizeList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteBYTE(data, self.BottleNum)
+ data = CommFunc.WriteWORD(data, self.NeedWishValue)
+ data = CommFunc.WriteBYTE(data, self.ChooseTimeMax)
+ data = CommFunc.WriteBYTE(data, self.ChoosePrizeCount)
+ for i in range(self.ChoosePrizeCount):
+ data = CommFunc.WriteString(data, self.ChoosePrizeList[i].GetLength(), self.ChoosePrizeList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ BottleNum:%d,
+ NeedWishValue:%d,
+ ChooseTimeMax:%d,
+ ChoosePrizeCount:%d,
+ ChoosePrizeList:%s
+ '''\
+ %(
+ self.BottleNum,
+ self.NeedWishValue,
+ self.ChooseTimeMax,
+ self.ChoosePrizeCount,
+ "..."
+ )
+ return DumpString
+
+
+class tagMCFeastWishInfo(Structure):
+ Head = tagHead()
+ StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
+ EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
+ WishPoolShowCount = 0 #(BYTE WishPoolShowCount)//祝福池展示物品数
+ WishPoolShowItemList = list() #(vector<DWORD> WishPoolShowItemList)//祝福池展示物品ID列表
+ BottleCount = 0 #(BYTE BottleCount)// 祝福瓶个数
+ BottleInfoList = list() #(vector<tagMCFeastWishBottleInfo> BottleInfoList)// 祝福瓶信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x43
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
+ self.WishPoolShowCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.WishPoolShowCount):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.WishPoolShowItemList.append(value)
+ self.BottleCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.BottleCount):
+ temBottleInfoList = tagMCFeastWishBottleInfo()
+ _pos = temBottleInfoList.ReadData(_lpData, _pos)
+ self.BottleInfoList.append(temBottleInfoList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x43
+ self.StartDate = ""
+ self.EndtDate = ""
+ self.WishPoolShowCount = 0
+ self.WishPoolShowItemList = list()
+ self.BottleCount = 0
+ self.BottleInfoList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 10
+ length += 10
+ length += 1
+ length += 4 * self.WishPoolShowCount
+ length += 1
+ for i in range(self.BottleCount):
+ length += self.BottleInfoList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteString(data, 10, self.StartDate)
+ data = CommFunc.WriteString(data, 10, self.EndtDate)
+ data = CommFunc.WriteBYTE(data, self.WishPoolShowCount)
+ for i in range(self.WishPoolShowCount):
+ data = CommFunc.WriteDWORD(data, self.WishPoolShowItemList[i])
+ data = CommFunc.WriteBYTE(data, self.BottleCount)
+ for i in range(self.BottleCount):
+ data = CommFunc.WriteString(data, self.BottleInfoList[i].GetLength(), self.BottleInfoList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ StartDate:%s,
+ EndtDate:%s,
+ WishPoolShowCount:%d,
+ WishPoolShowItemList:%s,
+ BottleCount:%d,
+ BottleInfoList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.StartDate,
+ self.EndtDate,
+ self.WishPoolShowCount,
+ "...",
+ self.BottleCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCFeastWishInfo=tagMCFeastWishInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFeastWishInfo.Head.Cmd,m_NAtagMCFeastWishInfo.Head.SubCmd))] = m_NAtagMCFeastWishInfo
+
+
+#------------------------------------------------------
+# AA 44 节日祝福活动玩家信息 #tagMCFeastWishPlayerInfo
+
+class tagMCFeastWishPlayerBottle(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("BottleNum", c_ubyte), #瓶子编号
+ ("WishValue", c_ushort), #当前可用祝福值
+ ("ChooseRecord", c_int), #已选物品索引记录,与记录索引位运算判断是否已选择;累计已选择次数前端自己计算,通过该值可算出
+ ]
+
+ def __init__(self):
+ self.Clear()
+ 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.BottleNum = 0
+ self.WishValue = 0
+ self.ChooseRecord = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCFeastWishPlayerBottle)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 44 节日祝福活动玩家信息 //tagMCFeastWishPlayerInfo:
+ BottleNum:%d,
+ WishValue:%d,
+ ChooseRecord:%d
+ '''\
+ %(
+ self.BottleNum,
+ self.WishValue,
+ self.ChooseRecord
+ )
+ return DumpString
+
+
+class tagMCFeastWishPlayerInfo(Structure):
+ Head = tagHead()
+ BottleCount = 0 #(BYTE BottleCount)// 祝福瓶个数
+ PlayerBottleInfo = list() #(vector<tagMCFeastWishPlayerBottle> PlayerBottleInfo)// 祝福瓶信息
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x44
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.BottleCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.BottleCount):
+ temPlayerBottleInfo = tagMCFeastWishPlayerBottle()
+ _pos = temPlayerBottleInfo.ReadData(_lpData, _pos)
+ self.PlayerBottleInfo.append(temPlayerBottleInfo)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x44
+ self.BottleCount = 0
+ self.PlayerBottleInfo = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ for i in range(self.BottleCount):
+ length += self.PlayerBottleInfo[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.BottleCount)
+ for i in range(self.BottleCount):
+ data = CommFunc.WriteString(data, self.PlayerBottleInfo[i].GetLength(), self.PlayerBottleInfo[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ BottleCount:%d,
+ PlayerBottleInfo:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.BottleCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCFeastWishPlayerInfo=tagMCFeastWishPlayerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFeastWishPlayerInfo.Head.Cmd,m_NAtagMCFeastWishPlayerInfo.Head.SubCmd))] = m_NAtagMCFeastWishPlayerInfo
+
+
+#------------------------------------------------------
+# AA 45 节日祝福祝福结果 #tagMCFeastWishResult
+
+class tagMCFeastWishResult(Structure):
+ Head = tagHead()
+ AddWishValue = 0 #(WORD AddWishValue)// 本次增加的祝福值
+ WishResultLen = 0 #(WORD WishResultLen)
+ WishResult = "" #(String WishResult)// 获得物品结果[[物品ID,个数,是否绑定], ...]
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x45
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.AddWishValue,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.WishResultLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.WishResult,_pos = CommFunc.ReadString(_lpData, _pos,self.WishResultLen)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xAA
+ self.Head.SubCmd = 0x45
+ self.AddWishValue = 0
+ self.WishResultLen = 0
+ self.WishResult = ""
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 2
+ length += 2
+ length += len(self.WishResult)
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteWORD(data, self.AddWishValue)
+ data = CommFunc.WriteWORD(data, self.WishResultLen)
+ data = CommFunc.WriteString(data, self.WishResultLen, self.WishResult)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ AddWishValue:%d,
+ WishResultLen:%d,
+ WishResult:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.AddWishValue,
+ self.WishResultLen,
+ self.WishResult
+ )
+ return DumpString
+
+
+m_NAtagMCFeastWishResult=tagMCFeastWishResult()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFeastWishResult.Head.Cmd,m_NAtagMCFeastWishResult.Head.SubCmd))] = m_NAtagMCFeastWishResult
+
+
+#------------------------------------------------------
# AA 02 首充信息 #tagMCFirstGoldInfo
class tagMCFirstGoldInfo(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/FeastWish.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/FeastWish.py
new file mode 100644
index 0000000..cec730d
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/FeastWish.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package GM.Commands.FeastWish
+#
+# @todo:节日祝福
+# @author hxp
+# @date 2021-01-29
+# @version 1.0
+#
+# 详细描述: 节日祝福
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2021-01-29 11:30"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+import PlayerControl
+import PlayerFeastWish
+import ChConfig
+
+
+def __Help(curPlayer):
+ GameWorld.DebugAnswer(curPlayer, "重置祝福瓶: FeastWish 0")
+ GameWorld.DebugAnswer(curPlayer, "设置祝福瓶: FeastWish 编号 祝福值")
+ GameWorld.DebugAnswer(curPlayer, "祝福瓶领取: FeastWish 编号 记录索引 是否领取")
+ return
+
+## GM命令执行入口
+# @param curPlayer 当前玩家
+# @param paramList 参数列表 []
+# @return None
+# @remarks 函数详细说明.
+def OnExec(curPlayer, paramList):
+
+ if not paramList:
+ __Help(curPlayer)
+ return
+
+ if paramList[0] == 0:
+ bottleNumList = PlayerFeastWish.GetWishBottleNumList()
+ for bottleNum in bottleNumList:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, 0)
+ GameWorld.DebugAnswer(curPlayer, "重置OK!")
+ elif len(paramList) == 2:
+ bottleNum, wishValue = paramList
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, wishValue)
+ GameWorld.DebugAnswer(curPlayer, "设置祝福瓶(%s),祝福值=%s" % (bottleNum, wishValue))
+ elif len(paramList) == 3:
+ bottleNum, recordIndex, isGet = paramList
+ getState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
+ updState = GameWorld.SetBitValue(getState, recordIndex, isGet)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, updState)
+ GameWorld.DebugAnswer(curPlayer, "设置祝福瓶(%s),getState=%s,updState=%s" % (bottleNum, getState, updState))
+ else:
+ __Help(curPlayer)
+ return
+
+ PlayerFeastWish.Sync_FeastWishActionInfo(curPlayer)
+ PlayerFeastWish.Sync_FeastWishPlayerInfo(curPlayer)
+ return
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
index 1fe80c9..7236d4b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
@@ -1768,6 +1768,24 @@
numValue += pow(10, dataIndex)*(dataValue - lastTagLV)
return numValue
+def GetBitValue(dataValue, index):
+ """ 得到某个字节值中某一位(Bit)的值
+ @param dataValue: 待取值的字节值
+ @param index: 待读取位的序号,从右向左0开始,0-7为一个完整字节的8个位
+ @return: 返回读取该位的值,0或1
+ """
+ return 1 if dataValue & (1 << index) else 0
+
+def SetBitValue(dataValue, index, val):
+ """ 更改某个字节值中某一位(Bit)的值
+ @param dataValue: 准备更改的字节原值
+ @param index: 待更改位的序号,从右向左0开始,0-7为一个完整字节的8个位
+ @param val: 目标位预更改的值,0或1
+ @return: 返回更改后字节的值
+ """
+ if val:
+ return dataValue | (1 << index)
+ return dataValue & ~(1 << index)
## 自写round函数
# @param num
@@ -1976,7 +1994,7 @@
@param recType: 通用记录类型, 对应 ShareDefine.Def_UniversalGameRecTypeList
@param valueList: 数值列表[value1, value2, ...], 按顺序, 支持value1 ~ value5
@param strValueList: 字符值列表[strValue1, strValue2, ...], 按顺序, 支持strValue1 ~ strValue3
- @param notifyType: 0-不通知; 1-通知本人; 2-通知全服
+ @param notifyType: 0-不通知; 1-通知本人; 2-通知全服;3-通知本人单条;4-通知全服单条
@param isSort: 存储记录满需删除时是否需要先按时间排序, 默认1是, 先进先出
'''
msgStr = str([recType, valueList, strValueList, notifyType, isSort])
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 5bc8417..2761b28 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1469,6 +1469,31 @@
("list", "LoginAwardItemList", 0),
),
+ "ActFeastWish":(
+ ("DWORD", "CfgID", 1),
+ ("char", "StartDate", 0),
+ ("char", "EndDate", 0),
+ ("dict", "TemplateIDInfo", 0),
+ ),
+
+ "ActFeastWishBottle":(
+ ("BYTE", "TemplateID", 1),
+ ("BYTE", "WishBottleNum", 0),
+ ("WORD", "NeedWishValue", 0),
+ ("BYTE", "ChooseTimeMax", 0),
+ ("dict", "ChoosePrizeItem", 0),
+ ("list", "GoodItemIDList", 0),
+ ("char", "WorldNotifyKey", 0),
+ ),
+
+ "ActFeastWishPool":(
+ ("BYTE", "TemplateID", 1),
+ ("list", "WishPoolItemWeightInfo", 0),
+ ("list", "WishPoolClientItemShow", 0),
+ ("list", "GoodItemIDList", 0),
+ ("char", "WorldNotifyKey", 0),
+ ),
+
"ZhuXianBoss":(
("DWORD", "NPCID", 0),
("BYTE", "LineID", 1),
@@ -4727,6 +4752,59 @@
def GetDayNum(self): return self.DayNum # 第X天从1开始
def GetLoginAwardItemList(self): return self.LoginAwardItemList # 奖励列表[[物品ID,个数,是否拍品], ...]
+# 节日祝福时间表
+class IPY_ActFeastWish():
+
+ def __init__(self):
+ self.CfgID = 0
+ self.StartDate = ""
+ self.EndDate = ""
+ self.TemplateIDInfo = {}
+ return
+
+ def GetCfgID(self): return self.CfgID # 配置ID
+ def GetStartDate(self): return self.StartDate # 开启日期
+ def GetEndDate(self): return self.EndDate # 结束日期
+ def GetTemplateIDInfo(self): return self.TemplateIDInfo # 模板信息 {(世界等级A,B):模板编号, ...}
+
+# 节日祝福瓶模板表
+class IPY_ActFeastWishBottle():
+
+ def __init__(self):
+ self.TemplateID = 0
+ self.WishBottleNum = 0
+ self.NeedWishValue = 0
+ self.ChooseTimeMax = 0
+ self.ChoosePrizeItem = {}
+ self.GoodItemIDList = []
+ self.WorldNotifyKey = ""
+ return
+
+ def GetTemplateID(self): return self.TemplateID # 模板ID
+ def GetWishBottleNum(self): return self.WishBottleNum # 祝福瓶编号
+ def GetNeedWishValue(self): return self.NeedWishValue # 单次领奖所需祝福值
+ def GetChooseTimeMax(self): return self.ChooseTimeMax # 最大可领奖次数
+ def GetChoosePrizeItem(self): return self.ChoosePrizeItem # 选择奖励物品信息,选完为止 {记录索引:[物品ID,个数,是否拍品], ...}
+ def GetGoodItemIDList(self): return self.GoodItemIDList # 需要广播的物品ID列表 [物品ID, ...]
+ def GetWorldNotifyKey(self): return self.WorldNotifyKey # 全服广播key,参数(玩家名, 物品ID, 物品数据, 个数,)
+
+# 节日祝福池模板表
+class IPY_ActFeastWishPool():
+
+ def __init__(self):
+ self.TemplateID = 0
+ self.WishPoolItemWeightInfo = []
+ self.WishPoolClientItemShow = []
+ self.GoodItemIDList = []
+ self.WorldNotifyKey = ""
+ return
+
+ def GetTemplateID(self): return self.TemplateID # 模板ID
+ def GetWishPoolItemWeightInfo(self): return self.WishPoolItemWeightInfo # 祝福池产出物品权重 [[权重, [物品ID,个数]], ..]
+ def GetWishPoolClientItemShow(self): return self.WishPoolClientItemShow # 前端展示物品列表 [物品ID, ...]
+ def GetGoodItemIDList(self): return self.GoodItemIDList # 需要广播的物品ID列表 [物品ID, ...]
+ def GetWorldNotifyKey(self): return self.WorldNotifyKey # 全服广播key,参数(玩家名, 物品ID, 物品数据, 个数,)
+
# 诛仙BOSS表
class IPY_ZhuXianBoss():
@@ -5544,6 +5622,12 @@
self.ipyActFeastLoginLen = len(self.ipyActFeastLoginCache)
self.ipyActFeastLoginAwardCache = self.__LoadFileData("ActFeastLoginAward", IPY_ActFeastLoginAward)
self.ipyActFeastLoginAwardLen = len(self.ipyActFeastLoginAwardCache)
+ self.ipyActFeastWishCache = self.__LoadFileData("ActFeastWish", IPY_ActFeastWish)
+ self.ipyActFeastWishLen = len(self.ipyActFeastWishCache)
+ self.ipyActFeastWishBottleCache = self.__LoadFileData("ActFeastWishBottle", IPY_ActFeastWishBottle)
+ self.ipyActFeastWishBottleLen = len(self.ipyActFeastWishBottleCache)
+ self.ipyActFeastWishPoolCache = self.__LoadFileData("ActFeastWishPool", IPY_ActFeastWishPool)
+ self.ipyActFeastWishPoolLen = len(self.ipyActFeastWishPoolCache)
self.ipyZhuXianBossCache = self.__LoadFileData("ZhuXianBoss", IPY_ZhuXianBoss)
self.ipyZhuXianBossLen = len(self.ipyZhuXianBossCache)
self.ipyActFeastWeekPartyCache = self.__LoadFileData("ActFeastWeekParty", IPY_ActFeastWeekParty)
@@ -6056,6 +6140,12 @@
def GetActFeastLoginByIndex(self, index): return self.ipyActFeastLoginCache[index]
def GetActFeastLoginAwardCount(self): return self.ipyActFeastLoginAwardLen
def GetActFeastLoginAwardByIndex(self, index): return self.ipyActFeastLoginAwardCache[index]
+ def GetActFeastWishCount(self): return self.ipyActFeastWishLen
+ def GetActFeastWishByIndex(self, index): return self.ipyActFeastWishCache[index]
+ def GetActFeastWishBottleCount(self): return self.ipyActFeastWishBottleLen
+ def GetActFeastWishBottleByIndex(self, index): return self.ipyActFeastWishBottleCache[index]
+ def GetActFeastWishPoolCount(self): return self.ipyActFeastWishPoolLen
+ def GetActFeastWishPoolByIndex(self, index): return self.ipyActFeastWishPoolCache[index]
def GetZhuXianBossCount(self): return self.ipyZhuXianBossLen
def GetZhuXianBossByIndex(self, index): return self.ipyZhuXianBossCache[index]
def GetActFeastWeekPartyCount(self): return self.ipyActFeastWeekPartyLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 9d758d7..3c16272 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -53,6 +53,7 @@
import PlayerActCollectWords
import PlayerNewFairyCeremony
import GameLogic_CrossGrassland
+import PlayerFeastWish
import PlayerWeekParty
import NPCHurtManager
import PlayerActLogin
@@ -1134,6 +1135,11 @@
for gItemExID, gItemExCount in gradeItemExList:
dropIDList += [gItemExID] * gItemExCount
+ # 7.相关活动掉落
+ feastWishDropIDList = PlayerFeastWish.GetFeastWishDropItemIDList(dropPlayer, npcData)
+ if feastWishDropIDList:
+ dropIDList.extend(feastWishDropIDList)
+
# 检查掉落互斥ID组
dropIDList = __RemoveMutexDropID(dropIDList, IpyGameDataPY.GetFuncCfg("MutexDrop", 1))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 8ce412e..f15e221 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -81,6 +81,7 @@
import PlayerWeekParty
import PlayerFeastWeekParty
import PlayerFeastLogin
+import PlayerFeastWish
import PlayerActLogin
import PlayerTreasure
import GameLogic_GodArea
@@ -700,6 +701,8 @@
PlayerFeastWeekParty.OnLogin(curPlayer)
# 节日登录活动
PlayerFeastLogin.OnPlayerLogin(curPlayer)
+ # 节日祝福活动
+ PlayerFeastWish.OnPlayerLogin(curPlayer)
# 登录奖励活动
PlayerActLogin.OnLogin(curPlayer)
# 仙界盛典活动
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 665f38d..b09564c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -84,6 +84,7 @@
import PlayerWeekParty
import PlayerFeastWeekParty
import PlayerFeastLogin
+import PlayerFeastWish
import PlayerActLogin
import PlayerFlashGiftbag
import PlayerDailyGiftbag
@@ -1387,6 +1388,9 @@
elif actionName == ShareDefine.OperationActionName_FeastLogin:
PlayerFeastLogin.RefreshFeastLoginActionInfo()
+ elif actionName == ShareDefine.OperationActionName_FeastWish:
+ PlayerFeastWish.RefreshFeastWishActionInfo()
+
elif actionName == ShareDefine.OperationActionName_FeastWeekParty:
PlayerFeastWeekParty.RefreshOperationAction_FeastWeekParty()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py
new file mode 100644
index 0000000..65f4223
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py
@@ -0,0 +1,407 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.PlayerFeastWish
+#
+# @todo:节日祝福
+# @author hxp
+# @date 2021-01-29
+# @version 1.0
+#
+# 详细描述: 节日祝福
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2021-01-29 11:30"""
+#-------------------------------------------------------------------------------
+
+import ItemCommon
+import PyGameData
+import ShareDefine
+import PlayerControl
+import IpyGameDataPY
+import ItemControler
+import ChPyNetSendPack
+import IPY_GameWorld
+import NetPackCommon
+import GameWorld
+import ChConfig
+
+import random
+
+def OnPlayerLogin(curPlayer):
+ isReset = __CheckPlayerFeastWishAction(curPlayer)
+ if not isReset:
+ actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
+ # 活动中同步活动信息
+ if actInfo.get(ShareDefine.ActKey_State):
+ Sync_FeastWishActionInfo(curPlayer)
+ Sync_FeastWishPlayerInfo(curPlayer)
+ return
+
+def RefreshFeastWishActionInfo():
+ ## 收到GameServer同步的活动信息,刷新活动信息
+ playerManager = GameWorld.GetPlayerManager()
+ for index in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(index)
+ if curPlayer.GetID() == 0:
+ continue
+ __CheckPlayerFeastWishAction(curPlayer)
+ return
+
+def __CheckPlayerFeastWishAction(curPlayer):
+ ## 检查玩家活动信息
+
+ playerID = curPlayer.GetPlayerID()
+
+ actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
+ actID = actInfo.get(ShareDefine.ActKey_ID, 0)
+ state = actInfo.get(ShareDefine.ActKey_State, 0)
+
+ playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishID) # 玩家身上的活动ID
+ # 活动ID 相同的话不处理
+ if actID == playerActID:
+ GameWorld.DebugLog("节日祝福活动ID不变,不处理!", curPlayer.GetPlayerID())
+ return
+ GameWorld.DebugLog("节日祝福活动重置! actID=%s,playerActID=%s,state=%s" % (actID, playerActID, state), playerID)
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishID, actID)
+ if not state:
+ return
+
+ bottleNumList = GetWishBottleNumList()
+ for bottleNum in bottleNumList:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, 0)
+
+ Sync_FeastWishActionInfo(curPlayer)
+ Sync_FeastWishPlayerInfo(curPlayer)
+ return True
+
+#// AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem
+#
+#struct tagCMFeastWishBottleChooseItem
+#{
+# tagHead Head;
+# BYTE BottleNum; //瓶子编号
+# BYTE RecordIndex; //物品索引,用于选择及记录是否已选择
+#};
+def OnFeastWishBottleChooseItem(index, clientData, tick):
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ bottleNum = clientData.BottleNum
+ getRecordIndex = clientData.RecordIndex
+
+ templateID = __GetWishTemplateID()
+ GameWorld.DebugLog("节日祝福瓶选择奖励! templateID=%s,bottleNum=%s,getRecordIndex=%s" % (templateID, bottleNum, getRecordIndex))
+ if not templateID:
+ return
+
+ bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", templateID)
+ if not bottleIpyDataList:
+ return
+
+ findIpyData = None
+ for bottleIpyData in bottleIpyDataList:
+ if bottleNum == bottleIpyData.GetWishBottleNum():
+ findIpyData = bottleIpyData
+ break
+
+ if not findIpyData:
+ GameWorld.DebugLog(" 找不到对应节日祝福瓶! bottleNum=%s" % bottleNum)
+ return
+
+ choosePrizeItemDict = findIpyData.GetChoosePrizeItem()
+ if getRecordIndex not in choosePrizeItemDict:
+ GameWorld.DebugLog(" 找不到对应节日祝福瓶奖励物品! getRecordIndex=%s" % getRecordIndex)
+ return
+
+ curWishValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleValue % bottleNum)
+ getState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
+ getTimes = 0
+ for recordIndex in choosePrizeItemDict.keys():
+ if getState & pow(2, recordIndex):
+ getTimes += 1
+ if getRecordIndex == recordIndex:
+ GameWorld.DebugLog(" 该物品已经选择过! getRecordIndex=%s,getState=%s" % (getRecordIndex, getState))
+ return
+
+ if getTimes >= findIpyData.GetChooseTimeMax():
+ GameWorld.DebugLog(" 已没有领取次数! getState=%s,getTimes=%s >= %s" % (getState, getTimes, findIpyData.GetChooseTimeMax()))
+ return
+
+ if curWishValue < findIpyData.GetNeedWishValue():
+ GameWorld.DebugLog(" 祝福值不足领取! curWishValue=%s < %s" % (curWishValue, findIpyData.GetNeedWishValue()))
+ return
+
+ if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
+ return
+ itemInfo = choosePrizeItemDict[getRecordIndex]
+ itemID, itemCount, isAuctionItem = itemInfo
+ if not ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem], ["", False, {}]):
+ return
+
+ updWishValue = curWishValue - findIpyData.GetNeedWishValue()
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, updWishValue)
+
+ updGetState = getState | pow(2, getRecordIndex)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, updGetState)
+
+ Sync_FeastWishPlayerInfo(curPlayer, [bottleNum])
+
+ GameWorld.DebugLog(" 选择成功: getState=%s,updGetState=%s,curWishValue=%s,updWishValue=%s,itemInfo=%s"
+ % (getState, updGetState, curWishValue, updWishValue, itemInfo))
+
+ if itemID in findIpyData.GetGoodItemIDList():
+ recFromType = 1 # 记录来源: 1-祝福瓶,2-祝福池
+ valueList = [itemID, itemCount, recFromType]
+ strValueList = [curPlayer.GetPlayerName()]
+ notifyType = 4 # 通知全服单条
+ GameWorld.AddUniversalGameRec(0, ShareDefine.Def_UniversalGameRecType_FeastWish, valueList, strValueList, notifyType)
+
+ notifyKey = findIpyData.GetWorldNotifyKey()
+ if notifyKey:
+ PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), itemID, "", itemCount])
+
+ return
+
+#// AA 11 节日祝福池祝福 #tagCMFeastWishPoolWish
+#
+#struct tagCMFeastWishPoolWish
+#{
+# tagHead Head;
+# BYTE WishCount; //祝福次数
+#};
+def OnFeastWishPoolWish(index, clientData, tick):
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ wishCount = clientData.WishCount
+
+ templateID = __GetWishTemplateID()
+ GameWorld.DebugLog("玩家节日祝福: wishCount=%s,templateID=%s" % (wishCount, templateID))
+ if not templateID:
+ return
+
+ bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", templateID)
+ poolIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWishPool", templateID)
+ if not bottleIpyDataList or not poolIpyData:
+ return
+
+ canWishCountList = IpyGameDataPY.GetFuncEvalCfg("FeastWishCfg", 2)
+ if wishCount not in canWishCountList:
+ return
+
+ costItemID = IpyGameDataPY.GetFuncCfg("FeastWishCfg", 1)
+
+ costItemNeedCount = wishCount
+ costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID)
+ lackCount = max(0, costItemNeedCount - bindCnt - unBindCnt)
+ if lackCount > 0:
+ GameWorld.DebugLog(" 所需祝福道具不足!costItemID=%s,costItemNeedCount=%s,lackCount=%s"
+ % (costItemID, costItemNeedCount, lackCount))
+ return
+
+ giveWishValueTotal = 0
+ wishValueRange = IpyGameDataPY.GetFuncEvalCfg("FeastWishCfg", 3)
+
+ giveItemDict = {} # 用于判断占用背包用
+ giveItemList = [] # 用于实际给物品及通知前端用,一个个给
+ isAuctionItem = 0 # 默认给非拍品
+ itemWeightInfoList = poolIpyData.GetWishPoolItemWeightInfo()
+ for _ in xrange(wishCount):
+ randItemInfo = GameWorld.GetResultByWeightList(itemWeightInfoList)
+ if not randItemInfo:
+ GameWorld.ErrLog("节日祝福池物品权重配置异常! %s" % itemWeightInfoList)
+ return
+ itemID, itemCount = randItemInfo
+ giveItemList.append([itemID, itemCount, isAuctionItem])
+ giveItemDict[itemID] = giveItemDict.get(itemID, 0) + itemCount
+ giveWishValueTotal += random.randint(wishValueRange[0], wishValueRange[1])
+
+ checkSpaceList = [[itemID, itemCount, isAuctionItem] for itemID, itemCount in giveItemDict.items()]
+ if not ItemControler.CheckPackSpaceEnough(curPlayer, checkSpaceList):
+ return
+
+ GameWorld.DebugLog(" giveWishValueTotal=%s,giveItemList=%s" % (giveWishValueTotal, giveItemList))
+
+ # 扣除消耗
+ ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemNeedCount, "FeastWish")
+
+ # 加祝福值
+ syncBottleNumList = []
+ for bottleIpyData in bottleIpyDataList:
+ bottleNum = bottleIpyData.GetWishBottleNum()
+ curWishValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleValue % bottleNum)
+ getState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
+ getTimes = 0
+ for recordIndex in bottleIpyData.GetChoosePrizeItem().keys():
+ if getState & pow(2, recordIndex):
+ getTimes += 1
+ canGetTimes = max(0, bottleIpyData.GetChooseTimeMax() - getTimes)
+ wishValueMax = bottleIpyData.GetNeedWishValue() * canGetTimes
+ if curWishValue >= wishValueMax:
+ GameWorld.DebugLog(" 瓶子祝福值已满! bottleNum=%s,canGetTimes=%s,wishValueMax=%s <= curWishValue=%s"
+ % (bottleNum, canGetTimes, wishValueMax, curWishValue))
+ continue
+ updWishValue = min(wishValueMax, curWishValue + giveWishValueTotal)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, updWishValue)
+ GameWorld.DebugLog(" 瓶子祝福值更新! bottleNum=%s,canGetTimes=%s,wishValueMax=%s,curWishValue=%s,updWishValue=%s"
+ % (bottleNum, canGetTimes, wishValueMax, curWishValue, updWishValue))
+ syncBottleNumList.append(bottleNum)
+
+ # 给物品
+ goodItemIDList = poolIpyData.GetGoodItemIDList()
+ notifyKey = poolIpyData.GetWorldNotifyKey()
+ for itemID, itemCount, isAuctionItem in giveItemList:
+ itemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
+ itemUserData = itemObj.GetUserData()
+ isOK = ItemControler.DoLogic_PutItemInPack(curPlayer, itemObj, ["FeastWish", False, {}], [IPY_GameWorld.rptItem])
+
+ if isOK and itemID in goodItemIDList:
+ # 通知GameServer记录好物品轮播
+ recFromType = 2 # 记录来源: 1-祝福瓶,2-祝福池
+ valueList = [itemID, itemCount, recFromType]
+ strValueList = [curPlayer.GetPlayerName()]
+ notifyType = 4 # 通知全服单条
+ GameWorld.AddUniversalGameRec(0, ShareDefine.Def_UniversalGameRecType_FeastWish, valueList, strValueList, notifyType)
+
+ if notifyKey:
+ PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), itemID, itemUserData, itemCount])
+
+ # 通知前端结果
+ retPack = ChPyNetSendPack.tagMCFeastWishResult()
+ retPack.AddWishValue = giveWishValueTotal
+ retPack.WishResult = str(giveItemList)
+ retPack.WishResultLen = len(retPack.WishResult)
+ NetPackCommon.SendFakePack(curPlayer, retPack)
+
+ if syncBottleNumList:
+ Sync_FeastWishPlayerInfo(curPlayer, syncBottleNumList)
+
+ return
+
+def GetFeastWishDropItemIDList(curPlayer, npcData):
+ ## 获取掉落祝福道具ID列表
+ ## @return: [itemID, ...]
+
+ actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
+ if not actInfo:
+ return []
+
+ if not actInfo.get(ShareDefine.ActKey_State):
+ return []
+
+ if not ChConfig.IsGameBoss(npcData):
+ return []
+
+ npcID = npcData.GetNPCID()
+ killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
+ limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
+ if limitIndex not in [ShareDefine.Def_Boss_Func_World, ShareDefine.Def_Boss_Func_Home]:
+ # 规定只有世界boss、boss之家可掉落
+ return
+
+ dropRate = IpyGameDataPY.GetFuncCfg("FeastWishCfg", 4)
+ if not GameWorld.CanHappen(dropRate):
+ return
+ wishItemID = IpyGameDataPY.GetFuncCfg("FeastWishCfg", 1) # 默认掉1个
+ #GameWorld.DebugLog("掉落节日祝福道具: npcID=%s,dropRate=%s,wishItemID=%s" % (npcID, dropRate, wishItemID))
+ return [wishItemID]
+
+def Sync_FeastWishPlayerInfo(curPlayer, bottleNumList=[]):
+ ## 通知活动玩家信息
+
+ if bottleNumList:
+ syncBottleNumList = bottleNumList
+ else:
+ syncBottleNumList = GetWishBottleNumList()
+
+ playerPack = ChPyNetSendPack.tagMCFeastWishPlayerInfo()
+ playerPack.PlayerBottleInfo = []
+ for bottleNum in syncBottleNumList:
+ playerBottle = ChPyNetSendPack.tagMCFeastWishPlayerBottle()
+ playerBottle.BottleNum = bottleNum
+ playerBottle.WishValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleValue % bottleNum)
+ playerBottle.ChooseRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
+ playerPack.PlayerBottleInfo.append(playerBottle)
+ playerPack.BottleCount = len(playerPack.PlayerBottleInfo)
+ NetPackCommon.SendFakePack(curPlayer, playerPack)
+ return
+
+def GetWishBottleNumList():
+ templateID = __GetWishTemplateID()
+ if not templateID:
+ return []
+
+ bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", templateID)
+ if not bottleIpyDataList:
+ return []
+ return [bottleIpyData.GetWishBottleNum() for bottleIpyData in bottleIpyDataList]
+
+def __GetWishTemplateID():
+ actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
+ if not actInfo:
+ return
+
+ if not actInfo.get(ShareDefine.ActKey_State):
+ return
+
+ cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
+ ipyData = IpyGameDataPY.GetIpyGameData("ActFeastWish", cfgID)
+ if not ipyData:
+ return
+
+ worldLV = actInfo.get(ShareDefine.ActKey_WorldLV)
+ templateID = GameWorld.GetDictValueByRangeKey(ipyData.GetTemplateIDInfo(), worldLV, 0)
+ return templateID
+
+def Sync_FeastWishActionInfo(curPlayer):
+ ## 通知活动信息
+ actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
+ if not actInfo:
+ return
+
+ if not actInfo.get(ShareDefine.ActKey_State):
+ return
+
+ cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
+ ipyData = IpyGameDataPY.GetIpyGameData("ActFeastWish", cfgID)
+ if not ipyData:
+ return
+
+ worldLV = actInfo.get(ShareDefine.ActKey_WorldLV)
+ templateID = GameWorld.GetDictValueByRangeKey(ipyData.GetTemplateIDInfo(), worldLV, 0)
+ if not templateID:
+ return
+
+ bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", templateID)
+ poolIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWishPool", templateID)
+
+ openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ actPack = ChPyNetSendPack.tagMCFeastWishInfo()
+ actPack.Clear()
+ actPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
+ actPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actPack.WishPoolShowItemList = poolIpyData.GetWishPoolClientItemShow() if poolIpyData else []
+ actPack.WishPoolShowCount = len(actPack.WishPoolShowItemList)
+ actPack.BottleInfoList = []
+ if bottleIpyDataList:
+ for bottleIpyData in bottleIpyDataList:
+ bottleInfo = ChPyNetSendPack.tagMCFeastWishBottleInfo()
+ bottleInfo.BottleNum = bottleIpyData.GetWishBottleNum()
+ bottleInfo.NeedWishValue = bottleIpyData.GetNeedWishValue()
+ bottleInfo.ChooseTimeMax = bottleIpyData.GetChooseTimeMax()
+ bottleInfo.ChoosePrizeList = []
+ prizeItemDict = bottleIpyData.GetChoosePrizeItem()
+ for recordIndex, itemInfo in prizeItemDict.items():
+ itemID, itemCount, isAuctionItem = itemInfo
+ itemInfo = ChPyNetSendPack.tagMCFeastWishBottleItem()
+ itemInfo.RecordIndex = recordIndex
+ itemInfo.ItemID = itemID
+ itemInfo.ItemCount = itemCount
+ itemInfo.IsBind = isAuctionItem
+ bottleInfo.ChoosePrizeList.append(itemInfo)
+ bottleInfo.ChoosePrizeCount = len(bottleInfo.ChoosePrizeList)
+ actPack.BottleInfoList.append(bottleInfo)
+ actPack.BottleCount = len(actPack.BottleInfoList)
+ NetPackCommon.SendFakePack(curPlayer, actPack)
+ return
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 3760fb6..fa2fc3f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -226,10 +226,12 @@
OperationActionName_RechargeRebateGold = "ActRechargeRebateGold" # 充值返利仙玉活动(活动结束邮件发放,节日活动)
OperationActionName_GrowupBuy = "ActGrowupBuy" # 成长必买活动
OperationActionName_FeastLogin = "ActFeastLogin" # 节日登录活动
+OperationActionName_FeastWish = "ActFeastWish" # 节日祝愿活动
#节日活动类型列表 - 该类型无视开服天,日期到了就开启
FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket,
OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy,
OperationActionName_FeastLogin, OperationActionName_TotalRecharge3,
+ OperationActionName_FeastWish,
]
#所有的运营活动列表,含节日活动
OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
@@ -252,6 +254,7 @@
OperationActionName_WeekParty,
OperationActionName_CollectWords, OperationActionName_CollectWords2,
OperationActionName_FeastLogin, OperationActionName_TotalRecharge3,
+ OperationActionName_FeastWish,
]
#所有的累计充值活动
@@ -1103,7 +1106,7 @@
Def_UniversalGameRecType_Reward, # 通用奖励表(TopBar)14
Def_UniversalGameRecType_ArenaBattleRecord, # 竞技场玩家挑战记录 15
Def_UniversalGameRecType_CrossActInfo, # 跨服运营活动信息记录 16
- Def_UniversalGameRecType_17,
+ Def_UniversalGameRecType_FeastWish, #节日祝福大奖记录17
Def_UniversalGameRecType_18,
Def_UniversalGameRecType_19,
Def_UniversalGameRecType_20,
--
Gitblit v1.8.0