From b55a8f02a5e1dd8cddb56452a163cb9244803c6e Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 02 八月 2022 14:35:09 +0800 Subject: [PATCH] 9387 【主干】【越南】【bt7】【后端】支持跨服协助 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py | 34 +++++++++++++++++++++++----------- 1 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py index 61815ea..4d39ab4 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py @@ -71,13 +71,11 @@ objID = clientData.ObjID npcID = clientData.NPCID - if GameWorld.IsCrossServer(): - return - - if not curPlayer.GetFamilyID(): - GameWorld.DebugLog("没有仙盟不能请求协助!", playerID) - return - + if not GameWorld.IsCrossServer(): + if not curPlayer.GetFamilyID(): + GameWorld.DebugLog("本服boss没有仙盟不能请求协助!", playerID) + return + curNPC = GameWorld.FindNPCByNPCID(npcID) if not curNPC: GameWorld.DebugLog("协助NPC不存在无法协助!npcID=%s" % npcID, playerID) @@ -103,7 +101,8 @@ npcLV = curNPC.GetLV() mapID = curPlayer.GetMapID() lineID = NPCHurtManager.GetBossLineID(npcID) - queryData = [mapID, lineID, npcID, objID, npcLV] + serverGroupID = PlayerControl.GetPlayerServerGroupID(curPlayer) + queryData = [mapID, lineID, npcID, objID, npcLV, serverGroupID] QueryGameServer_PlayerAssist(playerID, "RequestAssistBoss", queryData) return @@ -206,6 +205,17 @@ awardItemID, awardItemCount = ipyData.GetAssistPlayerAward() ItemControler.GivePlayerItemOrMail(curPlayer, [[awardItemID, awardItemCount, 0]]) + # 跨服发布协助玩家奖励 + elif queryType == "CrossNoAssistPlayerAward": + assistAwardItemID = queryData[0] + ItemControler.GivePlayerItemOrMail(curPlayer, [[assistAwardItemID, 1, 0]]) + + # 跨服协助玩家奖励 + elif queryType == "CrossAssistPlayerAward": + assistMoney, isFriend = queryData + assistMoneyType = ShareDefine.TYPE_Price_FamilyActivity + AddTodayAssistMoney(curPlayer, assistMoneyType, assistMoney, isFriend) + return def GameServer_AssistBossMsg(assistData): @@ -217,13 +227,13 @@ # 开始协助 if msgType == "Start": - assistGUID, assistPlayerID, assistPlayerName, isFriend, tagPlayerID, tagPlayerName, tagTeamID, lineID, objID, npcID = assistData[1:] + assistGUID, assistPlayerID, assistPlayerName, isFriend, tagPlayerID, tagPlayerName, tagTeamID, lineID, objID, npcID, serverGroupID = assistData[1:] npchurtList = NPCHurtManager.GetPlayerHurtListEx(lineID, objID, npcID) if not npchurtList: return npchurtList.AddAssistPlayer(assistPlayerID, assistPlayerName, isFriend, tagPlayerID, tagPlayerName, tagTeamID) - QueryGameServer_PlayerAssist(0, "AddAssistBossPlayerOK", [assistGUID, assistPlayerID]) + QueryGameServer_PlayerAssist(0, "AddAssistBossPlayerOK", [assistGUID, assistPlayerID, tagPlayerID, serverGroupID]) # 取消协助 elif msgType == "Cancel": @@ -366,7 +376,9 @@ socialEx = int(addValue * friendAddAssistMoneyPer / 100.0) realAdd = addValue + socialEx - PlayerControl.GiveMoney(curPlayer, moneyType, realAdd) + + if not GameWorld.IsCrossServer(): + PlayerControl.GiveMoney(curPlayer, moneyType, realAdd) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoney, todayAssistMoney + addValue) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoneySocial, socialMoney + socialEx) -- Gitblit v1.8.0