From 92e5118d99b8e202b78c9cc781dd5b3b7d0b4485 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期六, 16 二月 2019 13:47:05 +0800 Subject: [PATCH] 5315 【后端】【1.6】登录奖励活动(循环广播) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4508.py | 37 +++++++++++++++++++++++++++++++++---- 1 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4508.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4508.py index ab20270..ab1c352 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4508.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4508.py @@ -15,8 +15,24 @@ import GameWorld import SkillCommon import BuffSkill +import SkillShell +import IPY_GameWorld -def CheckCanHappen(attacker, defender, passiveEffect, skillID): +def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs): + # 先判断概率 + rate = passiveEffect.GetEffectValue(0) + if rate and not GameWorld.CanHappen(rate): + return False + + # 关联技能 + checkSkillID = passiveEffect.GetEffectValue(2) + if checkSkillID: + useSkill = skillkwargs.get("useSkill", None) + if not useSkill: + return False + if useSkill.GetSkillTypeID() != checkSkillID: + return False + curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID) if not curSkill: return False @@ -28,14 +44,27 @@ return False buffManager = buffTuple[0] - buff = buffManager.FindBuff(skillID) + buff = buffManager.FindBuff(curSkill.GetSkillTypeID()) if not buff: return False - + if buff.GetLayer() <= 0: return False - + triggerSkillID = passiveEffect.GetEffectValue(1) + BuffSkill.SetBuffLayer(attacker, buff, buff.GetLayer()-1, skillTypeID=curSkill.GetSkillTypeID()) + + if triggerSkillID and attacker.GetGameObjType() == IPY_GameWorld.gotPlayer: + skillManager = attacker.GetSkillManager() + #获得技能 + triggerSkill = skillManager.FindSkillBySkillTypeID(triggerSkillID) + if triggerSkill: + #玩家技能会升级 + SkillShell.UsePassiveTriggerSkill(attacker, triggerSkill, defender, GameWorld.GetGameWorld().GetTick(), isEnhanceSkill = True) + else: + triggerSkill = GameWorld.GetGameData().GetSkillBySkillID(triggerSkillID) + if triggerSkill: + SkillShell.UsePassiveTriggerSkill(attacker, triggerSkill, defender, GameWorld.GetGameWorld().GetTick(), isEnhanceSkill = True) return True -- Gitblit v1.8.0