From c82bf80c543ddc6bada1e3085acb8ab9ee7b13db Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 28 十一月 2025 14:26:33 +0800
Subject: [PATCH] 237 【福利内容】每日任务/每周任务/章节奖励-服务端(A340下发已完成的成就)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
index 0ef20d0..74383d5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -25,6 +25,7 @@
 import traceback
 import random
 import ReadChConfig
+import PlayerActivity
 import ChPyNetSendPack
 import NetPackCommon
 import PlayerXiangong
@@ -901,6 +902,18 @@
         GameWorld.SendMsgToClientServer(ShareDefine.CrossServerMsg_PutInItem, itemMsg, [serverGroupID])
         return
     
+    def __autoUseByEffectID(self, curPlayer, tagItem, itemEff, itemID, itemCount):
+        effectID = itemEff.GetEffectID()
+        
+        # 物品碎片
+        if effectID == ChConfig.Def_Effect_ItemCount:
+            SetItemCountByID(curPlayer, itemID, GetItemCountByID(curPlayer, itemID) + itemCount)
+        # 活跃度
+        elif effectID == ChConfig.Def_Effect_AddActivity:
+            PlayerActivity.DoAddActivity(curPlayer, itemCount)
+            
+        return
+    
     ## 放入物品 
     #  @param packIndex 背包索引
     #  @param tagItem 物品
@@ -939,11 +952,11 @@
         #    tagItem.Clear()
         #    return True
         itemEff = tagItem.GetEffectByIndex(0)
-        #物品碎片
-        if itemEff.GetEffectID() == ChConfig.Def_Effect_ItemCount:
-            SetItemCountByID(curPlayer, itemID, GetItemCountByID(curPlayer, itemID) + tagItemCount)
+        if itemEff.GetEffectID() in ChConfig.AutoUseItemEffectIDList:
+            self.__autoUseByEffectID(curPlayer, tagItem, itemEff, itemID, tagItemCount)
             tagItem.Clear()
             return True
+        
         #气运
         if itemEff.GetEffectID() == ChConfig.Def_Effect_TiandaoQiyun:
             isAutoUse = itemEff.GetEffectValue(1)
@@ -1992,11 +2005,11 @@
         return False
     
     if isAuctionItem:
-        ipyData = None #IpyGameDataPY.GetIpyGameData("AuctionItem", itemID)
-        if not ipyData:
-            GameWorld.ErrLog("非拍卖物品,默认转为非拍品! itemID=%s,itemCount=%s,isAuctionItem=%s" 
-                             % (itemID, itemCount, isAuctionItem), curPlayer.GetPlayerID())
-            isAuctionItem = 0
+        #ipyData = None #IpyGameDataPY.GetIpyGameData("AuctionItem", itemID)
+        #if not ipyData:
+        #    GameWorld.ErrLog("非拍卖物品,默认转为非拍品! itemID=%s,itemCount=%s,isAuctionItem=%s" 
+        #                     % (itemID, itemCount, isAuctionItem), curPlayer.GetPlayerID())
+        isAuctionItem = 0
     
     defaultPack = IPY_GameWorld.rptItem if not packIndexList else packIndexList[0]
     packIndex = ChConfig.GetItemPackType(curItemData, defaultPack)
@@ -2179,7 +2192,7 @@
     if itemData.GetItemTypeID() in ChConfig.Def_TransformItemIDList or itemData.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
         return True
     itemEff = itemData.GetEffectByIndex(0)
-    if itemEff.GetEffectID() == ChConfig.Def_Effect_ItemCount:
+    if itemEff.GetEffectID() in ChConfig.AutoUseItemEffectIDList:
         return True
     return False
 

--
Gitblit v1.8.0