From ac415b81547ada883896d409e2f83ab7faac819f Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期六, 28 九月 2024 15:29:51 +0800 Subject: [PATCH] 10253 【越南】【砍树】【英文】聚魂 和 古宝获得物品展示(支持多选) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py index d5a8d3c..7b83cd9 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py @@ -1534,20 +1534,37 @@ #// A3 23 使用物品 #tagCMUseItems # +#struct tagCMUseItemsSelect +#{ +# DWORD SelectID; //选择项ID +# WORD SelectCnt; //选择数 +#}; +# #struct tagCMUseItems #{ # tagHead Head; # BYTE ItemIndex; //物品在背包中索引 # WORD UseCnt; //使用个数,0表示全部使用 # DWORD ExData; //使用扩展值, 默认0, 选择物品宝箱时发送选择的物品ID +# BYTE SelectCount; //指定选择项,当批量使用单个箱子需要同时选中多种选项时使用该值 +# tagCMUseItemsSelect SelectList[SelectCount]; #}; def OnUseItems(index, packData, tick): curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) itemIndex = packData.ItemIndex useCnt = packData.UseCnt exData = packData.ExData - GameWorld.DebugLog("OnUseItems itemIndex=%s,useCnt=%s,exData=%s" % (itemIndex, useCnt, exData), curPlayer.GetPlayerID()) - + selectDict = {} + if packData.SelectCount: + for selectInfo in packData.SelectList: + selectDict[selectInfo.SelectID] = selectInfo.SelectCnt + GameWorld.DebugLog("OnUseItems itemIndex=%s,useCnt=%s,exData=%s,selectDict=%s" % (itemIndex, useCnt, exData, selectDict), curPlayer.GetPlayerID()) + if selectDict: + exData = selectDict + GameWorld.DebugLog(" 使用多项选择,以多选为准! exData=%s" % exData) + elif exData: + GameWorld.DebugLog(" 使用单项选择,兼容旧模式! exData=%s" % exData) + backPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem) curItem = backPack.GetAt(itemIndex) -- Gitblit v1.8.0