<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
<config name="firstitems_config"><![CDATA[
config = {
storage = 30001,
items = {2050, 2382}
}
]]></config>
<event type="login" name="FirstItems" event="script"> <![CDATA[
domodlib('firstitems_config')
function onLogin(cid)
local config = {
voc_items = {
{ -- SORC
{2190}, -- wand of vortex
{2525}, -- dwarven shield
{2457}, -- steel helmet
{2463} -- plate robe
},
{ -- DRUID
{2182}, -- snakebite rod
{2525}, -- dwarven shield
{2457}, -- steel helmet
{2463} -- plate robe
},
{ -- PALADIN
{2389}, -- throwing knife
{2525}, -- dwarven shield
{2457}, -- steel helmet
{2463} -- plate armor
},
{ -- KNIGHT
{2383}, -- spike sword
{2525}, -- dwarven shield
{2457}, -- steel helmet
{2463} -- plate armor
}
},
all_items = {
{2647}, -- plate legs
{2643} -- leather boots
},
extra_items = {
{2789, 15},
{2160, 1},
{2120},
{5710},
{8704}, -- small hp
{7618}, -- hp
{7588}, -- stron hp
{7591}, -- great hp
{8473}, -- ultimate hp
{7620}, -- mp
{7589}, -- smp
{7590}, -- gmp
{8472} -- sp
},
knight_weapons = {
{2394}, -- morning star
{2428} -- orcish axe
}
}
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
]]></event>
</mod>