-- Colandus @ 1337Rox0r
-- How to think when adding items? Try fill the hands first, then the arrow slot. This because armor etc won't go to hand slot (Vocation items will be given before commonItems, as you usually use to have
-- the hand/arrow slot items there and not in common items. Take a look at how I did it:
local commonItems = {
-- ITEMS ALL VOC RECEIVE
{itemid=2457, count=1}, -- demon set (legs, helm, arm)
{itemid=2463, count=1},
{itemid=2647, count=1},
{itemid=2160, count=10},
{itemid=2643, count=1},
{itemid=2661, count=1},
{itemid=2120, count=1},
{itemid=2554, count=1},
{itemid=2671, count=5}
}
local firstItems = {
{ -- SORC ITEMS
{itemid=2190, count=1}, -- wand
{itemid=2525, count=1}, --dwarven shield
{itemid=2268, count=100}, --sd
{itemid=2273, count=100}, --uh
{itemid=2304, count=100} --gfb
},
{ -- DRUID ITEMS
{itemid=2182, count=1}, -- rod
{itemid=2525, count=1}, --dwarven shield
{itemid=2268, count=100}, --sd
{itemid=2273, count=100}, --uh
{itemid=2304, count=100} --gfb
},
{ -- PALADIN ITEMS
{itemid=2455, count=1}, --xbow
{itemid=2543, count=1}, --1 bolt
{itemid=2268, count=100}, --sd
{itemid=2273, count=100}, --uh
{itemid=2304, count=100} --gfb
},
{ -- KNIGHT ITEMS
{itemid=2432, count=1}, -- fire axe
{itemid=2525, count=1}, --dwarven shield
{itemid=2407, count=1}, --bright sword
{itemid=2436, count=1}, --skull staff
{itemid=2273, count=100} --uh
}
}
for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end
function onLogin(cid)
if getPlayerGroupId(cid) < 2 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 90808)
if hasReceivedFirstItems ~= TRUE then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, TRUE)
local giveItems = firstItems[getPlayerVocation(cid)]
if giveItems ~= nil then
for _, v in ipairs(giveItems) do
--doAddContainerItem(backpack, v.itemid, v.count or 1)
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You received your first items depending on your vocation.")
end
setPlayerStorageValue(cid, 90808, TRUE)
end
end
return TRUE
end