• 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!

The Best beginner items firstitems.lua

Ravauvial

Member
Joined
Mar 19, 2009
Messages
186
Reaction score
8
Location
Stanwood, Washington, USA
File name: firstitems.lua
Location: data\creaturescripts\scripts
Version: 8.4

Code:
local firstItems_storage = 30001
local commonItems = {
	{itemid=2554, inContainer = TRUE}, -- shovel
	{itemid=2120, inContainer = TRUE}, -- rope
	{itemid=2160, count=2, inContainer = TRUE}, -- 2 crystal coins
}
local firstItems = {
	{ -- Sorcerer 
		{itemid=8820}, -- mage hat
		{itemid=2173}, -- AOL
		{itemid=8819}, -- magician's robe
		{itemid=2530}, -- copper shield
		{itemid=2190}, -- wand of vortex
		{itemid=2468}, -- studded legs
		{itemid=2216}, -- ring of healing
		{itemid=2175}, -- spellbook
		{itemid=2643}, -- leather boots
		{itemid=1988, container = TRUE} -- backpack
	},
	{ -- Druid
		{itemid=8820}, -- mage hat
		{itemid=2173}, -- AOL
		{itemid=8819}, -- magician's robe
		{itemid=2530}, -- copper shield
		{itemid=2182}, -- snakebite rod
		{itemid=2468}, -- studded legs
		{itemid=2216}, -- ring of healing
		{itemid=2175}, -- spellbook
		{itemid=2643}, -- leather boots
		{itemid=1988, container = TRUE} -- backpack
	},
	{ -- Paladin
		{itemid=2481}, -- soldier helmet
		{itemid=2173}, -- AOL
		{itemid=2660}, -- ranger cloak
		{itemid=2456}, -- bow
		{itemid=8923}, -- ranger legs
		{itemid=2216}, -- ring of healing
		{itemid=2544, count = 100}, -- 100 arrows
		{itemid=2643}, -- leather boots
		{itemid=1988, container = TRUE} -- backpack
	},
	{ -- Knight
		{itemid=2481}, -- soldier helmet
		{itemid=2173}, -- AOL
		{itemid=2439, inContainer = TRUE}, -- daramanian mace
		{itemid=8601, inContainer = TRUE}, -- steel axe
		{itemid=2465}, -- brass armor
		{itemid=2509}, -- steel shield
		{itemid=8602}, -- jagged sword
		{itemid=2478}, -- brass legs
		{itemid=2216}, -- ring of healing
		{itemid=2643}, -- leather boots
		{itemid=1988, container = TRUE} -- backpack
	}
}

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 and getPlayerStorageValue(cid, firstItems_storage) <= 0 then
		local currvoc = getPlayerVocation(cid)
		local vocation = 5 > currvoc and currvoc or currvoc - 4
		local giveItems = firstItems[vocation]
	if giveItems then
		for _, v in ipairs(giveItems) do
	if v.container == TRUE then
		backpack = doPlayerAddItem(cid, v.itemid, 1)
	elseif v.inContainer == TRUE then
		doAddContainerItem(backpack, v.itemid, v.count or 1)
	else
		doPlayerAddItem(cid, v.itemid, v.count or 1)
		end
	end
end
setPlayerStorageValue(cid, firstItems_storage, 1)
end
return TRUE
end

The trick is this has to be in this order to insert into correct slots.
helmet, neckles, armor, right hand, left hand, leggs, ring, arrows, boots
 
1st post on OTfans
OTServ: Beginner Items - OpenTibia Fans

1st post on OTland
http://otland.net/f16/beginner-items-57088/
Cykotitan This is all you posted I had to figure it out on my own Quote: data/creaturescripts/scripts/firstitems.lua
and yes I will give you credit for pointing me in the right direction... Thanks
Read your post befor you slam.

By the way I just posted this to help other people from going through what I had to to get it to work properly.

also I did a search and couldn't find your name on any firstitem.lua, please give me a link that I can look at. still I did create this on my own.
 
Last edited:
Back
Top