From 47723b47452eadfaccd2a2813a2c8877a9ebbcf1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 24 十一月 2025 11:58:59 +0800
Subject: [PATCH] 332 【主界面】座骑系统-服务端(默认坐骑外观ID取ID大于0的)
---
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