From d70324d5963b2c4832f3696e08825999b3848822 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 07 十一月 2018 16:05:45 +0800
Subject: [PATCH] 2306 【1.2】【BUG】老号的封魔之魂次数满了无法领取
---
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