| | |
| | | #__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)
|
| | |
| | | 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
|
| | |
| | | #范围校验
|
| | | 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()
|
| | |
|
| | |
| | | # 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)
|
| | |
| | | return
|
| | |
|
| | | def SetPVPNPCPlayerAttr(self, pvpPlayerID):
|
| | | PropDict = PlayerViewCacheTube.GetPlayerPropData(pvpPlayerID)
|
| | | PropDict, PlusDict = PlayerViewCacheTube.GetPlayerPropPlusDictByID(pvpPlayerID)
|
| | | if not PropDict:
|
| | | return
|
| | | curNPC = self.__Instance
|
| | |
| | | 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):
|
| | |
| | | return
|
| | |
|
| | | #宠物死亡调用独立接口
|
| | | if curNPC_GameNPCObjType == IPY_GameWorld.gnotPet:
|
| | | PetControl.SetPetDead(curNPC)
|
| | | return
|
| | | #if curNPC_GameNPCObjType == IPY_GameWorld.gnotPet:
|
| | | # PetControl.SetPetDead(curNPC)
|
| | | # return
|
| | |
|
| | | #---通用死亡逻辑---
|
| | |
|