| | |
| | | import ChPyNetSendPack
|
| | | import DataRecordPack
|
| | | import GameLogic_FamilyWar
|
| | | import GameLogic_FamilyBoss
|
| | | import ChMapToGamePyPack
|
| | | import PlayerFamilyTech
|
| | | import PlayerFamilyRedPacket
|
| | |
| | | PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
| | | DelAddFamilyRecord(curPlayer)
|
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | | GameLogic_FamilyBoss.OnEnterFamily(curPlayer)
|
| | | PlayerFamilyRedPacket.CreatCacheRedPacktet(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | sendMsg = '%s'%(infoDict)
|
| | | #GameWorld.DebugLog("Send_GameServer_PyAddFamilyInfoValue sendMsg=%s" % sendMsg)
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, 'PyAddFamilyInfoValue', sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | | #// A6 05 家族捐献兽粮 #tagCMFamilyDonate
|
| | | #
|
| | | #struct tagCMFamilyDonate
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnFamilyDonateItem(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | return
|
| | | |
| | | playerFamilyID = curPlayer.GetFamilyID()
|
| | | if playerFamilyID <= 0:
|
| | | return
|
| | | totalAddActiveValue = 0
|
| | | delItemList = []
|
| | | totalCnt = 0
|
| | | curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | for i in range(curPack.GetCount()):
|
| | | item = curPack.GetAt(i)
|
| | | if item == None or item.IsEmpty():
|
| | | continue
|
| | | if item.GetType() != ChConfig.Def_ItemType_FamilyBossFood:
|
| | | continue
|
| | | addActiveValue = item.GetEffectByIndex(0).GetEffectValue(0)
|
| | | # if not addActiveValue:
|
| | | # continue
|
| | | itemCnt = item.GetCount() |
| | | totalAddActiveValue += addActiveValue * itemCnt
|
| | | delItemList.append([item, itemCnt])
|
| | | totalCnt += itemCnt
|
| | | if not totalCnt:
|
| | | GameWorld.DebugLog('背包里没有可捐献的物品')
|
| | | return
|
| | | for eatItem, delCnt in delItemList:
|
| | | ItemCommon.DelItem(curPlayer, eatItem, delCnt, False)
|
| | | |
| | | #累加个人活跃度/贡献度
|
| | | if totalAddActiveValue:
|
| | | AddPlayerFamilyActiveValue(curPlayer, totalAddActiveValue, True, ShareDefine.Def_AddFAVReason_FamilyDonateItem)
|
| | | AddFamilyBossFood(curPlayer, totalCnt, ShareDefine.Def_AddFAVReason_FamilyDonateItem)
|
| | | GameWorld.DebugLog(' 捐献仙盟兽粮 totalCnt=%s,totalAddActiveValue=%s'%(totalCnt,totalAddActiveValue))
|
| | | return
|
| | |
|
| | | def DoAddFamilyBossFoodEx(curPlayer, itemID, itemCnt, reason=0):
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | return
|
| | | if itemData.GetType() != ChConfig.Def_ItemType_FamilyBossFood:
|
| | | return
|
| | | addActiveValue = itemData.GetEffectByIndex(0).GetEffectValue(0)
|
| | | if not addActiveValue:
|
| | | return
|
| | | totalAddActiveValue = addActiveValue * itemCnt
|
| | | GameWorld.DebugLog('自动捐献仙盟兽粮 totalCnt=%s,totalAddActiveValue=%s,reason=%s' % (itemCnt, totalAddActiveValue, reason))
|
| | | #累加个人活跃度/贡献度
|
| | | AddPlayerFamilyActiveValue(curPlayer, totalAddActiveValue, True, reason)
|
| | | AddFamilyBossFood(curPlayer, itemCnt, reason)
|
| | | return True
|
| | |
|
| | | ##增加兽粮
|
| | | # @param curPlayer 玩家实例
|
| | | # @param addExp 增加的经验点
|
| | | # @return 返回值无意义
|
| | | def AddFamilyBossFood(curPlayer, addExp, reason):
|
| | | #没有家族不处理
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | if familyID == 0:
|
| | | return
|
| | | if addExp <= 0:
|
| | | return
|
| | | SendPack_GameServer_AddFamilyDetailEx(curPlayer, 0, 0, addExp, reason)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|