|
--获取物品属性
function on_getItemInfo(item, actor, itemFrom, itemPos, mainAppend)
local ret, _temp, _mainItemInfo, _steelInfo, _steelSuitInfo, _suitInfo ,_mainItemInfo2= "", "", "", "", "", "",""
--local _startTime = os.clock()
itemInfo.init(item, actor, itemFrom, itemPos, mainAppend)
local dbitem = nil
if item:getName() ~= "" then
--根据物品ID获取数据库实例
dbitem = c.item.getDBItem(item:getIndex())
if dbitem == nil then return "" end
--获取物品信息
_mainItemInfo = itemInfo.getItemInfo(item, dbitem, actor, itemFrom, itemPos)
if _mainItemInfo ~= "" then
--获取钢纹属性
_steelInfo = itemInfo.getItemSteelInfo(item, dbitem)
end
end
--装备栏专有属性
if in_array(itemFrom, {const.ift_state, const.ift_herostate, const.ift_user1state}) then
if item:getName() ~= "" then
if _mainItemInfo ~= "" then
--获取钢纹套装属性
_steelSuitInfo = itemInfo.getItemSteelSuitInfo(item, dbitem, actor, itemFrom, itemPos)
--获取套装属性
_suitInfo = itemInfo.getItemSuitProp(itemFrom, itemPos)
end
end
--检测装备栏头盔位是否存在面巾或斗笠
if itemPos == const.item_helmet or itemPos == const.item_fasguin_helmet then
local _nowItemPos
if itemPos == const.item_helmet then
_nowItemPos = const.item_zhuli
else
_nowItemPos = const.item_fasguin_zhuli
end
--获取斗笠或面巾
local _ZLItem = nil
if itemFrom == const.ift_state then
_ZLItem = c.item.getMyEquipPos(_nowItemPos)
elseif itemFrom == const.ift_herostate then
_ZLItem = c.item.getHeroEquipPos(_nowItemPos)
elseif itemFrom == const.ift_user1state then
_ZLItem = c.item.getUser1EquipPos(_nowItemPos)
end
if _ZLItem ~= nil then
dbitem = c.item.getDBItem(_ZLItem:getIndex())
if dbitem ~= nil then
_temp = itemInfo.getItemInfo(_ZLItem, dbitem, actor, itemFrom, _nowItemPos)
if _temp ~= "" then
if _mainItemInfo ~= "" then
_temp = _temp.."\\ \\".._mainItemInfo
end
_mainItemInfo = _temp
--获取钢纹属性
if _steelInfo == "" then
_steelInfo = itemInfo.getItemSteelInfo(_ZLItem, dbitem)
end
--获取钢纹套装属性
if _steelSuitInfo == "" then
_steelSuitInfo = itemInfo.getItemSteelSuitInfo(_ZLItem, dbitem, actor, _nowItemPos)
end
--获取套装属性
if _suitInfo == "" then
_suitInfo = itemInfo.getItemSuitProp(itemFrom, _nowItemPos)
end
end
end
end
end
--鉴定星级套装
_mainItemInfo = _mainItemInfo..itemInfo.getIdentifySuitProp(item, itemFrom, itemPos)
--体格属性
_mainItemInfo = _mainItemInfo..itemInfo.getPhysiqueProp(actor, itemFrom, itemPos)
end
--整理最后输出hint字符串
if _mainItemInfo ~= "" then
_temp = ""
if _steelInfo ~= "" or _steelSuitInfo ~= "" then
_temp = hintHelper.addParent()
if _steelInfo ~= "" then
_temp = _temp..hintHelper.addSubParent().._steelInfo
end
if _steelSuitInfo ~= "" then
_temp = _temp..hintHelper.addSubParent().._steelSuitInfo
end
end
_steelInfo = _temp
end
if _suitInfo ~= "" then
_suitInfo = hintHelper.addParent()..hintHelper.addSubParent().._suitInfo
end
ret = _mainItemInfo..mainAppend.._steelInfo.._suitInfo
--包裹里对比身上装备
if itemFrom == 0 and g_var["item_duibi"] then --包裹里的物品 g_var["item_duibi"] 装备对比控制
--获取当前装备处于哪个位置的装备
local index = stdModeToItemPos(dbitem:getStdMode())
_mainItemInfo2 = on_getEquipByPos(index,actor)
if _mainItemInfo2 ~= "" then
_mainItemInfo2 = hintHelper.addParent("right")..hintHelper.addSubParent()..hintHelper.set(100,10,nil,nil,nil,nil)..hintHelper.img("ui_n", 1953, 64, 51).."\\"..hintHelper.set(nil,-2,nil,2,nil,nil).._mainItemInfo2
end
if index ==const.item_ringl or index == const.item_armringl then -- 手镯和戒指需要对比2个装备位置
index = index + 1
local _mainItemInfo3 = on_getEquipByPos(index,actor)
if _mainItemInfo3 ~= "" then
_mainItemInfo2 =_mainItemInfo2..hintHelper.addParent("right")..hintHelper.addSubParent()..hintHelper.set(100,10,nil,nil,nil,nil)..hintHelper.img("ui_n", 1953, 64, 51).."\\"..hintHelper.set(nil,-2,nil,2,nil,nil).._mainItemInfo3
end
end
end
--local _endTime = os.clock()
--print(string.format("所用时间:%.4fms",_endTime-_startTime))
return ret.._mainItemInfo2
end
function on_getEquipByPos(index,actor)
if index < 0 then return "" end
local item2 =nil
if actor:getRace() == 0 then --主号
item2 = c.item.getMyEquipPos(index)
end
if actor:getRace() == 1 then -- 英雄
item2 = c.item.getHeroEquipPos(index)
end
if item2:getName() ~= "" then
--根据物品ID获取数据库实例
dbitem2 = c.item.getDBItem(item2:getIndex())
if dbitem2 == nil then return "" end
--获取物品信息
return itemInfo.getItemInfo(item2, dbitem2, actor, 2, index)
end
return ""
end
补充内容 (2020-6-24 15:45):
代码都是 Bindevent.lua 里/// 不影响底层的排版
补充内容 (2020-6-24 16:12):
仅供参考 需要0601版后 登陆器解压出来的lua (/传奇目录/lua/) 复制到自己专属目录 修改BingEvent.lua 方法
补充内容 (2020-6-24 17:28):
https://bbs.hgem2.net/forum.php? ... =1716&pid=13557
补充内容 (2020-6-24 22:54):
不要问我QQ啥的, 纯新手,提供的只能是一种思路方法。纯粹分享而已 没有其他啥想法,有的话 只想说LUA牛逼!Lua 万岁 |
评分
-
查看全部评分
|