From bfa9319169cab043c6cb96a92da91fa3248b220d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 22 八月 2019 18:48:52 +0800
Subject: [PATCH] 8240 【主干】【后端】优化仙界盛典

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 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 24147cb..aaf744a 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
@@ -72,6 +72,9 @@
 import math
 import time
 
+# 商店类型定义
+ShopType_FairyCeremony = 19 # 仙界盛典烟花
+
 g_mysticalShopDict = {} #神秘商店{等级范围:[等级段,{金钱类型:库}]}
 #---------------------------------------------------------------------
 ##开始交易
@@ -677,7 +680,7 @@
     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
@@ -750,11 +753,11 @@
     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):
@@ -781,7 +784,7 @@
 ## 商店购买物品限制条件扩展
 #  @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]: #仙盟商店
@@ -796,12 +799,15 @@
         #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)
         curTime = int(time.time())

--
Gitblit v1.8.0