Hello.. i using 0.4 ot.. 8.6 client and heres my script.. first item.. when i login i dont get ( vocation items) i only get (all) + (extras)
this is xml file.. in my mods
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" 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 = {
{ --
{2268, 1}, -- sd
{2191}, -- wand of dragonbreath
{2175}, -- speelbook
{8871}, -- focus cape
{2323} -- hat of the mad
},
{ --
{2268, 1}, -- sd
{2186}, -- moonlight rod
{2323}, -- hat of the mad
{2175}, -- speelbook
{8871} -- focus cape
},
{ --
{2268, 1}, -- sd
{8472, 1}, -- gsp
{7368, 1}, -- assasssin star
{8872}, -- belted cape
{2525}, -- dwarven shield
{2457} -- steel helmet
},
{ --
{2457}, -- steel helmet
{2463}, -- plate armor
{2525}, -- dwarven shield
{2400} -- magic sword
}
},
all_items = {
{2643}, -- leather boots
{2647} -- p legs
},
extra_items = {
{2789, 10}, -- brown mushrooms
{7620, 1}, -- mp
{7618, 1}, -- hp
{2293, 1}, -- mw
{2305, 1}, -- great fireball
{2274, 1}, -- avalanche
{2261, 1}, -- destroy
{2120}, --
{2554} --
},
knight_weapons = {
{2457}, -- steel helmet
{2463}, -- plate armor
{2525}, -- dwarven shield
{2400} -- magic sword
},
paladin_weapons = {
}
}
if getPlayerGroupId(cid) < 3 then
if getPlayerStorageValue(cid, storage) == -1 then
local vocation = getPlayerVocation(cid)
local common = config.voc_items[vocation > 4 and vocation - 4 or vocation]
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
doPlayerAddItem(cid, w[1], w[2] or 1)
end
end
end
local weapons2 = config.paladin_weapons
if weapons2 ~= nil then
for _, w in ipairs(weapons2) do
if isPaladin(cid) then
doAddContainerItem(bp, w[1], w[2] or 1)
end
end
end
setPlayerStorageValue(cid, storage, 1)
end
end
return true
end
]]></event>
</mod>
this is xml file.. in my mods