提交 | 用户 | age
|
00b076
|
1 |
#!/usr/bin/python |
H |
2 |
# -*- coding: GBK -*- |
|
3 |
#------------------------------------------------------------------------------- |
|
4 |
# |
|
5 |
##@package Player.PlayerActBossTrial |
|
6 |
# |
|
7 |
# @todo:boss历练 |
|
8 |
# @author hxp |
|
9 |
# @date 2023-10-20 |
|
10 |
# @version 1.0 |
|
11 |
# |
|
12 |
# 详细描述: boss历练 |
|
13 |
# |
|
14 |
#------------------------------------------------------------------------------- |
|
15 |
#"""Version = 2023-10-20 16:00""" |
|
16 |
#------------------------------------------------------------------------------- |
|
17 |
|
|
18 |
import PyGameData |
|
19 |
import ItemCommon |
|
20 |
import ShareDefine |
|
21 |
import PlayerControl |
|
22 |
import IpyGameDataPY |
|
23 |
import ChPyNetSendPack |
9a60fc
|
24 |
import CrossRealmPlayer |
619d78
|
25 |
import FunctionNPCCommon |
00b076
|
26 |
import PlayerBillboard |
H |
27 |
import ItemControler |
|
28 |
import NetPackCommon |
|
29 |
import IPY_GameWorld |
|
30 |
import GameWorld |
|
31 |
import ChConfig |
|
32 |
|
c9eeb3
|
33 |
def OnMixFirstLogin(curPlayer): |
H |
34 |
|
|
35 |
for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_BossTrial, {}).values(): |
|
36 |
actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) |
|
37 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
38 |
continue |
|
39 |
submitCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitCount % actNum) |
|
40 |
if not submitCount: |
|
41 |
continue |
|
42 |
GameWorld.Log("Boss历练合服首登同步凭证榜单: actNum=%s,submitCount=%s" % (actNum, submitCount), curPlayer.GetPlayerID()) |
db73a4
|
43 |
PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_BossTrialSubmit, submitCount, autoSort=True) |
c9eeb3
|
44 |
break |
H |
45 |
|
|
46 |
return |
|
47 |
|
00b076
|
48 |
def OnPlayerLogin(curPlayer): |
H |
49 |
|
|
50 |
for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_BossTrial, {}).values(): |
|
51 |
actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) |
|
52 |
isReset = __CheckPlayerBossTrialAction(curPlayer, actNum) |
|
53 |
# 活动中同步活动信息 |
|
54 |
if not isReset and actInfo.get(ShareDefine.ActKey_State): |
|
55 |
Sync_BossTrialActionInfo(curPlayer, actNum) |
|
56 |
Sync_BossTrialPlayerInfo(curPlayer, actNum) |
|
57 |
|
9a60fc
|
58 |
if not __CheckPlayerCrossActBossTrial(curPlayer): |
H |
59 |
Sync_CrossActBossTrialActionInfo(curPlayer) |
|
60 |
|
|
61 |
return |
|
62 |
|
|
63 |
def PlayerOnDay(curPlayer, onEventType): |
|
64 |
for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_BossTrial, {}).values(): |
|
65 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
66 |
continue |
|
67 |
|
|
68 |
actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) |
|
69 |
cfgID = actInfo.get(ShareDefine.ActKey_CfgID) |
|
70 |
ipyData = IpyGameDataPY.GetIpyGameData("ActBossTrial", cfgID) |
|
71 |
if not ipyData: |
|
72 |
continue |
|
73 |
submitAwardResetType = ipyData.GetSubmitAwardResetType() |
|
74 |
if not submitAwardResetType: |
|
75 |
continue |
|
76 |
|
|
77 |
if onEventType != submitAwardResetType: |
|
78 |
continue |
|
79 |
|
|
80 |
GameWorld.DebugLog("boss历练活动重置提交奖励: actNum=%s,cfgID=%s,submitAwardResetType=%s" |
|
81 |
% (actNum, cfgID, submitAwardResetType), curPlayer.GetPlayerID()) |
|
82 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitAwardCount % actNum, 0) |
|
83 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitAward % actNum, 0) |
|
84 |
Sync_BossTrialPlayerInfo(curPlayer, actNum) |
|
85 |
|
00b076
|
86 |
return |
H |
87 |
|
|
88 |
def RefreshBossTrialActionInfo(actNum): |
|
89 |
## 收到GameServer同步的活动信息,刷新活动信息 |
|
90 |
playerManager = GameWorld.GetPlayerManager() |
|
91 |
for index in xrange(playerManager.GetPlayerCount()): |
|
92 |
curPlayer = playerManager.GetPlayerByIndex(index) |
|
93 |
if curPlayer.GetID() == 0: |
|
94 |
continue |
|
95 |
__CheckPlayerBossTrialAction(curPlayer, actNum) |
|
96 |
return |
|
97 |
|
|
98 |
def __CheckPlayerBossTrialAction(curPlayer, actNum): |
|
99 |
## 检查玩活动数据信息 |
|
100 |
|
|
101 |
playerID = curPlayer.GetPlayerID() |
|
102 |
|
|
103 |
actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_BossTrial, actNum) |
|
104 |
actID = actInfo.get(ShareDefine.ActKey_ID, 0) |
|
105 |
state = actInfo.get(ShareDefine.ActKey_State, 0) |
|
106 |
|
|
107 |
playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialID % actNum) # 玩家身上的活动ID |
|
108 |
|
eda1c4
|
109 |
__CheckActItemRecycle(curPlayer) # 必须在活动ID更新之前处理 |
00b076
|
110 |
# 活动ID 相同的话不处理 |
H |
111 |
if actID == playerActID: |
|
112 |
GameWorld.DebugLog("Boss历练活动ID不变,不处理! actID=%s" % actID, curPlayer.GetPlayerID()) |
|
113 |
return |
|
114 |
GameWorld.DebugLog("Boss历练活动重置! actID=%s,playerActID=%s,state=%s" % (actID, playerActID, state), playerID) |
|
115 |
|
|
116 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialID % actNum, actID) |
|
117 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitCount % actNum, 0) |
9a60fc
|
118 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitAwardCount % actNum, 0) |
00b076
|
119 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitAward % actNum, 0) |
H |
120 |
|
|
121 |
if state: |
619d78
|
122 |
cfgID = actInfo.get(ShareDefine.ActKey_CfgID) |
H |
123 |
ipyData = IpyGameDataPY.GetIpyGameData("ActBossTrial", cfgID) |
|
124 |
if ipyData and ipyData.GetActShopType(): |
|
125 |
FunctionNPCCommon.ResetShopItemBuyCountByShopType(curPlayer, [ipyData.GetActShopType()]) |
00b076
|
126 |
Sync_BossTrialActionInfo(curPlayer, actNum) |
H |
127 |
Sync_BossTrialPlayerInfo(curPlayer, actNum) |
|
128 |
|
|
129 |
return True |
9a60fc
|
130 |
|
H |
131 |
def RefreshCrossActBossTrialInfo(): |
|
132 |
## 收到GameServer同步的活动信息,刷新活动信息 |
|
133 |
playerManager = GameWorld.GetPlayerManager() |
|
134 |
for index in xrange(playerManager.GetPlayerCount()): |
|
135 |
curPlayer = playerManager.GetPlayerByIndex(index) |
|
136 |
if curPlayer.GetID() == 0: |
|
137 |
continue |
|
138 |
__CheckPlayerCrossActBossTrial(curPlayer) |
|
139 |
|
|
140 |
return |
|
141 |
|
|
142 |
def __CheckPlayerCrossActBossTrial(curPlayer): |
|
143 |
|
|
144 |
playerID = curPlayer.GetPlayerID() |
|
145 |
|
|
146 |
actInfo = CrossRealmPlayer.GetPlayerCrossActInfo(curPlayer, ShareDefine.CrossActName_BossTrial) |
|
147 |
cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0) |
|
148 |
actID = actInfo.get(ShareDefine.ActKey_ID, 0) |
|
149 |
state = actInfo.get(ShareDefine.ActKey_State, 0) |
|
150 |
dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
|
151 |
|
|
152 |
playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CA_BossTrialID) # 玩家身上的活动ID |
|
153 |
|
eda1c4
|
154 |
__CheckActItemRecycle(curPlayer) # 必须在活动ID更新之前处理 |
9a60fc
|
155 |
# 活动ID 相同的话不处理 |
H |
156 |
if actID == playerActID: |
|
157 |
GameWorld.DebugLog("跨服Boss历练活动ID不变,不处理!cfgID=%s,dayIndex=%s,actID=%s" % (cfgID, dayIndex, actID), playerID) |
|
158 |
return |
|
159 |
GameWorld.DebugLog("跨服Boss历练活动重置! cfgID=%s,actID=%s,playerActID=%s,state=%s" % (cfgID, actID, playerActID, state), playerID) |
|
160 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CA_BossTrialID, actID) |
|
161 |
|
|
162 |
if not state: |
|
163 |
CrossRealmPlayer.NotifyCrossActEnd(curPlayer, ShareDefine.CrossActName_BossTrial) |
|
164 |
|
|
165 |
Sync_CrossActBossTrialActionInfo(curPlayer) |
|
166 |
return True |
|
167 |
|
eda1c4
|
168 |
def __CheckActItemRecycle(curPlayer): |
H |
169 |
## 检查活动物品回收,玩家所有参与过的活动ID都结束后才处理 |
|
170 |
|
|
171 |
if IsInActBossTrial(curPlayer): |
|
172 |
# 还有活动中,标记待回收,如果一直有交替的活动开启中,则该状态一直为等待回收状态 |
|
173 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialRecycleState, 1) |
|
174 |
return |
|
175 |
|
|
176 |
playerID = curPlayer.GetPlayerID() |
|
177 |
recycleState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialRecycleState) |
|
178 |
if not recycleState: |
|
179 |
# 这样可以兼容回收功能上线后,确保老玩家之前屯的活动物品不会被回收,至少可以参与一次 |
|
180 |
GameWorld.DebugLog("Boss历练活动玩家没有标记过等待回收活动物品,不处理!", playerID) |
|
181 |
return |
|
182 |
|
|
183 |
if recycleState == 2: |
|
184 |
# 因为结束参与及活动结束都会触发检查,所以需要标记已处理过,防止一次活动多次回收 |
|
185 |
GameWorld.DebugLog("Boss历练活动已回收过活动物品!", playerID) |
|
186 |
return |
|
187 |
|
|
188 |
actItemID = IpyGameDataPY.GetFuncCfg("BossTrial", 1) |
|
189 |
clearCountDict = ItemControler.ClearItemID(curPlayer, [actItemID]) |
|
190 |
clearCount = clearCountDict.get(actItemID, 0) |
|
191 |
GameWorld.Log("Boss历练活动回收活动物品! actItemID=%s,clearCount=%s" % (actItemID, clearCount), playerID) |
|
192 |
if clearCount > 0: |
|
193 |
addMoney = clearCount |
|
194 |
PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_BossTrial, addMoney, "BossTrialRecycle") |
|
195 |
paramList = [clearCount, actItemID, actItemID, addMoney] |
|
196 |
PlayerControl.SendMailByKey("BossTrialRecycle", [playerID], [], paramList) |
|
197 |
|
|
198 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialRecycleState, 2) |
|
199 |
return |
9a60fc
|
200 |
|
eda1c4
|
201 |
def CheckActItemAutoTransform(curPlayer, tagItem, itemID, tagItemCount): |
H |
202 |
## 检查活动物品自动转化为对应积分,物品实例外部统一清理 |
|
203 |
if itemID != IpyGameDataPY.GetFuncCfg("BossTrial", 1): |
|
204 |
return False |
|
205 |
if IsInActBossTrial(curPlayer): |
|
206 |
return False |
|
207 |
GameWorld.DebugLog("Boss历练活动非参与中,自动回收获得的活动物品! itemID=%s,itemCount=%s" % (itemID, tagItemCount)) |
|
208 |
PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_BossTrial, tagItemCount, "BossTrialRecycle") |
|
209 |
return True |
|
210 |
|
|
211 |
def IsInActBossTrial(curPlayer): |
27a35e
|
212 |
## 玩家是否有正在进行中活动,不含参与结束阶段 |
eda1c4
|
213 |
return PlayerControl.IsInOperationAction(curPlayer, ShareDefine.OperationActionName_BossTrial, ChConfig.Def_PDict_BossTrialID, |
H |
214 |
ShareDefine.CrossActName_BossTrial, ChConfig.Def_PDict_CA_BossTrialID) |
|
215 |
|
9a60fc
|
216 |
def SendToGameServer_BossTrial(curPlayer, msgType, dataMsg=""): |
H |
217 |
playerID = curPlayer.GetPlayerID() |
|
218 |
msgList = str([msgType, dataMsg]) |
|
219 |
GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, "BossTrial", msgList, len(msgList)) |
|
220 |
GameWorld.Log("Boss历练发送GameServer: %s, %s" % (msgType, dataMsg), playerID) |
|
221 |
return |
00b076
|
222 |
|
H |
223 |
#// AA 23 Boss历练提交凭证 #tagCMActBossTrialSubmit |
|
224 |
# |
|
225 |
#struct tagCMActBossTrialSubmit |
|
226 |
#{ |
|
227 |
# tagHead Head; |
|
228 |
# BYTE ActNum; //活动编号 |
|
229 |
# WORD SubmitCount; //提交凭证个数 |
|
230 |
#}; |
|
231 |
def OnActBossTrialSubmit(index, clientData, tick): |
|
232 |
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) |
|
233 |
actNum = clientData.ActNum |
|
234 |
submitCount = clientData.SubmitCount |
|
235 |
|
|
236 |
playerID = curPlayer.GetPlayerID() |
|
237 |
actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_BossTrial, actNum) |
|
238 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
239 |
GameWorld.DebugLog("Boss历练非活动中: actNum=%s" % actNum, playerID) |
|
240 |
return |
|
241 |
|
45fb7d
|
242 |
crossActInfo = CrossRealmPlayer.GetPlayerCrossActInfo(curPlayer, ShareDefine.CrossActName_BossTrial) |
H |
243 |
if crossActInfo.get(ShareDefine.ActKey_State, 0): |
eda1c4
|
244 |
if crossActInfo.get(ShareDefine.ActKey_StateJoin) != ShareDefine.ActStateJoin_Start: |
45fb7d
|
245 |
GameWorld.Log("跨服Boss历练非参与活动中: actNum=%s" % actNum, playerID) |
H |
246 |
return |
|
247 |
else: |
eda1c4
|
248 |
if actInfo.get(ShareDefine.ActKey_StateJoin) != ShareDefine.ActStateJoin_Start: |
45fb7d
|
249 |
GameWorld.Log("Boss历练非参与活动中: actNum=%s" % actNum, playerID) |
H |
250 |
return |
|
251 |
|
00b076
|
252 |
itemID = IpyGameDataPY.GetFuncCfg("BossTrial", 1) |
H |
253 |
itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem) |
|
254 |
lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList({itemID:submitCount}, itemPack) |
|
255 |
if lackItemDict: |
|
256 |
GameWorld.DebugLog("Boss历练提交凭证物品不足! actNum=%s,itemID=%s,submitCount=%s,lackItemDict=%s" % (actNum, itemID, submitCount, lackItemDict), playerID) |
|
257 |
return |
|
258 |
ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "BossTrialSubmit") |
|
259 |
|
9a60fc
|
260 |
submitAwardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitAwardCount % actNum) |
H |
261 |
updSubmitAwardCount = submitAwardCount + submitCount |
|
262 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitAwardCount % actNum, updSubmitAwardCount) |
|
263 |
|
00b076
|
264 |
nowSubmitCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitCount % actNum) |
H |
265 |
updSubmitCount = nowSubmitCount + submitCount |
|
266 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitCount % actNum, updSubmitCount) |
9a60fc
|
267 |
GameWorld.DebugLog("Boss历练提交凭证: actNum=%s,itemID=%s,submitCount=%s,updSubmitCount=%s,updSubmitAwardCount=%s" |
H |
268 |
% (actNum, itemID, submitCount, updSubmitCount, updSubmitAwardCount), playerID) |
619d78
|
269 |
|
H |
270 |
PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_BossTrial, submitCount, "BossTrialSubmit") |
00b076
|
271 |
|
db73a4
|
272 |
PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_BossTrialSubmit, updSubmitCount, autoSort=True) |
00b076
|
273 |
|
H |
274 |
Sync_BossTrialPlayerInfo(curPlayer, actNum) |
9a60fc
|
275 |
|
H |
276 |
SendToGameServer_BossTrial(curPlayer, "BossTrialSubmit", [submitCount, updSubmitCount]) |
00b076
|
277 |
return |
H |
278 |
|
|
279 |
#// AA 24 Boss历练领奖 #tagCMActBossTrialGetAward |
|
280 |
# |
|
281 |
#struct tagCMActBossTrialGetAward |
|
282 |
#{ |
|
283 |
# tagHead Head; |
|
284 |
# BYTE ActNum; //活动编号 |
|
285 |
# WORD SubmitCount; //领取凭证个数对应奖励 |
|
286 |
#}; |
|
287 |
def OnActBossTrialGetAward(index, clientData, tick): |
|
288 |
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) |
|
289 |
actNum = clientData.ActNum |
|
290 |
submitCount = clientData.SubmitCount |
|
291 |
|
|
292 |
playerID = curPlayer.GetPlayerID() |
|
293 |
actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_BossTrial, actNum) |
|
294 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
295 |
GameWorld.DebugLog("Boss历练非活动中: actNum=%s" % actNum, playerID) |
|
296 |
return |
|
297 |
|
|
298 |
cfgID = actInfo.get(ShareDefine.ActKey_CfgID) |
|
299 |
ipyData = IpyGameDataPY.GetIpyGameData("ActBossTrial", cfgID) |
|
300 |
if not ipyData: |
|
301 |
return |
|
302 |
submitItemAwardInfo = ipyData.GetSubmitItemAwardInfo() |
|
303 |
if submitCount not in submitItemAwardInfo: |
|
304 |
GameWorld.DebugLog("Boss历练没有该奖励: actNum=%s,submitCount=%s not in %s" % (actNum, submitCount, submitItemAwardInfo.keys()), playerID) |
|
305 |
return |
|
306 |
recordIndex, awardItemList = submitItemAwardInfo[submitCount] |
|
307 |
|
9a60fc
|
308 |
nowSubmitCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitAwardCount % actNum) |
00b076
|
309 |
if nowSubmitCount < submitCount: |
H |
310 |
GameWorld.DebugLog("Boss历练提交凭证个数不足,无法领奖: actNum=%s,nowSubmitCount=%s < %s" % (actNum, nowSubmitCount, submitCount), playerID) |
|
311 |
return |
|
312 |
|
|
313 |
awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitAward % actNum) |
|
314 |
if awardState & pow(2, recordIndex): |
|
315 |
GameWorld.DebugLog("Boss历练领奖已领取过: actNum=%s,submitCount=%s,recordIndex=%s,awardState=%s" % (actNum, submitCount, recordIndex, awardState), playerID) |
|
316 |
return |
|
317 |
updAwardState = awardState | pow(2, recordIndex) |
|
318 |
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossTrialSubmitAward % actNum, updAwardState) |
|
319 |
GameWorld.DebugLog("Boss历练领奖: actNum=%s,submitCount=%s,recordIndex=%s,awardState=%s,updAwardState=%s" |
|
320 |
% (actNum, submitCount, recordIndex, awardState, updAwardState), playerID) |
|
321 |
|
|
322 |
ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["BossTrial", False, {}]) |
|
323 |
Sync_BossTrialPlayerInfo(curPlayer, actNum) |
|
324 |
return |
|
325 |
|
|
326 |
def GetBossTrialDropItemIDList(curPlayer, limitIndex): |
518556
|
327 |
bossIndexDropRateDict = IpyGameDataPY.GetFuncEvalCfg("BossTrial", 4) |
H |
328 |
if limitIndex not in bossIndexDropRateDict: |
00b076
|
329 |
return |
518556
|
330 |
dropCountRateList = bossIndexDropRateDict[limitIndex] |
00b076
|
331 |
|
H |
332 |
dropCountTotal = 0 |
|
333 |
itemID = IpyGameDataPY.GetFuncCfg("BossTrial", 1) |
|
334 |
|
9a60fc
|
335 |
if not GameWorld.IsCrossServer(): |
H |
336 |
for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_BossTrial, {}).values(): |
|
337 |
actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) |
|
338 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
339 |
GameWorld.DebugLog("Boss历练非活动中,不掉落! actNum=%s" % actNum) |
|
340 |
continue |
|
341 |
dropCount = GameWorld.GetResultByRandomList(dropCountRateList) |
|
342 |
GameWorld.DebugLog("本服Boss历练掉落! bossIndex=%s,actNum=%s,dropCount=%s" % (limitIndex, actNum, dropCount)) |
|
343 |
if not dropCount: |
|
344 |
continue |
|
345 |
dropCountTotal += dropCount |
|
346 |
|
|
347 |
else: |
|
348 |
crossActInfo = CrossRealmPlayer.GetPlayerCrossActInfo(curPlayer, ShareDefine.CrossActName_BossTrial) |
|
349 |
if crossActInfo.get(ShareDefine.ActKey_State): |
|
350 |
dropCount = GameWorld.GetResultByRandomList(dropCountRateList) |
|
351 |
GameWorld.DebugLog("跨服Boss历练掉落! bossIndex=%s,dropCount=%s" % (limitIndex, dropCount)) |
|
352 |
if dropCount: |
|
353 |
dropCountTotal += dropCount |
|
354 |
|
00b076
|
355 |
return itemID, dropCountTotal |
H |
356 |
|
|
357 |
def Sync_BossTrialPlayerInfo(curPlayer, actNum): |
|
358 |
## 通知玩家数据信息 |
|
359 |
actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_BossTrial, actNum) |
|
360 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
361 |
return |
|
362 |
clientPack = ChPyNetSendPack.tagMCActBossTrialPlayerInfo() |
|
363 |
clientPack.ActNum = actNum |
|
364 |
clientPack.SubmitCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitCount % actNum) |
9a60fc
|
365 |
clientPack.SubmitAwardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitAwardCount % actNum) |
H |
366 |
clientPack.SubmitAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossTrialSubmitAward % actNum) |
00b076
|
367 |
NetPackCommon.SendFakePack(curPlayer, clientPack) |
H |
368 |
return |
|
369 |
|
|
370 |
def Sync_BossTrialActionInfo(curPlayer, actNum): |
|
371 |
## 通知活动信息 |
|
372 |
actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_BossTrial, actNum) |
|
373 |
if not actInfo.get(ShareDefine.ActKey_State): |
|
374 |
return |
|
375 |
|
|
376 |
cfgID = actInfo.get(ShareDefine.ActKey_CfgID) |
|
377 |
dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
|
378 |
ipyData = IpyGameDataPY.GetIpyGameData("ActBossTrial", cfgID) |
|
379 |
if not ipyData: |
|
380 |
return |
|
381 |
|
9a60fc
|
382 |
personalTempIpyDataList = [] |
H |
383 |
personalTempID = GameWorld.GetTemplateIDByList(ipyData.GetTemplateIDList(), dayIndex) |
|
384 |
if personalTempID: |
|
385 |
personalTempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", personalTempID) |
|
386 |
|
|
387 |
familyTempIpyDataList = [] |
|
388 |
familyTempID = GameWorld.GetTemplateIDByList(ipyData.GetFamilyTemplateIDList(), dayIndex) |
|
389 |
if familyTempID: |
|
390 |
familyTempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", familyTempID) |
|
391 |
|
00b076
|
392 |
startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) |
H |
393 |
startDateSync = actInfo.get(ShareDefine.ActKey_StartDateSync, startDateStr) |
|
394 |
actInfo = ChPyNetSendPack.tagMCActBossTrialInfo() |
|
395 |
actInfo.ActNum = actNum |
|
396 |
actInfo.StartDate = startDateSync |
|
397 |
actInfo.EndtDate = endDateStr |
9a60fc
|
398 |
actInfo.JoinStartTime = ipyData.GetJoinStartTime() |
H |
399 |
actInfo.JoinEndTime = ipyData.GetJoinEndTime() |
00b076
|
400 |
actInfo.IsDayReset = ipyData.GetIsDayReset() |
H |
401 |
actInfo.ResetType = ipyData.GetResetType() |
|
402 |
actInfo.LimitLV = ipyData.GetLVLimit() |
619d78
|
403 |
actInfo.ShopType = ipyData.GetActShopType() |
9a60fc
|
404 |
actInfo.SubResetType = ipyData.GetSubmitAwardResetType() |
00b076
|
405 |
|
H |
406 |
actInfo.SubmitInfoList = [] |
|
407 |
submitItemAwardInfo = ipyData.GetSubmitItemAwardInfo() |
|
408 |
submitCountList = submitItemAwardInfo.keys() |
|
409 |
submitCountList.sort() |
|
410 |
for submitCount in submitCountList: |
|
411 |
recordIndex, awardItemList = submitItemAwardInfo[submitCount] |
|
412 |
subInfo = ChPyNetSendPack.tagMCActBossTrialSubmitInfo() |
|
413 |
subInfo.Clear() |
|
414 |
subInfo.RecordIndex = recordIndex |
|
415 |
subInfo.NeedCount = submitCount |
|
416 |
subInfo.AwardItemList = [] |
|
417 |
for itemID, itemCount, isAuctionItem in awardItemList: |
|
418 |
item = ChPyNetSendPack.tagMCActBossTrialItem() |
|
419 |
item.Clear() |
|
420 |
item.ItemID = itemID |
|
421 |
item.ItemCount = itemCount |
|
422 |
item.IsBind = isAuctionItem |
|
423 |
subInfo.AwardItemList.append(item) |
|
424 |
subInfo.Count = len(subInfo.AwardItemList) |
|
425 |
actInfo.SubmitInfoList.append(subInfo) |
|
426 |
actInfo.SubmitCount = len(actInfo.SubmitInfoList) |
|
427 |
|
9a60fc
|
428 |
actInfo.PersonalBillboardInfoList = __GetTempRankBillPackList(personalTempIpyDataList) |
H |
429 |
actInfo.PersonalBillCount = len(actInfo.PersonalBillboardInfoList) |
|
430 |
|
|
431 |
actInfo.FamilyBillboardInfoList = __GetTempRankBillPackList(familyTempIpyDataList) |
|
432 |
actInfo.FamilyBillCount = len(actInfo.FamilyBillboardInfoList) |
|
433 |
|
|
434 |
NetPackCommon.SendFakePack(curPlayer, actInfo) |
|
435 |
return |
|
436 |
|
|
437 |
def __GetTempRankBillPackList(ipyDataList): |
|
438 |
packBillList = [] |
|
439 |
if not ipyDataList: |
|
440 |
return packBillList |
|
441 |
for tempIpyData in ipyDataList: |
00b076
|
442 |
rankInfo = ChPyNetSendPack.tagMCActBossTrialBillard() |
H |
443 |
rankInfo.Rank = tempIpyData.GetRank() |
9a60fc
|
444 |
|
00b076
|
445 |
rankInfo.AwardItemList = [] |
H |
446 |
awardItemList = tempIpyData.GetAwardItemList() |
|
447 |
for itemID, itemCount, isAuctionItem in awardItemList: |
|
448 |
item = ChPyNetSendPack.tagMCActBossTrialItem() |
|
449 |
item.Clear() |
|
450 |
item.ItemID = itemID |
|
451 |
item.ItemCount = itemCount |
|
452 |
item.IsBind = isAuctionItem |
|
453 |
rankInfo.AwardItemList.append(item) |
|
454 |
rankInfo.Count = len(rankInfo.AwardItemList) |
9a60fc
|
455 |
|
H |
456 |
rankInfo.MemAwardItemList = [] |
|
457 |
memAwardItemList = tempIpyData.GetMemAwardItemList() |
|
458 |
for itemID, itemCount, isAuctionItem in memAwardItemList: |
|
459 |
item = ChPyNetSendPack.tagMCActBossTrialItem() |
|
460 |
item.Clear() |
|
461 |
item.ItemID = itemID |
|
462 |
item.ItemCount = itemCount |
|
463 |
item.IsBind = isAuctionItem |
|
464 |
rankInfo.MemAwardItemList.append(item) |
|
465 |
rankInfo.MemCount = len(rankInfo.MemAwardItemList) |
|
466 |
|
|
467 |
packBillList.append(rankInfo) |
|
468 |
return packBillList |
|
469 |
|
|
470 |
def Sync_CrossActBossTrialActionInfo(curPlayer): |
|
471 |
## 通知活动信息 |
|
472 |
actInfo = CrossRealmPlayer.GetPlayerCrossActInfo(curPlayer, ShareDefine.CrossActName_BossTrial) |
|
473 |
if not actInfo: |
|
474 |
return |
00b076
|
475 |
|
9a60fc
|
476 |
if not actInfo.get(ShareDefine.ActKey_State): |
H |
477 |
return |
|
478 |
|
|
479 |
ipyDataDict = actInfo.get(ShareDefine.ActKey_IpyDataInfo, {}) |
|
480 |
if not ipyDataDict: |
|
481 |
return |
|
482 |
|
|
483 |
personalTempIpyDataList = [] |
|
484 |
personalTempID = ipyDataDict.get("PersonalTemplateID", 0) |
|
485 |
if personalTempID: |
|
486 |
personalTempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", personalTempID) |
|
487 |
|
|
488 |
familyTempIpyDataList = [] |
|
489 |
familyTempID = ipyDataDict.get("FamilyTemplateID", 0) |
|
490 |
if familyTempID: |
|
491 |
familyTempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActBossTrialTemplate", familyTempID) |
|
492 |
|
|
493 |
actPack = ChPyNetSendPack.tagMCCrossActBossTrialInfo() |
|
494 |
actPack.ServerIDRangeInfo = str(actInfo.get(ShareDefine.ActKey_ServerIDRangeList, [])) |
|
495 |
actPack.ServerInfoLen = len(actPack.ServerIDRangeInfo) |
|
496 |
actPack.GroupValue1 = ipyDataDict.get("ZoneID", 0) |
|
497 |
actPack.StartDate = ipyDataDict.get("StartDate", "") |
|
498 |
actPack.EndtDate = ipyDataDict.get("EndDate", "") |
|
499 |
actPack.JoinStartTime = ipyDataDict.get("JoinStartTime", "") |
|
500 |
actPack.JoinEndTime = ipyDataDict.get("JoinEndTime", "") |
|
501 |
actPack.IsDayReset = ipyDataDict.get("IsDayReset", 0) |
|
502 |
actPack.ResetType = ipyDataDict.get("ResetType", 0) |
|
503 |
RankLimitList = ipyDataDict.get("RankLimitList", [0, 0]) |
|
504 |
actPack.RankLimitPersonal = RankLimitList[0] |
|
505 |
actPack.RankLimitFamily = RankLimitList[1] |
|
506 |
|
|
507 |
actPack.PersonalBillboardInfoList = __GetTempRankBillPackList(personalTempIpyDataList) |
|
508 |
actPack.PersonalBillCount = len(actPack.PersonalBillboardInfoList) |
|
509 |
|
|
510 |
actPack.FamilyBillboardInfoList = __GetTempRankBillPackList(familyTempIpyDataList) |
|
511 |
actPack.FamilyBillCount = len(actPack.FamilyBillboardInfoList) |
|
512 |
|
|
513 |
NetPackCommon.SendFakePack(curPlayer, actPack) |
00b076
|
514 |
return |