From 3a62560ad1f29d87134e19675a8b1a8dba57ecdd Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期五, 02 十一月 2018 22:08:17 +0800 Subject: [PATCH] 2683 子 天赋技能和新增双职业各两个技能 / 【后端】天赋技能 ----- 枪的攻和防 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_222.py | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_222.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_222.py index 2f8641a..33d750e 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_222.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_222.py @@ -25,6 +25,10 @@ import IPY_GameWorld import GameObj import GameMap +import AttackCommon +import SkillCommon +import AICommon + #--------------------------------------------------------------------- #--------------------------------------------------------------------- @@ -58,7 +62,7 @@ npcControl = NPCCommon.NPCControl(curNPC) #刷新自己仇恨度列表 - npcControl.RefreshAngryList(tick, 500) # 为确保踩陷阱体验,暂定1秒 + npcControl.RefreshAngryList(tick, 500) # 为确保踩陷阱体验, #遍历仇恨列表找到最近的,并触发 for i in range(0, curNPC.GetNPCAngry().GetAngryCount()): curAngry = curNPC.GetNPCAngry().GetAngryValueTag(i) @@ -77,7 +81,8 @@ continue #进入战斗 - NPCFight(curNPC, npcControl, curObj, tick) + if not NPCFight(curNPC, npcControl, curObj, tick): + continue return return @@ -97,14 +102,24 @@ if curSkill == None: GameWorld.Log("陷阱 = %s 数据库查找技能失败"%curNPC.GetName()) - return + return True + + battleRelationType = AttackCommon.GetBattleRelationType(curNPC, curObj) + + skillBattleType = SkillCommon.GetSkillBattleType(curSkill) + if not AttackCommon.CheckBattleRelationType(skillBattleType, battleRelationType): + # PK模式的判定 + return False + + curNPC.SetDict("traptagType", curObj.GetGameObjType()) + curNPC.SetDict("traptagID", curObj.GetID()) #触发技能, 改为统一在死亡时释放技能 #SkillShell.NPCUseSkillTag(curNPC, curObj, curSkill, tick) #有玩家进入仇恨列表,,,自爆 npcControl.SetKilled() - return + return True ## NPC死亡 # @param curNPC 当前npc @@ -115,15 +130,20 @@ #死亡NPC不能攻击, 这里设置NPC血量为1 curNPC.SetHP(1) - + #获得技能管理器 skillManager = curNPC.GetSkillManager() curSkill = skillManager.GetSkillByIndex(0) if not curSkill: return - + + curObj = GameWorld.GetObj(curNPC.GetDictByKey("traptagID"), curNPC.GetDictByKey("traptagType")) tick = GameWorld.GetGameWorld().GetTick() - SkillShell.NPCUseSkill(curNPC, curSkill, tick) + if curObj == None or GameObj.GetHP(curObj) <= 0: + SkillShell.NPCUseSkill(curNPC, curSkill, tick) + return + + AICommon.DoNPCUseSkill(curNPC, curObj, curSkill, 0, tick) GameObj.SetHP(curNPC, 0) return -- Gitblit v1.8.0