From faead810c3511a5032c2eea146cd9ab741fa1b53 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 28 八月 2018 12:17:45 +0800
Subject: [PATCH] fix:修复部分NPC血量超过亿用错接口导致逻辑异常问题,如AI根据血量释放技能
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 2 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py | 3 ++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py | 6 +++---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
index 023ee82..88fe8bb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -1051,7 +1051,7 @@
#根据副本需求, 过滤NPC
for curNPC in gameNPCList:
#尸体不处理
- if curNPC.GetHP() <= 0:
+ if GameObj.GetHP(curNPC) <= 0:
continue
#召唤兽特殊判断
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py
index 43083e9..5e4ced9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MergeBoss.py
@@ -40,7 +40,7 @@
import NPCCommon
import BuffSkill
import ChNPC
-
+import GameObj
import random
#当前副本地图的状态
@@ -807,7 +807,7 @@
objID = curNPC.GetID()
npcID = curNPC.GetNPCID()
- g_curBossDict["%s_%s" % (objID, npcID)] = [objID, npcID, curNPC.GetHP(), curNPC.GetMaxHP(),
+ g_curBossDict["%s_%s" % (objID, npcID)] = [objID, npcID, GameObj.GetHP(curNPC), GameObj.GetMaxHP(curNPC),
curNPC.GetPosX(), curNPC.GetPosY()]
__CheckOutTimeBuff(tick)
@@ -1142,7 +1142,7 @@
hpPerList = sorted(hpPerDict.keys(), reverse = True)
maxBuffCnt = bossBuffInfo[2]
- nowHPPer = defender.GetHP() * 100 / defender.GetMaxHP() # 当前百分比
+ nowHPPer = GameObj.GetHP(defender) * 100 / GameObj.GetMaxHP(defender) # 当前百分比
gameFB = GameWorld.GetGameFB()
hpPerMarkKey = FBDict_BossHPPerMark % (objID, npcID)
hpPerLogicMark = gameFB.GetGameFBDictByKey(hpPerMarkKey)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py
index 0c3079f..7095fc6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py
@@ -519,9 +519,10 @@
# @return 布尔值
def CheckSkillTrigger(curNPC, triggerDict, npcSkillindex, tick):
skillInfo = triggerDict.get(npcSkillindex)
+
if skillInfo != None:
#当前血量
- hpPercent = int(curNPC.GetHP()/float(GameObj.GetMaxHP(curNPC))*100)
+ hpPercent = int(GameObj.GetHP(curNPC)/float(GameObj.GetMaxHP(curNPC))*100)
checkHP = skillInfo[0]
#血量未到
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 00b6cae..7224177 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -2514,7 +2514,7 @@
self.__AddAngryValue(npcAngry, curObjID, curObjType, plusAngryValue, canPile)
#激活呆滞的NPC
- if curNPC.GetHP() > 0 and not curNPC.GetIsNeedProcess() :
+ if GameObj.GetHP(curNPC) > 0 and not curNPC.GetIsNeedProcess() :
curNPC.SetIsNeedProcess(True)
--
Gitblit v1.8.0