From 878be98501e25713d24426fc91a4a5271cbfb289 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 05 六月 2019 16:52:41 +0800
Subject: [PATCH] 3957 【2.0】排行榜-符印榜单通关层数0不用上榜
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py | 113 +++++++++++++-------------------------------------------
1 files changed, 26 insertions(+), 87 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 8fb8a5e..da0f3a2 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
@@ -194,17 +194,12 @@
return
## 登录
-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)
-
-
+def ShopItemOnLogin(curPlayer):
SyncMysticalLimitShopInfo(curPlayer)
SyncShopItemTodayBuyCount(curPlayer)
SyncSuperGiftInfo(curPlayer)
+ if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MysticalShopGoods % 0):
+ __DoMysticalShopRefresh(curPlayer, True, GameWorld.GetGameWorld().GetTick())
SyncMysticalShopInfo(curPlayer)
return
@@ -361,7 +356,7 @@
diffTime = GameWorld.GetCurrentTime() - GameWorld.GetDateTimeByStr(createRoleTime, ChConfig.TYPE_Time_Format)
pastSeconds = diffTime.days*24*60*60 + diffTime.seconds
refreshTime = IpyGameDataPY.GetFuncCfg('MysteryShopRefresh', 4)
- if pastSeconds % refreshTime == 0:
+ if refreshTime and pastSeconds % refreshTime == 0:
__DoMysticalShopRefresh(curPlayer, True, tick)
return
@@ -377,7 +372,10 @@
def __DoMysticalShopRefresh(curPlayer, isFree, tick):
global g_mysticalShopDict #{等级范围:[等级段,{金钱类型:库}]}
-
+ refreshTime = IpyGameDataPY.GetFuncCfg('MysteryShopRefresh', 4)
+ if not refreshTime:
+ return
+
lastTime = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MysticalShopLastTime)
if lastTime and tick - lastTime < 1000:
#GameWorld.DebugLog('神秘商店刷新,过于频繁!')
@@ -390,6 +388,8 @@
lvRange = ipyData.GetLVRange()
goodsID = ipyData.GetGoodsID()
goodsIpyData = IpyGameDataPY.GetIpyGameData('Store', goodsID)
+ if not goodsIpyData:
+ continue
moneyType = goodsIpyData.GetMoneyType()
weight = goodsIpyData.GetLimitValue()
lvkey = tuple(lvRange)
@@ -400,7 +400,8 @@
g_mysticalShopDict[lvkey][1][moneyType] = []
weightDict[moneyType] = weightDict.get(moneyType, 0) + weight
g_mysticalShopDict[lvkey][1][moneyType].append([weightDict[moneyType], goodsID])
-
+ if not g_mysticalShopDict:
+ return
playerLV = curPlayer.GetLV()
curLVDan, shopDict = GameWorld.GetDictValueByRangeKey(g_mysticalShopDict, playerLV)
if not shopDict:
@@ -420,7 +421,7 @@
cntList.sort()
costItemCnt = costItemCntDict[str(cntList[-1])]
for cnt in cntList:
- if curRefreshCnt <= cnt:
+ if curRefreshCnt < cnt:
costItemCnt = costItemCntDict[str(cnt)]
break
enough, indexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(costItemID, itemPack, costItemCnt)
@@ -452,9 +453,18 @@
GameWorld.DebugLog('神秘商店刷新特殊规则,等级段:%s,updLVRefreshCnt=%s,specialGoodsID=%s'%(curLVDan, updLVRefreshCnt, specialGoodsID))
GameWorld.DebugLog('神秘商店刷新isFree=%s,goldGoodsCnt=%s,sliverGoodsCnt=%s,goodsResultList=%s'%(isFree, goldGoodsCnt, sliverGoodsCnt, goodsResultList))
+ syncIndexList = []
for i in xrange(maxCnt):
goodsID = goodsResultList[i] if i < len(goodsResultList) else 0
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MysticalShopGoods % i, goodsID)
+
+ dayBuyCntKey = ChConfig.Def_PDict_ShopItemDayBuyCnt % goodsID
+ curDayBuyCnt = curPlayer.NomalDictGetProperty(dayBuyCntKey)
+ if curDayBuyCnt:
+ PlayerControl.NomalDictSetProperty(curPlayer, dayBuyCntKey, 0)
+ syncIndexList.append(goodsID)
+ if syncIndexList:
+ SyncShopItemTodayBuyCount(curPlayer, syncIndexList, True)
#通知
SyncMysticalShopInfo(curPlayer)
return
@@ -721,7 +731,7 @@
itemControl = ItemControler.PlayerItemControler(curPlayer)
for itemID, itemCount, isBind in totalItemList:
- curItemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, isBind)
+ curItemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, False, curPlayer=curPlayer)
if not curItemObj:
continue
userData = curItemObj.GetUserData()
@@ -850,10 +860,7 @@
#活动结束 重置
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)
@@ -925,46 +932,6 @@
return True
-
-#---------------------------------------------------------------------
-##检查物品可否修理
-# @param curPlayer 玩家实例
-# @param curItem 物品实例
-# @param farRepair 是否远程修理
-# @return 返回值真, 检查通过
-# @remarks 检查物品可否修理
-#===============================================================================
-# def __CheckRepairItem(curPlayer, curItem, farRepair):
-#
-# if not ItemCommon.CheckItemCanUse(curItem):
-# if not farRepair:
-# #封包信息不正确
-# PlayerControl.NotifyCode(curPlayer, "UseResLost04")
-#
-# return
-#
-# if curItem.GetCanRepair() == 0:
-# if not farRepair:
-# #物品不可修理
-# PlayerControl.NotifyCode(curPlayer, "UseResLost13")
-#
-# return
-#
-# if ItemControler.IsEventItem(curItem):
-# if not farRepair:
-# PlayerControl.NotifyCode(curPlayer, "itemuse_chenxin_31379")
-#
-# return
-#
-# if curItem.GetEndureReduceType() == ChConfig.Def_EquipReduceType_None or curItem.GetMaxEndure() == 0:
-# if not farRepair:
-# #耐久字段为0,不符合要求,返回
-# PlayerControl.NotifyCode(curPlayer, "UseResLost13")
-#
-# return
-#
-# return True
-#===============================================================================
#--------------------出售物品
##出售物品
# @param curPlayer 玩家实例
@@ -1086,7 +1053,7 @@
# @return 返回值真, 检查通过
# @remarks 检查物品是否可以出售
def __CheckItemSell(curPlayer, curItem) :
- if not ItemCommon.CheckItemCanUse(curItem):
+ if not ItemCommon.CheckItemCanUse(curItem) or ItemControler.GetIsAuctionItem(curItem):
PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_644055")
return
@@ -1131,35 +1098,7 @@
priceType = IPY_GameWorld.TYPE_Price_Silver_Money
curItemPrice = curItem.GetSilverPrice()
return curItemPrice, priceType
- #绑定价格售价为0, 2011.4.27
-# if curItem.GetIsBind():
-# itrmPrice_bind = eval(ReadChConfig.GetChConfig("ItemSellPrice_Bind"))
-# return itrmPrice_bind, priceType
-#
-# #无耐久物品
-# if curItemEndure == 0 :
-# return curItemPrice * 0.5, priceType
-#
-# itrmPrice_notBind = eval(ReadChConfig.GetChConfig("ItemSellPrice_NotBind"))
-# return itrmPrice_notBind, priceType
-#===============================================================================
-# 2010.11.25 绑定售价和非绑定一致
-# #绑定的
-# if curItem.GetIsBind():
-# return curItemPrice * 0.5 * 0.5, curItemType
-# #非绑定的
-# return curItemPrice * 0.5, curItemType
-#===============================================================================
-#===============================================================================
-#
-# #绑定正常物品出售价格
-# if curItem.GetIsBind() :
-# return eval(ChConfig.Def_Formula_ItemSellPrice) * 0.5, curItemType
-#
-# #未绑定正常物品出售价格
-# return eval(ChConfig.Def_Formula_ItemSellPrice), curItemType
-#===============================================================================
-#---------------------------------------------------------------------
+
##检查玩家可否开始NPC事件
# @param curPlayer 玩家实例
# @return 返回值真, 检查通过
--
Gitblit v1.8.0