| | |
| | | import PlayerControl
|
| | | import GameMap
|
| | | import ChConfig
|
| | | import EventShell
|
| | | import SkillShell
|
| | | import BuffSkill
|
| | | import BaseAttack
|
| | |
| | | "AccID":curPlayer.GetAccID(), "PlayerID":curPlayer.GetPlayerID()}
|
| | | DataRecordPack.SendEventPack("AddKillBossCnt", dataDict, curPlayer)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_KillBoss, 1, [limitIndex])
|
| | | EventShell.EventRespons_KillBoss(curPlayer, limitIndex)
|
| | | PlayerState.SetBossStateExit(curPlayer)
|
| | |
|
| | | if isCrossServer:
|
| | |
| | | GameWorld.Log("curNPC = %s 查找对象, 获得对象实例失败" % (curNPC.GetNPCID()))
|
| | | return False
|
| | |
|
| | | #守卫攻击镖车,仇恨特殊处理
|
| | | if self.__GuaedAttackTruck(seeObjDetail , tick):
|
| | | return True
|
| | | |
| | | #小怪不可行进通道就当作看不见
|
| | | if not AttackCommon.CanAttackByPath(curNPC, seeObjDetail):
|
| | | #GameWorld.DebugLog("有障碍 看见也不加仇恨")
|
| | |
| | |
|
| | | #GameWorld.Log("%s添加仇恨%s成功"%(curNPC.GetName(), seeObjDetail.GetName()))
|
| | | return True
|
| | | |
| | | #---------------------------------------------------------------------
|
| | | ##守卫攻击镖车,特殊处理
|
| | | # @param self 类实例
|
| | | # @param seeObj 视野中的对象
|
| | | # @param tick 时间戳
|
| | | # @return 返回值真, 可以添加这个对象
|
| | | # @remarks 守卫攻击镖车,特殊处理
|
| | | def __GuaedAttackTruck(self, seeObj, tick) :
|
| | | curNPC = self.__Instance
|
| | | |
| | | if curNPC.GetType() != IPY_GameWorld.ntGuard:
|
| | | return
|
| | | |
| | | if seeObj.GetGameObjType() != IPY_GameWorld.gotNPC or \
|
| | | seeObj.GetGameNPCObjType() != IPY_GameWorld.gnotTruck :
|
| | | return
|
| | | |
| | | #如果是远程的守卫,不考虑攻击距离,追击
|
| | | #不可移动的固定守卫,超出攻击距离,返回
|
| | | if curNPC.GetSpeed() == 0 and not BaseAttack.GetCanAttack(curNPC, seeObj, None, tick):
|
| | | return
|
| | | |
| | | relation = BaseAttack.GetTagRelation(curNPC, seeObj, None, tick)[0]
|
| | | |
| | | if relation != ChConfig.Type_Relation_Enemy :
|
| | | return
|
| | | |
| | | return True
|
| | | |
| | |
|
| | |
|
| | | def GetIsBossView(self):
|
| | | # 主动视野情况,GetIsBoss 0 1 4 为普通NPC视野(有视野范围配置,但去除视野刷新),其他为BOSS类视野有刷新
|
| | |
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_HPPerLogicMark, hpPerLogicMark)
|
| | | return
|
| | |
|
| | | |
| | | ## 给附近玩家加功勋
|
| | | # @param self 类实例
|
| | | # @param addPrestigeFormat 加功勋公式
|
| | | # @param matrix 范围大小
|
| | | # @return
|
| | | def __GiveNearbyPlayerPrestige(self, addPrestigeFormat, matrix=ChConfig.Def_Matrix_Three):
|
| | | # if addPrestigeFormat == '':
|
| | | # return
|
| | | # curNPC = self.__Instance
|
| | | # npcPosX = curNPC.GetPosX()
|
| | | # npcPosY = curNPC.GetPosY()
|
| | | # npcLV = curNPC.GetLV()
|
| | | # gameMap = GameWorld.GetMap()
|
| | | # |
| | | # for curPos in matrix:
|
| | | # |
| | | # #检查有没有对象在这一点上
|
| | | # mapObj = gameMap.GetPosObj(npcPosX + curPos[0], npcPosY + curPos[1])
|
| | | # |
| | | # if not mapObj:
|
| | | # continue
|
| | | # |
| | | # #遍历当前点对象
|
| | | # for i in range(0, mapObj.GetObjCount()):
|
| | | # |
| | | # curObj = mapObj.GetObjByIndex(i)
|
| | | # curObjType = curObj.GetGameObjType()
|
| | | # |
| | | # #不是玩家,跳过
|
| | | # if curObjType != IPY_GameWorld.gotPlayer:
|
| | | # continue
|
| | | # |
| | | # curTag = GameWorld.GetObj(curObj.GetID(), curObjType)
|
| | | # if not curTag:
|
| | | # continue
|
| | | # playerLV = curTag.GetLV()
|
| | | # addPrestige = eval(addPrestigeFormat)
|
| | | # PlayerPrestigeSys.AddPrestigeOffcialLV(curTag, addPrestige, ChConfig.Def_AddPrestige_NPC)
|
| | |
|
| | | return
|
| | | |
| | | #---------------------------------------------------------------------
|
| | | ## NPC死的时候, 检查自己是否需要重生. 0: tick后仍然死亡 1: tick后可以重生
|
| | | # @param self 类实例
|
| | |
| | | curNPC = self.__Instance
|
| | | npcID = curNPC.GetNPCID()
|
| | | #######################特殊NPC的处理
|
| | | #=====================================================================================================
|
| | | # if curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotTruck:
|
| | | # #如果是骠车死亡, 调用骠车死亡逻辑
|
| | | # PlayerTruck.DoTruckDestroy(curNPC)
|
| | | #=====================================================================================================
|
| | |
|
| | | #boss伤血排行榜击杀逻辑
|
| | | #BossHurtMng.BossOnKilled(curNPC)
|
| | |
| | | # #PlayerControl.WorldNotify(0, "Old_andyshao_861048", [curNPC.GetNPCID()])
|
| | | # if mapID == ChConfig.Def_MapID_DouHunTan:
|
| | | # NPCCustomRefresh.DoRefreshNeutralBoss(npcID)
|
| | | # |
| | | # # 周围玩家加威望
|
| | | # npcKilledAddPrestigeDict = ReadChConfig.GetEvalChConfig('NPCKilledAddPrestige')
|
| | | # if npcID in npcKilledAddPrestigeDict:
|
| | | # addPrestigeFormat = npcKilledAddPrestigeDict[npcID]
|
| | | # self.__GiveNearbyPlayerPrestige(addPrestigeFormat, ChConfig.Def_Matrix_Six)
|
| | | #===========================================================================================
|
| | |
|
| | | #清空NPC的仇恨
|
| | | curNPC.GetNPCAngry().Clear()
|
| | |
| | | curNPC_GameNPCObjType = curNPC.GetGameNPCObjType()
|
| | | #---特殊死亡逻辑---
|
| | |
|
| | | #镖车不能通知死亡
|
| | | if curNPC_GameNPCObjType == IPY_GameWorld.gnotTruck:
|
| | | return
|
| | | |
| | | #宠物死亡调用独立接口
|
| | | if curNPC_GameNPCObjType == IPY_GameWorld.gnotPet:
|
| | | PetControl.SetPetDead(curNPC)
|
| | |
| | | #调用底层 -> 通知客户端死亡
|
| | | SetDeadEx(curNPC)
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ## 召唤兽死亡,替换仇恨
|
| | | # @param self 类实例
|
| | | # @return 返回值无意义
|
| | | # @remarks 召唤兽死亡,替换仇恨
|
| | | #===========================================================================
|
| | | # def __NPCReplaceAngry(self):
|
| | | # curNPC = self.__Instance
|
| | | # #仅处理宠物和召唤兽
|
| | | # if curNPC.GetGameNPCObjType() not in [IPY_GameWorld.gnotSummon, IPY_GameWorld.gnotPet]:
|
| | | # return
|
| | | # |
| | | # if curNPC.GetType() not in [IPY_GameWorld.ntSummon, IPY_GameWorld.ntElf,
|
| | | # IPY_GameWorld.ntTrap, IPY_GameWorld.ntTruck,
|
| | | # IPY_GameWorld.ntFairy]:
|
| | | # return
|
| | | # |
| | | # summonOwner = GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curNPC)
|
| | | # |
| | | # if summonOwner == None:
|
| | | # summonOwner = GetSummonNPCOwner(IPY_GameWorld.gotNPC, curNPC)
|
| | | # |
| | | # #异常错误
|
| | | # if summonOwner == None:
|
| | | # #GameWorld.Log("替换仇恨,查找召唤兽主人失败 curNPC = %s"%(curNPC.GetNPCID()))
|
| | | # return
|
| | | # |
| | | # #仇恨NPC列表
|
| | | # angryNPCList = list()
|
| | | # for index in range(curNPC.GetAngryNPCCount()):
|
| | | # angryNPC = curNPC.GetAngryNPCByIndex(index)
|
| | | # #已经死亡
|
| | | # if GameObj.GetHP(angryNPC) <= 0:
|
| | | # continue
|
| | | # |
| | | # angryNPCList.append(angryNPC)
|
| | | # |
| | | # #在ReplaceNPCAngryFromOldToNew的时候, 会删除仇恨, |
| | | # #改变 summonNPC.GetAngryNPCCount() 的长度, 所以必须先构建列表,
|
| | | # #在替换仇恨
|
| | | # for angryListNPC in angryNPCList:
|
| | | # #替换仇恨
|
| | | # ReplaceNPCAngryFromOldToNew(angryListNPC, curNPC, summonOwner)
|
| | | # |
| | | # return
|
| | | #===========================================================================
|
| | | |
| | | #---------------------------------------------------------------------
|
| | | ## NPC非战斗中回血
|
| | | # @param self 类实例
|
| | |
| | | return
|
| | | npcID = curNPC.GetNPCID()
|
| | | #GameWorld.DebugLog("__MissionOnKillNPC isFeel=%s" % (isFeel), curPlayer.GetPlayerID())
|
| | | killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
|
| | | limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
|
| | | isWorldBoos = limitIndex == ShareDefine.Def_Boss_Func_World
|
| | | if isFeel:
|
| | | #击杀NPC触发摸怪任务事件
|
| | | EventShell.EventRespons_OnKillByFeel(curPlayer, curNPC)
|
| | | if isWorldBoos:
|
| | | EventShell.EventRespons_KillWorldBossByFeel(curPlayer)
|
| | | else:
|
| | | #普通NPC击杀触发
|
| | | EventShell.EventRespons_OnKillById(curPlayer, curNPC)
|
| | | if isWorldBoos:
|
| | | EventShell.EventRespons_KillWorldBoss(curPlayer)
|
| | | #击杀特定NPC成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillSpecificNPC, 1, [npcID])
|
| | | return
|