From 9795e3216cea1fa777ea7e8a1e54f7ed5a2cbd17 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 08 十月 2018 10:32:55 +0800
Subject: [PATCH] 4012 【后端】【1.0.18】【主干】神兽出战系统广播,神兽出战上限扩展系统广播

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py |   14 ++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py     |    7 +++++--
 PySysDB/PySysDBPY.h                                                                      |    1 +
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index a4f34ce..ad4e352 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -137,6 +137,7 @@
 	list		HelpBattleSkills;	//助战技能ID列表
 	DWORD		FightPowerEx;	//助战附加战力
 	list		EquipPlaceColorList;	//穿戴装备颜色限制
+	list		HelpBattleNotify;	//助战广播 ["广播key",[参数1,参数2,...],广播CD分钟]
 };
 
 //神兽强化表
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 32f9f27..6c738f8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -133,6 +133,7 @@
                         ("list", "HelpBattleSkills", 0),
                         ("DWORD", "FightPowerEx", 0),
                         ("list", "EquipPlaceColorList", 0),
+                        ("list", "HelpBattleNotify", 0),
                         ),
 
                 "DogzEquipPlus":(
@@ -1224,7 +1225,8 @@
         self.BaseAttrValues = []
         self.HelpBattleSkills = []
         self.FightPowerEx = 0
-        self.EquipPlaceColorList = []
+        self.EquipPlaceColorList = []
+        self.HelpBattleNotify = []
         return
         
     def GetDogzID(self): return self.DogzID # 神兽ID
@@ -1232,7 +1234,8 @@
     def GetBaseAttrValues(self): return self.BaseAttrValues # 基础属性值列表
     def GetHelpBattleSkills(self): return self.HelpBattleSkills # 助战技能ID列表
     def GetFightPowerEx(self): return self.FightPowerEx # 助战附加战力
-    def GetEquipPlaceColorList(self): return self.EquipPlaceColorList # 穿戴装备颜色限制
+    def GetEquipPlaceColorList(self): return self.EquipPlaceColorList # 穿戴装备颜色限制
+    def GetHelpBattleNotify(self): return self.HelpBattleNotify # 助战广播 ["广播key",[参数1,参数2,...],广播CD分钟]
 
 # 神兽强化表
 class IPY_DogzEquipPlus():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
index cd9df55..7231a85 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
@@ -29,6 +29,8 @@
 import SkillCommon
 import SkillShell
 
+import time
+
 '''
 神兽编号: 1~20,上线后不可修改
 神兽装备位: 101~105 物品表中的装备位配置
@@ -39,6 +41,8 @@
 '''
 
 DogzEquipCount = 5 # 神兽装备位数量,固定5个,策划说打死也不改
+
+g_helpBattleNotifyTimeDict = {} # 助战广播时间记录 {神兽ID:广播time, ...}
 
 def GetDogzEquipPlaceIndex(equipPlace):
     ## 获取神兽装备位对应的索引
@@ -235,6 +239,8 @@
 #    BYTE        BatteState;    //助战状态,0-召回,1-助战
 #};
 def OnDogzBattleStateChange(index, clientData, tick):
+    global g_helpBattleNotifyTimeDict
+    
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     playerID = curPlayer.GetPlayerID()
     dogzID = clientData.DogzID
@@ -283,6 +289,14 @@
     SetDogzIsHelpFight(curPlayer, dogzID, isFight)
     RefreshDogzAttr(curPlayer)
     PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
+    
+    if isFight and ipyData.GetHelpBattleNotify():
+        curTime = int(time.time())
+        notifyKey, notifyParamList, notifyCD = ipyData.GetHelpBattleNotify()
+        lastNotifyTime = g_helpBattleNotifyTimeDict.get(dogzID, 0)
+        if curTime - lastNotifyTime >= notifyCD * 60: 
+            PlayerControl.WorldNotify(0, notifyKey, notifyParamList)
+            g_helpBattleNotifyTimeDict[dogzID] = curTime
     return
 
 

--
Gitblit v1.8.0