| | |
| | | import NPCCommon
|
| | | import AICommon
|
| | | import IPY_GameWorld
|
| | | import FamilyRobBoss
|
| | | import AttackCommon
|
| | | import GameWorld
|
| | | import BaseAttack
|
| | |
| | | elif ownerType == ChConfig.Def_NPCHurtTypePlayer:
|
| | | tagObj = GameWorld.GetObj(ownerID, IPY_GameWorld.gotPlayer)
|
| | |
|
| | | elif dropOwnerType == ChConfig.DropOwnerType_Family:
|
| | | ownerInfo = FamilyRobBoss.RefreshFamilyOwnerNPCHurt(npcControl, curNPC, tick, refreshInterval)
|
| | | if ownerInfo:
|
| | | tagObj, ownerFamilyID = ownerInfo
|
| | | ownerType, ownerID = ChConfig.Def_NPCHurtTypeFamily, ownerFamilyID
|
| | | |
| | | # 没有攻击目标,则刷新仇恨,支持主动怪
|
| | | if not tagObj:
|
| | | angryObjType, maxAngryObj = None, None
|
| | |
| | | maxAngryObj = GameWorld.GetObj(angryID, angryObjType)
|
| | |
|
| | | tagObj = maxAngryObj
|
| | | if angryObjType == IPY_GameWorld.gotPlayer and maxAngryObj:
|
| | | if angryObjType == IPY_GameWorld.gotPlayer and maxAngryObj and not ownerType:
|
| | | teamID = maxAngryObj.GetTeamID()
|
| | | if teamID:
|
| | | ownerType, ownerID = ChConfig.Def_NPCHurtTypeTeam, teamID
|
| | |
| | | def __RefreshBossDropOwnerObjBuff(curNPC, npcControl, tick, ownerType=0, ownerID=0, isDead=False):
|
| | | npcID = curNPC.GetNPCID()
|
| | | dropOwnerType = NPCCommon.GetDropOwnerType(curNPC)
|
| | | if dropOwnerType not in [ChConfig.DropOwnerType_MaxHurt, ChConfig.DropOwnerType_MaxAngry]:
|
| | | if dropOwnerType not in [ChConfig.DropOwnerType_MaxHurt, ChConfig.DropOwnerType_MaxAngry, ChConfig.DropOwnerType_Family]:
|
| | | #GameWorld.DebugLog("不需要展示掉落归属的NPC! npcID=%s,dropOwnerType=%s" % (npcID, dropOwnerType))
|
| | | return
|
| | |
|
| | |
| | | if isOk:
|
| | | GameWorld.DebugLog("删除归属队员buff: teamID=%s,playerID=%s" % (ownerID, curTeamPlayer.GetPlayerID()))
|
| | |
|
| | | elif ownerType == ChConfig.Def_NPCHurtTypeFamily:
|
| | | |
| | | hurtType, hurtID = ChConfig.Def_NPCHurtTypeFamily, ownerID
|
| | | refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | | copyPlayerMgr = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(copyPlayerMgr.GetPlayerCount()):
|
| | | player = copyPlayerMgr.GetPlayerByIndex(index)
|
| | | if not player:
|
| | | continue
|
| | | |
| | | # 归属仙盟 且 在boss区域内
|
| | | if player.GetFamilyID() == ownerID and npcControl.GetIsInRefreshPoint(player.GetPosX(), player.GetPosY(), refreshPoint):
|
| | | __AddBossDropOwnerPlayerBuff(player, tick, curNPC)
|
| | | |
| | | else:
|
| | | isOk = BuffSkill.DelBuffBySkillID(player, ChConfig.Def_SkillID_DropOwnerBuff, tick, buffOwner=curNPC)
|
| | | if isOk:
|
| | | GameWorld.DebugLog("删除非归属仙盟成员buff: teamID=%s,playerID=%s" % (ownerID, player.GetPlayerID()))
|
| | | |
| | | if isDead:
|
| | | key = (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), npcID)
|
| | | teamID = curTeam.GetTeamID() if curTeam else 0
|
| | | if killerDict:
|
| | | PyGameData.g_npcKillerInfo[key] = killerDict, curTeam, hurtType, hurtID
|
| | | GameWorld.Log("Boss被击杀: npcID=%s,key=%s,playerIDList=%s,teamID=%s" % (npcID, key, killerDict.keys(), teamID))
|
| | | elif ownerType == ChConfig.Def_NPCHurtTypeFamily:
|
| | | PyGameData.g_npcKillerInfo[key] = {}, None, hurtType, hurtID
|
| | | |
| | | GameWorld.Log("Boss被击杀: npcID=%s,key=%s,playerIDList=%s,teamID=%s,hurtType=%s,hurtID=%s" |
| | | % (npcID, key, killerDict.keys(), teamID, hurtType, hurtID))
|
| | | return
|
| | |
|
| | | def __AddBossDropOwnerPlayerBuff(curPlayer, tick, curNPC):
|
| | |
| | | if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0:
|
| | | continue
|
| | | __SetBossDropOwnerBuffDisappearTime(curTeamPlayer, curNPC)
|
| | | elif ownerType == ChConfig.Def_NPCHurtTypeFamily:
|
| | | copyPlayerMgr = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(copyPlayerMgr.GetPlayerCount()):
|
| | | player = copyPlayerMgr.GetPlayerByIndex(index)
|
| | | if not player:
|
| | | continue
|
| | | __SetBossDropOwnerBuffDisappearTime(player, curNPC)
|
| | | |
| | | return
|
| | |
|
| | | def __SetBossDropOwnerBuffDisappearTime(curPlayer, curNPC):
|