注册函数:LuaFnGetItemTableIndexByIndex
参数说明:sceneId(场景编号)、selfId(调用者ID)、itemIndex(背包物品索引)
功能说明:取当前位置的物品种类 物品ID
在某些怀旧端 18是武魂
ID对应装备位:
118 龙纹
117 暗器
116 衣服
115 肩膀
114 护腕
113 护符
112 护符2
111 戒指
110 武魂 (原百宝箱)
109 霸王令(帮会令牌)
108 坐骑
107 项链
106 戒指2
105 腰带
104 鞋子
103 手套
102 时装
101 帽子
100 武器
参考案例代码:
--获得装备位
local equip_point = LuaFnGetBagEquipType(sceneId,selfId, EquipIndex)
if equip_point == -1 then
return 1
elseif equip_point == 2 then --原有时装已替换为 2号位 留下此代码
return 4
end
local nKfsID116 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 116 )
local nKfsID115 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 115 )
local nKfsID107 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 107 )
local nKfsID106 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 106 )
local nKfsID111 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 111 )
local nKfsID112 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 112 )
local nKfsID113 = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 113 )
if nKfsID116 == 10553111 or nKfsID116 == 10553110 then
nKfsID116 =9
end
if nKfsID115 == 10553108 or nKfsID115 == 10553109 then
nKfsID115 =9
end
if nKfsID107 == 10553103 or nKfsID107 == 10553100 then
nKfsID107 =9
end
if nKfsID106 == 10553101 or nKfsID106 == 10553104 then
nKfsID106 =9
end
if nKfsID111 == 10553101 or nKfsID111 == 10553104 then
nKfsID111 =9
end
if nKfsID112 == 10553102 or nKfsID112 == 10553105 then
nKfsID112 =9
end
if nKfsID113 == 10553102 or nKfsID113 == 10553105 then
nKfsID113 =9
end
if nKfsID116 == 9 and nKfsID115 =9 and nKfsID107 =9 and nKfsID106 =9 and nKfsID111 =9 and nKfsID112 =9 and nKfsID113 =9 then
LuaFnSendSpecificImpactToUnit(sceneId,selfId,selfId,selfId,20179,0)
end
|