547 【红颜系统】新增红颜-服务端(新增激活方式8-定军阁层;新增红颜特殊效果5-遣散/吞噬额外返还;统一A801、0320物品获得标记;)
8个文件已修改
91 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -234,6 +234,7 @@
    DWORD        StarAddPer;    // 卡牌每星级加成
    list        BookActAwardMoney;    // 图鉴激活奖励货币 类型|值
    list        DismissReturnItems;    // 遣散每星返还道具 [[物品ID,个数], ...]
    list        BeautyReturnItems;    // 红颜效果返还道具基数 [[物品ID,个数], ...]
    list        RecommendAwardMoney;    // 阵容推荐激活奖励货币 类型|值
};
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4923,3 +4923,11 @@
CoinType_ExchangePayCoin, # 代表转换 6
CoinType_PayCoin, # 代币充值 7
) = range(8)
# 物品产出来源特殊标记
(
ItemSrcSign_Default, # 无
ItemSrcSign_GubaoEff, # 古宝效果额外产出 1
ItemSrcSign_BeautyEff, # 红颜效果额外产出 2
ItemSrcSign_TitleEff, # 称号效果额外产出 3
) = range(1 + 3)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
@@ -74,9 +74,10 @@
    itemList += FBCommon.GetSweepAwardList(mapID, lineID, sweepCnt)
    GameWorld.DebugLog("白骨盈野扫荡: mapID=%s,lineID=%s,sweepCnt=%s,itemList=%s" % (mapID, lineID, sweepCnt, itemList))
    
    isBind = ItemControler.GetIsBindValue(srcSign=ChConfig.ItemSrcSign_BeautyEff)
    exItemCount, exItemID = PlayerBeauty.GetBeautyEffInfo(curPlayer, PlayerBeauty.EffType_FBZhanchuiItemEx) # 扫荡额外物品奖励
    if exItemCount and exItemID:
        itemList += [[exItemID, exItemCount, 1]] # 标记是红颜效果额外获得的
        itemList += [[exItemID, exItemCount, isBind]] # 标记是红颜效果额外获得的
        GameWorld.DebugLog("红颜额外增加扫荡物品奖励: exItemID=%s, exItemCount=%s, itemList=%s" % (exItemID, exItemCount, itemList))
        
    ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
@@ -86,7 +87,7 @@
    for itemInfo in itemList:
        itemDict = {"ItemID":itemInfo[0], "Count":itemInfo[1]}
        if len(itemInfo) > 2:
            itemDict['BeautyEx'] = itemInfo[2]
            itemDict['IsBind'] = itemInfo[2]
        jsonItemList.append(itemDict)
    overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_isSweep:1}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -238,6 +238,7 @@
                        ("DWORD", "StarAddPer", 0),
                        ("list", "BookActAwardMoney", 0),
                        ("list", "DismissReturnItems", 0),
                        ("list", "BeautyReturnItems", 0),
                        ("list", "RecommendAwardMoney", 0),
                        ),
@@ -2046,7 +2047,8 @@
    def GetStarAddPer(self): return self.attrTuple[6] #  卡牌每星级加成 DWORD
    def GetBookActAwardMoney(self): return self.attrTuple[7] #  图鉴激活奖励货币 类型|值 list
    def GetDismissReturnItems(self): return self.attrTuple[8] #  遣散每星返还道具 [[物品ID,个数], ...] list
    def GetRecommendAwardMoney(self): return self.attrTuple[9] #  阵容推荐激活奖励货币 类型|值 list
    def GetBeautyReturnItems(self): return self.attrTuple[9] #  红颜效果返还道具基数 [[物品ID,个数], ...] list
    def GetRecommendAwardMoney(self): return self.attrTuple[10] #  阵容推荐激活奖励货币 类型|值 list
# 武将品质突破表
class IPY_HeroQualityBreak():
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -2005,14 +2005,20 @@
    GameWorld.ErrLog('DoLogic_PutItemInPack Error 物品无法放入背包')
    return False
## 是否拍品
def GetIsAuctionItem(curItem): return curItem.GetIsBind()
def SetIsAuctionItem(curItem, isAuctionItem, curPlayer=None):
    curItem.SetIsBind(isAuctionItem)
def GetIsBindValue(isBind=0, srcSign=0):
    ## 获取IsBind值,适用于配置或者通知前端特殊标记用,兼容是否绑定/拍品设定
    # @param isBind: 可支持原绑定/拍品逻辑,如果该项目没有该逻辑暂时默认都为0
    # @param srcSign: 标记物品特殊来源,如xx特权额外产出等
    return srcSign * 10 + isBind
    
    if isAuctionItem:
        curItem.SetUserAttr(ShareDefine.Def_IudetAuctionItemCreateTime, int(time.time()))
        return
## 是否拍品
def GetIsAuctionItem(curItem): return 0#curItem.GetIsBind()
def SetIsAuctionItem(curItem, isAuctionItem, curPlayer=None):
    #curItem.SetIsBind(isAuctionItem)
    #
    #if isAuctionItem:
    #    curItem.SetUserAttr(ShareDefine.Def_IudetAuctionItemCreateTime, int(time.time()))
    #    return
    return
def GetItemCountByID(curPlayer, itemID):
@@ -2265,7 +2271,7 @@
            break
           
    if isSendMail:
        PlayerControl.SendMailByKey(mailKey, [curPlayer.GetPlayerID()], giveItemList)
        PlayerMail.SendMailByKey(mailKey, curPlayer.GetPlayerID(), giveItemList)
        GameWorld.DebugLog("GivePlayerItemOrMail背包空间不够,发送邮件: mailItemList=%s" % str(giveItemList), curPlayer.GetPlayerID())
    else:
        for itemID, itemCnt, isAuctionItem in giveItemList:
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
@@ -23,6 +23,7 @@
import IpyGameDataPY
import ChPyNetSendPack
import OpenServerActivity
import GameLogic_Dingjunge
import PlayerGoldRush
import NetPackCommon
import ItemControler
@@ -39,7 +40,8 @@
UnlockWay_FBZhanchui, # 白骨盈野过关 5
UnlockWay_OfficialRank, # 官职达到 6
UnlockWay_TravelCnt, # 游历次数 7
) = range(1, 1 + 7)
UnlockWay_FBDingjunge, # 定军阁通关层 8
) = range(1, 1 + 8)
# 皮肤解锁方式
UnlockWaySkin_Default = 1 # 默认解锁 1
@@ -51,7 +53,8 @@
EffType_ArenaItemEx, # 2. 演武场挑战胜利,概率额外获得1个物品的概率    TypeValue:物品ID  Value:概率
EffType_TravelEnergy, # 3.游历体力上限增加     Value:增加上限
EffType_FBZhanchuiItemEx, # 4.白骨盈野扫荡额外物品奖励      TypeValue:物品ID  Value:数量
) = range(1, 1 + 4)
EffType_HeroItemExPer, # 5.遣散/吞噬武将额外返还      Value:百分比
) = range(1, 1 + 5)
def OnPlayerLogin(curPlayer):
    SyncBeautyInfo(curPlayer)
@@ -182,6 +185,13 @@
            GameWorld.DebugLog("激活红颜所需副本未过关! beautyID=%s,mapID=%s,funcLineID=%s" % (beautyID, mapID, funcLineID), playerID)
            return
        
    elif unlockWay == UnlockWay_FBDingjunge:
        passLayer = GameLogic_Dingjunge.GetPassLayerMax(curPlayer)
        needLayer = unlockValue
        if passLayer < needLayer:
            GameWorld.DebugLog("激活红颜所需定军阁通关层不足! beautyID=%s,passLayer=%s < %s" % (beautyID, passLayer, needLayer), playerID)
            return
    elif unlockWay == UnlockWay_OfficialRank:
        realmLV = curPlayer.GetOfficialRank()
        needRealmLV = unlockValue
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -285,7 +285,7 @@
        gubaoPowerType = exItemGubaoPowerDict[investType]
        # 古宝月卡奖励双倍特权
        exItemList = []
        gubaoExSign = 10 # 标记古宝额外奖励
        isBind = ItemControler.GetIsBindValue(srcSign=ChConfig.ItemSrcSign_GubaoEff)
        for itemInfo in rewardItemList:
            itemID, itemCount = itemInfo[:2]
            addPer = PlayerGubao.GetGubaoPowerValue(curPlayer, gubaoPowerType, itemID)
@@ -294,7 +294,7 @@
            countEx = int(itemCount * addPer / 100.0)
            if not countEx:
                continue
            exItemList.append([itemID, countEx, gubaoExSign])
            exItemList.append([itemID, countEx, isBind])
        if exItemList:
            rewardItemList += exItemList
            
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
@@ -28,6 +28,7 @@
import PlayerControl
import PlayerOnline
import PlayerPreset
import PlayerBeauty
import PlayerTask
import GameWorld
import ChConfig
@@ -413,6 +414,12 @@
        for itemID, itemCount in dismissReturnItems:
            returnCnt = max(1, int(itemCount * ratio / 100.0))
            returnItemList.append([itemID, returnCnt])
        returnItemExDict = {}
        __calcHeroQualityReturnItemEx(curPlayer, qualityIpyData, returnItemExDict)
        for key, itemCount in returnItemExDict.items():
            itemID, isBind = key
            returnItemList.append([itemID, itemCount, isBind])
        GameWorld.DebugLog("吞噬额外总返还: %s" % returnItemList)
        ItemControler.GivePlayerItemOrMail(curPlayer, returnItemList, event=["HeroStarUPReturn", False, {}])
        
    OpenServerActivity.UpdOSA_HeroTrainBillboard(curPlayer) # 升星
@@ -1427,6 +1434,7 @@
    ratio = IpyGameDataPY.GetFuncCfg("HeroRebirth", 5)
    dismissItemList = []
    returnItemDict = {}
    returnItemExDict = {}
    curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
    for itemIndex in itemIndexList:
        if itemIndex < 0 or itemIndex >= curPack.GetCount():
@@ -1469,6 +1477,7 @@
        GameWorld.DebugLog("    星级返还: quality=%s,heroStar=%s,ratio=%s,%s,总%s" % (quality, heroStar, ratio, dismissReturnItems, returnItemDict))
        __calcHeroLVReturnitem(quality, heroLV, returnItemDict, ratio)
        __calcHeroBreakReturnitem(quality, breakLV, returnItemDict, ratio)
        __calcHeroQualityReturnItemEx(curPlayer, qualityIpyData, returnItemExDict)
        dismissItemList.append([itemIndex, heroItem])
    
    if not dismissItemList:
@@ -1479,10 +1488,34 @@
        
    if returnItemDict:
        returnItemList = [[k, v] for k, v in returnItemDict.items()]
        for key, itemCount in returnItemExDict.items():
            itemID, isBind = key
            returnItemList.append([itemID, itemCount, isBind])
        GameWorld.DebugLog("遣散总返还: %s" % returnItemList)
        ItemControler.GivePlayerItemOrMail(curPlayer, returnItemList, event=["HeroDismiss", False, {}])
        
    return
def __calcHeroQualityReturnItemEx(curPlayer, qualityIpyData, returnItemExDict):
    ## 其他功能额外返还
    # 红颜特殊效果
    beautyReturnItems = qualityIpyData.GetBeautyReturnItems()
    if beautyReturnItems:
        isBind = ItemControler.GetIsBindValue(srcSign=ChConfig.ItemSrcSign_BeautyEff)
        retPer = PlayerBeauty.GetBeautyEffInfo(curPlayer, PlayerBeauty.EffType_HeroItemExPer)[0] # 红颜遣散/吞噬额外返还百分比
        for itemID, itemCount in beautyReturnItems:
            if not retPer:
                break
            key = (itemID, isBind)
            retCnt = max(1, int(round(itemCount * retPer / 100.0)))
            returnItemExDict[key] = returnItemExDict.get(key, 0) + retCnt
        GameWorld.DebugLog("    红颜返还: retPer=%s,%s,总%s" % (retPer, beautyReturnItems, returnItemExDict))
    # 称号特殊效果
    return
#// B4 12 战斗阵容预设保存 #tagCSHeroPresetSave
#
#struct    tagCSHeroPresetPos