From 776cf3759b9801f3795ee975cd77078f505b90d6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 06 一月 2024 14:49:08 +0800
Subject: [PATCH] 10071 【后端】灵宠改版

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

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 8105c44..44956ba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -2310,7 +2310,7 @@
     #__NotifyMapPlayerSummonMapNPC(npcId, rebornX, rebornY)
     return curSummon
 
-def SummonNPC(gameObj, npcID, rebornX, rebornY):
+def SummonNPC(gameObj, npcID, rebornX, rebornY, skillIDList=None):
     ''' 某个实例进行召唤,有从属关系
     '''
     npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
@@ -2343,6 +2343,13 @@
     curSummon.SetSightLevel(gameObj.GetSightLevel())
     
     curSummon.Reborn(rebornX, rebornY, False)
+    #有指定的技能,重新学习
+    if skillIDList:
+        #GameWorld.DebugLog("指定召唤兽技能: npcID=%s,skillIDList=%s" % (npcID, skillIDList))
+        skillManger = curSummon.GetSkillManager()
+        skillManger.ResetSkill()
+        for skillID in skillIDList:
+            skillManger.LVUPSkillByID(skillID)
     NPCControl(curSummon).DoNPCRebornCommLogic(tick)
     #curSummon.RefreshView()
     return curSummon
@@ -3723,7 +3730,7 @@
         #范围校验
         if not posMap:
             GameWorld.ErrLog("__Func_GetRandPosInRefreshArea GetRefreshPosAt error: return None! npcID=%s" % curNPC.GetNPCID())
-            return
+            return curNPC.GetPosX(), curNPC.GetPosY()
         posMapX = posMap.GetPosX()
         posMapY = posMap.GetPosY()
         
@@ -4115,8 +4122,7 @@
 #        curNPC.ForbiddenSkillTypeList_Clear()
     
         #宠物特殊处理
-        if curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
-            PetControl.RefurbishPetAttr(curNPC, canSyncClient)
+        if PetControl.RefurbishPetAttr(curNPC):
             return
         
         pvpPlayerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_PVPPlayerID)
@@ -4137,7 +4143,7 @@
         return
     
     def SetPVPNPCPlayerAttr(self, pvpPlayerID):
-        PropDict = PlayerViewCacheTube.GetPlayerPropData(pvpPlayerID)
+        PropDict, PlusDict = PlayerViewCacheTube.GetPlayerPropPlusDictByID(pvpPlayerID)
         if not PropDict:
             return
         curNPC = self.__Instance
@@ -4160,9 +4166,18 @@
         GameObj.SetAtkBackDefRate(curNPC, PropDict.get("AtkBackDefRate", 0))
         GameObj.SetSuckHPPer(curNPC, PropDict.get("SuckHPPer", 0))
         GameObj.SetSuckHPDefPer(curNPC, PropDict.get("SuckHPDefPer", 0))
-        
-        GameWorld.DebugLog("SetPVPNPCPlayerAttr: objID=%s,NPCID=%s,pvpPlayerID=%s,maxHP=%s" 
-                           % (curNPC.GetID(), curNPC.GetNPCID(), pvpPlayerID, GameObj.GetMaxHP(curNPC)))
+                
+        skillManager = curNPC.GetSkillManager()
+        SkillInfo = PlusDict.get("SkillInfo", {})
+        for _, skillLVDict in SkillInfo.items():
+            for skillID, _ in skillLVDict.items():
+                skillManager.LearnSkillByID(skillID)
+                
+        GameWorld.DebugLog("SetPVPNPCPlayerAttr: objID=%s,NPCID=%s,pvpPlayerID=%s,maxHP=%s,SkillInfo=%s" 
+                           % (curNPC.GetID(), curNPC.GetNPCID(), pvpPlayerID, GameObj.GetMaxHP(curNPC), SkillInfo))
+        for index in range(0, skillManager.GetSkillCount()):
+            useSkill = skillManager.GetSkillByIndex(index)
+            GameWorld.DebugLog("    NPC SkillID=%s" % useSkill.GetSkillID())
         return
     
     def SetHelpBattleRobotRebornAttr(self, fightPower):
@@ -4603,9 +4618,9 @@
             return
         
         #宠物死亡调用独立接口
-        if curNPC_GameNPCObjType == IPY_GameWorld.gnotPet:
-            PetControl.SetPetDead(curNPC)
-            return
+        #if curNPC_GameNPCObjType == IPY_GameWorld.gnotPet:
+        #    PetControl.SetPetDead(curNPC)
+        #    return
         
         #---通用死亡逻辑---
         

--
Gitblit v1.8.0