Hi, i got a problem. I'm using cryingdamson 0.3.6
The characters starting items drops to the ground when entering the game the first time.
I think it has something to do with "const_slot_backpack". I think it puts the items on the wrong place, like you can't put legs on the head slot.
I got an example on that, when you die you'll get a bag in the bag slot. It doesn't drops to the ground.
My firstitems.lua file
This is the creaturescripts.xml
The characters starting items drops to the ground when entering the game the first time.
I think it has something to do with "const_slot_backpack". I think it puts the items on the wrong place, like you can't put legs on the head slot.
I got an example on that, when you die you'll get a bag in the bag slot. It doesn't drops to the ground.
My firstitems.lua file
Lua:
local storage = 67777
function onLogin(cid)
local config = {
voc_items = { },
extra_items = {
{2789, 15},
{2120},
{5710}
}
}
if getPlayerGroupId(cid) < 3 then
if getPlayerStorageValue(cid, storage) == -1 then
local common = config.voc_items[getPlayerVocation(cid)]
if common ~= nil then
for _, v in ipairs(common) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
end
local all = config.all_items
if all ~= nil then
for _, v in ipairs(all) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
end
local extra = config.extra_items
local bp = doPlayerAddItem(cid, 1988, 1)
if extra ~= nil then
for _, v in ipairs(extra) do
doAddContainerItem(bp, v[1], v[2] or 1)
end
end
local weapons = config.knight_weapons
if weapons ~= nil then
for _, w in ipairs(weapons) do
if isKnight(cid) then
doAddContainerItem(bp, w[1], w[2] or 1)
end
end
end
setPlayerStorageValue(cid, storage, 1)
end
end
return true
end
This is the creaturescripts.xml
XML:
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>