From f5dde47094e426c534c219d784efdb93cc8ac1fb Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 03 四月 2019 17:34:17 +0800
Subject: [PATCH] 6446 【后端】增加所有已激活坐骑的攻击和生命百分比的效果值

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py |   73 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py
new file mode 100644
index 0000000..c5c3cf2
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py
@@ -0,0 +1,73 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+##@package
+#
+# @todo: 增加所有坐骑的某个属性效果百分比
+#
+# @author: Alee
+# @date 2019-4-3 下午05:28:34
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+#导入
+import ChConfig
+import PlayerControl
+import ShareDefine
+import IpyGameDataPY
+import GameWorld
+#---------------------------------------------------------------------
+
+## buff线性增加属性
+#  @param defender Buff承受者
+#  @param curEffect 技能效果
+#  @param calcDict 技能效果累加总表
+#  @return None
+def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
+    attrType = curEffect.GetEffectValue(0)
+    value = GetHorseAttrByQuality(defender, attrType)
+    value = int(value*curEffect.GetEffectValue(1)*1.0/ChConfig.Def_MaxRateValue)
+    
+    #[属性索引, 是否基础属性,(非)线性]
+    attrInfo = ChConfig.ItemEffect_AttrDict.get(attrType, [])
+    if attrInfo == []:
+        return
+    
+    for i in attrInfo[0]:
+        GameWorld.AddDictValue(calcDict, {i:value})
+    
+    return
+
+
+## 返回buff类型,线性与否
+#  @param 
+#  @return None
+#  @remarks 函数详细说明.  
+def GetCalcType():
+    return ChConfig.TYPE_Linear
+
+def GetHorseAttrByQuality(curPlayer, attrType):
+    value = 0
+    ipyDataMgr = IpyGameDataPY.IPY_Data()
+    for i in xrange(ipyDataMgr.GetHorseCount()):
+        ipyData = ipyDataMgr.GetHorseByIndex(i)
+        horseID = ipyData.GetHorseID()
+        lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
+        if not lv:
+            continue
+    
+        horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
+        if not horseUpData:
+            continue
+        
+        attrTypeList = horseUpData.GetAttrType()
+        attrValueList = horseUpData.GetAttrValue()
+        if attrType not in attrTypeList:
+            continue
+        
+        value += attrValueList[attrTypeList.index(attrType)]
+
+    return value
+

--
Gitblit v1.8.0