| | |
| | | curNPC.GetDictByKey(ChConfig.Def_NPCDead_KillerID))
|
| | | return
|
| | |
|
| | | def GameServer_KillGameWorldBoss(bossID, killPlayerName, hurtValue, isNotify=True):
|
| | | def GameServer_KillGameWorldBoss(bossID, killPlayerName, hurtValue, isNotify=True, killerIDList=[]):
|
| | | dataMapID = GameWorld.GetGameWorld().GetMapID()
|
| | | realMapID = GameWorld.GetGameWorld().GetRealMapID()
|
| | | copyMapID = GameWorld.GetGameWorld().GetCopyMapID()
|
| | | killMsg = str([bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID])
|
| | | killMsg = str([bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID, killerIDList])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'KillGameWorldBoss', killMsg, len(killMsg))
|
| | | GameWorld.DebugLog("Boss被击杀: bossID=%s,dataMapID=%s,realMapID=%s,copyMapID=%s" % (bossID, dataMapID, realMapID, copyMapID))
|
| | | GameWorld.DebugLog("Boss被击杀: bossID=%s,dataMapID=%s,realMapID=%s,copyMapID=%s,killerIDList=%s" % (bossID, dataMapID, realMapID, copyMapID, killerIDList))
|
| | | return
|
| | |
|
| | | def GameServe_GameWorldBossState(bossID, isAlive):
|
| | |
| | | GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID, 0)
|
| | | return
|
| | |
|
| | | def OnPlayerKillBoss(curPlayer, npcID, mapID, isCrossServer): |
| | | killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
|
| | | limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
|
| | | if limitIndex != None:
|
| | | #今日杀怪次数+1
|
| | | key = ChConfig.Def_PDict_Boss_KillCnt % limitIndex
|
| | | newCnt = curPlayer.NomalDictGetProperty(key, 0) + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, key, newCnt)
|
| | | BossHurtMng.NotifyAttackBossCnt(curPlayer, limitIndex)
|
| | | GameWorld.DebugLog("今日杀怪次数 playerID=%s, newCnt=%s" % (curPlayer.GetPlayerID(), newCnt))
|
| | | |
| | | dataDict = {"objID":npcID, "bossID":npcID, "touchCnt":newCnt,
|
| | | "AccID":curPlayer.GetAccID(), "PlayerID":curPlayer.GetPlayerID()}
|
| | | DataRecordPack.SendEventPack("AddKillBossCnt", dataDict, curPlayer)
|
| | | |
| | | if isCrossServer:
|
| | | return
|
| | | |
| | | if limitIndex == ShareDefine.Def_Boss_Func_World:
|
| | | # 世界BOSS击杀成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillWorldBoss, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_WorldBOSS, 1)
|
| | | |
| | | if mapID == ChConfig.Def_FBMapID_BossHome:
|
| | | #BOSS之家
|
| | | # BOSS之家BOSS击杀成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillBossHomeBoss, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_BOSSHome)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_BOSSHome, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_BossHome, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_BOSSHome, 1)
|
| | | return
|
| | | |
| | | #################################################
|
| | | ## NPC控制定义
|
| | | #
|
| | |
| | | self.__Killer = None # 击杀者, 由各种规则得出, 一般也是物品归属的代表, 用于广播、记录等确保与归属一致
|
| | | self.__AllKillerDict = {} # 所有击杀的玩家ID对应字典, 非队伍, 一般也是归属的拥有者
|
| | | self.__FeelPlayerList = [] # 所有摸怪玩家列表,处理任务及某些逻辑用
|
| | | self.__ownerPlayerList = [] # 归属者列表
|
| | |
|
| | | self.__OwnerHurtType = 0
|
| | | self.__OwnerHurtID = 0
|
| | |
| | | if GetDropOwnerType(curNPC) == ChConfig.DropOwnerType_Family:
|
| | | killerName = FamilyRobBoss.FamilyOwnerBossOnKilled(curNPC, self.__OwnerHurtID)
|
| | | #KillerJob = 0 if not self.__Killer else self.__Killer.GetJob()
|
| | | GameServer_KillGameWorldBoss(curNPC.GetNPCID(), killerName, 0)
|
| | | killerIDList = [player.GetPlayerID() for player in self.__ownerPlayerList]
|
| | | GameServer_KillGameWorldBoss(curNPC.GetNPCID(), killerName, 0, True, killerIDList)
|
| | | #===========================================================================================
|
| | | # # 暗金boss
|
| | | # if curNPC.GetIsBoss() == ChConfig.Def_NPCType_Boss_Dark:
|
| | |
| | | dropPlayer = curPlayer
|
| | | self.__KilledByPlayerSetPrize(curPlayer)
|
| | | ownerPlayerList.append(curPlayer)
|
| | | |
| | | self.__ownerPlayerList = ownerPlayerList
|
| | | |
| | | #调用物品掉落
|
| | | self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList)
|
| | |
|
| | |
| | |
|
| | | self.__DoNormalTeamExp(curPlayer)
|
| | | self.__KillNPCFuncEx(curPlayer, curNPC, maxHurtID, True)
|
| | | self.__ownerPlayerList = ownerPlayerList
|
| | |
|
| | | #调用物品掉落
|
| | | self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList)
|
| | |
| | | maxLV = curPlayerLV
|
| | | dropPlayer = player
|
| | | ownerPlayerList.append(player)
|
| | | self.__ownerPlayerList = ownerPlayerList
|
| | |
|
| | | if not ownerPlayerList:
|
| | | GameWorld.Log("奖励归属仙盟,但是不存在可获得该奖励的成员!npcID=%s,hurtType=%s,hurtID=%s"
|
| | |
| | | defObjType = curNPC.GetGameObjType()
|
| | | mapFBType = GameWorld.GetMap().GetMapFBType()
|
| | | mapID = FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID())
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | #playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | # 如果是NPC
|
| | | if defObjType == IPY_GameWorld.gotNPC:
|
| | | if defObjType != IPY_GameWorld.gotNPC:
|
| | | return
|
| | | |
| | | # 跨服服务器处理
|
| | | if GameWorld.IsCrossServer():
|
| | | #掉落归属
|
| | | if mapFBType != IPY_GameWorld.fbtNull:
|
| | | FBLogic.DoFB_DropOwner(curPlayer , curNPC)
|
| | | else:
|
| | | if curNPC.GetLV()>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC)
|
| | |
|
| | | killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
|
| | | limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
|
| | | if limitIndex != None:
|
| | | #今日杀怪次数+1
|
| | | key = ChConfig.Def_PDict_Boss_KillCnt % limitIndex
|
| | | newCnt = curPlayer.NomalDictGetProperty(key, 0) + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, key, newCnt)
|
| | | BossHurtMng.NotifyAttackBossCnt(curPlayer, limitIndex)
|
| | | GameWorld.DebugLog("今日杀怪次数 playerID=%s, newCnt=%s" % (curPlayer.GetPlayerID(), newCnt))
|
| | | |
| | | dataDict = {"objID":curNPC.GetID(), "bossID":npcID, "touchCnt":newCnt,
|
| | | "AccID":curPlayer.GetAccID(), "PlayerID":curPlayer.GetPlayerID()}
|
| | | DataRecordPack.SendEventPack("AddKillBossCnt", dataDict, curPlayer)
|
| | | if limitIndex == 0:
|
| | | # 世界BOSS击杀成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillWorldBoss, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_WorldBOSS, 1)
|
| | | if ChConfig.IsGameBoss(curNPC) and mapID == ChConfig.Def_FBMapID_BossHome:
|
| | | #BOSS之家
|
| | | # BOSS之家BOSS击杀成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillBossHomeBoss, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_BOSSHome)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_BOSSHome, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_BossHome, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_BOSSHome, 1)
|
| | | if ChConfig.IsGameBoss(curNPC):
|
| | | OnPlayerKillBoss(curPlayer, npcID, mapID, True)
|
| | | return
|
| | | |
| | | #掉落归属
|
| | | if mapFBType != IPY_GameWorld.fbtNull:
|
| | | FBLogic.DoFB_DropOwner(curPlayer , curNPC)
|
| | | else:
|
| | | if curNPC.GetLV()>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC)
|
| | |
|
| | | if ChConfig.IsGameBoss(curNPC):
|
| | | OnPlayerKillBoss(curPlayer, npcID, mapID, False)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #GameWorld.DebugLog("__MissionOnKillNPC isFeel=%s" % (isFeel), curPlayer.GetPlayerID())
|
| | | killBossCntLimitDict = IpyGameDataPY.GetFuncCfg('KillBossCntLimit', 1)
|
| | | limitIndex = GameWorld.GetDictValueByKey(killBossCntLimitDict, npcID)
|
| | | isWorldBoos = limitIndex == 0
|
| | | isWorldBoos = limitIndex == ShareDefine.Def_Boss_Func_World
|
| | | if isFeel:
|
| | | #击杀NPC触发摸怪任务事件
|
| | | EventShell.EventRespons_OnKillByFeel(curPlayer, curNPC)
|