noshirtstan
New Member
- Joined
- Aug 2, 2020
- Messages
- 68
- Reaction score
- 2
Hey folks, Im trying to add additional values to select items via a global looting system. Having an issue trying to get it to work properly though.
Here is what I have:
Here is the error I get when the monster dies and the loot drops:

Any thoughts?
Here is what I have:
LUA:
function Container:addExtraLoot(c, t)
if t.hasName then
local cn = c:getName():lower()
local cm = t.hasName:lower()
if not cn:match(cm) then
return true
end
end
for i = 1, #t.items do
local count = 1
if t.items[i].count then
if t.items[i].countMax then
count = math.random(t.items[i].count, titems[i].countMax)
else
count = t.items[i].count
end
else
if t.items[i].countMax then
count = math.random(1, t.items[i].countMax)
end
end
if math.random(0, 100000) <= t.items[i].chance then
self:addItem(t.items[i].id, count)
if t.items[i].id == 26384 then
local rndm = math.random(50501, 50506)
local rndm2 = math.random(1, #craftingProfessionsConfig[rndm].skillRecipes)
item:setAttribute(ITEM_ATTRIBUTE_ACTIONID, rndm) [B][I][COLOR=rgb(184, 49, 47)]-- LINE 39 ITEM ERROR[/COLOR][/I][/B]
if rndm == 50501 then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, math.random(101, 110))
item:setAttribute(ITEM_ATTRIBUTE_NAME, "Blacksmithing Recipe")
elseif rndm == 50502 then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, math.random(201, 211))
item:setAttribute(ITEM_ATTRIBUTE_NAME, "Alchemy Recipe")
elseif rndm == 50503 then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, math.random(301, 310))
item:setAttribute(ITEM_ATTRIBUTE_NAME, "Inscription Recipe")
elseif rndm == 50504 then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, math.random(401, 410))
item:setAttribute(ITEM_ATTRIBUTE_NAME, "Tailoring Recipe")
elseif rndm == 50505 then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, math.random(501, 510))
item:setAttribute(ITEM_ATTRIBUTE_NAME, "Leatherworking Recipe")
elseif rndm == 50506 then
item:setAttribute(ITEM_ATTRIBUTE_TEXT, math.random(601, 610))
item:setAttribute(ITEM_ATTRIBUTE_NAME, "Engineering Recipe")
end
return true
end
end
end
end
Here is the error I get when the monster dies and the loot drops:
Any thoughts?