7338 子 【开发】【2.0】称号,灵宠,技能附带效果 / 【后端】【2.0】新增技能
4个文件已修改
2个文件已添加
145 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_522.py 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4109.py 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -586,7 +586,8 @@
Def_Skill_Effect_ProcessAttack = 1314  # 间隔性攻击,A值为攻击次数,B值为是否广播客户端
Def_Skill_Effect_BuffTick = 9999    #BUFF的时间处理间隔
Def_Skill_Effect_BurnToAddHP = 1091    #buff中灼烧伤害转化吸血给 放灼烧者
Def_Skill_Effect_ChangeSkillTypeID = 1305    # 改变释放的技能ID
Def_Skill_Effect_AddExpRate = 1306    # 被技能杀死的 额外加经验
#写死的技能效果ID------------NPC专用
Def_Skill_Effect_AttackMove = 2100    # NPC位移战斗
@@ -731,6 +732,7 @@
Def_SkillID_FamilyWar_RandBuffAttr = 22203 # 仙盟联赛 - 随机buff属性加成,根据采集次数,成长buff等级
Def_SkillID_FamilyWar_OwnerlessBuff = 22213 # 仙盟联赛 - 无主buff,随机N个敌方水晶变为无主
Def_SkillID_LXHY_AddExpRate = 47113 # 流星火雨杀死的怪增加经验
# 切地图需清除的buff
ClearBuffOnMapChangeList = [Def_SkillID_DropOwnerBuff, Def_SkillID_FamilyWar_CWinBuff, 
@@ -5061,7 +5063,7 @@
(Def_SkillFuncType_Common, #0为通用技能
Def_SkillFuncType_FbSkill, #1为法宝功能获得的主动技能
Def_SkillFuncType_FbPassiveSkill, #2为法宝功能获得的被动技能
Def_SkillFuncType_FbSPSkill, #3为法宝功能获得的SP技能
Def_SkillFuncType_FbSPSkill, #3为法宝功能获得的SP技能 (专精)
Def_SkillFuncType_GiftSkill, #4为天赋技能
Def_SkillFuncType_HorseSkill, #5为坐骑技能
Def_SkillFuncType_PetSkill, #6为宠物技能
@@ -5073,7 +5075,8 @@
Def_SkillFuncType_Dogz,     #12 神兽技能
Def_SkillFuncType_ZhuXian,     #13 诛仙技能
Def_SkillFuncType_SuiteSkill,     #14 套装技能
) = range(15)
Def_SkillFuncType_PassiveSkillWithSP,     #15 可有专精的被动技能
) = range(16)
# 受技能效果完全影响的怪, 对应 Def_BattleRelationType_CommNoBoss
Def_SkillAttack_NPCIsBoss = [ Def_NPCType_Ogre_Normal     ,  #平凡小怪 0    # c++ 定义为普通NPC视野刷新
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -5019,10 +5019,12 @@
        
        #if self.__GetIsLog():
        #    GameWorld.Log("玩家增加个人经验,npcID=%s,addExp=%s" % (curNPC.GetNPCID(), add_Exp), curPlayer.GetPlayerID())
        addSkillID = 0
        if curNPC.GetDictByKey(ChConfig.Def_NPCDead_KillerID) == curPlayer.GetID():
            addSkillID = curNPC.GetDictByKey(ChConfig.Def_NPCDead_Reason)
        #设定人物获得经验
        playerControl = PlayerControl.PlayerControl(curPlayer)
        playerControl.AddExp(add_Exp, ShareDefine.Def_ViewExpType_KillNPC)
        playerControl.AddExp(add_Exp, ShareDefine.Def_ViewExpType_KillNPC, addSkillID)
        
        
        self.__KillNPCFuncEx(curPlayer, curNPC, curPlayer.GetPlayerID(), False)
@@ -5233,8 +5235,11 @@
            return
        #GameWorld.Log("普通队伍杀死怪物,队伍分享人数 = %s,个人经验增加 玩家 = %s, 增加 = %s"%(playerCount, curPlayer.GetPlayerID(), add_Exp))
        #设定人物获得经验
        addSkillID = 0
        if curNPC.GetDictByKey(ChConfig.Def_NPCDead_KillerID) == curPlayer.GetID():
            addSkillID = curNPC.GetDictByKey(ChConfig.Def_NPCDead_Reason)
        playerControl = PlayerControl.PlayerControl(curPlayer)
        playerControl.AddExp(add_Exp, ShareDefine.Def_ViewExpType_KillNPC)
        playerControl.AddExp(add_Exp, ShareDefine.Def_ViewExpType_KillNPC, addSkillID)
        return
    
    #---------------------------------------------------------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3790,9 +3790,9 @@
    #  @param expViewType 经验获得的渠道
    #  @param isSysHint 是否系统提示(默认是)
    #  @return 布尔值
    def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True):
    def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True, addSkillID=0):
        curPlayer = self.__Player
        finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint)
        finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint, addSkillID)
        
        # 通知客户端经验来源
        if finalAddExp:
@@ -3808,7 +3808,8 @@
            
        return finalAddExp
    
    def __AddExp(self, curPlayer, addExp, expViewType, isSysHint):
    # 参数 addSkillID 表示因什么技能杀死NPC获得经验
    def __AddExp(self, curPlayer, addExp, expViewType, isSysHint, addSkillID=0):
        if addExp == 0:
            # 不进入计算
            return addExp, expViewType
@@ -3837,6 +3838,11 @@
        if expViewType == ShareDefine.Def_ViewExpType_KillNPC:
            exp_rate = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)
            superRate = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(curPlayer, None, None, ChConfig.TriggerType_AddExpRate)
            if addSkillID == ChConfig.Def_SkillID_LXHY_AddExpRate:
                addSkill = GameWorld.GetGameData().GetSkillBySkillID(addSkillID)
                hasEffect = SkillCommon.GetSkillEffectByEffectID(addSkill, ChConfig.Def_Skill_Effect_AddExpRate)
                if hasEffect:
                    superRate += hasEffect.GetEffectValue(0)
            exp_rate += superRate
            if superRate:
                expViewType = ShareDefine.Def_ViewExpType_KillNPCSuper
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_522.py
New file
@@ -0,0 +1,44 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: 根据签到天增长的属性值
#
# @author: Alee
# @date 2019-6-18 下午07:47:20
# @version 1.0
#
# @note:
#
#---------------------------------------------------------------------
#导入
import ChConfig
import EffGetSet
import IPY_GameWorld
#---------------------------------------------------------------------
def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
        return
    attrType = curEffect.GetEffectValue(0)
    attrTypeList = [attrType]
    # 攻击力有最大最小 特殊处理
    if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
        attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
    for tmpType in attrTypeList:
        calcDict[tmpType] = calcDict.get(tmpType, 0) + curEffect.GetEffectValue(1)*defender.NomalDictGetProperty(ChConfig.Def_PDict_TotalSignNum)  # 总签到天数
    return
## 返回buff类型,线性与否
#  @param
#  @return None
#  @remarks 函数详细说明.
def GetCalcType():
    return ChConfig.TYPE_Linear
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4109.py
New file
@@ -0,0 +1,24 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: 攻击方的最大生命百分比转化为固定伤害值
#
# @author: Alee
# @date 2019-6-18 下午09:24:04
# @version 1.0
#
# @note:
#
#---------------------------------------------------------------------
import ChConfig
import GameObj
def CheckCanHappen(attacker, defender, effect, curSkill):
    return True
def GetValue(attacker, defender, effect):
    return effect.GetEffectValue(0)*GameObj.GetMaxHP(GameObj)/ChConfig.Def_MaxRateValue
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -177,6 +177,11 @@
                                                     ChConfig.Def_PDictType_GFPassive)
        if findSkillID == 0:
            continue
        passiveEff = GetPassiveEffManager().GetPassiveEff(curPlayer)
        if passiveEff:
            findSkillID = passiveEff.ChangeSkillTypeID(findSkillID)
        skills.append(findSkillID)
        
    return skills
@@ -393,6 +398,7 @@
             4106:ChConfig.TriggerType_AddHP,   # 技能回血 84
             4107:ChConfig.TriggerType_SkillValue,   # 增加技能伤害固定值 82
             4108:ChConfig.TriggerType_SkillSuccess,  # 使用技能成功后不触发技能 处理消耗等问题用 87
             4109:ChConfig.TriggerType_SkillValue,   # 增加技能伤害固定值 82
             }
    return tdict.get(effectID, -1) 
    #===========================================================================
@@ -474,6 +480,9 @@
        self.AffectDogzSkillDict = {}   # 神兽助战技能
        self.AffectSuperEquipSkillDict = {}   # 特殊装备持有技能,相同技能不重复,数值增长性衰减, 触发使用
        self.AffectSuperEquipEffectCntDict = {}  # 特殊装备技能效果对应的已计算后的数值,直接调用
        self.ChangeSkill = {}   # 改变释放的技能ID,方便处理特效动作表现等问题 {原SkillTypeID: 改变后的SkillTypeID}
        self.IsChangeSkill = False # 当前是否刷新技能替换
    
    #记录会影响其他技能或者被动触发释放技能的BUFF
    def AddBuffInfoByEffect(self, effect, skillID, onwerID, onwerType):
@@ -635,10 +644,26 @@
        
        return self.AffectPassiveSkillSetDict
    
    # 改变技能ID的处理, 先存储释放的时候替换, 并且不登记到被动触发
    def ChangeSkillTypeIDDict(self, curSkill):
        hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_ChangeSkillTypeID)
        if not hasEffect:
            return
        self.ChangeSkill[hasEffect.GetEffectValue(0)] = curSkill.GetSkillTypeID()
        self.IsChangeSkill = True
        GameWorld.DebugLog("self.ChangeSkill  --- %s"%self.ChangeSkill)
        return True
    # 真实替换技能ID
    def ChangeSkillTypeID(self, skillID):
        return self.ChangeSkill.get(skillID, skillID)
    
    # 重刷被动型技能(含sp,天赋,不含被动技能功能)存储
    def RefreshPassiveSkill(self):
        self.AffectSkillDict = {}
        self.ChangeSkill = {}
        skillManager = self.gameObj.GetSkillManager()
        for i in range(0 , skillManager.GetSkillCount()):
            curSkill = skillManager.GetSkillByIndex(i)
@@ -651,6 +676,10 @@
            if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbPassiveSkill,
                                          ChConfig.Def_SkillFuncType_Dogz]:
                # 被动技能和神兽需设置才有效
                continue
            # 改变技能ID的处理
            if self.ChangeSkillTypeIDDict(curSkill):
                continue
            
            skillTypeID = curSkill.GetSkillTypeID()
@@ -776,9 +805,19 @@
                return
            self.AddPassiveEff(gameObj, passiveEff)
        elif skillID:
            curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
            if curSkill and passiveEff.ChangeSkillTypeIDDict(curSkill):
                # 替换技能不添加
                return
            # 单个添加被动技能
            passiveEff.AddPassiveSkill(skillID)
        if passiveEff.IsChangeSkill:
            GameWorld.DebugLog("刷被动----")
            # 存在替换技能 目前需要刷新镶嵌的被动技能,存在多刷现象
            self.RegistPassiveEffSet(gameObj)
            return True
        return
    
    # 人物需同步注册被动技能
@@ -1632,6 +1671,10 @@
    # 如灼烧是被动技能 但可以被不断的强化
    if useSkill.GetSkillType() != ChConfig.Def_SkillType_PassiveLstDepBuff:
        return False
    if useSkill.GetFuncType() == ChConfig.Def_SkillFuncType_PassiveSkillWithSP:
        # 有专精的被动技能,可以再次触发被动效果
        return False
    return True