| | |
| | | import math
|
| | | import time
|
| | |
|
| | | # 商店类型定义
|
| | | ShopType_FairyCeremony = 19 # 仙界盛典烟花
|
| | |
|
| | | g_mysticalShopDict = {} #神秘商店{等级范围:[等级段,{金钱类型:库}]}
|
| | | #---------------------------------------------------------------------
|
| | | ##开始交易
|
| | |
| | | sendMailKey = mailKey if isLackPack and mailKey else '' #背包不足且配置了mailKey的才发邮件
|
| | |
|
| | | # 购买限制条件扩展
|
| | | if CheckBuyItemLimitEx(curPlayer, shopType, itemIndex, mainItemID, ipyData.GetLimitValue()):
|
| | | if CheckBuyItemLimitEx(curPlayer, shopType, itemIndex, mainItemID, ipyData.GetLimitValue(), clientBuyCount):
|
| | | GameWorld.Log("Store shop item buy limit! shopType=%s,itemIndex=%s,limitValue=%s"
|
| | | % (shopType, itemIndex, ipyData.GetLimitValue()), curPlayer.GetPlayerID())
|
| | | return
|
| | |
| | | EventShell.EventRespons_ShopBuy(curPlayer, shopType)
|
| | | #curPlayer.ShopResult(itemIndex, IPY_GameWorld.tsrShopOK)
|
| | | 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)
|
| | |
|
| | | if shopType == ShopType_FairyCeremony:
|
| | | PlayerFairyCeremony.OnBuyFireworks(curPlayer, itemIndex, clientBuyCount)
|
| | | # if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
|
| | | # PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
|
| | | return
|
| | |
|
| | | def GetShopJobItem(job, itemID, jobItemList):
|
| | |
| | | ## 商店购买物品限制条件扩展
|
| | | # @param curPlayer 玩家实例
|
| | | # @return
|
| | | def CheckBuyItemLimitEx(curPlayer, shopNPCID, itemIndex, curItemID, limitValue):
|
| | | def CheckBuyItemLimitEx(curPlayer, shopNPCID, itemIndex, curItemID, limitValue, clientBuyCount):
|
| | | if shopNPCID == 7: #符印商店
|
| | | return not PlayerRune.GetIsOpenByRuneID(curPlayer, curItemID)
|
| | | if shopNPCID in [8, 9, 10]: #仙盟商店
|
| | |
| | | #playerCreateRoleDays = GameWorld.GetCreateRoleDays(curPlayer)
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)+1
|
| | | return openServerDay != limitValue
|
| | | #烟花狂欢
|
| | | if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
|
| | | return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
|
| | | if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
|
| | | return not PlayerNewFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
|
| | | |
| | | #仙界盛典 - 烟花狂欢
|
| | | if shopNPCID == ShopType_FairyCeremony:
|
| | | return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex, clientBuyCount)
|
| | | |
| | | #另一个仙界盛典可用其他商店NPCID,这里先注释,之后再改
|
| | | # if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
|
| | | # return not PlayerNewFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
|
| | |
|
| | | if shopNPCID == 16:#神秘限购
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % itemIndex)
|