From 1e7d00e39484a4522fadc88b3386010def98c0b6 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 22 五月 2019 14:45:57 +0800
Subject: [PATCH] 6895  还原技能攻击个数限制

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py |   57 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
index 4e6acb2..a7b492a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
@@ -93,12 +93,16 @@
         GameWorld.ErrLog("不存在该合成物品! makeItemID=%s" % makeItemID)
         return
     
+    packType = ChConfig.GetItemPackType(makeItemData.GetType(), IPY_GameWorld.rptItem)
+    GameWorld.DebugLog("makeItemID=%s,packType=%s" % (makeItemID, packType), playerID)
+    
     needSpace = int(math.ceil(float(compoundCnt) / makeItemData.GetPackCount()))
-    emptySpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
+    emptySpace = ItemCommon.GetItemPackSpace(curPlayer, packType, needSpace)
     #验证背包空间
     if needSpace > emptySpace:
-        PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_202580")
-        GameWorld.DebugLog("背包空间不足!needSpace=%s > emptySpace=%s" % (needSpace, emptySpace), playerID)
+        #PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_202580")
+        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packType])
+        GameWorld.DebugLog("背包空间不足!packType=%s,needSpace=%s > emptySpace=%s" % (packType, needSpace, emptySpace), playerID)
         return
     
     compoundBindCnt = 0
@@ -123,7 +127,7 @@
     canDecompound = makeItemData.GetType() in canDecompoundItemTypeList and makeItemData.GetItemColor() >= decompoundMinColor
     decompoundItemInfo = [] # 拆解返还物品列表 [装备ID,材料1ID,个数,是否绑定,材料2ID,个数,是否绑定,...]
     
-    itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+    itemPack = curPlayer.GetItemManager().GetPack(packType)
     itemExpireTime = 0
     wingItemExpInfo = None #材料翅膀精炼信息
     dogzEquipPlusExp = 0 #神兽装备强化熟练度
@@ -132,11 +136,7 @@
         unfixedItem = GameWorld.GetGameData().GetItemByTypeID(unfixedItemIDList[0])
         if not unfixedItem:
             return
-        if ItemCommon.GetIsDogzEquip(unfixedItem):
-            unfixedItemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
-        else:
-            unfixedItemPack = itemPack
-        unfixedItemCostInfo = __CheckUnfixedItem(playerID, compoundID, makeItemData, unfixedItemPack, unfixedItemIndexList, 
+        unfixedItemCostInfo = __CheckUnfixedItem(playerID, compoundID, makeItemData, itemPack, unfixedItemIndexList, 
                                                  unfixedItemIDList, needUnfixedItemCount)
         if not unfixedItemCostInfo:
             return
@@ -178,13 +178,13 @@
     PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, totalNeedMoney, ChConfig.Def_Cost_ItemProduce, 
                            {ChConfig.Def_Cost_Reason_SonKey:makeItemID, "CompoundCount":compoundCnt})
     
-    drDict = {"CompoundID":compoundID, "MakeItemID":makeItemID, "CompoundCount":compoundCnt, "itemExpireTime":itemExpireTime}
+    drDict = {"CompoundID":compoundID, "MakeItemID":makeItemID, "CompoundCount":compoundCnt, "itemExpireTime":itemExpireTime, "PackType":packType}
     makeItemBind = False
     
     # 扣不固定消耗物品
     if unfixedItemIDList:
         bindUnfixedIndexList, unbindUnfixedIndexList = unfixedItemCostList
-        hasBind = ItemCommon.ReduceItem(curPlayer, unfixedItemPack, bindUnfixedIndexList + unbindUnfixedIndexList, needUnfixedItemCount, 
+        hasBind = ItemCommon.ReduceItem(curPlayer, itemPack, bindUnfixedIndexList + unbindUnfixedIndexList, needUnfixedItemCount, 
                                         False, ChConfig.ItemDel_ItemCompound, drDict)
         makeItemBind = True if hasBind else makeItemBind
         
@@ -254,13 +254,13 @@
     if successRate != maxRateValue:
         drDict = {"PlayerID":curPlayer.GetPlayerID(), "AccID":curPlayer.GetAccID(), "ID":compoundID, "MakeItemID":makeItemID, "IsSuccess":canHappen,
                   "RateInfo":{"totalSuccRate":"%s(%s+%s+%s)" % (totalSuccRate, successRate, addSuccRate, incRate), "randValue":randValue, "maxRateValue":maxRateValue},
-                  "AddSuccRateItemInfo":addSuccRateItemInfo
+                  "AddSuccRateItemInfo":addSuccRateItemInfo, "PackType":packType,
                   }
         DataRecordPack.SendEventPack("ItemCompound", drDict, curPlayer)
         
     if canHappen:
         GameWorld.DebugLog("合成成功: makeItemID=%s,compoundCnt=%s,compoundBindCnt=%s,itemExpireTime=%s" % (makeItemID, compoundCnt, compoundBindCnt, itemExpireTime), playerID)
-        userData = GiveNewCompoundItem(curPlayer, makeItemID, compoundCnt, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime)
+        userData = GiveNewCompoundItem(curPlayer, packType, makeItemID, compoundCnt, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime)
         
         msgMark = ipyData.GetSysMark()
         paramType = ipyData.GetSysMarkParamType()
@@ -278,12 +278,12 @@
         ItemCommon.SyncMakeItemAnswer(curPlayer, ShareDefine.Def_mitItemCompound, ChConfig.Def_ComposeState_Sucess, makeItemID)
         #成功合成1个物品成就
         PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundItemEx, compoundCnt, [makeItemID])
-        #合成X阶X颜色X星级以上装备
-        classLV = ItemCommon.GetItemClassLV(makeItemData)
-        itemColor = makeItemData.GetItemColor()
-        itemQuality = makeItemData.GetItemQuality()
-        PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundEquip, compoundCnt, [classLV, itemColor, itemQuality])
-        EventShell.EventRespons_CompoundEquip(curPlayer, itemColor, itemQuality)
+        #合成X阶X颜色X星级以上装备, 星级改为装备位了,暂时没有用,屏蔽
+        #classLV = ItemCommon.GetItemClassLV(makeItemData)
+        #itemColor = makeItemData.GetItemColor()
+        #itemQuality = makeItemData.GetItemQuality()
+        #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundEquip, compoundCnt, [classLV, itemColor, itemQuality])
+        #EventShell.EventRespons_CompoundEquip(curPlayer, itemColor, itemQuality)
     # 合成失败
     else:
         GameWorld.DebugLog("合成失败!")
@@ -578,7 +578,7 @@
     return incRateItemCostList, expireTime
 
 def __CheckItemCanUseCompound(playerID, index, curItem):
-    if not ItemCommon.CheckItemCanUse(curItem):
+    if not ItemCommon.CheckItemCanUse(curItem) or ItemControler.GetIsAuctionItem(curItem):
         GameWorld.DebugLog("该物品不可使用!无法合成! index=%s" % (index), playerID)
         return
     
@@ -601,21 +601,21 @@
 #  @param newItem: 新物品
 #  @param itemCount: 合成数量
 #  @return None
-def GiveNewCompoundItem(curPlayer, newItemID, itemCount, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime):
+def GiveNewCompoundItem(curPlayer, packType, newItemID, itemCount, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime):
     compoundUnBindCnt = itemCount - compoundBindCnt
     
     if compoundBindCnt > 0:
-        userData = __GivePlayerCompoundItem(curPlayer, newItemID, compoundBindCnt, True, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime)
+        userData = __GivePlayerCompoundItem(curPlayer, packType, newItemID, compoundBindCnt, True, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime)
     if compoundUnBindCnt > 0:
-        userData = __GivePlayerCompoundItem(curPlayer, newItemID, compoundUnBindCnt, False, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime)
+        userData = __GivePlayerCompoundItem(curPlayer, packType, newItemID, compoundUnBindCnt, False, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime)
         
     if not userData:
         return ""
     return userData
 
-def __GivePlayerCompoundItem(curPlayer, newItemID, itemCount, isBind, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, expireTime):
+def __GivePlayerCompoundItem(curPlayer, packType, newItemID, itemCount, isBind, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, expireTime):
     playerID = curPlayer.GetPlayerID()
-    curSingleItem = ItemControler.GetOutPutItemObj(newItemID, itemCount, isBind, expireTime)
+    curSingleItem = ItemControler.GetOutPutItemObj(newItemID, itemCount, False, expireTime)
     if not curSingleItem:
         GameWorld.ErrLog("创造物品失败, give item itemid:%s,count:%s" % (newItemID, itemCount), playerID)
         return
@@ -653,8 +653,7 @@
         GameWorld.Log("保存可拆解装备拆解物品信息: %s" % decompoundItemInfo, playerID)
         
     userData = curSingleItem.GetUserData()
-    if not ItemControler.PlayerItemControler(curPlayer).PutInItem(IPY_GameWorld.rptItem, curSingleItem, 
-                                                                  event=[ChConfig.ItemGive_ItemCompound, False, {}]):
+    if not ItemControler.PlayerItemControler(curPlayer).PutInItem(packType, curSingleItem, event=[ChConfig.ItemGive_ItemCompound, False, {}]):
         GameWorld.ErrLog("给合成物品失败, give item itemid:%s,count:%s" % (newItemID, itemCount), playerID)
         curSingleItem.Clear()
         return
@@ -711,7 +710,7 @@
         return
     curEquip = itemPack.GetAt(decompoundItemIndex)
     
-    if not ItemCommon.CheckItemCanUse(curEquip):
+    if not ItemCommon.CheckItemCanUse(curEquip) or ItemControler.GetIsAuctionItem(curEquip):
         return
     
     attrCount = curEquip.GetUserAttrCount(ShareDefine.Def_IudetItemDecompound)
@@ -748,7 +747,7 @@
     
     # 返还物品
     for itemID, itemCount, isBind in giveItemList:
-        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], 
+        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem], 
                                      event=["ItemDecompound", True, {"decompoundItemNoteDict":decompoundItemNoteDict}])
         
     GameWorld.Log("拆解物品成功: decompoundItemNoteDict=%s" % str(decompoundItemNoteDict), playerID)

--
Gitblit v1.8.0