<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Darkhaos" contact="None" enabled="yes">
<config name="firstitems_config"><![CDATA[
local items =
{
voc =
{
{
{item = 2190}, -- wand of vortex
{item = 2175}, -- spellbook
{item = 8820}, -- mage hat
{item = 8819} -- mage robe
},
{
{item = 2182}, -- snakebite rod
{item = 2175}, -- spellbook
{item = 8820}, -- mage hat
{item = 8819} -- mage robe
},
{
{item = 2410}, -- throwing knife
{item = 2530}, -- copper shield
{item = 2480}, -- legion helmet
{item = 2464} -- chain armor
},
{
{item = 2409}, -- serpent sword
{item = 2530}, -- copper shield
{item = 2480}, -- legion helmet
{item = 2464} -- chain armor
}
},
all = {
{item = 2468}, -- studded legs
{item = 2643} -- leather boots
},
extra = {
{item = 2789, count = 15},
{item = 2120},
{item = 5710}
},
knightWeapons = {
{item = 2423}, -- clerical mace
{item = 2429} -- barbarian axe
}
}
local storage = 67777
local c = nil
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')
function onLogin(cid)
if(getCreatureStorage(cid, storage) < 1 then
for i = 1, 4 do
if getPlayerVocation(cid) == i then
for t = 1, table.maxn(items.voc[i]) do
c = 1
if tonumber(items.voc[i][t].count) then
c = items.voc[i][t].count
end
doPlayerAddItem(cid, items.voc[i][t].item, c)
end
end
end
for i = 1, table.maxn(items.all) do
c = 1
if tonumber(items.all[i].count) then
c = items.all[i].count
end
doPlayerAddItem(cid, items.all[i].item, c)
end
for i = 1, table.maxn(items.extra) do
c = 1
if tonumber(items.extra[i].count) then
c = items.extra[i].count
end
doPlayerAddItem(cid, items.extra[i].item, c)
end
if isKnight(cid) then
for i = 1, table.maxn(items.knightWeapons) do
c = 1
if tonumber(items.knightWeapons[i].count) then
c = items.extra[i].count
end
doPlayerAddItem(cid, items.knightWeapons[i].item, c)
end
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received the " .. getVocationInfo(getPlayerVocation(cid)).name .. "'s first items.")
doCreatureSetStorage(cid, storage, 1)
end
return true
end
]]></event>
</mod>