| | |
| | | # @date 2018-7-16
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 累计充值活动
|
| | | # 详细描述: 累计充值X元活动
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-7-16 12:00"""
|
| | |
| | | if TotalRechargeID == playerTotalRechargeID:
|
| | | #GameWorld.DebugLog("累计充值活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV)
|
| | | templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeTemplateID)
|
| | |
|
| | |
| | | % (TotalRechargeID, playerTotalRechargeID, state, templateID, playerTemplateID), playerID)
|
| | |
|
| | | # 未领取的奖励邮件发放
|
| | | __SendTotalRechargeMail(curPlayer, playerTemplateID)
|
| | | __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID, TotalRechargeID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID, templateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeWorldLV, actWorldLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, 0)
|
| | |
|
| | |
| | | Sync_TotalRechargeInfo(curPlayer)
|
| | | return True
|
| | |
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID):
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV):
|
| | | # 未领取的奖励邮件发放
|
| | |
|
| | | if not playerTemplateID:
|
| | |
| | | continue
|
| | | awardRecord |= pow(2, awardIndex)
|
| | |
|
| | | awardItemList = ipyData.GetAwardItem().get(str(job), [])
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), job, playerWorldLV)
|
| | | batchPlayerIDList.append([playerID])
|
| | | batchAddItemList.append(awardItemList)
|
| | | batchParamList.append([needGold])
|
| | |
| | | PlayerControl.SendMailBatch("TotalRechargeMail", batchPlayerIDList, batchAddItemList, batchParamList)
|
| | |
|
| | | return
|
| | |
|
| | | def __GetItemList(itemDict, job, worldLV):
|
| | | #{世界等级范围:{职业:[(物品ID,个数,是否绑定), ...]}}
|
| | | itemInfoDict = GameWorld.GetDictValueByRangeKey(itemDict, worldLV, {})
|
| | | if str(job) not in itemInfoDict:
|
| | | GameWorld.ErrLog('累计充值奖励未配置该职业itemDict=%s,job=%s'%(itemDict, job))
|
| | | return []
|
| | | else:
|
| | | return itemInfoDict[str(job)]
|
| | | |
| | |
|
| | | def AddTotalRechargeGold(curPlayer, addGold):
|
| | | if addGold <= 0:
|
| | |
| | | return
|
| | |
|
| | | needGold = awardIpyData.GetNeedGold()
|
| | | awardItemList = awardIpyData.GetAwardItem().get(str(curPlayer.GetJob()), [])
|
| | | actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), curPlayer.GetJob(), actWorldLV)
|
| | |
|
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
|
| | | if curRechargeGold < needGold:
|
| | |
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), needGold])
|
| | |
|
| | | for itemID, itemCount, isBind in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | |
|
| | | addDataDict = {"TemplateID":templateID, "NeedGold":needGold, "AwardIndex":awardIndex,
|
| | | "ItemList":str(awardItemList)}
|
| | |
| | | if not templateIDList:
|
| | | return
|
| | | job = curPlayer.GetJob()
|
| | | actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | actInfo = ChPyNetSendPack.tagMCActTotalRechargeInfo()
|
| | | actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
|
| | |
| | | awardInfo.AwardIndex = ipyData.GetAwardIndex()
|
| | | awardInfo.NeedGold = ipyData.GetNeedGold()
|
| | | awardInfo.AwardItem = []
|
| | | awardItemDict = ipyData.GetAwardItem()
|
| | | for itemID, itemCount, isBind in awardItemDict.get(str(job), []):
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), job, actWorldLV)
|
| | | for itemID, itemCount, isBind in awardItemList:
|
| | | awardItem = ChPyNetSendPack.tagMCTotalRechargeAwardItem()
|
| | | awardItem.ItemID = itemID
|
| | | awardItem.ItemCount = itemCount
|