From f198885f31c9c7eb19eb28adce562e39e64d581c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 18 七月 2025 16:23:11 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(属性计算、战斗力计算;新角色初始给默认装备、默认阵容武将;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py |  124 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 113 insertions(+), 11 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
index eeb08bc..c5ce267 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
@@ -25,6 +25,7 @@
 import PlayerFamilyTech
 import PlayerFamilyEmblem
 import PlayerFamilyZhenfa
+import PlayerFamilyZhenbaoge
 import IPY_PlayerDefine
 import IpyGameDataPY
 import IPY_GameWorld
@@ -69,6 +70,18 @@
                       IPY_PlayerDefine.fmlViceLeader:"DeputyLeaderMax",
                       }
 
+def FamilyOnDay():
+    if GameWorld.IsCrossServer():
+        return
+    
+    familyManager = DBDataMgr.GetFamilyMgr()
+    for i in range(0, familyManager.GetCount()):
+        family = familyManager.GetAt(i)
+        #珍宝阁
+        PlayerFamilyZhenbaoge.OnDay(family)
+        
+    return
+
 def PlayerOnDay(curPlayer):
     if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Family):
         return
@@ -76,9 +89,7 @@
     Sync_FamilyDayRewardState(curPlayer)
     __FamilyAffair_Refresh(curPlayer, True)
     
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeCut, 0)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeBuy, 0)
-    #PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer)
+    PlayerFamilyZhenbaoge.PlayerOnDay(curPlayer)
     return
 
 def OnPlayerLogin(curPlayer, tick):
@@ -90,7 +101,7 @@
     PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
     __FamilyAffair_CheckReset(curPlayer)
     PlayerFamilyZhenfa.OnPlayerLogin(curPlayer)
-    #PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer)
+    PlayerFamilyZhenbaoge.OnPlayerLogin(curPlayer)
     return
 
 def OnPlayerLogout(curPlayer):
@@ -215,7 +226,7 @@
     #XW_JZ_EstablishSud <n color="255,255,0">恭喜您,家族建立成功!</n>    25  -   -
     PlayerControl.NotifyCode(curPlayer, "XW_JZ_EstablishSud")
     PlayerControl.WorldNotify(0, "jiazu_liubo_671654", [curPlayer.GetName(), fullFamilyName, newFamilyID])
-    #PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily)
+    PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily)
     return
 
 def CheckInputFamilyName(curPlayer, inputName):
@@ -398,7 +409,6 @@
         #触发家族升级事件, 在SetFamilyLV之后,任务可以取等级判定
         if isLVUP:
             pass
-            #EventShell.EventResponse_OnFamilyLVUp(curPlayer)
         
     if lastFamilyID != 0 and curPlayer.GetFamilyID() == 0:
         #玩家离开家族
@@ -408,7 +418,6 @@
         #刚进家族并为族长,触发建家族事件
         if curPlayer.GetFamilyMemberLV() == IPY_GameWorld.fmlLeader:
             pass
-            #EventShell.EventResponse_OnCreateFamily(curPlayer)
             
         #进入家族触发事件
         __OnEnterFamily(curPlayer, tick)
@@ -422,7 +431,6 @@
     familyMgr = DBDataMgr.GetFamilyMgr()
     familyMgr.DelPlayerReqJoinFamilyIDAll(curPlayer.GetPlayerID())
     Sync_RequestAddFamilyInfo(curPlayer)
-    #EventShell.EventResponse_OnFamily(curPlayer)
     __FamilyAffair_CheckReset(curPlayer)
     PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
     #GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
@@ -441,8 +449,6 @@
     curPlayer.SetFamilyLV(0)
     PlayerControl.SetLeaveFamilyTimeEx(curPlayer, int(time.time()))
     
-    #触发玩家离开家族的任务
-    #EventShell.EventResponse_OnLeaveFamily(curPlayer)
     FBLogic.OnLeaveFamily(curPlayer, tick)
     return
 
@@ -1356,6 +1362,102 @@
 
 ## ------------------------------------------------------------------------------------------------
 
+#// A6 17 查询家族行为信息 #tagCMQueryFamilyAction
+#
+#struct    tagCMQueryFamilyAction
+#{
+#    tagHead        Head;
+#    BYTE        ActionType;        // 行为类型
+#    DWORD        FamilyID;         // 家族ID,发0默认自己家族
+#};
+def OnQueryFamilyAction(index, cliendData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    
+    if not curPlayer:
+        return
+    
+    actionType = cliendData.ActionType
+    familyID = cliendData.FamilyID
+    if not familyID:
+        familyID = curPlayer.GetFamilyID()
+        
+    SendFamilyActionInfo(curPlayer, familyID, actionType)
+    return
+
+def SendFamilyActionInfo(curPlayer, familyID, actionType):
+    ## 发送家族行为
+    # @param curPlayer: 为None时通知该仙盟所有成员
+    
+    familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, actionType)
+    
+    clientPack = ChPyNetSendPack.tagMCFamilyActionInfo()
+    clientPack.FamilyID = familyID
+    clientPack.ActionType = actionType
+    clientPack.FamilyActionList = []
+    
+    for index in xrange(familyAction.Count()):
+        familyActionData = familyAction.At(index)
+        
+        actionData = ChPyNetSendPack.tagMCFamilyAction()
+        actionData.Time = familyActionData.GetTime()
+        actionData.Name = familyActionData.GetName()
+        actionData.NameLen = len(actionData.Name)
+        actionData.Value1 = familyActionData.GetValue1()
+        actionData.Value2 = familyActionData.GetValue2()
+        actionData.Value3 = familyActionData.GetValue3()
+        actionData.Value4 = familyActionData.GetValue4()
+        actionData.Value5 = familyActionData.GetValue5()
+        actionData.Value6 = familyActionData.GetValue6()
+        actionData.UseData = familyActionData.GetUserData()
+        actionData.UseDataLen = len(actionData.UseData)
+        clientPack.FamilyActionList.append(actionData)
+        
+    clientPack.Count = len(clientPack.FamilyActionList)
+    
+    if curPlayer:
+        NetPackCommon.SendFakePack(curPlayer, clientPack)
+        return
+    Broadcast_FamilyPack(familyID, clientPack)
+    return
+
+def SendFamilyAction(actionDataList, curPlayer=None):
+    ## 同步指定仙盟action
+    # @param actionDataList: 支持列表或指定actionData
+    # @param curPlayer: 为None时通知该仙盟所有成员
+    if not isinstance(actionDataList, list):
+        actionDataList = [actionDataList]
+    if not actionDataList:
+        return
+    familyActionData = actionDataList[0]
+    familyID = familyActionData.GetFamilyID()
+    actionType = familyActionData.GetActionType()
+    
+    clientPack = ChPyNetSendPack.tagMCFamilyActionInfo()
+    clientPack.FamilyID = familyID
+    clientPack.ActionType = actionType
+    clientPack.FamilyActionList = []
+    for familyActionData in actionDataList:
+        actionData = ChPyNetSendPack.tagMCFamilyAction()
+        actionData.Time = familyActionData.GetTime()
+        actionData.Name = familyActionData.GetName()
+        actionData.NameLen = len(actionData.Name)
+        actionData.Value1 = familyActionData.GetValue1()
+        actionData.Value2 = familyActionData.GetValue2()
+        actionData.Value3 = familyActionData.GetValue3()
+        actionData.Value4 = familyActionData.GetValue4()
+        actionData.Value5 = familyActionData.GetValue5()
+        actionData.Value6 = familyActionData.GetValue6()
+        actionData.UseData = familyActionData.GetUserData()
+        actionData.UseDataLen = len(actionData.UseData)
+        clientPack.FamilyActionList.append(actionData)
+    clientPack.Count = len(clientPack.FamilyActionList)
+    
+    if curPlayer:
+        NetPackCommon.SendFakePack(curPlayer, clientPack)
+        return
+    Broadcast_FamilyPack(familyID, clientPack)
+    return
+
 def GetFamilyDayAward(curPlayer):
     ##领取仙盟每日奖励 2小时脱机挂时间
     return
@@ -1536,7 +1638,7 @@
     starInfo = affairStarDict.get(str(star), [])
     needDuration = starInfo[1] if len(starInfo) > 1 else 0
     # 可扩展减时长属性
-    speedPer = PlayerControl.GetAffairSpeedPer(curPlayer)
+    speedPer = 0#PlayerControl.GetAffairSpeedPer(curPlayer)
     if speedPer:
         needDuration = int(needDuration * max(10000 - speedPer, 0) / 10000.0)
         #GameWorld.DebugLog("事务加速: needDuration=%s,speedPer=%s" % (needDuration, speedPer), curPlayer.GetPlayerID())

--
Gitblit v1.8.0