搜索
查看: 592|回复: 5

地面叠加类物品数量不显示?

[复制链接]
发表于 2022-9-7 11:40:10 | 显示全部楼层 |阅读模式
--物品掉落回调显示数量示例
function on_DropItem(x, y, looks, color, effectId, name, expand1, dbIdx, count, seeMode)
        if expand1 > 0 then
                return {showName = name.."【极品属性+"..expand1.."】", color = 243}
        end

        if count > 1 then --物品数量大于1个
                local _dbItem = c.item.getDBItem(dbIdx)
                if ((_dbItem ~= nil) and (_dbItem:getStdMode() == 17)) or (name == "金币") then
                        return {showName = name.."x"..count}
                end
        end
end
------------
客户端里加了数量显示没效果.是不是服务端那还要加啊?

发表于 2022-9-8 12:47:50 | 显示全部楼层
扔金币没作用?
 楼主| 发表于 2022-9-8 17:50:40 | 显示全部楼层

金币是有大小堆区别的,但不显示数量,
其他堆叠类物品也不显示数量!

服务端的
--物品掉落地上时触发,返回expand1值,用于自定义值传送给客户端
function on_ItemDropShowType(item)
  local itemName = item:getName()--名称       
  
  --取物品极品属性总和         
  local bestValue = item:getBestValue(0)+item:getBestValue(1)+item:getBestValue(2)+item:getBestValue(3)+item:getBestValue(4)+item:getBestValue(5)
  print("物品地上显示["..itemName.."]--[物品爆出显示类型触发]"..tostring(bestValue))       
  
  return {expand1=bestValue} --返回expand1
end

--取精灵名字信息触发

是不是没发数量?
发表于 2022-9-14 20:39:12 | 显示全部楼层
一蓑烟雨任平生 发表于 2022-9-8 17:50
金币是有大小堆区别的,但不显示数量,
其他堆叠类物品也不显示数量!


可以啊.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| 发表于 2022-9-17 19:12:53 | 显示全部楼层

是和我的一样吗??
 楼主| 发表于 2022-9-17 19:21:59 | 显示全部楼层
解决了,下面有段重复了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|HGEM2论坛

GMT+8, 2024-9-21 10:49 , Processed in 0.507759 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表