| | |
| | | import IPY_GameWorld |
| | | import GameWorld |
| | | import ChConfig |
| | | import PlayerCoin |
| | | import FunctionNPCCommon |
| | | |
| | | def OnPlayerLogin(curPlayer): |
| | | |
| | |
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_FamilyCTGAssist, actNum) |
| | | actID = actInfo.get(ShareDefine.ActKey_ID, 0) |
| | | state = actInfo.get(ShareDefine.ActKey_State, 0) |
| | | #cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0) |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0) |
| | | #dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
| | | |
| | | playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FamilyCTGAssistID % actNum) # 玩家身上的活动ID |
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FamilyCTGAssistAward % actNum, 0) |
| | | |
| | | if state: |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActFamilyCTGAssist", cfgID) |
| | | if ipyData: |
| | | resetCTGIDList = ipyData.GetCTGIDList() |
| | | PlayerCoin.DoResetCTGCountByIDList(curPlayer, "ActFamilyCTGAssist", resetCTGIDList) |
| | | shopType = ipyData.GetActShopType() |
| | | if shopType: |
| | | FunctionNPCCommon.ResetShopItemBuyCountByShopType(curPlayer, [shopType]) |
| | | |
| | | Sync_FamilyCTGAssistActionInfo(curPlayer, actNum) |
| | | Sync_FamilyCTGAssistPlayerInfo(curPlayer, actNum) |
| | | |
| | | return True |
| | | |
| | | def OnPlayerCTG(curPlayer): |
| | | def OnPlayerCTG(curPlayer, ctgID): |
| | | if not curPlayer.GetFamilyID(): |
| | | return |
| | | |
| | | actNumList = [] |
| | | for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FamilyCTGAssist, {}).values(): |
| | | actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0) |
| | | if actInfo.get(ShareDefine.ActKey_State): |
| | | actNumList.append(actNum) |
| | | |
| | | if not actInfo.get(ShareDefine.ActKey_State): |
| | | continue |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0) |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActFamilyCTGAssist", cfgID) |
| | | if not ipyData: |
| | | continue |
| | | ctgIDList = ipyData.GetCTGIDList() |
| | | if ctgIDList and ctgID not in ctgIDList: |
| | | GameWorld.DebugLog("仙盟充值协助该充值ID不触发协助! cfgID=%s,actNum=%s,ctgID=%s not in %s" % (cfgID, actNum, ctgID, ctgIDList), curPlayer.GetPlayerID()) |
| | | continue |
| | | actNumList.append(actNum) |
| | | |
| | | if not actNumList: |
| | | return |
| | | |
| | |
| | | return |
| | | |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID) |
| | | dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
| | | #dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActFamilyCTGAssist", cfgID) |
| | | if not ipyData: |
| | | return |
| | | templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) |
| | | templateID = ipyData.GetTemplateID() |
| | | if not templateID: |
| | | return |
| | | |
| | |
| | | return |
| | | |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID) |
| | | dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
| | | #dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0) |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActFamilyCTGAssist", cfgID) |
| | | if not ipyData: |
| | | return |
| | | templateID = GameWorld.GetTemplateID(ipyData, cfgID, dayIndex) |
| | | templateID = ipyData.GetTemplateID() |
| | | if not templateID: |
| | | return |
| | | tempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFamilyCTGAssistTemp", templateID) |
| | |
| | | actInfo.AwardInfoList.append(award) |
| | | |
| | | actInfo.AwardCount = len(actInfo.AwardInfoList) |
| | | |
| | | actInfo.CTGIDList = ipyData.GetCTGIDList() |
| | | actInfo.CTGIDCount = len(actInfo.CTGIDList) |
| | | actInfo.ShopType = ipyData.GetActShopType() |
| | | |
| | | NetPackCommon.SendFakePack(curPlayer, actInfo) |
| | | return |