From 761d6a3a33c200f338dca6e05c27738244796538 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 06 十一月 2018 17:02:56 +0800
Subject: [PATCH] 2683 子 天赋技能和新增双职业各两个技能 / 【后端】天赋技能 ----- 通用类

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_514.py            |   50 +++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4061.py |   35 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py             |    1 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py                        |   22 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_516.py            |   49 +++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_517.py            |   49 +++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_515.py            |   52 +++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py            |   48 ++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py            |   48 ++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                            |   10 +
 10 files changed, 361 insertions(+), 3 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 367993d..9745bfb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -5085,4 +5085,12 @@
 Def_PPAct_Pray,  #祈愿 11
 Def_PPAct_BossHome,  #boss之家 12
 Def_PPAct_VIPBoss,  #vipBOSS 13
-) = range(1, 13+1)
\ No newline at end of file
+) = range(1, 13+1)
+
+# 套装枚举,普通套装,强化套装
+(EquipSuitType_Normal,
+EquipSuitType_Plus,
+) = range(1,3)
+
+EquipGroupType_Armor = '1'  # 防具套装
+EquipGroupType_Relics = '2' # 仙器套装
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index 7553fae..49cd1c6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -743,7 +743,7 @@
     for suiteKey, cnt in suitCntDict.items():
         groupType,suiteType,suiteLV = suiteKey.split('_')
         suiteLV = int(suiteLV)
-        job = 0 if groupType == '2' else myjob #仙器组合默认职业0
+        job = 0 if groupType == ChConfig.EquipGroupType_Relics else myjob #仙器组合默认职业0
         ipyData = IpyGameDataPY.GetIpyGameData('EquipSuitAttr', int(groupType), int(suiteType), int(suiteLV), job)
         if not ipyData:
             continue
@@ -764,7 +764,7 @@
         paramList= [name, cnt, suiteLV, groupType, suiteType]
         notifyRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartSuiteNotify % (groupType, suiteType, cnt))
         if not notifyRecord & pow(2, suiteLV):
-            if groupType == '1':
+            if groupType == ChConfig.EquipGroupType_Armor:
                 if cnt >=5:
                     PlayerControl.WorldNotify(0, 'EquipSuit5', paramList)
                     notifyRecord |= pow(2, suiteLV)
@@ -980,6 +980,24 @@
             break
     return findGroupType
 
+#  获取满套装化的最低阶数,如5件套,4件5级,1件3级,则返回3
+def GetEquipSuitsLVByType(curPlayer, suitType, groupType):
+    suiteLV = 999
+    equipSuitTypeDict = IpyGameDataPY.GetFuncEvalCfg('EquipSuitType')
+    if groupType not in equipSuitTypeDict:
+        return 0
+    maxCnt = len(equipSuitTypeDict[groupType])
+    cnt = 0
+    for equipPlace in equipSuitTypeDict[groupType]:
+        curSuiteLV = GetEquipPartSuiteLV(curPlayer, equipPlace, suitType)
+        if curSuiteLV > 0:
+            cnt += 1
+        suiteLV = min(curSuiteLV, suiteLV)
+        
+    if cnt != maxCnt:
+        return 0
+    return 0 if suiteLV == 999 else suiteLV
+
 
 ## 通知公共部位套装等级
 def NotifyEquipPartSuiteLV(curPlayer, index=None):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_514.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_514.py
new file mode 100644
index 0000000..c9ddba4
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_514.py
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 普通套装每一阶数提升属性百分比
+#
+# @author: Alee
+# @date 2018-11-5 下午04:38:39
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import PlayerControl
+import ChEquip
+import IPY_GameWorld
+#---------------------------------------------------------------------
+
+
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        return
+    suitsLV = ChEquip.GetEquipSuitsLVByType(defender, ChConfig.EquipSuitType_Normal, ChConfig.EquipGroupType_Armor)
+    if not suitsLV:
+        return
+    attrList = PlayerControl.GetCalcAttrListValue(defender, curEffect.GetEffectValue(2))
+    attrType = curEffect.GetEffectValue(1)
+    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:
+        value = int(attrList[2].get(tmpType, 0)*curEffect.GetEffectValue(0)*suitsLV*1.0/ChConfig.Def_MaxRateValue)
+        calcDict[tmpType] = calcDict.get(tmpType, 0) + value
+        
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_Linear
+
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_515.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_515.py
new file mode 100644
index 0000000..f3af3eb
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_515.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 强化套装每一阶数提升属性百分比
+#
+# @author: Alee
+# @date 2018-11-5 下午04:38:39
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import PlayerControl
+import ChEquip
+import IPY_GameWorld
+#---------------------------------------------------------------------
+
+
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        return
+    suitsLV = ChEquip.GetEquipSuitsLVByType(defender, ChConfig.EquipSuitType_Plus, ChConfig.EquipGroupType_Armor)
+    if not suitsLV:
+        return
+    attrList = PlayerControl.GetCalcAttrListValue(defender, curEffect.GetEffectValue(2))
+    attrType = curEffect.GetEffectValue(1)
+    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:
+        value = int(attrList[2].get(tmpType, 0)*curEffect.GetEffectValue(0)*suitsLV*1.0/ChConfig.Def_MaxRateValue)
+        calcDict[tmpType] = calcDict.get(tmpType, 0) + value
+        
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_Linear
+
+import random
+
+random.seed()
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_516.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_516.py
new file mode 100644
index 0000000..f58181a
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_516.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 仙器普通套装达到X阶激活属性
+#
+# @author: Alee
+# @date 2018-11-5 下午04:38:39
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import PlayerControl
+import ChEquip
+import IPY_GameWorld
+#---------------------------------------------------------------------
+
+
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        return
+    suitsLV = ChEquip.GetEquipSuitsLVByType(defender, ChConfig.EquipSuitType_Normal, ChConfig.EquipGroupType_Relics)
+
+    if suitsLV < curEffect.GetEffectValue(2):
+        return
+    
+    attrType = curEffect.GetEffectValue(1)
+    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(0)
+        
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_Linear
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_517.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_517.py
new file mode 100644
index 0000000..b9679df
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_517.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 全身防具普通套装达到X阶,所有技能的伤害提升XXX%
+#
+# @author: Alee
+# @date 2018-11-6 下午03:26:05
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import PlayerControl
+import ChEquip
+import IPY_GameWorld
+#---------------------------------------------------------------------
+
+
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        return
+    suitsLV = ChEquip.GetEquipSuitsLVByType(defender, ChConfig.EquipSuitType_Normal, ChConfig.EquipGroupType_Armor)
+
+    if suitsLV < curEffect.GetEffectValue(2):
+        return
+    
+    attrType = curEffect.GetEffectValue(1)
+    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(0)
+        
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_Linear
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py
new file mode 100644
index 0000000..2de14fc
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 每有属性值(如力量)达到多少点,提升属性百分比
+#
+# @author: Alee
+# @date 2018-11-6 下午03:26:05
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import EffGetSet
+import IPY_GameWorld
+#---------------------------------------------------------------------
+
+
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        return
+    funcMark = curEffect.GetEffectValue(2)/1000000
+    value = EffGetSet.GetValueByEffIndex(defender, funcMark)/(curEffect.GetEffectValue(2)%1000000)
+    if value == 0:
+        return
+
+    attrType = curEffect.GetEffectValue(1)
+    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(0)
+        
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_NoLinear
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py
new file mode 100644
index 0000000..b59476e
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 每有属性值(如力量)达到多少点,提升属性固定值
+#
+# @author: Alee
+# @date 2018-11-6 下午03:26:05
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import EffGetSet
+import IPY_GameWorld
+#---------------------------------------------------------------------
+
+
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        return
+    funcMark = curEffect.GetEffectValue(2)/1000000
+    value = EffGetSet.GetValueByEffIndex(defender, funcMark)/(curEffect.GetEffectValue(2)%1000000)
+    if value == 0:
+        return
+
+    attrType = curEffect.GetEffectValue(1)
+    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(0)
+        
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_Linear
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4061.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4061.py
new file mode 100644
index 0000000..6e8fbe9
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4061.py
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+# @todo: 全身防具普通套装达到x阶,每攻击X次,下一次技能将提升百分XX%的技能伤害
+#
+# @author: Alee
+# @date 2018-1-9 下午09:39:37
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+
+import ChConfig
+import GameWorld
+import GameObj
+import ChEquip
+
+def CheckCanHappen(attacker, defender, effect, curSkill):    
+    suitsLV = ChEquip.GetEquipSuitsLVByType(defender, ChConfig.EquipSuitType_Normal, ChConfig.EquipGroupType_Armor)
+    if suitsLV < effect.GetEffectValue(1):
+        # 全身防具普通套装阶数判断
+        return False
+    
+    # 攻击次数判定
+    attackCnt = curSkill.GetProficiency()
+    # 外层有CD拦着,CD中不计数
+    curSkill.SetProficiency(attackCnt + 1)
+    
+    if attackCnt + 1 > effect.GetEffectValue(0):
+        curSkill.SetProficiency(0)
+        return True
+
+    return False
+    
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
index e4e37db..ae5b0d9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -336,6 +336,7 @@
              4058:ChConfig.TriggerType_AddBuffOver, # 添加buff之后触发技能 56
              4059:ChConfig.TriggerType_StormAttackOneByOne, # 类剑刃风暴攻击1对1触发技能  57
              4060:ChConfig.TriggerType_StormAttackOver, # 类剑刃风暴攻击后触发技能  57
+             4061:ChConfig.TriggerType_AttackOverPassive,  # 攻击(对敌技能)后被动技能被触发在其他被动效果处理后调用,触发顺序原因
              }
     return tdict.get(effectID, -1) 
     #===========================================================================

--
Gitblit v1.8.0