From fb86600c411e628bdf36461783c21c84a8e285c5 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 31 七月 2019 15:03:49 +0800 Subject: [PATCH] 8187 【后端】【主干】优化仙盟宴会体验 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py | 42 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py index 7134d5c..8e6064a 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py @@ -14,7 +14,8 @@ # 详细描述: 战盟盛宴 # #--------------------------------------------------------------------- -"""Version = 2018-04-16 17:20""" +#"""Version = 2018-04-16 17:20""" +#--------------------------------------------------------------------- import ShareDefine import FBCommon import ChConfig @@ -32,6 +33,7 @@ import ItemCommon import ItemControler import Item_AddLV +import PlayerTalk #当前副本地图的状态 ( @@ -48,6 +50,8 @@ FBPlayerDict_TotalPoint = 'XMYH_TotalPoint%s' # 获得的总仙盟贡献值 FBPlayerDict_HasCollect = 'XMYH_HasCollect%s' # 是否已采集 FBPlayerDict_HasSit = 'XMYH_HasSit%s' # 是否已传功 +FBPlayerDict_TagPlayerID = 'XMYH_TagPlayerID%s' # 邀请传功目标玩家ID +FBPlayerDict_HelpCount = 'XMYH_HelpCount%s' # 已经帮助传功次数 g_familyMapPlayerIDDict = {}#{lineid:[playerid,..]} def OnFBPlayerOnDay(curPlayer): @@ -170,6 +174,8 @@ gameWorld.SetGameWorldDict(FBPlayerDict_TotalPoint % playerID, 0) gameWorld.SetGameWorldDict(FBPlayerDict_HasCollect % playerID, 0) gameWorld.SetGameWorldDict(FBPlayerDict_HasSit % playerID, 0) + gameWorld.SetGameWorldDict(FBPlayerDict_TagPlayerID % playerID, 0) + gameWorld.SetGameWorldDict(FBPlayerDict_HelpCount % playerID, 0) FBCommon.ClearAreaRewardRecord(playerID) @@ -441,8 +447,8 @@ gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, newTotalExp/ChConfig.Def_PerPointValue) - GameWorld.DebugLog("OnGetExp() addExp=%s,updTotalExp=%s" - % (addExp, newTotalExp), playerID) + #GameWorld.DebugLog("OnGetExp() addExp=%s,updTotalExp=%s" + # % (addExp, newTotalExp), playerID) return ##玩家退出副本 @@ -490,6 +496,7 @@ GameWorld.DebugLog('邀请%s打坐,该玩家不在副本里' % tagPlayerID, playerID) PlayerControl.NotifyCode(curPlayer, 'PartySitFail') return + gameWorld.SetGameWorldDict(FBPlayerDict_TagPlayerID % playerID, tagPlayerID) curPlayer.StopMove() curPlayer.Sit() # if not gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasSit % tagPlayerID): @@ -535,5 +542,34 @@ gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, newTotalExp/ChConfig.Def_PerPointValue) gameWorld.SetGameWorldDict(FBPlayerDict_HasSit % playerID, 1) + + #帮助传功奖励 + helpSitActivityAward = IpyGameDataPY.GetFuncEvalCfg('FamilyPartySitAward', 3) + if helpSitActivityAward and len(helpSitActivityAward) == 2: + helpFamilyActivity, maxHelpAwardCount = helpSitActivityAward + helpThanks = IpyGameDataPY.GetFuncCfg('FamilyPartySitAward', 4) % (helpFamilyActivity, maxHelpAwardCount) + sitThanks = helpThanks.decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding()) + tagPlayerID = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TagPlayerID % playerID) + PlayerTalk.TalkPrivateByID(curPlayer, tagPlayerID, sitThanks) + tagPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(tagPlayerID) + if tagPlayer: + helpCount = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HelpCount % tagPlayerID) + 1 + gameWorld.SetGameWorldDict(FBPlayerDict_HelpCount % tagPlayerID, helpCount) + GameWorld.DebugLog("帮助传功奖励: sitPlayerID=%s,tagPlayerID=%s,helpCount=%s" % (playerID, tagPlayerID, helpCount)) + if helpCount <= maxHelpAwardCount: + PlayerControl.GiveMoney(tagPlayer, ShareDefine.TYPE_Price_FamilyActivity, helpFamilyActivity) + GameWorld.DebugLog(' 传功结束,giveLV=%s, giveExp=%s, worldlv=%s' % (giveLV, giveExp, worldlv)) return True + +def DoAddFamilyMemberFamilyActivity(familyID, addFamilyActivity): + playerManager = GameWorld.GetPlayerManager() + for index in xrange(playerManager.GetPlayerCount()): + curPlayer = playerManager.GetPlayerByIndex(index) + if not curPlayer: + continue + if curPlayer.GetFamilyID() != familyID: + continue + PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FamilyActivity, addFamilyActivity) + GameWorld.DebugLog("增加本仙盟成员答题活跃令, playerID=%s,addFamilyActivity=%s" % (curPlayer.GetPlayerID(), addFamilyActivity)) + return -- Gitblit v1.8.0