6805 【后端】【2.0】副本前端化(支持骑乘、宠物的召唤限制处理)
6个文件已修改
60 ■■■■■ 已修改文件
PySysDB/PySysDBPY.h 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -538,6 +538,15 @@
    dict        SweepGoodDrop;    //扫荡珍稀符印
};
//地图表格
struct tagChinMap
{
    DWORD        _MapID;    //地图ID
    BYTE        CanRide;    //可否骑乘
    BYTE        CanOutPet;    //可否召唤宠物
};
//副本总表
struct tagFBFunc
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -451,6 +451,12 @@
                        ("dict", "SweepGoodDrop", 0),
                        ),
                "ChinMap":(
                        ("DWORD", "MapID", 1),
                        ("BYTE", "CanRide", 0),
                        ("BYTE", "CanOutPet", 0),
                        ),
                "FBFunc":(
                        ("DWORD", "DataMapID", 1),
                        ("BYTE", "DayTimes", 0),
@@ -2335,6 +2341,19 @@
    def GetSweepRunePoint(self): return self.SweepRunePoint # 扫荡符印精华
    def GetSweepYsog(self): return self.SweepYsog # 扫荡魔精
    def GetSweepGoodDrop(self): return self.SweepGoodDrop # 扫荡珍稀符印
# 地图表格
class IPY_ChinMap():
    def __init__(self):
        self.MapID = 0
        self.CanRide = 0
        self.CanOutPet = 0
        return
    def GetMapID(self): return self.MapID # 地图ID
    def GetCanRide(self): return self.CanRide # 可否骑乘
    def GetCanOutPet(self): return self.CanOutPet # 可否召唤宠物
# 副本总表
class IPY_FBFunc():
@@ -4562,6 +4581,8 @@
        self.ipyNPCDropItemLen = len(self.ipyNPCDropItemCache)
        self.ipyRuneTowerCache = self.__LoadFileData("RuneTower", IPY_RuneTower)
        self.ipyRuneTowerLen = len(self.ipyRuneTowerCache)
        self.ipyChinMapCache = self.__LoadFileData("ChinMap", IPY_ChinMap)
        self.ipyChinMapLen = len(self.ipyChinMapCache)
        self.ipyFBFuncCache = self.__LoadFileData("FBFunc", IPY_FBFunc)
        self.ipyFBFuncLen = len(self.ipyFBFuncCache)
        self.ipyFBLineCache = self.__LoadFileData("FBLine", IPY_FBLine)
@@ -5024,6 +5045,8 @@
    def GetNPCDropItemByIndex(self, index): return self.ipyNPCDropItemCache[index]
    def GetRuneTowerCount(self): return self.ipyRuneTowerLen
    def GetRuneTowerByIndex(self, index): return self.ipyRuneTowerCache[index]
    def GetChinMapCount(self): return self.ipyChinMapLen
    def GetChinMapByIndex(self, index): return self.ipyChinMapCache[index]
    def GetFBFuncCount(self): return self.ipyFBFuncLen
    def GetFBFuncByIndex(self, index): return self.ipyFBFuncCache[index]
    def GetFBLineCount(self): return self.ipyFBLineLen
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -260,6 +260,8 @@
    if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
        PlayerFB.DoExitCustomScene(curPlayer)
        
    PetControl.DoLogic_PetLoadMapOK(curPlayer)
    msgInfo = ""
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetPlayerID(), 0, 0, "RefreshMainServerRole", msgInfo, len(msgInfo))
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
@@ -46,6 +46,7 @@
import BaseAttack
import PassiveBuffEffMng
import ChNetSendPack
import IpyGameDataPY
#---------------------------------------------------------------------
DefPetRebornHPRate = 100  # 宠物死亡复活血量百分比
@@ -460,7 +461,7 @@
# @return BOOL 是否可出战
# @remarks 检查当前指定宠物是否可出战
def CheckPetCanFight(curPlayer, curPetObj):
    if not GameWorld.GetMap().GetMapCanOutPet():
    if not GetMapCanOutPet(curPlayer):
        #Pet_liubo_314885 此地图禁止宠物
        PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
        return False
@@ -546,7 +547,7 @@
    if not rolePet.GetIsBattle():
        return
    
    if not GameWorld.GetMap().GetMapCanOutPet():
    if not GetMapCanOutPet(curPlayer):
        #此地图禁止宠物
        return
    #召唤宠物出战
@@ -578,7 +579,7 @@
# @remarks 
def DoLogic_PetLoadMapOK(curPlayer):
    
    if GameWorld.GetMap().GetMapCanOutPet():
    if GetMapCanOutPet(curPlayer):
        #此地图宠物可以上
        PlayerPet.AutoSummonPet(curPlayer)
        return
@@ -591,6 +592,16 @@
    PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
    return
def GetMapCanOutPet(curPlayer):
    ## 检查本地图可否出战宠物,支持前端自定义场景
    customMapID = PlayerControl.GetCustomMapID(curPlayer)
    if customMapID:
        ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
        canOutPet = True if ipyMapData and ipyMapData.GetCanOutPet() else False
    else:
        canOutPet = GameWorld.GetMap().GetMapCanOutPet()
    return canOutPet
#---------------------------------------------------------------------
## 刷新宠物信息并通知客户端
#  @param rolePet 宠物实例
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py
@@ -40,6 +40,7 @@
import FBHelpBattle
import SkillShell
import PyGameData
import PetControl
import NPCCommon
import time
@@ -510,6 +511,7 @@
    PlayerControl.SetCustomMap(curPlayer, mapID, lineID)
    GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
    if mapID:
        PetControl.DoLogic_PetLoadMapOK(curPlayer)
        FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
        
    #通知进入状态
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
@@ -189,6 +189,13 @@
    if not curPlayer.GetInitOK():
        return False
                    
    customMapID = PlayerControl.GetCustomMapID(curPlayer)
    if customMapID:
        ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
        if not ipyMapData or not ipyMapData.GetCanRide():
            PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
            return False
    else:
    #地图不允许骑马 RideLimit_lhs_0
    if not GameWorld.GetMap().GetMapCanRide():
        PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")