From 2a8f48212d23842a9f7acceaa16ad324e7a32738 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 31 一月 2019 17:23:34 +0800
Subject: [PATCH] 6087 【后端】【1.5.200】春节红包雨活动(成就完成修改)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py | 92 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 83 insertions(+), 9 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
index 960bc9a..2e88be0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -64,6 +64,7 @@
import PlayerRune
import GameFuncComm
import PlayerFairyCeremony
+import PlayerNewFairyCeremony
import PlayerSpringSale
import PyGameData
@@ -192,6 +193,14 @@
## 登录
def ShopItemOnLogin(curPlayer):
+ if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_SuperGift):
+ GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_SuperGift, 1)
+ isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
+ if isGet:#首充奖励已领取则代表超值礼包已开启过,
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftHasOpen, 1)
+
+
+ SyncMysticalShopInfo(curPlayer)
SyncShopItemTodayBuyCount(curPlayer)
SyncSuperGiftInfo(curPlayer)
return
@@ -234,8 +243,14 @@
__ResetShopItemBuyCount(curPlayer, [refreshType])
return
+def ShopItemOnCrossPKSeasonChange(curPlayer):
+ ## 按跨服PK赛季重置
+ refreshType = 8
+ __ResetShopItemBuyCount(curPlayer, [refreshType])
+ return
+
def __ResetShopItemBuyCount(curPlayer, onEventTypeList):
- #重置商店物品购买次数 1:周一0点刷新 2:周一5点刷新 3:每日0点刷新 4:每日5点刷新 5每月0点 6每月5点
+ #重置商店物品购买次数 1:周一0点刷新 2:周一5点刷新 3:每日0点刷新 4:每日5点刷新 5每月0点 6每月5点 7每3天5点 8每赛季
syncIndexList = []
ipyDataMgr = IpyGameDataPY.IPY_Data()
for i in xrange(ipyDataMgr.GetStoreCount()):
@@ -272,6 +287,49 @@
syncIndexList.append(shopItem.GetID())
if syncIndexList:
SyncShopItemTodayBuyCount(curPlayer, syncIndexList, True)
+ return
+
+def MysticalShopOpen(curPlayer, befLV, aftLV):
+ ##神秘限购开启
+ ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('Store', {'ShopType':16}, True)
+ if not ipyDataList:
+ return
+ curTime = int(time.time())
+ syncGoodsList = []
+ for ipyData in ipyDataList:
+ limitLV = ipyData.GetLimitLV()
+ if befLV < limitLV and aftLV >= limitLV:
+ goodsID = ipyData.GetID()
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShopItemStartTime % goodsID, curTime)
+ syncGoodsList.append(goodsID)
+ GameWorld.DebugLog('神秘限购商品%s 开卖'%goodsID, curPlayer.GetID())
+ if syncGoodsList:
+ SyncMysticalShopInfo(curPlayer)
+ return
+
+def SyncMysticalShopInfo(curPlayer):
+ ##神秘限购通知
+ packData = ChPyNetSendPack.tagMCMysticalShopTimeInfo()
+ packData.ShopTimeList = []
+ ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('Store', {'ShopType':16}, True)
+ curTime = int(time.time())
+ for ipyData in ipyDataList:
+ goodsID = ipyData.GetID()
+ startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % goodsID)
+ if not startTime:
+ continue
+ if curTime - startTime >= ipyData.GetLimitValue():
+ #超时的重置
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShopItemStartTime % goodsID, 0)
+ else:
+ goodsTime = ChPyNetSendPack.tagMCMysticalShopTime()
+ goodsTime.GoodsID = goodsID
+ goodsTime.StartTime = startTime
+ packData.ShopTimeList.append(goodsTime)
+ if not packData.ShopTimeList:
+ return
+ packData.Count = len(packData.ShopTimeList)
+ NetPackCommon.SendFakePack(curPlayer, packData)
return
## 回购物品
@@ -326,7 +384,10 @@
# @param tick 时间戳
# @return 返回值真, 逻辑运行成功
def BuyItem(curPlayer, tick):
-
+
+ if GameWorld.IsCrossServer():
+ return
+
buyItemList = IPY_GameWorld.IPY_CBuyItemList()
itemIndex = buyItemList.GetBuyItemIndex()
if itemIndex < 0:
@@ -361,7 +422,7 @@
if not state:
GameWorld.DebugLog("限时抢购非活动中!state=%s" % (state), curPlayer.GetPlayerID())
return
- shopTypeList = PlayerFlashSale.GetShopTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0), state)
+ shopTypeList = PlayerFlashSale.GetShopTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0), state, actInfo.get(ShareDefine.ActKey_WorldLV, 0))
if not shopTypeList:
return
actShopType = shopTypeList[0]
@@ -421,10 +482,10 @@
jobItemList = ipyData.GetJobItem()
totalItemList = []
if itemID:
- jobItemID = __GetShopJobItem(job, itemID, jobItemList)
+ jobItemID = GetShopJobItem(job, itemID, jobItemList)
totalItemList.append([jobItemID, itemCount * clientBuyCount, isBind])
for itemIDEx, itemCountEx, isBindEx in itemListEx:
- jobItemID = __GetShopJobItem(job, itemIDEx, jobItemList)
+ jobItemID = GetShopJobItem(job, itemIDEx, jobItemList)
totalItemList.append([jobItemID, itemCountEx * clientBuyCount, isBindEx])
#允许价钱配置0,用来免费购买
if not totalItemList:
@@ -541,9 +602,12 @@
SyncShoppingResult(curPlayer, itemIndex, clientBuyCount)
if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
+ if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
+ PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
+
return
-def __GetShopJobItem(job, itemID, jobItemList):
+def GetShopJobItem(job, itemID, jobItemList):
## 获取商城物品对应的职业物品, 职业从1开始
for jobItemIDList in jobItemList:
if type(jobItemIDList) not in [list, tuple]:
@@ -585,9 +649,15 @@
#烟花狂欢
if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
-
- if itemIndex in dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')):
- return not CheckSuperGiftBuy(curPlayer, itemIndex)
+ if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
+ return not PlayerNewFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
+# if itemIndex in dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')):
+# return not CheckSuperGiftBuy(curPlayer, itemIndex)
+ if shopNPCID == 16:#神秘限购
+ startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % itemIndex)
+ curTime = int(time.time())
+ return not startTime or curTime - startTime >= limitValue
+
#
# limitPlusDict = {shopItem.GetLimitPlusType1():shopItem.GetLimitPlusValue1(),
# shopItem.GetLimitPlusType2():shopItem.GetLimitPlusValue2(),
@@ -638,6 +708,10 @@
#活动结束 重置
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, 0)
else:
+ if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuperGiftHasOpen):
+ #老号已开启过超值礼包则不再开启
+ return
+
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, curTime)
addItemList = IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList', 2)
PlayerControl.SendMailByKey('SellMail2', [curPlayer.GetID()], addItemList)
--
Gitblit v1.8.0