And code look like:
var QuiverAmmoBagsId = new List<int>
{
29143,
29144,
29118,
18714,
44447,
44448,
34105,
34106,
34099,
34100,
19319,
19320,
2662,
2663,
8217,
8218,
7371,
7372,
3604,
3605,
3573,
3574,
11362,
11363,
5439,
5441,
7278,
7279,
2101,
2102,
};
var freeSlots = 0;
var bags = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWContainer();
foreach (var b in bags)
{
if (b.IsValid &&
QuiverAmmoBagsId.Contains(b.Entry) &&
b.Owner == wManager.Wow.ObjectManager.ObjectManager.Me.Guid &&
(b.ContainedIn == 0 || b.ContainedIn == wManager.Wow.ObjectManager.ObjectManager.Me.Guid) &&
!string.IsNullOrWhiteSpace(b.Name))
{
freeSlots += Lua.LuaDoString<int>($@"
local freeSlots = 0;
for bagID = 1, 4 do
if GetBagName(bagID) ~= nil and GetBagName(bagID) == '{b.Name.Replace("'", "\'")}' then
for s=1,GetContainerNumSlots(bagID) do
local i = GetContainerItemInfo(bagID,s);
if not i then
freeSlots = freeSlots + 1
end
end
end
end
return freeSlots;");
}
}