From 875d928db2370eaaa6a43bf01d0761d7939dab5f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 13 十月 2018 17:14:42 +0800
Subject: [PATCH] 4064 【后端】【主干】直接给玩家的货币类物品优化处理; 2094 邮件发放神兽装备,神兽背包空间不足逻辑错误;
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py | 127 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 120 insertions(+), 7 deletions(-)
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 b852b8c..4099682 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -26,7 +26,6 @@
import GameWorld
import ChConfig
import IpyGameDataPY
-#import SkillBoosts
import SkillCommon
import BuffSkill
import SkillShell
@@ -43,7 +42,6 @@
import PetControl
import QuestCommon
-#GameWorld.ImportAll("Script\\Skill\\", "SkillBoosts")
GameWorld.ImportAll("Script\\Skill\\", "PassiveBuff")
@@ -260,6 +258,8 @@
GetPassiveEffManager().RegistPassiveBuff(curPlayer)
+ # 助战神兽技能
+ GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
#-被动逻辑处理--------------------------------------------------------------------------------------------------
##离开地图处理
@@ -326,6 +326,8 @@
4048:ChConfig.TriggerType_MissSkill, # 闪避后触发释放技能
4049:ChConfig.TriggerType_MissSuccessPer, # 闪避成功率提升
4050:ChConfig.TriggerType_OneDamage, # 伤害降低到1点
+ 4051:ChConfig.TriggerType_LuckyHit, # 会心一击时增加会心伤害百分比 50
+ 4052:ChConfig.TriggerType_Buff_SuckBloodPer, # 攻击 百分比吸血
}
return tdict.get(effectID, -1)
#===========================================================================
@@ -356,7 +358,8 @@
4511:ChConfig.TriggerType_AttackAddFinalValue, #攻击增加输出伤害11
4512:ChConfig.TriggerType_ReduceHurtHPPer, # 百分比减少攻击计算后伤害
4513:ChConfig.TriggerType_AttackAddFinalValue, #攻击增加输出伤害11
- 4515:ChConfig.TriggerType_AddIceAtkPer, # BUFF类:攻击附加真实伤害百分比
+ 4515:ChConfig.TriggerType_AddIceAtkPer, # BUFF类:攻击附加真实伤害百分比
+ 4516:ChConfig.TriggerType_ChangeHurtToHP, # BUFF类:buff中把受到伤害的xx%转化为生命值
803:ChConfig.TriggerType_BloodShield, # 血盾
806:ChConfig.TriggerType_BloodShield, # 血盾
808:ChConfig.TriggerType_BloodShield, # 血盾
@@ -375,7 +378,7 @@
self.AffectBuffDict = {} # 当前正受影响的效果buff, key为触发点
self.AffectSkillDict = {} # 被动技能 {(触发模式, 被影响的技能ID):[被动技能ID,效果]
self.AffectPassiveSkillSetDict = {} # 被动技能装备 {(触发模式, 被影响的技能ID):[被动技能ID,效果]
-
+ self.AffectDogzSkillDict = {} # 神兽助战技能
#记录会影响其他技能或者被动触发释放技能的BUFF
def AddBuffInfoByEffect(self, effect, skillID):
@@ -430,6 +433,37 @@
return self.AffectBuffDict.get((triggerType, 0), {})
+ # 重刷神兽助战技能
+ def RefreshDogzBattleSkill(self):
+ self.AffectDogzSkillDict = {}
+ skills = FindDogzBattleSkills(self.gameObj)
+
+ for curSkill in skills:
+ if not SkillCommon.isPassiveTriggerSkill(curSkill):
+ continue
+
+ skillTypeID = curSkill.GetSkillTypeID()
+
+ connSkillID = SkillShell.GetConnectSkillID(curSkill) # 关联技能ID, 0代表不限技能
+ for i in xrange(curSkill.GetEffectCount()):
+ curEffect = curSkill.GetEffect(i)
+ effectID = curEffect.GetEffectID()
+ if effectID == 0:
+ continue
+
+ triggerType = GetTriggerTypeByEffectID(effectID)
+ if triggerType == -1:
+ continue
+
+ key = (triggerType,connSkillID)
+ if key not in self.AffectDogzSkillDict:
+ self.AffectDogzSkillDict[key] = []
+
+ self.AffectDogzSkillDict[key].append((skillTypeID, effectID))
+
+ return self.AffectDogzSkillDict
+
+
# 重刷可装备的被动技能
def RefreshPassiveSkillSet(self):
self.AffectPassiveSkillSetDict = {}
@@ -474,8 +508,9 @@
if not SkillCommon.isPassiveTriggerSkill(curSkill):
continue
- if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_FbPassiveSkill:
- # 被动技能需装备
+ if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbPassiveSkill,
+ ChConfig.Def_SkillFuncType_Dogz]:
+ # 被动技能和神兽需设置才有效
continue
skillTypeID = curSkill.GetSkillTypeID()
@@ -535,10 +570,11 @@
## skillList=self.AffectSkillDict.get((triggerType, connSkillID), [])再用extend会导致AffectSkillDict无限增长
skillList.extend(self.AffectSkillDict.get((triggerType, connSkillID), []))
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, connSkillID), []))
+ skillList.extend(self.AffectDogzSkillDict.get((triggerType, connSkillID), []))
if connSkillID != 0 and connSkillID != ChConfig.Def_SkillID_Somersault:
skillList.extend(self.AffectSkillDict.get((triggerType, 0), []))
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, 0), []))
-
+ skillList.extend(self.AffectDogzSkillDict.get((triggerType, 0), []))
return skillList
#所有obj的被动效果管理
@@ -598,6 +634,20 @@
self.AddPassiveEff(gameObj, passiveEff)
else:
passiveEff.RefreshPassiveSkillSet()
+ return
+
+
+ # 人物需同步注册神兽技能
+ def RegistPassiveEffDogz(self, gameObj):
+ passiveEff = self.GetPassiveEff(gameObj)
+ if not passiveEff:
+ # 强制刷新所有被动技能
+ passiveEff = PassiveEff(gameObj)
+ if not passiveEff.RefreshDogzBattleSkill():
+ return
+ self.AddPassiveEff(gameObj, passiveEff)
+ else:
+ passiveEff.RefreshDogzBattleSkill()
return
@@ -1065,3 +1115,66 @@
return curValue
+
+# 因为要兼容低等级技能,所以技能只能是在助战的时候,先删除神兽技能再学习新的助战神兽技能
+def PlayerDogzSkill(curPlayer):
+
+ dogzSkills = [] # 需要学习的技能
+ ipyDataMgr = IpyGameDataPY.IPY_Data()
+ for i in xrange(ipyDataMgr.GetDogzCount()):
+ ipyData = ipyDataMgr.GetDogzByIndex(i)
+ if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, i):
+ continue
+
+ dogzSkills.extend(ipyData.GetHelpBattleSkills())
+
+ delDogzSkills = [] # 删除不在助战神兽队列的技能
+ skillManager = curPlayer.GetSkillManager()
+ for i in xrange(skillManager.GetSkillCount()):
+ curSkill = skillManager.GetSkillByIndex(i)
+ if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
+ continue
+ skillID = curSkill.GetSkillID()
+
+ delDogzSkills.append(skillID)
+
+ GameWorld.DebugLog("PlayerDogzSkill:%s - 删除%s"%(dogzSkills, delDogzSkills))
+
+ # 删除神兽技能
+ for skillID in delDogzSkills:
+ skillManager.DeleteSkillBySkillID(skillID, False)
+
+ # 添加助战技能,同类技能取最高
+ dogzSkills.sort()
+ for skillID in dogzSkills:
+ skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
+ if not skillData:
+ continue
+ if skillData.GetSkillType() == ChConfig.Def_SkillType_AttrSkillNoLearn:
+ # 同技能可多个叠加的技能不能学,算属性时直接取表
+ continue
+
+ skillManager.LearnSkillByID(skillID, False)
+
+ # 刷被动效果
+ GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
+ return
+
+
+# 获取助战神兽的技能列表
+def FindDogzBattleSkills(gameObj):
+ skills = []
+ if gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
+ return skills
+
+ skillManager = gameObj.GetSkillManager()
+ for i in xrange(skillManager.GetSkillCount()):
+ curSkill = skillManager.GetSkillByIndex(i)
+ if not curSkill:
+ continue
+
+ if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
+ continue
+ skills.append(curSkill)
+
+ return skills
--
Gitblit v1.8.0