129 【战斗】战斗系统-服务端(主线掉落物品默认不堆叠;注:单个物品的个数可能大于1,单个战利品ID可能一次掉多个;)
4个文件已修改
40 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -571,7 +571,7 @@
def GetItemPackType(itemData, defaultPack=IPY_GameWorld.rptItem):
    ## 获取物品对应存放的默认背包类型
    if defaultPack in [ShareDefine.rptTreasure, ShareDefine.rptTempItem]:
    if defaultPack in [ShareDefine.rptTreasure, ShareDefine.rptTempItem, IPY_GameWorld.rptIdentify]:
        #寻宝背包、临时背包不做处理
        return defaultPack
    import IpyGameDataPY
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/MainLevel.py
@@ -19,6 +19,9 @@
import PlayerControl
import IpyGameDataPY
import GameLogic_MainLevel
import IPY_GameWorld
import ClearPack
import ChConfig
def OnExec(curPlayer, gmList):
    
@@ -26,6 +29,7 @@
        GameWorld.DebugAnswer(curPlayer, "重置主线: MainLevel 0")
        GameWorld.DebugAnswer(curPlayer, "设置主线: MainLevel 章节 关卡 波")
        GameWorld.DebugAnswer(curPlayer, "测试掉落: MainLevel d 战锤数")
        GameWorld.DebugAnswer(curPlayer, "重置掉落: MainLevel d 0 [是否清掉落背包]")
        GameWorld.DebugAnswer(curPlayer, "重置战利: MainLevel b 0")
        GameWorld.DebugAnswer(curPlayer, "设置战利: MainLevel b 战利品ID 已掉落个数")
        return
@@ -34,6 +38,16 @@
    
    if value == "d":
        unXiantao = gmList[1] if len(gmList) > 1 else 1
        if unXiantao == 0:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, 0)
            GameLogic_MainLevel.ResetBootyDropToday(curPlayer)
            clearDropPack = gmList[2] if len(gmList) > 2 else 0
            if clearDropPack:
                ClearPack.__DoLogic_Clear_Pack(curPlayer, IPY_GameWorld.rptIdentify)
            GameWorld.DebugAnswer(curPlayer, "重置未结算战锤掉落OK!")
            return
        GameLogic_MainLevel.GMTestKillDrop(curPlayer, unXiantao)
        return
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevel.py
@@ -91,7 +91,8 @@
def __doMainDrop(curPlayer):
    # 装备掉落
    __doDropEquip(curPlayer)
    if __doDropEquip(curPlayer) == -1:
        return
    
    playerID = curPlayer.GetPlayerID()
    DailyBootyUpperList = []
@@ -102,10 +103,16 @@
           
    GameWorld.DebugLog("可掉落战利品上限: chapterID=%s, %s" % (chapterID, DailyBootyUpperList), playerID)
    
    # 战利品掉落默认不堆叠,故最多只能掉落剩余空格子个数的物品
    spaceCount = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptIdentify)
    # 其他战利品掉落
    bootyDropNeedDict = IpyGameDataPY.GetFuncEvalCfg("MainBootyDrop", 1, {})
    bootyDropCntDict = IpyGameDataPY.GetFuncEvalCfg("MainBootyDrop", 2, {})
    for itemID, dropUpper in DailyBootyUpperList:
        if spaceCount <= 0:
            GameWorld.DebugLog("掉落背包已满!", playerID)
            break
        if dropUpper <= 0:
            continue
        todyDropCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BootyDropToday % itemID)
@@ -137,7 +144,8 @@
        if dropCntTotal <= 0:
            continue
        
        GameWorld.DebugLog("掉落战利品! itemID=%s,unXiantaoCntBooty=%s,次数=%s,dropCntTotal=%s" % (itemID, unXiantaoCntBooty, dropBootyCnt, dropCntTotal), playerID)
        GameWorld.DebugLog("掉落战利品! itemID=%s,unXiantaoCntBooty=%s,次数=%s,dropCntTotal=%s,spaceCount=%s"
                           % (itemID, unXiantaoCntBooty, dropBootyCnt, dropCntTotal, spaceCount), playerID)
        curItem = ItemControler.GetOutPutItemObj(itemID, dropCntTotal, False, curPlayer=curPlayer)
        if curItem == None:
            continue
@@ -147,23 +155,24 @@
        unXiantaoCntBooty = unXiantaoCntBooty % dropOneNeed
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntBooty % itemID, unXiantaoCntBooty)
        SetBootyDropToday(curPlayer, itemID, todyDropCnt + dropCntTotal)
        spaceCount -= 1
        
    return
def __doDropEquip(curPlayer):
    ## 主线掉落装备
    playerID = curPlayer.GetPlayerID()
    unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip)
    dropOneNeed = IpyGameDataPY.GetFuncCfg("MainEquipDrop", 1) # 每消耗X个战锤掉落一件装备
    dropEquipCnt = unXiantaoCntEquip / dropOneNeed
    if dropEquipCnt <= 0:
        GameWorld.DebugLog("主线暂不能掉落! unXiantaoCntEquip=%s,dropOneNeed=%s,dropEquipCnt=%s" % (unXiantaoCntEquip, dropOneNeed, dropEquipCnt))
        GameWorld.DebugLog("主线暂不能掉落! unXiantaoCntEquip=%s,dropOneNeed=%s,dropEquipCnt=%s" % (unXiantaoCntEquip, dropOneNeed, dropEquipCnt), playerID)
        return
    dropEquipCnt = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptIdentify, dropEquipCnt)
    if not dropEquipCnt:
        GameWorld.DebugLog("掉落鉴定背包没有空间!")
        return
        GameWorld.DebugLog("掉落背包已满!", playerID)
        return -1
    
    playerID = curPlayer.GetPlayerID()
    treeLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreeLV)
    ipyData = IpyGameDataPY.GetIpyGameData("TreeLV", treeLV)
    if not ipyData:
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -1038,6 +1038,9 @@
        else:
            maxPackCount = curItemData.GetPackCount()
            
        if packIndex == IPY_GameWorld.rptIdentify:
            defaultPile = False # 掉落背包默认不判断堆叠
        # 虚拟背包, 默认不做叠加
        if packIndex in ShareDefine.Def_VPack_TypeList:
            return self.PutItemInVPack(packIndex, tagItem, event)