<?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 = {2160}
}
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')
function onLogin(cid)
if(getPlayerStorageValue(cid, config.storage) > 0) then
return true
end
for _, id in ipairs(config.items) do
doPlayerAddItem(cid, id, 1)
end
if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerAddItem(cid, 2493, 1)
doPlayerAddItem(cid, 2494, 1)
doPlayerAddItem(cid, 2495, 1)
doPlayerAddItem(cid, 2643, 1)
else
doPlayerAddItem(cid, 2493, 1)
doPlayerAddItem(cid, 2494, 1)
doPlayerAddItem(cid, 2495, 1)
doPlayerAddItem(cid, 2643, 1)
end
doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2160, 25)
doPlayerAddItem(cid, 2543, 1)
doPlayerAddItem(cid, 2268, 1)
doPlayerAddItem(cid, 2455, 1)
doPlayerAddItem(cid, 2273, 1)
doPlayerAddItem(cid, 2276, 1)
doPlayerAddItem(cid, 2186, 1)
doPlayerAddItem(cid, 2191, 1)
doPlayerAddItem(cid, 2544, 1)
doPlayerAddItem(cid, 2456, 1)
setPlayerStorageValue(cid, config.storage, 1)
return true
end
]]></event>
</mod>
<event type="login" name="FirstItems" script="firstitems.lua"/>
local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1}, -- shovel
{itemid=2420, count=1}, -- machete
{itemid=2789, count=10}, -- brown mushrooms
{itemid=2305, count=1}, -- fire bomb rune
{itemid=2261, count=1}, -- destroy field rune
{itemid=2293, count=1}, -- mw
{itemid=2173, count=1}, -- amulet of loss
}
local firstItems = {
{ -- SORC ITEMS
{itemid=2323, count=1}, -- hat of the mad
{itemid=8871, count=1}, -- focus cape
{itemid=2647, count=1}, -- plate legs
{itemid=2195, count=1}, -- boots of haste
{itemid=2516, count=1}, -- dragon shield
{itemid=2190, count=1}, -- wand of vortex
{itemid=2268, count=1}, -- sd
{itemid=2273, count=1}, -- uh
{itemid=7589, count=1}, -- smp
},
{ -- DRUID ITEMS
{itemid=2491, count=1}, -- crown helmet
{itemid=8871, count=1}, -- focus cape
{itemid=2647, count=1}, -- plate legs
{itemid=2195, count=1}, -- boots of haste
{itemid=2516, count=1}, -- dragon shield
{itemid=2182, count=1}, -- snakebite rod
{itemid=2268, count=1}, -- sd
{itemid=2273, count=1}, -- uh
{itemid=7589, count=1}, -- smp
{itemid=2269, count=1}, -- wg
},
{ -- PALADIN ITEMS
{itemid=2491, count=1}, -- crown helmet
{itemid=8891, count=1}, -- paladin armor
{itemid=2647, count=1}, -- plate legs
{itemid=2195, count=1}, -- boots of haste
{itemid=2516, count=1}, -- dragon shield
{itemid=2399, count=1}, -- throwing stars
{itemid=2268, count=1}, -- sd
{itemid=2273, count=1}, -- uh
{itemid=7588, count=1}, -- shp
{itemid=7589, count=1}, -- smp
},
{ -- KNIGHT ITEMS
{itemid=2491, count=1}, -- crown helmet
{itemid=2487, count=1}, -- crown armor
{itemid=2647, count=1}, -- plate legs
{itemid=2195, count=1}, -- boots of haste
{itemid=2528, count=1}, -- tower shield
{itemid=2432, count=1}, -- fire axe
{itemid=2407, count=1}, -- bright sword
{itemid=2436, count=1}, -- skull staff
{itemid=7620, count=1}, -- mp
{itemid=7588, count=1}, -- shp
{itemid=2273, count=1}, -- 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, 67708)
if hasReceivedFirstItems ~= 1 then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)
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 have recieved your first items!")
end
setPlayerStorageValue(cid, 67708, 1)
end
end
return TRUE
end
but the cap isnt a problem...chars do have cap, they start with 435 cap...can someone else tell me how to fix it?
<?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}, -- spellbook
{2457}, -- hat of the mad
{2463}, -- plate armor
{2647} -- plate legs
},
{ -- DRUID
{2182}, -- snakebite rod
{2525}, -- spellbook
{2457}, -- helmet
{2463}, -- plate armor
{2647} -- plate legs
},
{ -- PALADIN
{2389}, -- throwing knife
{2525}, -- dwarven shield
{2457}, -- steel helmet
{2463}, -- plate armor
{2647} -- ranger legs
},
{ -- KNIGHT
{2383}, -- spike sword
{2428}, -- orcish axe
{2422}, -- iron hammer
{2525}, -- dwarven shield
{2457}, -- steel helmet
{2463}, -- plate armor
{2647} -- plate legs
}
},
all_items = {
{2643}, -- leather boots
{2661} -- Necklace
},
extra_items = {
{2789, 20},
{2120},
{2554},
{7620,1}, -- small hp
{7618,1}, -- hp
},
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>