• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

First items

Gorbanked

New Member
Joined
Aug 27, 2008
Messages
39
Reaction score
0
I just wanna know how i can changebthe first items with moder acc, if someone put a example it will be amazing!
 
Creaturescripts - Scripts. Save as firstitems.lua
LUA:
function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			local bag = doPlayerAddItem(cid, 9774, 1)
	
			doAddContainerItem(bag, 2120, 1)
			doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
		
			doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2190, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 2643, 1)

		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			local bag = doPlayerAddItem(cid, 9774, 1)
			doAddContainerItem(bag, 2120, 1)
			doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
		
			doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2182, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 2643, 1)

			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			local bag = doPlayerAddItem(cid, 9774, 1)
			doAddContainerItem(bag, 2120, 1)
			doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
		
			doPlayerAddItem(cid, 2389, 3)
			doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2643, 1)
			doPlayerAddItem(cid, 2647, 1)
                  doPlayerAddItem(cid, 2463, 1)
			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			local bag = doPlayerAddItem(cid, 9774, 1)
			doAddContainerItem(bag, 2120, 1)
			doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
			doAddContainerItem(bag, 8601, 1)
		
	            doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 2643, 1)

			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end

Creaturescripts.xml
XML:
	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

This is what i use, I find it easier but you can edit it pretty easily.
 
I got this in firstitems mod
<?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="buffer"><![CDATA[
domodlib('firstitems_config')
if(getPlayerStorageValue(cid, config.storage) > 0) then
return
end

for _, id in ipairs(config.items) do
doPlayerAddItem(cid, id, 1)
end

if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
end

doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
setPlayerStorageValue(cid, config.storage, 1)
]]></event>
</mod>

what i should change?
 
Code:
<?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 = {
['druid'] = { write itemids here},
['sorcerer'] = { write itemids here},
['knight'] = {write itemids here},
['paladin'] = {write itemids here}
}
}
]]></config>
<event type="login" name="FirstItems" event="buffer"><![CDATA[
domodlib('firstitems_config')
if(getPlayerStorageValue(cid, config.storage) > 0) then
return
end

for _, id in ipairs(config.items[getPlayerVocationName(cid)]) do
doPlayerAddItem(cid, id, 1)
end

if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
end

doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
setPlayerStorageValue(cid, config.storage, 1)
]]></event>
</mod>

Have never tried it... but should work

you need to edit the items for each vocation..
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
<config name="firstitems_config"><![CDATA[
STORAGE = 30002
commonItems = {
{itemid=2160, count=3, inContainer = true}, -- 2 platinum coins
{itemid=2643} -- leather boots
}
firstItems = {
{ -- Sorcerer
{itemid=1988}, -- backpack
{itemid=2525}, -- dwarven shield
{itemid=2190}, -- wand of vortex
{itemid=2463}, -- plate armor
{itemid=2457}, -- steel helmet
{itemid=2647} -- plate legs
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=2525}, -- dark shield
{itemid=2182}, -- snakebite rod
{itemid=2463}, -- plate armor
{itemid=2457}, -- steel helmet
{itemid=2647} -- plate legs
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=2525}, -- dark shield
{itemid=2389, count=3}, -- 3 spears
{itemid=2463}, -- plate armor
{itemid=2457}, -- steel helmet
{itemid=2647} -- plate legs
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=2525}, -- dark shield
{itemid=2394}, -- morning star
{itemid=2428, inContainer = true},
{itemid=2383, inContainer = true},
{itemid=2463}, -- plate armor
{itemid=2457}, -- steel helmet
{itemid=2647} -- plate legs
}
}
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')

for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end

function onLogin(cid)
if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
if isItemContainer(v.itemid) then
backpack = doPlayerAddItem(cid, v.itemid, 1)
elseif v.inContainer then
doAddContainerItem(backpack, v.itemid, v.count or 1)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end
setPlayerStorageValue(cid, STORAGE, 1)
end
return true
end
]]></event>
</mod>
 
Back
Top