From 75c16c80bcacd22c5e0bc4c7a77ffca594ad4e2f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 25 九月 2018 21:16:21 +0800
Subject: [PATCH] 1834 装备分解-服务端防范不分解非装备道具
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py | 41 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
index 5620200..d919299 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
@@ -25,6 +25,9 @@
import IpyGameDataPY
import ChConfig
import ChEquip
+import PassiveBuffEffMng
+import SkillCommon
+import SkillShell
'''
神兽编号: 1~20,上线后不可修改
@@ -53,6 +56,9 @@
## 设置神兽是否助战状态
GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, dogzID - 1, 1 if isFight else 0)
Sync_DogzHelpbattleState(curPlayer, dogzID, isFight)
+
+ # 设置成功后才能刷技能
+ PassiveBuffEffMng.PlayerDogzSkill(curPlayer)
return
@@ -364,7 +370,7 @@
delItemList = []
dogzItemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
dogzItemPackCount = dogzItemPack.GetCount()
- for i in indexList:
+ for listIndex, i in enumerate(indexList):
if i < 0 or i >= dogzItemPackCount:
GameWorld.ErrLog("神兽背包索引不存在,无法强化!i=%s" % (i), playerID)
return
@@ -377,7 +383,7 @@
GameWorld.ErrLog("神兽背包物品无经验效果,无法强化!i=%s,itemID=%s" % (i, curItem.GetItemTypeID()), playerID)
return
- delCount = max(1, min(curItem.GetCount(), indexUseCountList[i]))
+ delCount = max(1, min(curItem.GetCount(), indexUseCountList[listIndex]))
baseExp = effect.GetEffectValue(0)
doubleCostGold = effect.GetEffectValue(1)
@@ -445,6 +451,7 @@
RefreshDogzAttr(curPlayer)
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
+ curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitDogzEquipPlus, 1)
return
def GetDogzEquipPlusLVExpInfo(equipColor, equipPlace, totalExp):
@@ -539,8 +546,38 @@
# 保存计算值
PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Dogz, allAttrList)
curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Dogz, fightPowerEx)
+
+ # 技能属性,从Def_CalcAttrFunc_Dogz获取
+ skillAttrList = CalcDogzBattleSkillAttr(curPlayer)
+ PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkill, skillAttrList)
return
+# 助战神兽技能属性,必须在 SetDogzIsHelpFight后调用
+def CalcDogzBattleSkillAttr(curPlayer):
+ skillAttrList = [{} for _ in range(4)]
+ skillManager = curPlayer.GetSkillManager()
+
+ for i in range(0 , skillManager.GetSkillCount()):
+ curSkill = skillManager.GetSkillByIndex(i)
+ if not curSkill:
+ continue
+
+ if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
+ continue
+
+ if not SkillCommon.isPassiveAttr(curSkill):
+ continue
+
+
+ for effectIndex in xrange(curSkill.GetEffectCount()):
+ curEffect = curSkill.GetEffect(effectIndex)
+ SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
+
+
+ #GameWorld.DebugLog("神兽技能属性: skillFPEx=%s, %s" % ( skillFPEx, skillAttrList))
+ return skillAttrList
+
+
def Sync_DogzInfo(curPlayer):
## 同步神兽信息
dogzInfoPack = ChPyNetSendPack.tagMCDogzInfo()
--
Gitblit v1.8.0