xdh
2018-11-19 17c0a15c9b306ab2fb7576ca99adbdf8e4e8285e
4715 【1.3】【后端】新的洗练副本-冰晶矿脉(新)
7个文件已修改
611 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py 375 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -328,6 +328,7 @@
    DWORD        RePotionCD;    //ѪƿCD
    DWORD        AttackEff;    //挂机效率
    DWORD        ReFightPower;    //战斗力
    DWORD        IceLodeFightPower;    //冰晶矿脉扫荡战斗力
};
//GM测试属性表
@@ -1384,4 +1385,14 @@
    BYTE        _Level;    //关卡
    list        RefreshNPC;    //刷怪配置
    dict        AttrDict;    //属性
};
//冰晶矿脉星级奖励表
struct tagIceLodeStarAward
{
    BYTE        _Index;    //奖励索引
    BYTE        Star;    //星数
    list        LVLimit;    //等级范围
    list        ItemList;    //奖励
};
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -24702,6 +24702,94 @@
#------------------------------------------------------
# B2 04 冰晶矿脉信息通知 #tagMCIceLodeInfo
class  tagMCIceLodeInfo(Structure):
    Head = tagHead()
    Cnt = 0    #(BYTE Cnt)// 今日玩法数量
    LineList = list()    #(vector<BYTE> LineList)// 玩法列表
    AwardRecord = 0    #(DWORD AwardRecord)// 领奖记录
    HasSweep = 0    #(BYTE HasSweep)// 是否已扫荡
    DayLV = 0    #(WORD DayLV)// 今日等级
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xB2
        self.Head.SubCmd = 0x04
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Cnt):
            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
            self.LineList.append(value)
        self.AwardRecord,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.HasSweep,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        self.DayLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xB2
        self.Head.SubCmd = 0x04
        self.Cnt = 0
        self.LineList = list()
        self.AwardRecord = 0
        self.HasSweep = 0
        self.DayLV = 0
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        length += 1 * self.Cnt
        length += 4
        length += 1
        length += 2
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteBYTE(data, self.Cnt)
        for i in range(self.Cnt):
            data = CommFunc.WriteBYTE(data, self.LineList[i])
        data = CommFunc.WriteDWORD(data, self.AwardRecord)
        data = CommFunc.WriteBYTE(data, self.HasSweep)
        data = CommFunc.WriteWORD(data, self.DayLV)
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                Cnt:%d,
                                LineList:%s,
                                AwardRecord:%d,
                                HasSweep:%d,
                                DayLV:%d
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.Cnt,
                                "...",
                                self.AwardRecord,
                                self.HasSweep,
                                self.DayLV
                                )
        return DumpString
m_NAtagMCIceLodeInfo=tagMCIceLodeInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCIceLodeInfo.Head.Cmd,m_NAtagMCIceLodeInfo.Head.SubCmd))] = m_NAtagMCIceLodeInfo
#------------------------------------------------------
# B2 03 公共副本扫荡信息 #tagMCPubFBSweepData
class  tagMCPubFBSweep(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3312,6 +3312,7 @@
Def_Player_Dict_FbCntRegainStartTime = "FbCntRegainStartTime_%s" # 副本次数恢复开始时间, 参数为副本ID
Def_Player_Dict_FbCntRegainTotalTime = "FbCntRegainTotalTime_%s" # 副本次数恢复还需时间, 参数为副本ID
Def_Player_Dict_FBHistoryMaxLine = "FBHistoryMaxLine_%s"  # 副本历史最高通关, 参数为副本ID
Def_Player_Dict_IceLoadLineID = "IceLoadLineID_%s"  # 副本星级星级信息, 参数为[key编号], 按位存储每个lineID是否选中
Def_Player_Dict_RefurbishGoodBookPlayerLv = "RefurbishGoodBookPlayerLv_97"  # 刷新天书任务时的玩家等级
Def_Player_Dict_GameFuncFirstTouch = "GameFuncFirstTouch_%s"  # 服务端功能首次触发开启状态; 参数, key编号
Def_Player_Dict_GameFuncAwardState = "GameFuncAwardState_%s"  # 服务端功能开启领奖状态; 参数, key编号
@@ -3650,6 +3651,12 @@
#聊天气泡
Def_PDict_ChatBubbleBoxState = "ChatBubbleBoxState_%s"  # 聊天气泡状态, 参数(key编号)
#冰晶矿脉
Def_PDict_IceLodeStarAwardRecord = "IceLodeStarAwardRecord" #星级奖励领奖记录
Def_PDict_IceLodeHasSweep = "IceLodeHasSweep" #今日是否已扫荡过
Def_PDict_IceLodeLastCheckTime = "IceLodeLastCheckTime" #上次补发星级奖励时间
Def_PDict_IceLodeDayLV = "IceLodeDayLV" #今日等级
Def_PDict_IceLodeIsInFBOnDay = "IceLodeIsInFBOnDay" #在副本里过天
#-------------------------------------------------------------------------------
#类型 Def_PDictType_OnlinePrize
Def_PDict1_OnlinePrizeCnt = "OnlinePrizeCnt"  # 新手在线已领取奖励次数
@@ -5066,7 +5073,8 @@
Def_RewardType_WishingWell, # 许愿池奖励16
Def_RewardType_OpenFunc, # 功能开启奖励17
Def_RewardType_TotalRecharge, # 累计充值奖励18
)= range(19)
Def_RewardType_IceLodeStar, # 冰晶矿脉星级奖励19
)= range(20)
#boss复活相关活动定义
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -24702,6 +24702,94 @@
#------------------------------------------------------
# B2 04 冰晶矿脉信息通知 #tagMCIceLodeInfo
class  tagMCIceLodeInfo(Structure):
    Head = tagHead()
    Cnt = 0    #(BYTE Cnt)// 今日玩法数量
    LineList = list()    #(vector<BYTE> LineList)// 玩法列表
    AwardRecord = 0    #(DWORD AwardRecord)// 领奖记录
    HasSweep = 0    #(BYTE HasSweep)// 是否已扫荡
    DayLV = 0    #(WORD DayLV)// 今日等级
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xB2
        self.Head.SubCmd = 0x04
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Cnt):
            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
            self.LineList.append(value)
        self.AwardRecord,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.HasSweep,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        self.DayLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xB2
        self.Head.SubCmd = 0x04
        self.Cnt = 0
        self.LineList = list()
        self.AwardRecord = 0
        self.HasSweep = 0
        self.DayLV = 0
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        length += 1 * self.Cnt
        length += 4
        length += 1
        length += 2
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteBYTE(data, self.Cnt)
        for i in range(self.Cnt):
            data = CommFunc.WriteBYTE(data, self.LineList[i])
        data = CommFunc.WriteDWORD(data, self.AwardRecord)
        data = CommFunc.WriteBYTE(data, self.HasSweep)
        data = CommFunc.WriteWORD(data, self.DayLV)
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                Cnt:%d,
                                LineList:%s,
                                AwardRecord:%d,
                                HasSweep:%d,
                                DayLV:%d
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.Cnt,
                                "...",
                                self.AwardRecord,
                                self.HasSweep,
                                self.DayLV
                                )
        return DumpString
m_NAtagMCIceLodeInfo=tagMCIceLodeInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCIceLodeInfo.Head.Cmd,m_NAtagMCIceLodeInfo.Head.SubCmd))] = m_NAtagMCIceLodeInfo
#------------------------------------------------------
# B2 03 公共副本扫荡信息 #tagMCPubFBSweepData
class  tagMCPubFBSweep(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py
@@ -27,9 +27,14 @@
import ChConfig
import NPCCommon
import ItemCommon
import ItemControler
import EventReport
import ChPyNetSendPack
import NetPackCommon
import random
import datetime
import time
import math
#---副本配置对应key值---
@@ -38,7 +43,8 @@
Def_FightTime, # 进行时间(秒)
Def_PickTime, # 拾取时间(秒)(包含退出时间)
Def_LeaveTime, # 退出时间(秒)
) = range(4)
Def_StarTime, #星级时间
) = range(5)
#---副本分线配置索引信息---
@@ -61,12 +67,12 @@
) = range(6)
FBPlayerDict_RemainNPCCnt = 'FBPlayerDict_RemainNPCCnt'   # 剩余怪数量
FBPlayerDict_TotalPoint = 'FBPlayerDict_TotalPoint'   # 获得的总怒气值
FBPlayerDict_CostTime = 'FBPlayerDict_CostTime' #通关时间
FBPlayerDict_TotalExp = 'FBPlayerDict_TotalExp'   # 获得的总经验
FBPlayerDict_TotalExpPoint = 'FBPlayerDict_TotalExpPoint'   # 获得的总经验点
FBPlayerDict_FBStar = 'FBPlayerDict_FBStar'   # 当前星级
@@ -74,7 +80,8 @@
#  @param None
#  @return 配置信息
def GetIceLodeNPCCfg():
    return FBCommon.GetFBLineRefreshNPC(GameWorld.GetMap().GetMapID())
    lineID = FBCommon.GetFBPropertyMark()
    return FBCommon.GetFBLineRefreshNPC(GameWorld.GetMap().GetMapID(), lineID)
def GetPointByNPCID(npcid):
    '''通过NPCID获取对应的积分'''
@@ -86,10 +93,37 @@
## OnDay处理
#  @param curPlayer
#  @return None
def IceLodeOnDay(curPlayer):
def OnFBPlayerOnDay(curPlayer):
    if curPlayer.GetMapID() == ChConfig.Def_FBMapID_IceLode:
        #玩家还在副本中,等这次副本结束,以最新的总星级给发奖励
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeIsInFBOnDay, 1)
        return
    #补发奖励
    CheckIceLodeStarAwardMail(curPlayer)
    return
def OnFBPlayerOnLogin(curPlayer):
    isInFBOnDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeIsInFBOnDay)
    if isInFBOnDay and curPlayer.GetMapID() != ChConfig.Def_FBMapID_IceLode: #在副本里过天,副本结束后再补发奖励
        if CheckIceLodeStarAwardMail(curPlayer):
            return
    starCnt, lineList = GetIceLodeAllStarCnt(curPlayer)
    if not lineList:
        __RandomLine(curPlayer)
    SyncIceLoddInfo(curPlayer)
    return
def __RandomLine(curPlayer):
    # 随机今日玩法
    maxCnt, randomCnt = IpyGameDataPY.GetFuncEvalCfg('IceLodeCfg', 2)
    lineList = range(maxCnt)
    random.shuffle(lineList)
    for i, lineID in enumerate(lineList):
        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_IceLoadLineID, lineID, 0 if i >= randomCnt else 1)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeDayLV, curPlayer.GetLV())
    GameWorld.DebugLog('    随机冰晶矿脉今日玩法 lineList =%s'%(lineList[:randomCnt]), curPlayer.GetID())
    return
## 是否能够通过活动查询进入
#  @param curPlayer 玩家实例
@@ -98,6 +132,10 @@
#  @param tick 时间戳
#  @return 布尔值
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
    starCnt, lineList = GetIceLodeAllStarCnt(curPlayer)
    if lineID not in lineList:
        GameWorld.DebugLog('冰晶矿脉今日没有该线路 lineID=%s,lineList=%s'%(lineID, lineList))
        return False
    return True
@@ -127,9 +165,10 @@
#  @return None
def DoEnterFB(curPlayer, tick):
    playerID = curPlayer.GetPlayerID()
    GameWorld.DebugLog("DoEnterFB...", playerID)
    mapID = GameWorld.GetGameWorld().GetMapID()
    gameFB = GameWorld.GetGameFB()
    lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
    GameWorld.DebugLog("DoEnterFB...lineID=%s"%lineID, playerID)
    hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
    if not hadDelTicket:
        PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
@@ -140,6 +179,20 @@
        if not isOK:
            PlayerControl.PlayerLeaveFB(curPlayer)
            return
        #星级为0则免费,否则收钱
        curStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
        if curStar:
            costGold = IpyGameDataPY.GetFuncCfg('IceLodeCfg')
            if costGold:
                costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costGold)
                if not costMoneyList:
                    GameWorld.Log('钱不够 lineID=%s,costGold=%s'%(lineID, costGold))
                    PlayerControl.PlayerLeaveFB(curPlayer)
                    return
                for moneyType, moneyNum in costMoneyList:
                    PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_BuyFBCnt, {"MapID":mapID, 'lineID':lineID})
        FBCommon.SetFBPropertyMark(lineID)
        FBCommon.SetHadDelTicket(curPlayer)
        FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_IceLode)
        FBCommon.SetFBStep(FB_Step_Prepare, tick)
@@ -156,6 +209,7 @@
        mapID = GameWorld.GetMap().GetMapID()
        notify_tick = FBCommon.GetFBLineStepTime(mapID)[Def_FightTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
        curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
        __UpdIceLoadFBStar(tick, True, curPlayer)
    DoFBHelp(curPlayer, tick)
    return
@@ -164,7 +218,6 @@
# @param tick 时间戳
# @return 无意义
def DoExitFB(curPlayer, tick):
    return
##玩家主动离开副本.
@@ -176,6 +229,7 @@
def OnPickUpItem(curPlayer, curItem, tick):
    return
    mapItemType = curItem.GetType()
    if mapItemType == ChConfig.Def_ItemType_Money:
        return
@@ -209,10 +263,10 @@
    gameFB = GameWorld.GetGameFB()
    
    # 获得副本信息
    totalPoint = gameFB.GetGameFBDictByKey(FBPlayerDict_TotalPoint)
    star = gameFB.GetGameFBDictByKey(FBPlayerDict_FBStar)
    lineID = FBCommon.GetFBPropertyMark()
    #副本帮助
    helpDict = {FBCommon.Help_score:totalPoint}
    helpDict = {FBCommon.Help_grade:star, FBCommon.Help_lineID:lineID}
    GameWorld.DebugLog("DoFBHelp %s" % str(helpDict))
    FBCommon.Notify_FBHelp(curPlayer, helpDict)
    return
@@ -231,6 +285,7 @@
    # 副本进行中
    elif fbStep == FB_Step_Fighting:
        __DoLogic_FB_Fighting(tick)
        __UpdIceLoadFBStar(tick)
    # 副本拾取中
    elif fbStep == FB_Step_PickItem:
        __DoLogic_FB_PickItem(tick)
@@ -240,25 +295,72 @@
    
    return
## 更新当前副本星级
def __UpdIceLoadFBStar(tick, isEnter=False, curPlayer=None):
    gameFB = GameWorld.GetGameFB()
    curStar = gameFB.GetGameFBDictByKey(FBPlayerDict_FBStar)
    if curStar == 1:
        return curStar
    mapID = GameWorld.GetMap().GetMapID()
    useSecond = int(math.ceil((tick - gameFB.GetFBStepTick()) / 1000.0))
    icelodeTimeCfg = FBCommon.GetFBLineStepTime(mapID)
    starTimeList = icelodeTimeCfg[Def_StarTime]
    diffSecond = 0
    updStar = 1 # 默认至少1星
    for star, starTime in enumerate(starTimeList, 2):
        if useSecond <= starTime:
            updStar = star
            diffSecond = starTime-useSecond
    if curStar == updStar and not isEnter:
        return curStar
    gameFB.SetGameFBDict(FBPlayerDict_FBStar, updStar)
    GameWorld.DebugLog("__UpdFBStar useSecond=%s,curStar=%s,updStar=%s, diffSecond=%s"
                       % (useSecond, curStar, updStar, diffSecond))
    if curPlayer:
        DoFBHelp(curPlayer, tick)
        if updStar != 1:
            curPlayer.Sync_TimeTick(IPY_GameWorld.tttFlagTake, 0, diffSecond * 1000, True)
    else:
        playerManager = GameWorld.GetMapCopyPlayerManager()
        for index in xrange(playerManager.GetPlayerCount()):
            curPlayer = playerManager.GetPlayerByIndex(index)
            if not curPlayer:
                continue
            DoFBHelp(curPlayer, tick)
            if updStar != 1:
                curPlayer.Sync_TimeTick(IPY_GameWorld.tttFlagTake, 0, diffSecond * 1000, True)
    return updStar
## 副本准备逻辑
#  @param tick:时间戳
#  @return 无意义
def __DoLogic_FB_Prepare(tick):
    #gameFB = GameWorld.GetGameFB()
    gameFB = GameWorld.GetGameFB()
    mapID = GameWorld.GetMap().GetMapID()
    stepTimeCfg = FBCommon.GetFBLineStepTime(mapID)
    # 间隔未到
    if tick - GameWorld.GetGameFB().GetFBStepTick() < stepTimeCfg[Def_PrepareTime] * 1000:
    if tick - gameFB.GetFBStepTick() < stepTimeCfg[Def_PrepareTime] * 1000:
        return
    
    # 设置开始刷怪
    npcCnt = 0
    npcCfg = GetIceLodeNPCCfg()
    for npcInfo in npcCfg:
        npcid = npcInfo[DL_NPCID]
        maxCnt = npcInfo[DL_ScreenMaxNPC]
        totalMaxCnt = npcInfo[DL_TotalNPCCnt]
        NPCCustomRefresh.SetNPCRefresh(npcInfo[Def_RefreshMark], [npcid], maxCnt, totalMaxCnt)
        npcCnt += maxCnt
    NPCCustomRefresh.ProcessAllNPCRefresh(tick) # 立即出发一次标识点刷新
    gameFB.SetGameFBDict(FBPlayerDict_RemainNPCCnt, npcCnt)
    
    # 副本开始
    FBCommon.SetFBStep(FB_Step_Fighting, tick)
@@ -354,29 +456,44 @@
def DoFB_Player_KillNPC(curPlayer, curNPC, tick):
    gameFB = GameWorld.GetGameFB()
    npcid = curNPC.GetNPCID()
    addPoint = GetPointByNPCID(npcid)
    if not addPoint:
    npcCfg = GetIceLodeNPCCfg()
    isfbnpc = False
    for npcInfo in npcCfg:
        if npcid == npcInfo[DL_NPCID]:
            isfbnpc = True
            break
    if not isfbnpc:
        return
    totalPoint = gameFB.GetGameFBDictByKey(FBPlayerDict_TotalPoint)
    maxPoint = IpyGameDataPY.GetFuncCfg('IceLodeNeedPoint')
    updPoint = min(totalPoint + addPoint, maxPoint)
    gameFB.SetGameFBDict(FBPlayerDict_TotalPoint, updPoint)
    
    if updPoint >= maxPoint:
        costTime = tick - GameWorld.GetGameFB().GetFBStepTick()
        gameFB.SetGameFBDict(FBPlayerDict_CostTime, costTime)
        FBCommon.SetFBStep(FB_Step_PickItem, tick)
        mapID = GameWorld.GetMap().GetMapID()
        curPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, FBCommon.GetFBLineStepTime(mapID)[Def_PickTime] * 1000, True)
        FBCommon.ClearFBNPC()
        npcCfg = GetIceLodeNPCCfg()
        for npcInfo in npcCfg:
            NPCCustomRefresh.CloseNPCRefresh(npcInfo[Def_RefreshMark], tick)
        #__DoIceLodeOver(True)
    remainNPCCnt = max(0, gameFB.GetGameFBDictByKey(FBPlayerDict_RemainNPCCnt) - 1)
    gameFB.SetGameFBDict(FBPlayerDict_RemainNPCCnt, remainNPCCnt)
    
    DoFBHelp(curPlayer, tick)
    if remainNPCCnt <=0:
        __DoIceLodeOver(True)
#    addPoint = GetPointByNPCID(npcid)
#    if not addPoint:
#        return
#    totalPoint = gameFB.GetGameFBDictByKey(FBPlayerDict_TotalPoint)
#    maxPoint = IpyGameDataPY.GetFuncCfg('IceLodeNeedPoint')
#    updPoint = min(totalPoint + addPoint, maxPoint)
#    gameFB.SetGameFBDict(FBPlayerDict_TotalPoint, updPoint)
#
#    if updPoint >= maxPoint:
#        costTime = tick - GameWorld.GetGameFB().GetFBStepTick()
#        gameFB.SetGameFBDict(FBPlayerDict_CostTime, costTime)
#        FBCommon.SetFBStep(FB_Step_PickItem, tick)
#        mapID = GameWorld.GetMap().GetMapID()
#        curPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, FBCommon.GetFBLineStepTime(mapID)[Def_PickTime] * 1000, True)
#
#        FBCommon.ClearFBNPC()
#        npcCfg = GetIceLodeNPCCfg()
#        for npcInfo in npcCfg:
#            NPCCustomRefresh.CloseNPCRefresh(npcInfo[Def_RefreshMark], tick)
#
#        #__DoIceLodeOver(True)
    #DoFBHelp(curPlayer, tick)
    return
## 是否副本复活
@@ -401,25 +518,29 @@
        return
    
    playerID = curPlayer.GetPlayerID()
    lineID = FBCommon.GetFBPropertyMark()
    star = GameWorld.GetGameFB().GetGameFBDictByKey(FBPlayerDict_FBStar)
    mapID = ChConfig.Def_FBMapID_IceLode
    hasPass = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, 0, False, [mapID])
    if isPass and not hasPass:
        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, 0, 1, False, [mapID])
    #更新星级
    lastStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    if isPass and star > lastStar:
        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, star, False, [mapID])
        FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # 同步信息
    # 记录最后一次手打获得的总经验
    exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
    expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
    totalExp = expPoint * ChConfig.Def_PerPointValue + exp
    isInFBOnDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeIsInFBOnDay)
    if isInFBOnDay: #在副本里过天,副本结束后再补发奖励
        CheckIceLodeStarAwardMail(curPlayer)
#    exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
#    expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
#    totalExp = expPoint * ChConfig.Def_PerPointValue + exp
    
    costTime = gameFB.GetGameFBDictByKey(FBPlayerDict_CostTime)
    if not costTime:
        costTime = tick - GameWorld.GetGameFB().GetFBStepTick()
    jsonItemList = PyGameData.g_fbPickUpItemDict.get(playerID, [])
    #jsonItemList = PyGameData.g_fbPickUpItemDict.get(playerID, [])
    jsonItemList = FBCommon.GetJsonItemList(FBCommon.GetFBLineReward(mapID, lineID))
    # 通知结果
    __SendIceLodeOverInfo(curPlayer, {FBCommon.Over_isPass:int(isPass),FBCommon.Over_exp:totalExp, FBCommon.Over_costTime:costTime, FBCommon.Over_itemInfo:jsonItemList})
    __SendIceLodeOverInfo(curPlayer, {FBCommon.Over_isPass:int(isPass), FBCommon.Over_costTime:costTime, FBCommon.Over_itemInfo:jsonItemList})
    
    # 进入离开阶段
    FBCommon.SetFBStep(FB_Step_Over, tick)
@@ -454,27 +575,161 @@
## 可否扫荡
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    playerID = curPlayer.GetPlayerID()
    star = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, 0, False, [mapID])
    # 是否过关过, 扫荡星级限制暂时客户端限制,这里只判断是否过关
    if star <= 0:
        GameWorld.DebugLog("IceLode 当前所属线路未过关过,不可扫荡!lineID=%s,star=%s" % (0, star), playerID)
        return False
    #战力判断
    LVIpyData = PlayerControl.GetPlayerLVIpyData(curPlayer.GetLV())
    reFightPower = 0 if not LVIpyData else LVIpyData.GetIceLodeFightPower() # 当前等级参考战力
    if curPlayer.GetFightPower() < reFightPower:
        GameWorld.DebugLog('冰晶矿脉扫荡 战力不足 %s'%(reFightPower))
        return
    #vip判断
    if curPlayer.GetVIPLv() < IpyGameDataPY.GetFuncCfg('IceLodeCfg', 5):
        GameWorld.DebugLog('冰晶矿脉扫荡 vip不足 ')
        return
    #Ǯ
    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeHasSweep):
        costMoney = IpyGameDataPY.GetFuncCfg('IceLodeCfg', 3)
    else:
        costMoney = 0
    if costMoney:
        costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney)
        if not costMoneyList:
            return
        for moneyType, moneyNum in costMoneyList:
            if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_FBSweep):
                GameWorld.DebugLog("冰晶矿脉扫荡仙玉不足!costGold=%s" % (costMoney))
                return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeHasSweep, 1)
    return True
## 扫荡结果
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    npcCountDict = {}
    iceLodeSweepDict = IpyGameDataPY.GetFuncEvalCfg('IceLodeSweep')
    for npcID, count in iceLodeSweepDict.items():
        npcCountDict[npcID] = count * sweepCnt
    exp_rate = PlayerControl.GetLimitExpRate(curPlayer, ChConfig.ExpRateLimitType_Sweep)
    jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, exp_rate)
    GameWorld.DebugLog("扫荡奖励: 次数=%s,totalExp=%s,totalMoney=%s,jsonItemList=%s" % (sweepCnt, totalExp, totalMoney, jsonItemList))
    overDict = {FBCommon.Over_isPass:1, FBCommon.Over_exp:totalExp, FBCommon.Over_isSweep:1, FBCommon.Over_itemInfo:jsonItemList}
    itemList = IpyGameDataPY.GetFuncEvalCfg('IceLodeCfg', 4)
    jsonItemList = FBCommon.GetJsonItemList(itemList)
    needSpace = len(itemList)
    if needSpace > ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace):
        PlayerControl.SendMailByKey(0, [curPlayer.GetID()], itemList)
    else:
        for itemID, itemCnt, isBind in itemList:
            ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
#    npcCountDict = {}
#    iceLodeSweepDict = IpyGameDataPY.GetFuncEvalCfg('IceLodeSweep')
#    for npcID, count in iceLodeSweepDict.items():
#        npcCountDict[npcID] = count * sweepCnt
#
#    exp_rate = PlayerControl.GetLimitExpRate(curPlayer, ChConfig.ExpRateLimitType_Sweep)
#    jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, exp_rate)
    GameWorld.DebugLog("扫荡奖励: 次数=%s,jsonItemList=%s" % (sweepCnt, jsonItemList))
    overDict = {FBCommon.Over_isPass:1, FBCommon.Over_isSweep:1, FBCommon.Over_itemInfo:jsonItemList}
    __SendIceLodeOverInfo(curPlayer, overDict)
    for _ in xrange(sweepCnt):
        EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_IceLode, 0, ChConfig.CME_Log_Start)
    return True
def GetIceLodeStarAward(curPlayer, starIndex):
    ## 领取冰晶矿脉星级奖励
    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('IceLodeStarAward', {'Index':starIndex}, True)
    if not ipyDataList:
        return
    playerLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeDayLV)
    #playerLV = curPlayer.GetLV()
    awardList = []
    needStar = 0
    for ipyData in ipyDataList:
        lvLimit = ipyData.GetLVLimit()
        if lvLimit[0]<=playerLV <=lvLimit[1]:
            awardList = ipyData.GetItemList()
            needStar = ipyData.GetStar()
            break
    if not awardList:
        GameWorld.Log('    领取冰晶矿脉星级奖励,没找到奖励 starIndex=%s,playerLV=%s'%(starIndex,playerLV), curPlayer.GetID())
        return
    awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeStarAwardRecord)
    if awardRecord & pow(2, starIndex):
        GameWorld.DebugLog('领取冰晶矿脉星级奖励, 奖励已领取 starIndex=%s'%starIndex)
        return
    starCnt, lineList = GetIceLodeAllStarCnt(curPlayer)
    if starCnt < needStar:
        GameWorld.DebugLog('领取冰晶矿脉星级奖励, 总星数不足starIndex=%s  starCnt=%s,needStar=%s'%(starIndex,starCnt,needStar))
        return
    # 检查背包
    needSpace = len(awardList)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeStarAwardRecord, awardRecord|pow(2, starIndex))
    for itemID, itemCount, isBind in awardList:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
    #֪ͨ
    SyncIceLoddInfo(curPlayer)
    return
def GetIceLodeAllStarCnt(curPlayer):
    ##获取当前总星数
    maxCnt, randomCnt = IpyGameDataPY.GetFuncEvalCfg('IceLodeCfg', 2)
    starCnt = 0
    lineList = []
    for i in xrange(maxCnt):
        if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_IceLoadLineID, i):
            starCnt += GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, i, False, [ChConfig.Def_FBMapID_IceLode])
            lineList.append(i)
    if len(lineList) != randomCnt:
        GameWorld.ErrLog('    冰晶矿脉获取当前总星数,当前线路数量异常!lineList=%s'%lineList)
    return starCnt, lineList[:randomCnt]
def CheckIceLodeStarAwardMail(curPlayer):
    #邮件补发未领取星级奖励
    serverTime = GameWorld.GetCurrentTime()
    curDateTimeStr = "%d-%d-%d 00:00:00" % (serverTime.year, serverTime.month, serverTime.day)
    curDateTime = datetime.datetime.strptime(curDateTimeStr, ChConfig.TYPE_Time_Format)
    curDateTime = int(time.mktime(curDateTime.timetuple()))
    lastCheckTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeLastCheckTime)
    if lastCheckTime and lastCheckTime == curDateTime:
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeLastCheckTime, curDateTime)
    itemList = []
    mailStarList = []
    awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeStarAwardRecord)
    playerLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeDayLV)
    starCnt, lineList = GetIceLodeAllStarCnt(curPlayer)
    ipyMgr = IpyGameDataPY.IPY_Data()
    newRecord = awardRecord
    for i in xrange(ipyMgr.GetIceLodeStarAwardCount()):
        ipyData = ipyMgr.GetIceLodeStarAwardByIndex(i)
        starIndex = ipyData.GetIndex()
        lvLimit = ipyData.GetLVLimit()
        if lvLimit[0]<=playerLV <=lvLimit[1]:
            if starCnt >= ipyData.GetStar() and not awardRecord & pow(2, starIndex):
                itemList += ipyData.GetItemList()
                newRecord |= pow(2, starIndex)
                mailStarList.append(starIndex)
    if itemList:
        PlayerControl.SendMailByKey('IceLodeStarReward', [curPlayer.GetID()], itemList, detail=mailStarList)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeIsInFBOnDay, 0)
    #重置领奖记录
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeStarAwardRecord, 0)
    #随机今日玩法
    __RandomLine(curPlayer)
    #֪ͨ
    SyncIceLoddInfo(curPlayer)
    return True
def SyncIceLoddInfo(curPlayer):
    starCnt, lineList = GetIceLodeAllStarCnt(curPlayer)
    packdata = ChPyNetSendPack.tagMCIceLodeInfo()
    packdata.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeStarAwardRecord)
    packdata.DayLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeDayLV)
    packdata.HasSweep = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_IceLodeHasSweep)
    packdata.LineList = lineList
    packdata.Cnt = len(packdata.LineList)
    NetPackCommon.SendFakePack(curPlayer, packdata)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -279,6 +279,7 @@
                        ("DWORD", "RePotionCD", 0),
                        ("DWORD", "AttackEff", 0),
                        ("DWORD", "ReFightPower", 0),
                        ("DWORD", "IceLodeFightPower", 0),
                        ),
                "GMAttr":(
@@ -1095,6 +1096,13 @@
                        ("list", "RefreshNPC", 0),
                        ("dict", "AttrDict", 0),
                        ),
                "IceLodeStarAward":(
                        ("BYTE", "Index", 1),
                        ("BYTE", "Star", 0),
                        ("list", "LVLimit", 0),
                        ("list", "ItemList", 0),
                        ),
                }
@@ -1586,7 +1594,8 @@
        self.RePotionReply = 0
        self.RePotionCD = 0
        self.AttackEff = 0
        self.ReFightPower = 0
        self.ReFightPower = 0
        self.IceLodeFightPower = 0
        return
        
    def GetLV(self): return self.LV # 玩家等级
@@ -1617,7 +1626,8 @@
    def GetRePotionReply(self): return self.RePotionReply # 血瓶恢复量
    def GetRePotionCD(self): return self.RePotionCD # ѪƿCD
    def GetAttackEff(self): return self.AttackEff # 挂机效率
    def GetReFightPower(self): return self.ReFightPower # 战斗力
    def GetReFightPower(self): return self.ReFightPower # 战斗力
    def GetIceLodeFightPower(self): return self.IceLodeFightPower # 冰晶矿脉扫荡战斗力
# GM测试属性表
class IPY_GMAttr():
@@ -3327,6 +3337,21 @@
    def GetLevel(self): return self.Level # 关卡
    def GetRefreshNPC(self): return self.RefreshNPC # 刷怪配置
    def GetAttrDict(self): return self.AttrDict # 属性
# 冰晶矿脉星级奖励表
class IPY_IceLodeStarAward():
    def __init__(self):
        self.Index = 0
        self.Star = 0
        self.LVLimit = []
        self.ItemList = []
        return
    def GetIndex(self): return self.Index # 奖励索引
    def GetStar(self): return self.Star # 星数
    def GetLVLimit(self): return self.LVLimit # 等级范围
    def GetItemList(self): return self.ItemList # 奖励
def Log(msg, playerID=0, par=0):
@@ -3556,6 +3581,8 @@
        self.ipyTotalRechargeTemplateLen = len(self.ipyTotalRechargeTemplateCache)
        self.ipyMagicWeaponFBCache = self.__LoadFileData("MagicWeaponFB", IPY_MagicWeaponFB)
        self.ipyMagicWeaponFBLen = len(self.ipyMagicWeaponFBCache)
        self.ipyIceLodeStarAwardCache = self.__LoadFileData("IceLodeStarAward", IPY_IceLodeStarAward)
        self.ipyIceLodeStarAwardLen = len(self.ipyIceLodeStarAwardCache)
        Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
        Log("IPY_DataMgr InitOK!")
        return
@@ -3926,6 +3953,8 @@
    def GetTotalRechargeTemplateByIndex(self, index): return self.ipyTotalRechargeTemplateCache[index]
    def GetMagicWeaponFBCount(self): return self.ipyMagicWeaponFBLen
    def GetMagicWeaponFBByIndex(self, index): return self.ipyMagicWeaponFBCache[index]
    def GetIceLodeStarAwardCount(self): return self.ipyIceLodeStarAwardLen
    def GetIceLodeStarAwardByIndex(self, index): return self.ipyIceLodeStarAwardCache[index]
IPYData = IPY_DataMgr()
def IPY_Data(): return IPYData
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -72,7 +72,7 @@
import PlayerFreeGoods
import ShopItemManage
import PlayerRecover
import Operate_EquipSuitCompose
import GameLogic_IceLode
import PlayerEquipDecompose
import PlayerCoat
import PlayerGreatMaster
@@ -5127,6 +5127,10 @@
    # 功能开启奖励
    elif rewardType == ChConfig.Def_RewardType_OpenFunc:
        GameFuncComm.GetFuncOpenAward(curPlayer, dataEx)
    # 冰晶矿脉星级奖励
    elif rewardType == ChConfig.Def_RewardType_IceLodeStar:
        GameLogic_IceLode.GetIceLodeStarAward(curPlayer, dataEx)
#
#    # 充值豪礼奖励
#    elif rewardType == ShareDefine.Def_RewardType_GoldGift: