From 7e2fba6800afaaeef3ac9d2d3c8c42ebcefd2016 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 05 三月 2019 15:53:48 +0800
Subject: [PATCH] 6328 【后端】优化代码eval
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
index 93ebc5c..0e6b322 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
@@ -482,6 +482,8 @@
return int(value)
+
+
## 玩家召唤NPC(当前玩家,召唤技能,召唤兽ID,召唤兽属性列表, 召唤兽离自己的距离, 当前时间)
# @param curPlayer 当前玩家
# @param curSkill 召唤技能
@@ -524,6 +526,8 @@
summonPos = GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(), curPlayer.GetPosY(), summonDist)
summonNPC.Reborn(summonPos.GetPosX(), summonPos.GetPosY())
summonNPC.SetBornTime(tick)
+ # 继承技能等级
+ SetSummonNPCSkillLV(summonNPC, curSkill)
if curSkill:
summonNPC.SetLastTime(curSkill.GetLastTime())
#----设置为无敌,在AI中解除无敌
@@ -531,6 +535,38 @@
summonNPC.SetCanAttack(False)
return
+
+# 召唤兽技能继承,玩家释放技能的等级
+def SetSummonNPCSkillLV(summonNPC, curSkill):
+ if curSkill.GetEffect(0).GetEffectValue(1) == 0:
+ return
+ skillLV = curSkill.GetSkillLV() - 1
+ if skillLV == 0:
+ return
+
+ skillManager = summonNPC.GetSkillManager()
+ learnSkillIDList =[]
+ for index in range(0, skillManager.GetSkillCount()):
+ useSkill = skillManager.GetSkillByIndex(index)
+ #已经到尾部了
+ if not useSkill or useSkill.GetSkillTypeID() == 0:
+ break
+
+ useSkillTypeID = useSkill.GetSkillTypeID()
+ # 找到可学习的技能
+ learnSkillID = useSkillTypeID + skillLV
+ findSkill = GameWorld.GetGameData().GetSkillBySkillID(learnSkillID)
+ if not findSkill:
+ continue
+ if findSkill.GetSkillTypeID() != useSkillTypeID:
+ # 不是同一个技能
+ continue
+ learnSkillIDList.append(learnSkillID)
+
+ for skillID in learnSkillIDList:
+ skillManager.LearnSkillByID(skillID, False)
+ return
+
## 设置召唤兽属性
# @param curPlayer 当前玩家
@@ -1232,6 +1268,9 @@
notifyLostValue = lostValue
curObjHP_BeforeAttack = GameObj.GetHP(curObj)
+ if curObjHP_BeforeAttack == 0:
+ # 没有血量不能再触发
+ return
if reduceHP :
lostValue = AttackCommon.CalcAtkProDef(buffOwner, curObj, lostValue, curSkill, tick)
--
Gitblit v1.8.0