| | |
| | | import PlayerBillboard
|
| | | import PlayerActBossTrial
|
| | | import PlayerCompensation
|
| | | import PlayerFamilyEmblem
|
| | | import PlayerFamilyParty
|
| | | import PlayerFamilySWRH
|
| | | import PlayerViewCache
|
| | |
| | | if not family:
|
| | | return 0
|
| | | return GetFamilyTotalFightPower(family)
|
| | | # 徽章
|
| | | def GetFamilyEmblem(curFamily): return curFamily.GetExtra6()
|
| | | def SetFamilyEmblem(curFamily, value): return curFamily.SetExtra6(value)
|
| | | # 徽章ID
|
| | | def GetFamilyEmblemID(curFamily): return curFamily.GetExtra6()
|
| | | def SetFamilyEmblemID(curFamily, emblemID): return curFamily.SetExtra6(emblemID)
|
| | |
|
| | | # 公告修改次数
|
| | | def GetFamilyBroadcastCnt(curFamily): return curFamily.GetExtra3()
|
| | |
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DoCreateFamily(curPlayer, familyName, fakeIndex, tick):
|
| | | def DoCreateFamily(curPlayer, familyName, fakeIndex, tick, emblemID=0):
|
| | | #---验证玩家属性---
|
| | | curPlayerID = curPlayer.GetPlayerID()
|
| | |
|
| | |
| | | if curFamily == None:
|
| | | GameWorld.ErrLog("家族创建数目已满, 创建家族失败", curPlayerID)
|
| | | return
|
| | | GameWorld.Log("创建仙盟: familyID=%s,playerID=%s" % (curFamily.GetID(), curPlayerID))
|
| | | emblemIDList = PlayerFamilyEmblem.GetDefaultFamilyEmblemIDList()
|
| | | if not emblemID or emblemID not in emblemIDList:
|
| | | emblemID = random.choice(emblemIDList) # 从默认徽章中随机选择一个
|
| | | GameWorld.Log("创建仙盟: familyID=%s,playerID=%s,emblemID=%s" % (curFamily.GetID(), curPlayerID, emblemID))
|
| | | #---创建家族---
|
| | | curFamily.SetServerID(GameWorld.GetAccIDServerID(curPlayer.GetAccID()))
|
| | | curFamily.SetCreateTime(GameWorld.GetCurrentDataTimeStr())
|
| | | curFamily.SetLV(1)
|
| | | curFamily.SetAcceptJoin(ShareDefine.FamilyAcceptJoin_Agree) #设置收人方式为直接通过申请
|
| | | SetFamilyEmblemID(curFamily, emblemID)
|
| | | PyDataManager.GetFamilyStoreItemManager().DelFamilyStoreItemAll(curFamily.GetID())
|
| | |
|
| | | #新创建的仙盟默认设置已处理过合服
|
| | |
| | | # tagHead Head;
|
| | | # char Name[33];
|
| | | # WORD FakeID;
|
| | | # BYTE EmblemID; //选择徽章ID,解锁仙盟等级为1级的均为可选ID
|
| | | #};
|
| | | ## 查看申请帮会的成员信息
|
| | | # @param index 玩家索引
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | inputName = clientPack.Name
|
| | | fakeIndex = clientPack.FakeID
|
| | | emblemID = clientPack.EmblemID
|
| | | #执行创建家族逻辑
|
| | | DoCreateFamily(curPlayer, inputName, fakeIndex, tick)
|
| | | DoCreateFamily(curPlayer, inputName, fakeIndex, tick, emblemID)
|
| | | #重置查看家族状态(仅创建家族时候重置, 其余状态由MapServer退出事件时重置)
|
| | | __ClearViewFamilyState(curPlayer)
|
| | | #玩家离开事件
|
| | |
| | | totalFightPower = GetFamilyTotalFightPower(family)
|
| | | familyView.TotalFightPower = totalFightPower % ChConfig.Def_PerPointValue
|
| | | familyView.TotalFightPowerEx = totalFightPower / ChConfig.Def_PerPointValue
|
| | | familyView.EmblemID = GetFamilyEmblemID(family)
|
| | | return familyView
|
| | |
|
| | | ## 玩家模糊查询家族,0F 0D封包
|
| | |
| | | break
|
| | | familyViewPack.PageCount = len(familyViewPack.Family)
|
| | | NetPackCommon.SendFakePack(curPlayer, familyViewPack)
|
| | | return
|
| | |
|
| | | #// A4 13 修改家族徽章 #tagCGChangeFamilyEmblem
|
| | | #
|
| | | #struct tagCGChangeFamilyEmblem
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE EmblemID; // 更换的徽章ID
|
| | | #};
|
| | | def OnChangeFamilyEmblem(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | changeEmblemID = clientData.EmblemID
|
| | | PlayerFamilyEmblem.OnChangeFamilyEmblem(curPlayer, changeEmblemID)
|
| | | return
|
| | |
|
| | | #class IPY_CFamilyChangeBroadcast
|
| | |
| | | fightPower = GetFamilyTotalFightPower(curFamily)
|
| | | value1 = fightPower / ChConfig.Def_PerPointValue
|
| | | value2 = fightPower % ChConfig.Def_PerPointValue
|
| | | value3 = GetFamilyEmblem(curFamily)
|
| | | value3 = GetFamilyEmblemID(curFamily)
|
| | | value4 = curFamily.GetLV()
|
| | | value5 = curFamily.GetServerID()
|
| | | return {"id":familyID, "name":name, "id2":id2, "name2":name2, "value1":value1, "value2":value2,
|