| | |
| | | import GameLogic_FamilyWar
|
| | | import ChMapToGamePyPack
|
| | | import PlayerFamilyTech
|
| | | import PlayerFamilyRedPacket
|
| | | import SkillCommon
|
| | | import BuffSkill
|
| | | import ItemCommon
|
| | |
| | | import GameFuncComm
|
| | | import PlayerTJG
|
| | | import IpyGameDataPY
|
| | | import cPickle
|
| | |
|
| | | import time
|
| | | import random
|
| | |
| | | EventShell.EventResponse_OnFamilyLVUp(curPlayer)
|
| | |
|
| | | if curPlayer.GetFamilyMemberLV() != refreshPack.GetFamilyMemberLV():
|
| | | # 因为仙盟职位没有存DBPlayer,而跨服后又没有Family信息,所以这里做个存储,用于跨服用
|
| | | curPlayer.SetReceivedSalary(refreshPack.GetFamilyMemberLV())
|
| | | curPlayer.SetFamilyMemberLV(refreshPack.GetFamilyMemberLV())
|
| | | #通知周围玩家家族职位刷新
|
| | | curPlayer.Notify_FamilyMemberLVRefresh()
|
| | | #curPlayer.Notify_FamilyMemberLVRefresh()
|
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | |
|
| | | if curPlayer.GetFamilyMoney() != refreshPack.GetFamilyMoney():
|
| | |
| | | PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
| | | DelAddFamilyRecord(curPlayer)
|
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | | PlayerFamilyRedPacket.CreatCacheRedPacktet(curPlayer)
|
| | | return
|
| | |
|
| | | ## 退出家族触发事件
|
| | |
| | | def __OnFamilyLVBuffChange(curPlayer, tick):
|
| | | return
|
| | | # 跨服服务器不处理,防止登录跨服服务器后无战盟导致战力下降
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | |
|
| | | familyLVBuffSkillTypeID = ReadChConfig.GetEvalChConfig("FamilyLVBuff")
|
| | |
| | | return
|
| | |
|
| | | #请求记录申请进入家族信息
|
| | | sendMsg = str([familyID, curPlayer.GetFightPower()])
|
| | | sendMsg = cPickle.dumps([familyID, curPlayer.GetFightPower()], 2)
|
| | | curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_AddFamilyAction,
|
| | | ShareDefine.Def_ActionType_FamilyAdd, '', sendMsg, len(sendMsg))
|
| | |
|
| | |
| | | PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
| | | SyncFamilyActivityInfo(curPlayer)
|
| | | Sync_FamilyDayRewardState(curPlayer)
|
| | | return
|
| | |
|
| | | def FamilyPlayerOnLoginCross(curPlayer):
|
| | | ## 登录跨服服务器
|
| | | crossFamilyMemberLV = curPlayer.GetReceivedSalary()
|
| | | if crossFamilyMemberLV:
|
| | | curPlayer.SetFamilyMemberLV(crossFamilyMemberLV)
|
| | | GameWorld.DebugLog("跨服登录设置仙盟职位等级: %s" % crossFamilyMemberLV, curPlayer.GetPlayerID())
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
| | | ## 添加家族事件记录
|
| | | def AddFamilyEventNote(curPlayer, eventType, valueList):
|
| | | ##同步记录到GameServer, eventType默认为value1
|
| | | sendMsg = str([eventType] + valueList)
|
| | | sendMsg = cPickle.dumps([eventType] + valueList, 2)
|
| | | curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_AddFamilyAction, ShareDefine.Def_ActionType_FamilyEvent, '', sendMsg, len(sendMsg))
|
| | | GameWorld.DebugLog("AddFamilyEventNote sendMsg=%s" % sendMsg)
|
| | | return
|
| | |
| | | # @param awardIndex
|
| | | # @return None
|
| | | def GetFamilyActivityAward(curPlayer, awardIndex):
|
| | | return
|
| | | familyActiveList = IpyGameDataPY.GetFuncEvalCfg('FamilyActive')
|
| | | familyActiveAwardList = IpyGameDataPY.GetFuncEvalCfg('FamilyActive', 2)
|
| | | if awardIndex < 0 or awardIndex >= len(familyActiveList):
|
| | |
| | | return
|
| | |
|
| | | def AddFamilyActivity(curPlayer, actionid, addCnt=1):
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FamilyActivity', actionid)
|
| | | if not ipyData:
|
| | | return
|
| | |
| | | return totalPoint
|
| | |
|
| | | def SyncFamilyActivityInfo(curPlayer, syncActionid=-1):
|
| | | return
|
| | | #通知活跃领取情况
|
| | | syncActionIDList = ShareDefine.FamilyActiveIDList if syncActionid==-1 else [syncActionid]
|
| | | sendPack = ChPyNetSendPack.tagMCFamilyActivityInfo()
|
| | |
| | | def UpdateFamilyName(index, clientData, tick):
|
| | |
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | #itemuse_lzxkoy_0:不可在跨服环境下使用改名功能。
|
| | | PlayerControl.NotifyCode(curPlayer, "itemuse_lzxkoy_0")
|
| | | return
|
| | |
| | | clientPack = ChPyNetSendPack.tagMCFamilyDayAward()
|
| | | clientPack.GetState = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyDayAward)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return |
| | | return
|
| | |
|
| | |
|
| | | #// A6 06 家族兑换活跃令 #tagCMFamilyActivityExchange
|
| | | #
|
| | | #struct tagCMFamilyActivityExchange
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE Count; //材料所在背包索引的数量
|
| | | # WORD IndexList[Count]; //材料所在背包索引列表
|
| | | # DWORD ItemIDList[Count]; //材料所在背包物品ID列表
|
| | | #};
|
| | | ## 家族兑换活跃令 |
| | | # @param playerIndex 玩家索引 |
| | | # @param clientData 客户端封包 |
| | | # @param tick 时间
|
| | | # @return None
|
| | | def OnFamilyActivityExchange(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | if not clientData.Count:
|
| | | return
|
| | | playerID = curPlayer.GetID()
|
| | | eatIndexList = clientData.IndexList
|
| | | eatItemIDList = clientData.ItemIDList
|
| | | givePoint = 0 #分解得到活跃令
|
| | | familyDonateDict = IpyGameDataPY.GetFuncEvalCfg('FamilyDonate', 1, {})
|
| | | familyDonateSpecialDict = IpyGameDataPY.GetFuncEvalCfg('FamilyDonate', 2, {})
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | for i, index in enumerate(eatIndexList):
|
| | | eatItem = itemPack.GetAt(index)
|
| | | if not ItemCommon.CheckItemCanUse(eatItem):
|
| | | GameWorld.DebugLog("物品不可用,无法兑换!itemIndex=%s" % index)
|
| | | continue
|
| | | eatItemID = eatItem.GetItemTypeID()
|
| | | if eatItemID != eatItemIDList[i]:
|
| | | GameWorld.Log('家族兑换活跃令 发的物品ID不对应index=%s eatItemID=%s,ItemIDList[i]=%s' % (index, eatItemID, eatItemIDList[i]), playerID)
|
| | | continue
|
| | | if eatItem.GetIsBind():
|
| | | GameWorld.DebugLog("装备已绑定,无法兑换!itemIndex=%s" % index)
|
| | | continue
|
| | | if eatItem.GetEndureReduceType():
|
| | | GameWorld.DebugLog("有时效耐久物品,无法兑换!itemIndex=%s" % index)
|
| | | continue
|
| | | if eatItemID in familyDonateSpecialDict:
|
| | | addPoint = familyDonateSpecialDict[eatItemID]
|
| | | else:
|
| | | if not ItemCommon.CheckItemIsEquip(eatItem):
|
| | | GameWorld.DebugLog("非装备,无法兑换!itemIndex=%s" % index)
|
| | | continue
|
| | | itemColor = eatItem.GetItemColor()
|
| | | if str(itemColor) not in familyDonateDict:
|
| | | continue
|
| | | isSuite = eatItem.GetSuiteID()
|
| | | addPoint = familyDonateDict[str(itemColor)][1 if isSuite else 0]
|
| | | itemCnt = eatItem.GetCount()
|
| | | givePoint += addPoint * itemCnt
|
| | | ItemCommon.DelItem(curPlayer, eatItem, itemCnt, True, ChConfig.ItemDel_FamilyStore, {'addPoint':addPoint}, True)
|
| | | |
| | | if not givePoint:
|
| | | GameWorld.DebugLog("家族兑换活跃令,没有装备可兑换!")
|
| | | return
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FamilyActivity, givePoint)
|
| | | |
| | | #通知结果
|
| | | packData = ChPyNetSendPack.tagMCFamilyActivityExchangeResult()
|
| | | packData.Clear()
|
| | | packData.Point = givePoint
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|