From bbca9a1da57c089959d1cf7384813d245290ff23 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 21 一月 2019 14:04:54 +0800
Subject: [PATCH] 5924 【后端】【1.5.100】诛仙Boss功能(初版)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py |  664 +++++++++++++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py            |   42 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py                                    |    6 
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py                                                     |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py                                |   98 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py                                     |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py                           |    7 
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py                                        |    2 
 ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py                                                     |    6 
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py                                                     |   98 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py              |   12 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py    |   19 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py                      |    7 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_ZhuXianBossAward.py   |   48 ++
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerZhuXianBoss.py                                            |   45 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                                  |   29 +
 ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py                                                            |    5 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py                                  |    2 
 PySysDB/PySysDBPY.h                                                                                                   |   11 
 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py                                                         |    6 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py                           |    9 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                       |   19 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py                     |    4 
 23 files changed, 1,084 insertions(+), 59 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 69f7c3a..10cdeba 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1579,4 +1579,15 @@
 	DWORD		TotalTimes;	//可完成的总次数,0表示不限次数
 	WORD		SingleTimes;	//单次领奖需要的次数
 	list		Reward;	//奖励物品
+};
+
+//诛仙BOSS表
+
+struct tagZhuXianBoss
+{
+	DWORD		NPCID;	//ID
+	BYTE		_LineID;
+	WORD		KillTime;	//击杀总时间秒
+	WORD		RealmLV;	//需要境界
+	DWORD		ZhuXianScore;	//需要诛仙总评分
 };
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
index 420e17f..5615d04 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
@@ -532,6 +532,7 @@
                                 ShareDefine.Def_UniversalGameRecType_FamilyRedPacketGrabRecord:10000000,   #仙盟红包已抢信息记录
                                 ShareDefine.Def_UniversalGameRecType_DujieHelpAllRecord:500,   #渡劫副本护法总记录
                                 ShareDefine.Def_UniversalGameRecType_DujieHelpRecord:10000,   #渡劫副本护法详细记录
+                                ShareDefine.Def_UniversalGameRecType_ZhuXianBossRecord:100,   #诛仙BOSS结算记录
                               }
 #---------------------------------------------------------------------
 #比较标识
@@ -671,6 +672,8 @@
 Def_FBMapID_FamilyInvade = 31170
 #封魔坛
 Def_FBMapID_SealDemon = 52010
+#诛仙BOSS
+Def_FBMapID_ZhuXianBoss = 31380
 #仙魔之争
 Def_FBMapID_XMZZ = 31010
 #仙盟boss副本
@@ -686,6 +689,8 @@
 #跨服蓬莱仙境
 Def_FBMapID_CrossPenglai = 32020
 
+#需要刷世界BOSS的副本
+WorldBossFBMapIDList = [Def_FBMapID_SealDemon, Def_FBMapID_ZhuXianBoss]
 #跨服地图
 Def_CrossMapIDList = [Def_FBMapID_CrossRealmPK, Def_FBMapID_CrossPenglai]
 #跨服对应分区配置表名
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index af22c9c..6612111 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -196,40 +196,60 @@
 # A0 07 副本地图功能线路人数 #tagGCFBLinePlayerCnt
 
 class  tagGCFBLineInfo(Structure):
-    _pack_ = 1
-    _fields_ = [
-                  ("FBLineID", c_ubyte),    # 功能线路ID
-                  ("PlayerCnt", c_ushort),    # 线路当前玩家数
-                  ]
+    FBLineID = 0    #(BYTE FBLineID)// 功能线路ID
+    PlayerCnt = 0    #(WORD PlayerCnt)// 线路当前玩家数
+    ExtraStrLen = 0    #(WORD ExtraStrLen)// 长度
+    ExtraStr = ""    #(String ExtraStr)// 额外信息
+    data = None
 
     def __init__(self):
         self.Clear()
         return
 
-    def ReadData(self, stringData, _pos=0, _len=0):
+    def ReadData(self, _lpData, _pos=0, _Len=0):
         self.Clear()
-        memmove(addressof(self), stringData[_pos:], self.GetLength())
-        return _pos + self.GetLength()
+        self.FBLineID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.PlayerCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.ExtraStrLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.ExtraStr,_pos = CommFunc.ReadString(_lpData, _pos,self.ExtraStrLen)
+        return _pos
 
     def Clear(self):
         self.FBLineID = 0
         self.PlayerCnt = 0
+        self.ExtraStrLen = 0
+        self.ExtraStr = ""
         return
 
     def GetLength(self):
-        return sizeof(tagGCFBLineInfo)
+        length = 0
+        length += 1
+        length += 2
+        length += 2
+        length += len(self.ExtraStr)
+
+        return length
 
     def GetBuffer(self):
-        return string_at(addressof(self), self.GetLength())
+        data = ''
+        data = CommFunc.WriteBYTE(data, self.FBLineID)
+        data = CommFunc.WriteWORD(data, self.PlayerCnt)
+        data = CommFunc.WriteWORD(data, self.ExtraStrLen)
+        data = CommFunc.WriteString(data, self.ExtraStrLen, self.ExtraStr)
+        return data
 
     def OutputString(self):
-        DumpString = '''// A0 07 副本地图功能线路人数 //tagGCFBLinePlayerCnt:
+        DumpString = '''
                                 FBLineID:%d,
-                                PlayerCnt:%d
+                                PlayerCnt:%d,
+                                ExtraStrLen:%d,
+                                ExtraStr:%s
                                 '''\
                                 %(
                                 self.FBLineID,
-                                self.PlayerCnt
+                                self.PlayerCnt,
+                                self.ExtraStrLen,
+                                self.ExtraStr
                                 )
         return DumpString
 
@@ -27341,6 +27361,58 @@
 
 
 #------------------------------------------------------
+# B2 12 诛仙BOSS协助次数 #tagMCZhuXianBossCnt
+
+class  tagMCZhuXianBossCnt(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("Cnt", c_ubyte),    # 剩余可协助次数
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x12
+        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 = 0xB2
+        self.SubCmd = 0x12
+        self.Cnt = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagMCZhuXianBossCnt)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 12 诛仙BOSS协助次数 //tagMCZhuXianBossCnt:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                Cnt:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.Cnt
+                                )
+        return DumpString
+
+
+m_NAtagMCZhuXianBossCnt=tagMCZhuXianBossCnt()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhuXianBossCnt.Cmd,m_NAtagMCZhuXianBossCnt.SubCmd))] = m_NAtagMCZhuXianBossCnt
+
+
+#------------------------------------------------------
 # B4 11 新增恶意攻击玩家 #tagMCAddMaliciousAtkPlayer
 
 class  tagMCAddMaliciousAtkPlayer(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index b519da0..0ce2b8d 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -485,7 +485,7 @@
         if not isAlive:
             continue
         mapID = ipyData.GetMapID()
-        if mapID != ChConfig.Def_FBMapID_SealDemon:
+        if mapID not in ChConfig.WorldBossFBMapIDList:
             GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID, 1)
     return
 
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
index 8b9efa3..895ab02 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -899,11 +899,13 @@
     fblinePack = ChPyNetSendPack.tagGCFBLinePlayerCnt()
     fblinePack.MapID = tagMapID
     fblinePack.FBLineInfoList = []
-    for lineID, playerCnt in fbLinePlayerCntDict.items():
+    for lineID, infoList in fbLinePlayerCntDict.items():
         mapLineState = ChPyNetSendPack.tagGCFBLineInfo()
         mapLineState.Clear()
         mapLineState.FBLineID = lineID
-        mapLineState.PlayerCnt = playerCnt
+        mapLineState.PlayerCnt = infoList[0] if infoList else 0
+        mapLineState.ExtraStr = infoList[1] if len(infoList) > 1 else ''
+        mapLineState.ExtraStrLen = len(mapLineState.ExtraStr)
         fblinePack.FBLineInfoList.append(mapLineState)
     
     fblinePack.Count = len(fblinePack.FBLineInfoList)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
index 0260e11..9436b24 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFB.py
@@ -103,7 +103,7 @@
         return
     
     #封魔坛副本判断里面的BOSS是否到了刷新时间
-    if tagMapID == ChConfig.Def_FBMapID_SealDemon:
+    if tagMapID in ChConfig.WorldBossFBMapIDList:
         bossID = mapInfo[2]
         if not GameWorldBoss.GetBossIsAliveOrCanReborn(bossID):
             return
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerZhuXianBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerZhuXianBoss.py
new file mode 100644
index 0000000..2dc3b91
--- /dev/null
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerZhuXianBoss.py
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+#
+##@package PlayerZhuXianBoss
+#
+# @todo:诛仙BOSS
+# @author xdh
+# @date 2019-01-19
+# @version 1.0
+#
+#
+# 详细描述: 诛仙BOSS
+#
+#---------------------------------------------------------------------
+"""Version = 2019-01-19 17:00"""
+
+import GameWorld
+import PlayerUniversalGameRec
+import ShareDefine
+import PlayerControl
+
+RecType = ShareDefine.Def_UniversalGameRecType_ZhuXianBossRecord
+
+## 玩家登录
+#  @param None
+#  @return None
+def OnPlayerLogin(curPlayer):
+    universalRecMgr = GameWorld.GetUniversalRecMgr()
+    recTypeListData = universalRecMgr.GetTypeList(RecType)
+    for index in xrange(recTypeListData.Count()):
+        recData = recTypeListData.At(index)
+        playerID = recData.GetValue1()
+        if playerID == curPlayer.GetID():
+            lineID = recData.GetValue2()
+            recTypeListData.Delete(index)
+            result = str(lineID)
+            curPlayer.MapServer_QueryPlayerResult(0, 0, "ZhuXianBossAward", result, len(result))
+            return
+    
+    
+    return
+
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 34f902f..4f104c8 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -878,6 +878,7 @@
 GameFuncID_LittleHelper = 146   # 小助手
 GameFuncID_TJG = 147            # 脱机挂
 GameFuncID_SuperGift = 150      # 超值礼包
+GameFuncID_ZhuXianBoss = 163    # 诛仙BOSS
 # 以下为暂时无用的
 GameFuncID_Truck = 33           # 运镖
 GameFuncID_RunDaily = 34        # 日常跑环
@@ -962,7 +963,7 @@
                                 Def_UniversalGameRecType_StoreServerCntRecord,  #商店全服购买记录 8,
                                 Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
                                 Def_UniversalGameRecType_FBHelpBattleRecord, #助战未同步记录10
-                                Def_UniversalGameRecType_11,
+                                Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
                                 Def_UniversalGameRecType_12,
                                 Def_UniversalGameRecType_13,
                                 Def_UniversalGameRecType_Reward,    # 通用奖励表(TopBar)14
@@ -1521,7 +1522,8 @@
 DailyActionID_IceLode, # 冰晶矿脉
 DailyActionID_HelpBattleCheckIn, # 助战登记  20
 DailyActionID_CrossReamPK, # 跨服PK  21
-) = range(1, 21 + 1)
+DailyActionID_ZhuXianBoss, # 诛仙BOSS  22
+) = range(1, 22 + 1)
 
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 6695f98..662e63a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1782,7 +1782,8 @@
 Def_FBMapID_SealDemon = 52010
 #单人封魔坛
 Def_FBMapID_SealDemonEx = 52020
-
+#诛仙BOSS
+Def_FBMapID_ZhuXianBoss = 31380
 #仙魔之争
 Def_FBMapID_XMZZ = 31010
 #神兽副本
@@ -1793,6 +1794,7 @@
 Def_FBMapID_CrossRealmPK = 32010
 #跨服蓬莱仙境
 Def_FBMapID_CrossPenglai = 32020
+
 
 #注册上传跨服服务器数据后直接进入跨服服务器的地图
 RegisterEnter_CrossServerMapIDList = [Def_FBMapID_CrossPenglai]
@@ -1805,7 +1807,7 @@
 #副本关闭时未拾取的物品邮件发放给玩家
 #这里只有需要的副本才配置,不做默认逻辑,防止某些副本实际不能给导致刷物品,如麒麟之府
 Def_SendUnPickItemMailMapIDList = [Def_FBMapID_IceLode, Def_FBMapID_PersonalBoss, Def_FBMapID_MunekadoTrial, 
-                                   Def_FBMapID_SealDemon, Def_FBMapID_SealDemonEx]
+                                   Def_FBMapID_SealDemon, Def_FBMapID_SealDemonEx, Def_FBMapID_ZhuXianBoss]
 
 #金钱不掉物品直接给玩家的地图
 Def_GiveMoneyMapIDList = []
@@ -1819,7 +1821,7 @@
 Def_MapID_LineIDToPropertyID = [Def_FBMapID_ElderBattlefield]
                       
 # 进入副本需要发送到GameServer的地图
-Def_MapID_SendToGameServer = [Def_FBMapID_FamilyInvade, Def_FBMapID_FamilyBossMap, Def_FBMapID_SealDemon, Def_FBMapID_FamilyWar] + Def_MapID_LineIDToPropertyID
+Def_MapID_SendToGameServer = [Def_FBMapID_FamilyInvade, Def_FBMapID_FamilyBossMap, Def_FBMapID_SealDemon, Def_FBMapID_FamilyWar, Def_FBMapID_ZhuXianBoss] + Def_MapID_LineIDToPropertyID
 
 ## 进入副本需要根据请求的功能线路处理的地图, hxp-改了进入模式,暂不需要了 180320
 #Def_MapID_ReqFBFuncLine = [Def_FBMapID_KirinHome, Def_FBMapID_BZZD, Def_FBMapID_SealDemonEx,
@@ -1827,10 +1829,10 @@
 #                            + Def_FBMapID_ClearDevil
 
 # 刷新标识点在无玩家的情况下也需要刷新的地图
-Def_NoPlayerNeedProcessRefreshPointMap = [Def_FBMapID_SealDemon, Def_FBMapID_GodArea, Def_FBMapID_BossHome, Def_FBMapID_GatherSoul]
+Def_NoPlayerNeedProcessRefreshPointMap = [Def_FBMapID_SealDemon, Def_FBMapID_GodArea, Def_FBMapID_BossHome, Def_FBMapID_GatherSoul, Def_FBMapID_ZhuXianBoss]
 
 # 可重复进的副本
-Def_NoLimitEnterCntMap = [Def_FBMapID_FamilyParty, Def_FBMapID_FamilyWar, Def_FBMapID_FamilyInvade, Def_FBMapID_ElderBattlefield]
+Def_NoLimitEnterCntMap = [Def_FBMapID_FamilyParty, Def_FBMapID_FamilyWar, Def_FBMapID_FamilyInvade, Def_FBMapID_ElderBattlefield, Def_FBMapID_ZhuXianBoss]
 
 # 无玩家时不自动关闭的自伸缩副本
 Def_NoPlayerNotCloseAutoSizeMap = [Def_FBMapID_FamilyInvade, Def_FBMapID_FamilyBossMap, Def_FBMapID_GatherSoul]
@@ -1890,6 +1892,7 @@
                 'XMZZ':[Def_FBMapID_XMZZ], #仙魔之争
                 'CrossRealmPK':[Def_FBMapID_CrossRealmPK], #跨服竞技场
                 'GatherSoul':[Def_FBMapID_GatherSoul],#聚魂副本
+                'ZhuXianBoss':[Def_FBMapID_ZhuXianBoss],#诛仙BOSS
                 }
 
 #特殊副本ID, 由系统分配, 进入时候不验证IsMapCopyFull
@@ -3725,6 +3728,9 @@
 Def_PDict_LoginAwardID = "LoginAwardID"  # 玩家身上的BOSS复活活动ID,唯一标识,取活动开始日期time值
 Def_PDict_LoginAwardCurTimes = "LoginAwardCurTimes_%s_%s" #当前完成次数 参数(第X天,模板ID)
 Def_PDict_LoginAwardGotTimes = "LoginAwardGotTimes_%s_%s" #当前已领次数 参数(第X天,模板ID)
+
+#诛仙BOSS
+Def_PDict_ZhuXianBossHelpCnt = "ZhuXianBossHelpCnt"  # 协助次数
 #-------------------------------------------------------------------------------
 #类型 Def_PDictType_OnlinePrize
 Def_PDict1_OnlinePrizeCnt = "OnlinePrizeCnt"  # 新手在线已领取奖励次数
@@ -4985,7 +4991,8 @@
 VIPPrivilege_32,    #32 封魔坛自动挑战
 VIPPrivilege_XianyuanCoinUpperAdd,    #33 仙缘币上限加成
 VIPPrivilege_XianyuanCoinAddPer,    #34 仙缘币获得倍率加成(万分比)
-) = range(1, 35)
+VIPPrivilege_35,    #35 诛仙BOSS购买次数 - 副本总表统一处理
+) = range(1, 36)
 
 
 (
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index af22c9c..6612111 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -196,40 +196,60 @@
 # A0 07 副本地图功能线路人数 #tagGCFBLinePlayerCnt
 
 class  tagGCFBLineInfo(Structure):
-    _pack_ = 1
-    _fields_ = [
-                  ("FBLineID", c_ubyte),    # 功能线路ID
-                  ("PlayerCnt", c_ushort),    # 线路当前玩家数
-                  ]
+    FBLineID = 0    #(BYTE FBLineID)// 功能线路ID
+    PlayerCnt = 0    #(WORD PlayerCnt)// 线路当前玩家数
+    ExtraStrLen = 0    #(WORD ExtraStrLen)// 长度
+    ExtraStr = ""    #(String ExtraStr)// 额外信息
+    data = None
 
     def __init__(self):
         self.Clear()
         return
 
-    def ReadData(self, stringData, _pos=0, _len=0):
+    def ReadData(self, _lpData, _pos=0, _Len=0):
         self.Clear()
-        memmove(addressof(self), stringData[_pos:], self.GetLength())
-        return _pos + self.GetLength()
+        self.FBLineID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.PlayerCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.ExtraStrLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.ExtraStr,_pos = CommFunc.ReadString(_lpData, _pos,self.ExtraStrLen)
+        return _pos
 
     def Clear(self):
         self.FBLineID = 0
         self.PlayerCnt = 0
+        self.ExtraStrLen = 0
+        self.ExtraStr = ""
         return
 
     def GetLength(self):
-        return sizeof(tagGCFBLineInfo)
+        length = 0
+        length += 1
+        length += 2
+        length += 2
+        length += len(self.ExtraStr)
+
+        return length
 
     def GetBuffer(self):
-        return string_at(addressof(self), self.GetLength())
+        data = ''
+        data = CommFunc.WriteBYTE(data, self.FBLineID)
+        data = CommFunc.WriteWORD(data, self.PlayerCnt)
+        data = CommFunc.WriteWORD(data, self.ExtraStrLen)
+        data = CommFunc.WriteString(data, self.ExtraStrLen, self.ExtraStr)
+        return data
 
     def OutputString(self):
-        DumpString = '''// A0 07 副本地图功能线路人数 //tagGCFBLinePlayerCnt:
+        DumpString = '''
                                 FBLineID:%d,
-                                PlayerCnt:%d
+                                PlayerCnt:%d,
+                                ExtraStrLen:%d,
+                                ExtraStr:%s
                                 '''\
                                 %(
                                 self.FBLineID,
-                                self.PlayerCnt
+                                self.PlayerCnt,
+                                self.ExtraStrLen,
+                                self.ExtraStr
                                 )
         return DumpString
 
@@ -27341,6 +27361,58 @@
 
 
 #------------------------------------------------------
+# B2 12 诛仙BOSS协助次数 #tagMCZhuXianBossCnt
+
+class  tagMCZhuXianBossCnt(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("Cnt", c_ubyte),    # 剩余可协助次数
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x12
+        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 = 0xB2
+        self.SubCmd = 0x12
+        self.Cnt = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagMCZhuXianBossCnt)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 12 诛仙BOSS协助次数 //tagMCZhuXianBossCnt:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                Cnt:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.Cnt
+                                )
+        return DumpString
+
+
+m_NAtagMCZhuXianBossCnt=tagMCZhuXianBossCnt()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhuXianBossCnt.Cmd,m_NAtagMCZhuXianBossCnt.SubCmd))] = m_NAtagMCZhuXianBossCnt
+
+
+#------------------------------------------------------
 # B4 11 新增恶意攻击玩家 #tagMCAddMaliciousAtkPlayer
 
 class  tagMCAddMaliciousAtkPlayer(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py
index b876c90..81fe457 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/KillScreenNPC.py
@@ -25,6 +25,7 @@
 import GameObj
 import NPCCommon
 import GameLogic_SealDemon
+import GameLogic_ZhuXianBoss
 
 ## GM命令执行入口
 #  @param curPlayer 当前玩家
@@ -38,6 +39,12 @@
         lineID = gameWorld.GetPropertyID() - 1
         gameWorld.SetGameWorldDict(GameLogic_SealDemon.FBDict_RemainHP % lineID, 1)
         return
+    if curPlayer.GetMapID() == ChConfig.Def_FBMapID_ZhuXianBoss:
+        #诛仙BOSS击杀怪
+        gameWorld = GameWorld.GetGameWorld()
+        lineID = gameWorld.GetPropertyID() - 1
+        gameWorld.SetGameWorldDict(GameLogic_ZhuXianBoss.FBDict_RemainHP % lineID, 1)
+        return
     
     isMapAllNPC = 0
     if len(playerList) > 0:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
index 9b8a408..03a013c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -31,7 +31,7 @@
 import PlayerFamily
 import PlayerActivity
 import PlayerSuccess
-import PlayerMagicWeapon
+import GameFuncComm
 import PyGameData
 import PlayerVip
 import GameObj
@@ -1694,6 +1694,13 @@
             newEnterCnt = max(0, dayTimes - (maxCnt - enterCnt))
             PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, newEnterCnt)
             GameWorld.DebugLog("        特殊副本已进入次数更新: newEnterCnt=%s" % newEnterCnt)
+        elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+            if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_ZhuXianBoss):
+                curCnt = min(maxCnt - enterCnt + IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg'), IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2))
+                if curCnt > dayTimes:
+                    PlayerControl.NomalDictSetProperty(curPlayer, itemAddCntKey, curCnt - dayTimes)
+                elif curCnt < dayTimes:
+                    PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, dayTimes - curCnt)
             
         mapIDInfo.append(mapID)
         
@@ -1759,6 +1766,9 @@
     if mapID == ChConfig.Def_FBMapID_SealDemon and maxDayTimes and maxCnt - enterCnt >= maxDayTimes:
         GameWorld.DebugLog('当前次数已满,无需购买。。')
         return
+    if mapID == ChConfig.Def_FBMapID_ZhuXianBoss and maxCnt - enterCnt >= IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2):
+        return
+    
     if hasBuyCnt >= canBuyCnt:
         GameWorld.DebugLog("购买次数已经用完mapID=%s"%mapID)
         return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py
new file mode 100644
index 0000000..c436a58
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py
@@ -0,0 +1,664 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package GameWorldLogic.FBProcess.GameLogic_ZhuXianBoss
+#
+# @todo:诛仙boss
+# @author xdh
+# @date 2019-01-18
+# @version 1.0
+#
+# 详细描述: 诛仙boss
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-01-18 14:30"""
+#-------------------------------------------------------------------------------
+
+import FBCommon
+import GameWorld
+import IPY_GameWorld
+import GameWorldProcess
+import IpyGameDataPY
+import ChConfig
+import PyGameData
+import PlayerControl
+import NPCCommon
+import ItemCommon
+import ChPyNetSendPack
+import ShareDefine
+import EventShell
+import NPCCustomRefresh
+import PlayerSuccess
+import PlayerActivity
+import NetPackCommon
+import ItemControler
+import PlayerMagicWeapon
+import PlayerBossReborn
+import PlayerFairyCeremony
+import PlayerWeekParty
+import EventReport
+
+FBDict_StartTick = 'FBDict_StartTick%s' #开始时间
+FBDict_Speed = 'FBDict_Speed%s' #掉血速度 /s
+FBDict_RemainHP = 'FBDict_RemainHP%s' #剩余时间
+FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV'   # 鼓舞等级
+FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
+FBDict_IsReduceing = 'FBDict_IsReduceing%s' #是否掉血中
+FBPlayerDict_Rank = "FBPlayerDict_Rank" # 玩家排名
+FBDict_BossTotalHP = 'FBDict_BossTotalHP%s' #BOSS血量
+
+g_npcHurtDict = {}
+
+
+def OnFBPlayerOnLogin(curPlayer):
+    NotifyZXHelpCnt(curPlayer)
+    return
+
+def OnFBPlayerOnDay(curPlayer):
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhuXianBossHelpCnt, IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 3))
+    NotifyZXHelpCnt(curPlayer)
+    return
+
+def NotifyZXHelpCnt(curPlayer):
+    ##通知协助次数
+    packData = ChPyNetSendPack.tagMCZhuXianBossCnt()
+    packData.Cnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhuXianBossHelpCnt)
+    NetPackCommon.SendFakePack(curPlayer, packData)
+    return
+
+## 是否能够通过活动查询进入
+#  @param curPlayer 玩家实例
+#  @param mapID 地图ID
+#  @param lineID 线路id
+#  @param tick 时间戳
+#  @return 布尔值
+def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
+    #境界要求、诛仙总评分、玩家等级、归属次数不为0或有同盟玩家在副本里协助次数不为0
+    ipyData = IpyGameDataPY.GetIpyGameData('ZhuXianBoss', lineID)
+    if not ipyData:
+        return
+    
+    if curPlayer.GetOfficialRank() < ipyData.GetRealmLV():
+        return
+    #诛仙总评分
+    
+    
+    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianBoss)
+    if enterCnt >= FBCommon.GetEnterFBMaxCnt:
+        if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhuXianBossHelpCnt):
+            return
+        if not curPlayer.GetFamilyID():
+            GameWorld.DebugLog("    有归属次数为但没有进仙盟!", curPlayer.GetPlayerID())
+            return
+    return True
+
+def GetHasSameFamilyMerber(curFamilyID, playerManager):
+    ##副本里是否有同盟成员
+    GameWorld.Log('检查副本里是否有同盟成员 curFamilyID=%s'%curFamilyID)
+    if not curFamilyID:
+        return
+    for index in range(0 , playerManager.GetPlayerCount()):
+        player = playerManager.GetPlayerByIndex(index)
+        if not player.GetPlayerID():
+            continue
+        if player.GetFamilyID() == curFamilyID:
+            return True
+    return
+
+##副本玩家进入点
+# @param curPlayer 玩家实例
+# @param mapID 地图ID
+# @param lineId 分线ID
+# @param ipyEnterPosInfo 功能线路IPY配置坐标信息
+# @param tick 时间戳
+# @return posX, posY, 随机半径(可选)
+def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
+    return ipyEnterPosInfo
+
+### 查询地图是否开启
+##  @param tick 时间戳
+##  @return 布尔值
+#def OnCanOpen(tick):
+#    return True
+
+##查询是否可以进入地图
+# @param ask:请求结构体(IPY_BMChangeMapAsk)
+# @param tick:时间戳
+# @return IPY_GameWorld.cme 枚举
+def OnChangeMapAsk(ask, tick):
+    return IPY_GameWorld.cmeAccept
+
+##开启副本
+# @param tick 时间戳
+# @return 返回值无意义
+# @remarks 开启副本
+def OnOpenFB(tick):
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    bossID = CurFBLineBOSSID(lineID)
+    if not bossID:
+        return
+    key = ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID
+    GameWorld.GetGameWorld().SetGameWorldDict(key, 1)
+    GameWorld.DebugLog('    刷BOSSbossID=%s' % bossID)
+    ipyData = IpyGameDataPY.GetIpyGameData('ZhuXianBoss', lineID)
+    GameWorld.GetGameWorld().SetGameWorldDict(FBDict_BossTotalHP%lineID, ipyData.GetKillTime() * 1000)
+    return
+
+## 进副本
+#  @param curPlayer
+#  @param tick
+#  @return None
+def DoEnterFB(curPlayer, tick):
+    playerID = curPlayer.GetPlayerID()
+    mapID = GameWorld.GetMap().GetMapID()
+   
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1    
+    
+    playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()
+    GameWorld.DebugLog("DoEnterFB...playerCnt=%s,lineID=%s" % (playerCnt, lineID), playerID)
+    
+    if lineID < 0:
+        PlayerControl.PlayerLeaveFB(curPlayer)
+        return
+    hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
+    if not hadDelTicket:
+        FBCommon.SetHadDelTicket(curPlayer)
+        PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
+#        if playerCnt == 1:
+#            posX, posY = IpyGameDataPY.GetFuncEvalCfg('ZhuXianBossFirstPos')
+#            GameWorld.ResetPlayerPos(curPlayer, posX, posY)
+        EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss, 0, ChConfig.CME_Log_Start)
+
+        UpdateHurtInfo(curPlayer, 0, True)
+    
+    UpdateHPReduceSpeed(tick)        
+    gameFB = GameWorld.GetGameFB()
+    # 上鼓舞buff
+    encourageLV = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EncourageLV)
+    if encourageLV > 0:
+        FBCommon.AddFbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, tick)
+    else:
+        FBCommon.SendFBEncourageInfo(curPlayer, encourageLV)
+        
+    #DoFBHelp(curPlayer, tick)
+    return
+
+##关闭副本
+# @param tick 时间戳
+# @return 无意义
+# @remarks 
+def OnCloseFB(tick):
+    gameWorld = GameWorld.GetGameWorld()
+    lineID = gameWorld.GetPropertyID() - 1
+    gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, 0)
+    gameWorld.SetGameWorldDict(FBDict_Speed % lineID, 0)
+    gameWorld.SetGameWorldDict(FBDict_RemainHP % lineID, 0)
+    
+    gameWorld.SetPropertyID(0)
+    return
+
+##玩家退出副本
+# @param curPlayer 玩家实例
+# @param tick 时间戳
+# @return 无意义
+def DoExitFB(curPlayer, tick):
+    global g_npcHurtDict
+    gameWorld = GameWorld.GetGameWorld()
+    # 清除鼓舞buff
+    FBCommon.ClearEncourageBuff(curPlayer, tick)
+    #最后一人
+    if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
+        lineID = gameWorld.GetPropertyID() - 1
+        PyGameData.g_ZhuXianBossPlayerHurtDict[lineID] = {}
+        g_npcHurtDict[lineID] = {}
+        gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, 0)
+        GameWorld.GetGameFB().ClearGameFBDict()
+        GameWorldProcess.CloseFB(tick)
+        return
+        
+    UpdateHPReduceSpeed(tick, True)
+    
+    return
+
+##玩家主动离开副本.
+# @param curPlayer 玩家实例
+# @param tick 时间戳
+# @return 返回值无意义
+def DoPlayerLeaveFB(curPlayer, tick):
+    FBCommon.SetHadDelTicket(curPlayer, 0)
+    #主动退出的去掉排行榜信息
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    playerHurtDict = PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {})
+    playerHurtDict.pop(curPlayer.GetPlayerID(), 0)
+    PyGameData.g_ZhuXianBossPlayerHurtDict[lineID] = playerHurtDict
+    if not playerHurtDict: #榜上没人,停止掉血
+        StopReduceHP(lineID, tick)
+    return
+
+##玩家切换地图
+def DoPlayerChangeMapLogic(curPlayer):
+    FBCommon.SetHadDelTicket(curPlayer, 0)
+    return
+
+## 是否副本复活
+#  @param None
+#  @return 是否副本复活
+def OnPlayerReborn():
+    return True
+
+
+## 获得副本帮助信息
+#  @param curPlayer 当前玩家(被通知对象)
+#  @param tick 当前时间
+#  @return None
+def DoFBHelp(curPlayer, tick):
+    #伤害排行信息
+    hurtInfo = []
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    playerHurtList = PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {}).items()
+    npcHurtList = g_npcHurtDict.get(lineID, {}).items()
+    
+    syncHurtList = (playerHurtList + npcHurtList)[:5]
+    syncHurtList.sort(key=lambda asd:asd[1][1], reverse=True)
+        
+    for i, info in enumerate(syncHurtList, 1):
+        playerName, hurt = info[1][:2]
+        hurtDict = {}
+        hurtDict["rank"] = i
+        hurtDict["playerName"] = playerName
+        hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
+        hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
+        hurtInfo.append(hurtDict)
+    myRank = __GetSelfHurtRank(curPlayer)
+    if myRank and myRank > 5:
+        hurtDict = {}
+        hurtDict["rank"] = myRank
+        info = playerHurtList[myRank - 1]
+        playerName, hurt = info[1][:2]
+        hurtDict["playerName"] = playerName
+        hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
+        hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
+        hurtInfo.append(hurtDict)
+    
+    curSpeed = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_Speed % lineID) 
+    isReduceing = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_IsReduceing % lineID) 
+    remainHP = GetBossRemainHP(lineID, tick)
+    totalHP = __GetBossTotalHP(lineID)
+    hpReduceSpeed = curSpeed * 10000 / totalHP if totalHP else 0
+    remainHPPer = min(100, remainHP * 100 / totalHP) if totalHP else 0
+    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed, 'remainHPPer':remainHPPer, 'isReduceing':isReduceing}
+    GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
+    FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
+    return
+
+def __GetSelfHurtRank(curPlayer):
+    #获取自己的排名
+    playerName = curPlayer.GetName()
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    playerHurtList = __GetSortHurtList(lineID)
+    myRank = 0
+    for i, info in enumerate(playerHurtList):
+        if playerName == info[1][0]:
+            myRank = i + 1
+            break
+    return myRank
+
+## 副本行为
+#  @param curPlayer 玩家
+#  @param actionType 行为类型
+#  @param actionInfo 行为信息
+#  @param tick 当前时间
+#  @return None
+def DoFBAction(curPlayer, actionType, actionInfo, tick):
+    if actionType == 0:
+        FBCommon.FbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, actionInfo, tick)
+    return
+
+
+
+## 玩家对NPC造成伤害
+#  @param curPlayer 当前玩家
+#  @param curNPC 
+#  @param hurtHP 
+#  @return None
+def DoFB_Player_HurtNPC(curPlayer, curNPC, hurtHP):
+    UpdateHurtInfo(curPlayer, hurtHP)
+    return
+#
+def UpdateHurtInfo(curPlayer, hurtHP, isAdd=False):
+    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianBoss)
+    if enterCnt >= FBCommon.GetEnterFBMaxCnt:
+        #没归属的不进伤害榜
+        return
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    
+    playerName = curPlayer.GetName() 
+    playerID = curPlayer.GetPlayerID()
+    familyID = curPlayer.GetFamilyID()
+    playerHurtDict = PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {})
+    if playerID not in playerHurtDict:
+        if not isAdd:
+            return
+        playerHurtDict[playerID] = [playerName, hurtHP, familyID]
+    else:
+        playerHurtDict[playerID][1] += hurtHP
+    PyGameData.g_ZhuXianBossPlayerHurtDict[lineID] = playerHurtDict
+    #有人上榜开始掉血
+    StartReduceHP(lineID, GameWorld.GetGameWorld().GetTick())
+    return
+
+##---副本总逻辑计时器---
+# @param tick:时间戳
+# @return 无意义
+# @remarks 副本总逻辑计时器
+def OnProcess(tick):
+    gameFB = GameWorld.GetGameFB()
+    overTick = gameFB.GetGameFBDictByKey(FBDict_IsOver)
+    # 结算20秒后强制关闭副本, 防止玩家不捡东西导致不结算,强关后地板上的东西会邮件发放给玩家
+    if overTick and tick - overTick >= ChConfig.Def_FBPickupItemTime:
+        GameWorld.Log("强制踢出玩家关闭副本: overTick=%s,tick=%s" % (overTick, tick))
+        FBCommon.DoLogic_FBKickAllPlayer()
+        return
+    mapID = GameWorld.GetMap().GetMapID()
+   
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    if lineID <0:
+        return
+    gameWorld = GameWorld.GetGameWorld()
+    startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
+    if not startTick:
+        return
+    FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
+    __CheckBossHP(tick)
+    
+    
+    return
+
+
+def __GetSortHurtList(lineID):
+    playerHurtDict = PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {})
+    playerHurtList = sorted(playerHurtDict.iteritems(), key=lambda asd:asd[1][1], reverse=True)
+    return playerHurtList
+
+def GetFirstOwnerName(lineID):
+    ##获取归属者名字
+    playerHurtList = __GetSortHurtList(lineID)
+    if not playerHurtList:
+        return ''
+    return playerHurtList[0][1][0]
+
+def __DoLogicZhuXianBossOver(isPass, tick, dropPosX, dropPosY):
+    #结算
+    gameFB = GameWorld.GetGameFB()
+    mapID = GameWorld.GetMap().GetMapID()
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    leaveTick = FBCommon.GetFBLineStepTime(mapID, lineID) * 1000
+    playerHurtList = __GetSortHurtList(lineID)
+    if not playerHurtList:
+        GameWorld.Log(' __DoLogicZhuXianBossOver, 伤害榜上没有人!!lineID=%s'%lineID)
+        return
+    firsthurtInfo = playerHurtList[0]
+    firstPlayerID = firsthurtInfo[0]
+    firstPlayerFamilyID = firsthurtInfo[1][2]
+    playerManager = GameWorld.GetMapCopyPlayerManager()#GameWorld.GetPlayerManager()
+    firstPlayer = playerManager.FindPlayerByID(firstPlayerID)
+    if firstPlayer:
+        #gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_Rank, rank)
+        if not dropPosX or not dropPosY:
+            dropPosX, dropPosY = firstPlayer.GetPosX(), firstPlayer.GetPosY()
+        prizeItemList = GiveZhuXianBossAward(firstPlayer, lineID, dropItemMapInfo=[dropPosX, dropPosY, True])
+        if not prizeItemList:
+            # 没有掉落时直接通知结算,防止卡副本
+            firstPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
+            overDict = {FBCommon.Over_rank:1, FBCommon.Over_itemInfo:prizeItemList}
+            FBCommon.NotifyFBOver(firstPlayer, ChConfig.Def_FBMapID_ZhuXianBoss, lineID, isPass, overDict)
+        else:
+            firstPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, ChConfig.Def_FBPickupItemTime, True)
+    else:
+        leaveServerTick = PlayerControl.GetPlayerLeaveServerTick(firstPlayerID)
+        if leaveServerTick and tick - leaveServerTick < ChConfig.Def_PlayerOfflineProtectTime:
+            #离线超过3分钟的不给奖励
+            msgStr = str([ShareDefine.Def_UniversalGameRecType_ZhuXianBossRecord, [firstPlayerID, lineID], [], 0, 0])
+            playerManager.GameServer_QueryPlayerResult(0, 0, 0, 'AddUniversalGameRec', msgStr, len(msgStr))
+            
+    helpItemList = FBCommon.GetFBLineReward(mapID, lineID)
+    if helpItemList: #同盟协助奖励
+        needSpace = len(helpItemList)
+        jsonItemList = FBCommon.GetJsonItemList(helpItemList)
+        for index in range(0 , playerManager.GetPlayerCount()):
+            curPlayer = playerManager.GetPlayerByIndex(index)
+            curPlayerID = curPlayer.GetPlayerID()
+            if not curPlayerID:
+                continue
+            if curPlayerID == firstPlayerID:
+                continue
+            if curPlayer.GetFamilyID() != firstPlayerFamilyID:
+                continue
+            remainCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhuXianBossHelpCnt)
+            if not remainCnt:
+                continue
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhuXianBossHelpCnt, remainCnt-1)
+            NotifyZXHelpCnt(curPlayer)
+            curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
+            overDict = {FBCommon.Over_rank:0, FBCommon.Over_itemInfo:jsonItemList}
+            FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss, lineID, isPass, overDict)
+            
+            packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
+            if needSpace > packSpace:
+                PlayerControl.SendMailByKey('ZXBossHelperReward', [curPlayerID], helpItemList)
+            else:
+                for itemID, itemCount, isBind in helpItemList:
+                    ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
+    
+    return
+
+def GiveZhuXianBossAward(curPlayer, lineID, isMail=False, dropItemMapInfo=[]):
+    ##给归属者奖励
+    addCnt = 1
+    equipList = []
+    prizeItemDict ={}
+    bossID = CurFBLineBOSSID(lineID)
+
+    jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss, {bossID:addCnt}, 
+                                                                        mailTypeKey="ZXBossBelongerReward", isMail=isMail, 
+                                                                        dropItemMapInfo=dropItemMapInfo)
+    for jsonItem in jsonItemList:
+        if 'UserData' in jsonItem:
+            equipList.append(jsonItem)
+        else:
+            itemID, itemCnt = jsonItem['ItemID'], jsonItem.get('Count',1)
+            prizeItemDict[itemID] = prizeItemDict.get(itemID,0)+itemCnt
+    
+    GameWorld.DebugLog("诛仙boss结算奖励: lineID=%s,bossID=%s,totalExp=%s,totalMoney=%s,jsonItemList=%s" 
+                       % (lineID, bossID, totalExp, totalMoney, jsonItemList), curPlayer.GetPlayerID())
+    
+    prizeItemList = equipList + FBCommon.GetJsonItemList(prizeItemDict.items())
+    #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_ZhuXianBoss, addCnt)
+
+    #击杀特定NPC成就
+    PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillSpecificNPC, addCnt, [bossID])
+    FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss, addCnt)
+    # 每日活动
+    PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_ZhuXianBoss, addCnt)
+    return prizeItemList
+
+def OnPickUpItem(curPlayer, curItem, tick):
+    mapItemType = curItem.GetType()
+    if mapItemType == ChConfig.Def_ItemType_Money:
+        return
+    playerID = curPlayer.GetID()
+    isEquip = ItemCommon.CheckItemIsEquip(curItem)
+    jsonItem = ItemCommon.GetJsonItem(curItem)
+    if playerID in PyGameData.g_fbPickUpItemDict:
+        if isEquip:
+            PyGameData.g_fbPickUpItemDict[playerID].append(jsonItem)
+        else:
+            isIn = False
+            for itemInfo in PyGameData.g_fbPickUpItemDict[playerID]:
+                if itemInfo["ItemID"] == jsonItem["ItemID"] and itemInfo.get("IsBind") == jsonItem.get("IsBind"):
+                    itemInfo["Count"] = itemInfo.get("Count", 1)+ jsonItem.get("Count", 1)
+                    isIn = True
+                    break
+            if not isIn:
+                PyGameData.g_fbPickUpItemDict[playerID].append(jsonItem)
+    else:
+        PyGameData.g_fbPickUpItemDict[playerID] = [jsonItem]
+    
+    playerItemCount = 0
+    mapItemManager = GameWorld.GetMapItemManager()
+    for index in xrange(mapItemManager.GetMapItemCount()):
+        mapItem = mapItemManager.GetMapItemByIndex(index)
+        if not mapItem or mapItem.IsEmpty():
+            continue
+        
+        # 还有属于自己的东西没捡不通知结束
+        if mapItem.GetOwnerID() == curPlayer.GetPlayerID():
+            playerItemCount += 1
+        
+    isItemAllPickUp = (playerItemCount <= 1)
+    if not isItemAllPickUp:
+        return
+    
+    isPass = 1
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    leaveTick = FBCommon.GetFBLineStepTime(ChConfig.Def_FBMapID_ZhuXianBoss, lineID) * 1000
+    gameFB = GameWorld.GetGameFB()
+    rank = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_Rank)
+    
+    jsonItemList = PyGameData.g_fbPickUpItemDict.get(playerID, [])
+    curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
+    overDict = {FBCommon.Over_rank:rank, FBCommon.Over_itemInfo:jsonItemList}
+    FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss, lineID, isPass, overDict)
+    return
+
+
+def __CheckBossHP(tick):
+    gameFB = GameWorld.GetGameFB()
+    isOver = gameFB.GetGameFBDictByKey(FBDict_IsOver)
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+   
+    if not isOver and GetBossRemainHP(lineID, tick) == 0:
+
+        bossID = CurFBLineBOSSID(lineID)
+        curBoss = GameWorld.FindNPCByNPCID(bossID)
+        dropPosX, dropPosY = 0, 0
+        if curBoss:
+            dropPosX, dropPosY = curBoss.GetPosX(), curBoss.GetPosY()
+        
+        #结束 设置BOSS死亡
+
+        FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
+        GameWorld.DebugLog('结束 设置BOSS死亡 lineID=%s' % lineID)
+        playerHurtList = __GetSortHurtList(lineID)
+       
+        if playerHurtList:
+            killerName, hurtValue = playerHurtList[0][1][:2]
+            NPCCommon.GameServer_KillGameWorldBoss(bossID, killerName, hurtValue)
+            
+        NPCCommon.GameServe_GameWorldBossState(bossID, 0)
+            
+        __DoLogicZhuXianBossOver(1, tick, dropPosX, dropPosY)
+        gameFB.SetGameFBDict(FBDict_IsOver, tick)
+    return
+
+def UpdateHPReduceSpeed(tick, isExit=False):
+    gameWorld = GameWorld.GetGameWorld()
+    playerCnt = gameWorld.GetMapCopyPlayerManager().GetPlayerCount()
+    playerCnt = playerCnt - 1 if isExit else playerCnt
+    if playerCnt <=0:
+        return
+    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    if lineID < 0:
+        return
+
+    curSpeed = int(min(1 + 0.08 * (playerCnt - 1), 1.8) * 1000)
+    gameWorld.SetGameWorldDict(FBDict_Speed % lineID, curSpeed)
+    if not gameWorld.GetGameWorldDictByKey(FBDict_IsReduceing%lineID):
+        return
+    
+    startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
+    remainHP = gameWorld.GetGameWorldDictByKey(FBDict_RemainHP % lineID)
+    lastSpeed = gameWorld.GetGameWorldDictByKey(FBDict_Speed % lineID)
+    if not startTick:
+        startTick = tick 
+        lastSpeed = curSpeed
+        remainHP = __GetBossTotalHP(lineID)
+    remainHP = max(0, int((remainHP - (tick - startTick) / 1000.0 * lastSpeed)))
+    gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, tick)
+    
+    gameWorld.SetGameWorldDict(FBDict_RemainHP % lineID, remainHP)
+    GameWorld.DebugLog('    curSpeed=%s, remainHP=%s, passTime=%s, lastSpeed=%s' % (curSpeed, remainHP, tick - startTick, lastSpeed))
+    FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
+    return
+
+def StopReduceHP(lineID, tick):
+    ##暂停BOSS血量减少
+    gameWorld = GameWorld.GetGameWorld()
+    if not gameWorld.GetGameWorldDictByKey(FBDict_IsReduceing%lineID):
+        return
+    remainHP = GetBossRemainHP(lineID, tick)
+    if not remainHP:
+        return
+    gameWorld.SetGameWorldDict(FBDict_IsReduceing % lineID, 0)
+    gameWorld.SetGameWorldDict(FBDict_RemainHP % lineID, remainHP)
+    return
+
+def StartReduceHP(lineID, tick):
+    ##开始BOSS掉血
+    gameWorld = GameWorld.GetGameWorld()
+    if gameWorld.GetGameWorldDictByKey(FBDict_IsReduceing%lineID):
+        return
+    gameWorld.SetGameWorldDict(FBDict_IsReduceing % lineID, 1)
+    startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
+    if not startTick:
+        gameWorld.SetGameWorldDict(FBDict_RemainHP % lineID, __GetBossTotalHP(lineID))
+    gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, tick)
+    return
+
+def __GetBossTotalHP(lineID):return GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_BossTotalHP%lineID)
+    
+
+def GetBossRemainHP(lineID, tick):
+    gameWorld = GameWorld.GetGameWorld()
+    
+    startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
+    lastSpeed = gameWorld.GetGameWorldDictByKey(FBDict_Speed % lineID) 
+    remainHP = gameWorld.GetGameWorldDictByKey(FBDict_RemainHP % lineID)
+    if not gameWorld.GetGameWorldDictByKey(FBDict_IsReduceing%lineID):
+        return remainHP
+    if not startTick:
+        startTick = tick
+        remainHP = __GetBossTotalHP(lineID)
+    else:
+        remainHP = max(0, int((remainHP - (tick - startTick) / 1000.0 * lastSpeed)))
+    return remainHP
+
+def GetBossRemainHPPer(lineID, tick):
+    remainHP = GetBossRemainHP(lineID, tick)
+    totalHP = __GetBossTotalHP(lineID)
+    if not totalHP:
+        return 0
+    return remainHP * 100 / totalHP
+
+def CurFBLineBOSSID(lineID= -1):
+    #该分线刷的BOSSID
+    if lineID == -1:
+        lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    if lineID == -1:
+        return 0
+    ipyData = IpyGameDataPY.GetIpyGameData('ZhuXianBoss', lineID)
+    if not ipyData:
+        return 0
+    bossID = ipyData.GetNPCID()
+    return bossID
+
+##玩家死亡.
+# @param curPlayer:死亡的玩家 
+# @param tick 时间戳
+# @return 返回值无意义
+# @remarks 玩家主动离开副本.
+def DoPlayerDead(curPlayer):
+    return
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index f8d21a6..6def013 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1241,6 +1241,14 @@
                         ("WORD", "SingleTimes", 0),
                         ("list", "Reward", 0),
                         ),
+
+                "ZhuXianBoss":(
+                        ("DWORD", "NPCID", 0),
+                        ("BYTE", "LineID", 1),
+                        ("WORD", "KillTime", 0),
+                        ("WORD", "RealmLV", 0),
+                        ("DWORD", "ZhuXianScore", 0),
+                        ),
                 }
 
 
@@ -3781,6 +3789,23 @@
     def GetTotalTimes(self): return self.TotalTimes # 可完成的总次数,0表示不限次数
     def GetSingleTimes(self): return self.SingleTimes # 单次领奖需要的次数
     def GetReward(self): return self.Reward # 奖励物品
+
+# 诛仙BOSS表
+class IPY_ZhuXianBoss():
+    
+    def __init__(self):
+        self.NPCID = 0
+        self.LineID = 0
+        self.KillTime = 0
+        self.RealmLV = 0
+        self.ZhuXianScore = 0
+        return
+        
+    def GetNPCID(self): return self.NPCID # ID
+    def GetLineID(self): return self.LineID
+    def GetKillTime(self): return self.KillTime # 击杀总时间秒
+    def GetRealmLV(self): return self.RealmLV # 需要境界
+    def GetZhuXianScore(self): return self.ZhuXianScore # 需要诛仙总评分
 
 
 def Log(msg, playerID=0, par=0):
@@ -4042,6 +4067,8 @@
         self.ipyActLoginAwardLen = len(self.ipyActLoginAwardCache)
         self.ipyLoginAwardCache = self.__LoadFileData("LoginAward", IPY_LoginAward)
         self.ipyLoginAwardLen = len(self.ipyLoginAwardCache)
+        self.ipyZhuXianBossCache = self.__LoadFileData("ZhuXianBoss", IPY_ZhuXianBoss)
+        self.ipyZhuXianBossLen = len(self.ipyZhuXianBossCache)
         Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
         Log("IPY_DataMgr InitOK!")
         return
@@ -4444,6 +4471,8 @@
     def GetActLoginAwardByIndex(self, index): return self.ipyActLoginAwardCache[index]
     def GetLoginAwardCount(self): return self.ipyLoginAwardLen
     def GetLoginAwardByIndex(self, index): return self.ipyLoginAwardCache[index]
+    def GetZhuXianBossCount(self): return self.ipyZhuXianBossLen
+    def GetZhuXianBossByIndex(self, index): return self.ipyZhuXianBossCache[index]
 
 IPYData = IPY_DataMgr()
 def IPY_Data(): return IPYData
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 b1cf919..f388d6c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -2068,7 +2068,7 @@
     if ChConfig.IsGameBoss(curNPC): 
         # 通知GameServer boss状态 封魔坛在副本里单独处理
         ipyData = IpyGameDataPY.GetIpyGameDataNotLog('BOSSInfo', npcid)
-        if ipyData and ipyData.GetMapID() != ChConfig.Def_FBMapID_SealDemon:
+        if ipyData and ipyData.GetMapID() not in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
             GameServe_GameWorldBossState(npcid, 0)
             #GameWorld.GetGameWorld().SetGameWorldDict(ChConfig.Map_NPC_WorldBossDeadTick % npcid, GameWorld.GetGameWorld().GetTick())
             #因为存在boss分流,所以用gameFB字典,但是存活状态还是用GameWorld字典
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py
index a86f294..6e0c400 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCustomRefresh.py
@@ -17,6 +17,7 @@
 import ShareDefine
 import ReadChConfig
 import GameLogic_SealDemon
+import GameLogic_ZhuXianBoss
 import PlayerControl
 import IPY_GameWorld
 import IpyGameDataPY
@@ -401,6 +402,9 @@
     if mapID == ChConfig.Def_FBMapID_SealDemon:
         bossID = GameLogic_SealDemon.CurFBLineBOSSID()
         stoneNPCID = 0
+    elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+        bossID = GameLogic_ZhuXianBoss.CurFBLineBOSSID()
+        stoneNPCID = 0
     else:
         ipyData = IpyGameDataPY.GetIpyGameDataByCondition('BOSSInfo', {'RefreshMark':refreshMark, 'MapID':mapID}, isLogNone=False)
         if not ipyData:
@@ -412,7 +416,6 @@
         isNeedShunt = ipyData.GetIsNeedShunt()
     if not bossID and not stoneNPCID:
         return
-    
     gameFB = GameWorld.GetGameFB()
     gameWorldMgr = GameWorld.GetGameWorld()
     isActivityBoss = False # 是否活动boss
@@ -463,7 +466,7 @@
             NPCCommon.SetDeadEx(curNPC)
             
         # 非复活线 且 不需要分流的地图 且 不是封魔坛  不允许复活
-        if lineID != rebornLineID and not isNeedShunt and mapID != ChConfig.Def_FBMapID_SealDemon:
+        if lineID != rebornLineID and not isNeedShunt and mapID not in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
             return
         
         if isActivityBoss and activityBossRebornCount > 0:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index fc1273e..b04232e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -76,6 +76,7 @@
 import PyGameData
 import PlayerMagicWeapon
 import GameLogic_SealDemon
+import GameLogic_ZhuXianBoss
 import PlayerTJG
 import PlayerVip
 import PlayerRefineStove
@@ -1699,6 +1700,14 @@
             else:
                 bossID = GameLogic_SealDemon.CurFBLineBOSSID(lineID)
                 extendParamList = [bossID]
+        elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+            bossID = GameLogic_ZhuXianBoss.CurFBLineBOSSID(lineID)
+            extendParamList = [bossID, -1]
+            enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianBoss)
+            if enterCnt >= FBCommon.GetEnterFBMaxCnt:
+                if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhuXianBossHelpCnt):
+                    extendParamList = [bossID, curPlayer.GetFamilyID()]
+            
         SendToGameServerEnterFB(curPlayer, mapID, lineID, tick, extendParamList)
         return
     
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
index 971bab8..bb88c0b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -113,6 +113,10 @@
     enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_SealDemon)
     maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, ChConfig.Def_FBMapID_SealDemon)
     curPlayerPropDict['CntMark_%s'%ChConfig.Def_FBMapID_SealDemon] = max(maxCnt - enterCnt, 0)
+    # 诛仙BOSS剩余次数
+    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianBoss)
+    maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss)
+    curPlayerPropDict['CntMark_%s'%ChConfig.Def_FBMapID_ZhuXianBoss] = max(maxCnt - enterCnt, 0)
     # 世界BOSS剩余次数
     curPlayerPropDict['CntMark_%s'%ShareDefine.Def_Boss_Func_World] = BossHurtMng.GetCanKillBossCnt(curPlayer, ShareDefine.Def_Boss_Func_World)
     # BOSS之家剩余次数
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
index 8a9cca4..a9c50a9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
@@ -24,6 +24,7 @@
 #导入
 import FBLogic
 import GameLogic_SealDemon
+import GameLogic_ZhuXianBoss
 import IPY_GameWorld
 import PlayerControl
 import GameWorld
@@ -57,7 +58,7 @@
     tagMapID = packCMDList[0]  # 目标地图id
     tagMapLineID = packCMDList[1]  # 目标地图线路属性,从0开始
     resultLineID = -1  # 结果lineID
-    
+    notifyMark = 'GeRen_chenxin_500807' #不能进的提示
     if tagMapID in ChConfig.Def_MapID_LineIDToPropertyID:        
         GameWorld.Log("    DoLogic() tagMapID in ChConfig.Def_MapID_LineIDToPropertyID")
         tagMapPropertyID = tagMapLineID + 1 # 因为PropertyID默认是0,所以使用时从1开始
@@ -144,13 +145,14 @@
 #            GameWorld.DebugLog("    创建新战盟家园: tagFamilyID=%s,tagFamilyHomeLV=%s,resultLineID=%s" 
 #                               % (tagFamilyID, tagFamilyHomeLV, resultLineID))
 #===================================================================================================
-    elif tagMapID == ChConfig.Def_FBMapID_SealDemon:
+    elif tagMapID in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
         tagMapPropertyID = tagMapLineID + 1 # 因为PropertyID默认是0,所以使用时从1开始
         resultLineID = -1  # 结果lineID
         
         gameWorldManager = GameWorld.GetGameWorld()
         GameWorld.Log("    DoLogic()  tagMapID=%s,tagMapLineID=%s" % (tagMapID, tagMapLineID))
         findGameWord = None
+        findPlayerManager = None
         for index in range(gameWorldManager.GetGameWorldCount()):
             gameWorld = IPY_GameWorld.IPY_GameWorld(index)
             playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
@@ -163,13 +165,32 @@
 #                          % (index, propertyID, playerManager.GetPlayerCount()))
             # 如果不是同一线路属性的,则跳过
             if propertyID == tagMapPropertyID:
-                if GameLogic_SealDemon.GetBossRemainHPPer(tagMapLineID, tick) < 15:
-                    findGameWord = None
-                    break
+                if tagMapID == ChConfig.Def_FBMapID_SealDemon:
+                    if GameLogic_SealDemon.GetBossRemainHPPer(tagMapLineID, tick) < 15:
+                        findGameWord = None
+                        findPlayerManager = None
+                        notifyMark = "DemonJar_Text4"
+                        break
+                elif tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+                    if GameLogic_ZhuXianBoss.GetBossRemainHPPer(tagMapLineID, tick) < 15:
+                        findGameWord = None
+                        findPlayerManager = None
+                        notifyMark = "DemonJar_Text4"
+                        break
+                    
                 findGameWord = gameWorld
+                findPlayerManager = gameWorld
                 break
             if not findGameWord and propertyID == 0:
                 findGameWord = gameWorld
+                findPlayerManager = gameWorld
+        
+        if findPlayerManager and tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+            if packCMDList[3] !=-1 and not GameLogic_ZhuXianBoss.GetHasSameFamilyMerber(packCMDList[3], findPlayerManager):
+                notifyMark = "TryEnterJadeDynastyBossError_6"
+                findGameWord = None
+                GameWorld.DebugLog("    归属次数为0且没有同盟玩家在副本里!")
+                
         if findGameWord:
             if findGameWord.GetPropertyID() == 0:
                 findGameWord.SetFBFirstOpen(1) # 开启副本
@@ -180,7 +201,7 @@
         #resultLineID = tagMapLineID
         resultLineID = 0
         
-    return ['%s' % packCMDList, '%d' % resultLineID]
+    return ['%s' % packCMDList, '%d' % resultLineID, notifyMark]
 #---------------------------------------------------------------------
 
 
@@ -196,22 +217,19 @@
     
     #还原格式 '[]' -> []
     funResult = eval(funResult)
-    if not funResult or len(funResult) < 2:
+    if not funResult or len(funResult) < 3:
         GameWorld.Log("GY_Query_EnterFB DoResult() return []")
         return
     
     tagMapInfo = eval(funResult[0])
     backFBID = int(funResult[1]) # 返回的切图线路id(0~N)
-    
+    notifyMark = funResult[2]
     mapID = tagMapInfo[0] # 请求的切图id
     funcLineID = tagMapInfo[1]   # 请求的场次线路id(0~6)
     GameWorld.Log("GY_Query_EnterFB DoResult() mapID=%s,funcLineID=%s,backFBID=%s" % (mapID, funcLineID, backFBID), curPlayer.GetPlayerID())
     
     if backFBID == -1: # 未找到可进入的分线,则返回,提示人数已满
-        if mapID == ChConfig.Def_FBMapID_SealDemon:
-            PlayerControl.NotifyCode(curPlayer, "DemonJar_Text4")
-        else:
-            PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_500807")
+        PlayerControl.NotifyCode(curPlayer, notifyMark)
         return
     
     if curPlayer.GetMapID() == mapID:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py
index 4a04544..d1fc79b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py
@@ -19,7 +19,7 @@
 
 
 #导入
-import NPCCommon
+import GameLogic_ZhuXianBoss
 import GameWorld
 import IPY_GameWorld
 import ChConfig
@@ -51,7 +51,7 @@
     gameWorldManager = GameWorld.GetGameWorld()
     fbLinePlayerCntDict = {}
     if tagMapID == ChConfig.Def_FBMapID_SealDemon:
-        for index in range(gameWorldManager.GetGameWorldCount()):
+        for index in xrange(gameWorldManager.GetGameWorldCount()):
             gameWorld = IPY_GameWorld.IPY_GameWorld(index)
             playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
             fblineID = gameWorld.GetPropertyID() - 1
@@ -60,7 +60,20 @@
             if not isAllLine and tagFBLineID != fblineID:
                 continue
             playerCnt = playerManager.GetPlayerCount()
-            fbLinePlayerCntDict[fblineID] = playerCnt
+            fbLinePlayerCntDict[fblineID] = [playerCnt]
+            
+    elif tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+        for index in xrange(gameWorldManager.GetGameWorldCount()):
+            gameWorld = IPY_GameWorld.IPY_GameWorld(index)
+            playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
+            fblineID = gameWorld.GetPropertyID() - 1
+            if fblineID < 0:
+                continue
+            if not isAllLine and tagFBLineID != fblineID:
+                continue
+            playerCnt = playerManager.GetPlayerCount()
+            ownerName = GameLogic_ZhuXianBoss.GetFirstOwnerName(fblineID)
+            fbLinePlayerCntDict[fblineID] = [playerCnt, ownerName]
     else:
         return
     return [tagMapID, fbLinePlayerCntDict]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_ZhuXianBossAward.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_ZhuXianBossAward.py
new file mode 100644
index 0000000..401fce0
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_ZhuXianBossAward.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#---------------------------------------------------------------------
+#
+#---------------------------------------------------------------------
+##@package GY_Query_ZhuXianBossAward
+# @todo: 诛仙BOSS奖励处理
+#
+# @author: xdh
+# @date 2019-01-19 16:30
+# @version 1.0
+#
+# @note: 诛仙BOSS奖励处理
+#---------------------------------------------------------------------
+#"""Version = 2017-12-28 16:30""" 
+#---------------------------------------------------------------------
+import GameWorld
+import GameLogic_ZhuXianBoss
+#---------------------------------------------------------------------
+
+## XX
+#  @param query_Type 请求类型
+#  @param query_ID 请求的玩家ID
+#  @param packCMDList 发包命令
+#  @param tick 当前时间
+#  @return "True" or "False" or ""
+def DoLogic(query_Type, query_ID, packCMDList, tick):
+    return ''
+
+
+## 登陆信息
+#  @param curPlayer 发出请求的玩家
+#  @param callFunName 功能名称
+#  @param funResult 查询的结果
+#  @param tick 当前时间
+#  @return None
+def DoResult(curPlayer, callFunName, funResult, tick):
+    playerID = curPlayer.GetPlayerID()
+    GameWorld.DebugLog("GY_Query_ZhuXianBossAward funResult=%s" % funResult, playerID)
+    lineID = GameWorld.ToIntDef(funResult, -1)
+   
+    if lineID == -1:
+        return
+    
+    GameLogic_ZhuXianBoss.GiveZhuXianBossAward(curPlayer, lineID, True)
+    return
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
index 387207b..37d22ac 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
@@ -87,3 +87,5 @@
 g_crossPlayerDienstgradChangeInfo = {} #跨服玩家称号变化信息 {playerID:{id:isAdd, ...}, ...}
 g_crossPlayerItemsChangeInfo = {} #跨服玩家物品变化信息 {playerID:{"背包类型-物品位":itemMD5, ...}, ...}
 g_crossPlayerSkillsChangeInfo = {} #跨服玩家技能变化信息 {playerID:[技能ID], ...}
+
+g_ZhuXianBossPlayerHurtDict = {} #诛仙BOSS玩家伤害排行信息
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 34f902f..4f104c8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -878,6 +878,7 @@
 GameFuncID_LittleHelper = 146   # 小助手
 GameFuncID_TJG = 147            # 脱机挂
 GameFuncID_SuperGift = 150      # 超值礼包
+GameFuncID_ZhuXianBoss = 163    # 诛仙BOSS
 # 以下为暂时无用的
 GameFuncID_Truck = 33           # 运镖
 GameFuncID_RunDaily = 34        # 日常跑环
@@ -962,7 +963,7 @@
                                 Def_UniversalGameRecType_StoreServerCntRecord,  #商店全服购买记录 8,
                                 Def_UniversalGameRecType_FBHelpBattleCheckInPlayer, #助战玩家登记记录9
                                 Def_UniversalGameRecType_FBHelpBattleRecord, #助战未同步记录10
-                                Def_UniversalGameRecType_11,
+                                Def_UniversalGameRecType_ZhuXianBossRecord, #诛仙BOSS结算记录11
                                 Def_UniversalGameRecType_12,
                                 Def_UniversalGameRecType_13,
                                 Def_UniversalGameRecType_Reward,    # 通用奖励表(TopBar)14
@@ -1521,7 +1522,8 @@
 DailyActionID_IceLode, # 冰晶矿脉
 DailyActionID_HelpBattleCheckIn, # 助战登记  20
 DailyActionID_CrossReamPK, # 跨服PK  21
-) = range(1, 21 + 1)
+DailyActionID_ZhuXianBoss, # 诛仙BOSS  22
+) = range(1, 22 + 1)
 
 
 

--
Gitblit v1.8.0