From 5695662b3131c45271dac81da7f45391570d8b4a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 28 十一月 2018 11:25:06 +0800
Subject: [PATCH] 4762 【后端】优化机器人攻击顺序,防止动作一致;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py
index 1541e78..4fc8b87 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py
@@ -99,6 +99,16 @@
         curNPC.ResetPos(resultPos.GetPosX(), resultPos.GetPosY())
         tagDist = GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), curTag.GetPosX(), curTag.GetPosY())
         
+    delayTick = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_AtkDelayTick)
+    if delayTick:
+        startAtkTick = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_AtkStartTick)
+        if not startAtkTick:
+            curNPC.SetDict(ChConfig.Def_NPC_Dict_AtkStartTick, tick)
+            startAtkTick = tick
+        if tick - startAtkTick < delayTick:
+            GameWorld.DebugLog("未到攻击时间,暂不处理!objID=%s" % curNPC.GetID())
+            return
+        
     #---优先释放技能---
     if AICommon.DoAutoUseSkill(curNPC, curTag, tagDist, tick):
         return

--
Gitblit v1.8.0