fix:3604 【后端】潜力0级时增加战力 3609 【后端】法宝之魂改为由各个法宝单独觉醒,取消激活条件
3个文件已修改
99 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -620,6 +620,7 @@
    DWORD        PreTreasure;    //前置法宝
    list        SuccID;    //成就ID
    list        Potentials;    //技能潜力升级
    list        SkillPower;    //技能解锁战力
    dict        NeedItem;    //需要消耗物品
};
@@ -634,6 +635,7 @@
    list        UnLockSkill;    //解锁的技能
    DWORD        ActiveMWID;    //激活法宝ID
    list        ItemAward;    //物品奖励[itemID,cnt,isbind]
    DWORD        ActiveSoulID;    //激活魂ID
};
//法宝特权表
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -520,6 +520,7 @@
                        ("DWORD", "PreTreasure", 0),
                        ("list", "SuccID", 0),
                        ("list", "Potentials", 0),
                        ("list", "SkillPower", 0),
                        ("dict", "NeedItem", 0),
                        ),
@@ -531,6 +532,7 @@
                        ("list", "UnLockSkill", 0),
                        ("DWORD", "ActiveMWID", 0),
                        ("list", "ItemAward", 0),
                        ("DWORD", "ActiveSoulID", 0),
                        ),
                "TreasurePrivilege":(
@@ -2016,6 +2018,7 @@
        self.PreTreasure = 0
        self.SuccID = []
        self.Potentials = []
        self.SkillPower = []
        self.NeedItem = {}
        return
        
@@ -2024,6 +2027,7 @@
    def GetPreTreasure(self): return self.PreTreasure # 前置法宝
    def GetSuccID(self): return self.SuccID # 成就ID
    def GetPotentials(self): return self.Potentials # 技能潜力升级
    def GetSkillPower(self): return self.SkillPower # 技能解锁战力
    def GetNeedItem(self): return self.NeedItem # 需要消耗物品
# 法宝升级表
@@ -2037,6 +2041,7 @@
        self.UnLockSkill = []
        self.ActiveMWID = 0
        self.ItemAward = []
        self.ActiveSoulID = 0
        return
        
    def GetMWID(self): return self.MWID # 法宝ID
@@ -2046,6 +2051,7 @@
    def GetUnLockSkill(self): return self.UnLockSkill # 解锁的技能
    def GetActiveMWID(self): return self.ActiveMWID # 激活法宝ID
    def GetItemAward(self): return self.ItemAward # 物品奖励[itemID,cnt,isbind]
    def GetActiveSoulID(self): return self.ActiveSoulID # 激活魂ID
# 法宝特权表
class IPY_TreasurePrivilege():
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
@@ -157,6 +157,11 @@
    elif activeMWID:
        DoActiveMW(curPlayer, activeMWID)
    
    #激活魂
    activeSoulID = upIpyData.GetActiveSoulID()
    if activeSoulID:
        __DoActiveMWSoul(curPlayer, activeSoulID, False)
    CalcMagicWeaponAttr(curPlayer)
    PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
    
@@ -220,9 +225,10 @@
            activeCnt += 1
    return activeCnt
def GetPotentialsNextSkillID(skillID):
    #通过潜力技能ID获取对应的下一个技能ID
def GetPotentialsSkillInfo(curPlayer):
    #通过潜力技能ID获取对应的下一个技能ID {skillUseType:{skillid:[skilllv,nextSkillid,addPower,]}}
    global g_potentialsSkillDict
    if not g_potentialsSkillDict:
        g_potentialsSkillDict = {}
        ipyDataMgr = IpyGameDataPY.IPY_Data()
@@ -230,10 +236,31 @@
            ipyData = ipyDataMgr.GetTreasureByIndex(i)
            mwID = ipyData.GetID()
            skillIDList = ipyData.GetPotentials()
            for i, curSkillID in enumerate(skillIDList):
                nextSkillID = skillIDList[i+1] if i+1 < len(skillIDList) else 0
                g_potentialsSkillDict[curSkillID] = nextSkillID
    return g_potentialsSkillDict.get(skillID, 0)
            addPowerList = ipyData.GetSkillPower()
            lastSkillUseType = 0
            for curSkillID in skillIDList:
                skillData = GameWorld.GetGameData().FindSkillByType(curSkillID, 1)
                if skillData == None:
                    GameWorld.DebugLog("GetPotentialsSkillInfo() hasn't find skill(%s)" % curSkillID)
                    continue
                if lastSkillUseType != skillData.GetUseType():
                    index = 0
                else:
                    index +=1
                lastSkillUseType = skillData.GetUseType()
                addPower = addPowerList[index]
                preSkillID = skillData.GetLearnSkillReq()
                if not preSkillID:
                    continue
                skillUseType = skillData.GetUseType()
                preSkilllv = skillData.GetLearnSkillLV()
                if skillUseType not in g_potentialsSkillDict:
                    g_potentialsSkillDict[skillUseType] = {}
                g_potentialsSkillDict[skillUseType][preSkillID] = [preSkilllv, curSkillID, addPower]
    curskillUseType = pow(2, curPlayer.GetJob())
    return g_potentialsSkillDict.get(curskillUseType, {})
## 给技能
#  @param curPlayer
@@ -385,22 +412,25 @@
                    PlayerControl.WorldNotify(0, 'SkillPotential2', [curPlayer.GetName(), skillTypeID, upSkillLv, newSkillID])
            
    
    if SkillCommon.isPassiveAttr(upSkill) or newSkillIsPassive:
        curControl.RefreshPlayerAttrState()
    curControl.RefreshSkillFightPowerEx(upSkill.GetSkillID(), beforeFightPower)
    PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer, upSkill.GetSkillID())
    #通知技能已升级成功
    nextSkillID = GetPotentialsNextSkillID(skillTypeID)
    if nextSkillID:
        nextSkill = GameWorld.GetGameData().FindSkillByType(nextSkillID, 1)
        if nextSkill and nextSkill.GetLearnSkillReq() == skillTypeID and upSkillLv == nextSkill.GetLearnSkillLV():
    hasUnlockSkill = False
    nextSkillDict = GetPotentialsSkillInfo(curPlayer)
    if skillTypeID in nextSkillDict:
        needSkilllv,nextSkillID = nextSkillDict[skillTypeID][:2]
        if upSkillLv == needSkilllv:
            PlayerControl.WorldNotify(0, 'SkillPotential1', [curPlayer.GetName(), skillTypeID, upSkillLv, nextSkillID])
            CalcMagicWeaponAttr(curPlayer)
            hasUnlockSkill = True
                
    maxLV = upSkill.GetSkillMaxLV()
    if upSkillLv == maxLV:
        PlayerControl.WorldNotify(0, 'SkillPotential3', [curPlayer.GetName(), skillTypeID, maxLV])
    if SkillCommon.isPassiveAttr(upSkill) or newSkillIsPassive or hasUnlockSkill:
        curControl.RefreshPlayerAttrState()
    curControl.RefreshSkillFightPowerEx(upSkill.GetSkillID(), beforeFightPower)
    PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer, upSkill.GetSkillID())
    
    #获得技能等级
    #curSkillLV = curSkill.GetSkillLV()
@@ -465,7 +495,7 @@
        #    attrDict = refineipyData.GetTreasureAttr()
        #    GameWorld.AddDictValue(allAttrDict, attrDict)
        #=======================================================================
        treasureType = treasureIpyData.GetTreasureType()
        #等级属性
        curMWLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MagicWeaponLV % magicWeaponID)
        for lv in xrange(curMWLV+1):
@@ -473,6 +503,7 @@
            if upIpyData:
                attrDict = upIpyData.GetAddAttr()
                GameWorld.AddDictValue(allAttrDict, attrDict)
        if magicWeaponID == signDayMWID:
            #签到属性
            totalSignNum = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalSignNum) # 总签到天数
@@ -481,7 +512,7 @@
                addAttr[int(attid)] = attnum * totalSignNum
            GameWorld.AddDictValue(allAttrDict, addAttr)
        
        treasureType = treasureIpyData.GetTreasureType()
        for effID, value in allAttrDict.items():
            if treasureType == 1:
                PlayerControl.CalcAttrDict_Type(effID, value, allAttrList1)
@@ -492,9 +523,27 @@
            else:
                GameWorld.ErrLog("未知法宝属性, magicWeaponID=%s,treasureType=%s,effID=%s,value=%s" 
                                 % (magicWeaponID, treasureType, effID, value), curPlayer.GetPlayerID())
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_MagicWeapon1, allAttrList1)
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_MagicWeapon2, allAttrList2)
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_MagicWeapon3, allAttrList3)
    #技能解锁战力
    nextSkillDict = GetPotentialsSkillInfo(curPlayer)
    addPowerDict = {}
    for skillID, info in nextSkillDict.items():
        needSkilllv, nextSkillID, addPower = info
        skillManager = curPlayer.GetSkillManager()
        curSkill = skillManager.FindSkillBySkillTypeID(skillID)
        if not curSkill:
            continue
        curSkillLV = curSkill.GetSkillLV()
        if curSkillLV < needSkilllv:
            continue
        mfpType = ChConfig.Def_SkillFuncType_MFPType.get(curSkill.GetFuncType(), ShareDefine.Def_MFPType_Role)
        addPowerDict[mfpType] = addPowerDict.get(mfpType, 0) + addPower
    for mfpType, addPower in addPowerDict.items():
        curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % mfpType, addPower)
    return
#// A5 77 玩家精炼法宝 #tagCMMWRefine
@@ -1004,17 +1053,23 @@
            GameWorld.DebugLog('    激活法宝之魂 成就未完成  soulID=%s,succID=%s'%(soulID, succID))
            return
    
    __DoActiveMWSoul(curPlayer, soulID)
    return
def __DoActiveMWSoul(curPlayer, soulID, isRefreshAttr=True):
    GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_MWSoulActiveState, soulID, 1, True)
    #任务
    EventShell.EventRespons_MWSoulActive(curPlayer, soulID)
    
    CalcMagicWeaponSoulAttr(curPlayer)
    if isRefreshAttr:
    PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
    
    #֪ͨ
    Sycn_MWPrivilegeData(curPlayer, soulID)
    return
def GetIsActiveMWSoul(curPlayer, soulID):
    #获取法宝之魂是否已激活
    return GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_MWSoulActiveState, soulID)