From 3e312856ab8860d06c92f5ec91ab5b419e1bed93 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 24 一月 2019 15:20:24 +0800
Subject: [PATCH] 5931 【后端】【1.5.100】诛仙装备开发(评分公式参数修改)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 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 35b6323..b15c5d7 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
@@ -25,6 +25,7 @@
 import BaseAttack
 import FBCommon
 import AICommon
+import GameMap
 
 import random
 
@@ -61,6 +62,7 @@
         curTag = GameWorld.FindNPCByID(playerAtkObjID)
         
     npcControl = NPCCommon.NPCControl(curNPC)
+    npcControl.RefreshBuffState(tick)
     # 没有玩家正在攻击的目标则取自身的仇恨列表
     if not curTag:
         #GameWorld.DebugLog("没有玩家正在攻击的目标,刷新自身仇恨目标!objID=%s,maxHP=%s" % (curNPC.GetID(), GameObj.GetMaxHP(curNPC)))
@@ -73,13 +75,13 @@
             
     # 没有攻击目标则跟随玩家
     if not curTag:
-        GameWorld.DebugLog("没有攻击目标,跟随玩家!objID=%s" % curNPC.GetID())
+        #GameWorld.DebugLog("没有攻击目标,跟随玩家!objID=%s" % curNPC.GetID())
         dist = GameWorld.GetDist(fbPlayer.GetPosX(), fbPlayer.GetPosY(), curNPC.GetPosX(), curNPC.GetPosY())
         if dist > 12:
-            posX, posY = npcControl.GetMoveNearPos(fbPlayer.GetPosX(), fbPlayer.GetPosY(), 3)
-            curHP.ResetPos(posX, posY)
-        elif dist > 5:
-            npcControl.MoveToObj_Detel(fbPlayer, 5)
+            resultPos = GameMap.GetEmptyPlaceInArea(fbPlayer.GetPosX(), fbPlayer.GetPosY(), 3)
+            curNPC.ResetPos(resultPos.GetPosX(), resultPos.GetPosY())
+        elif dist > 3:
+            npcControl.MoveToObj_Detel(fbPlayer, 3)
         return
     __NPCFight(npcControl, curNPC, curTag, tick)
     return
@@ -92,10 +94,20 @@
         return
     tagDist = GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), curTag.GetPosX(), curTag.GetPosY())
     GameWorld.DebugLog("    与目标距离: %s" % tagDist)
-    if tagDist > 12:
-        posX, posY = npcControl.GetMoveNearPos(curTag.GetPosX(), curTag.GetPosY(), 3)
-        curNPC.ResetPos(posX, posY)
-        tagDist = GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), curTag.GetPosX(), curTag.GetPosY())
+#    if tagDist > 20:
+#        resultPos = GameMap.GetEmptyPlaceInArea(curTag.GetPosX(), curTag.GetPosY(), 3)
+#        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):

--
Gitblit v1.8.0