-- 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=2493, count=1}, -- demon set (legs, helm, arm)
{itemid=2494, count=1},
{itemid=2495, count=1},
{itemid=2160, count=50} -- 50cc
}
local firstItems = {
{ -- SORC ITEMS
{itemid=2190, count=1}, -- wand
{itemid=2520, count=1}, -- demon shield
{itemid=7890, count=1} -- an amulet (for test purpose)
},
{ -- DRUID ITEMS
{itemid=2182, count=1}, -- rod
{itemid=2520, count=1}, --demon shield
{itemid=7888, count=1} -- an amulet (for test purpose)
},
{ -- PALADIN ITEMS
{itemid=2455, count=1}, --xbow
{itemid=2543, count=100}, --100 bolt
{itemid=7887, count=1} -- an amulet (for test purpose)
},
{ -- KNIGHT ITEMS
{itemid=2432, count=1}, -- fire axe O.o
{itemid=2520, count=1}, --demon shield
{itemid=7889, count=1} -- an amulet (for test purpose)
}
}
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
if getPlayerStorageValue(cid, 90808) < 1 then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, TRUE)
local giveItems = firstItems[getPlayerVocation(cid)]
if giveItems 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, 1)
end
end
return true
end