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

[Release] First Items {onLogin}

Awesome Slayer

New Member
Joined
Jul 16, 2008
Messages
58
Reaction score
0
Hi this is my very first solo script i know for the experienced scripters this is a piece of cake but for me not so easy.... anyway here it is...

Code:
local firstItems =
{
	2173,
	2457,
	7463,
	2160,
	2525,
	2647,
	2544,
	2643
}

function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) == -1 then
		for i = 1, table.maxn(firstItems) do
			doPlayerAddItem(cid, firstItems[i], 1)
		end

		local bag = doPlayerAddItem(cid, 1988, 1)
		doAddContainerItem(bag, 5710, 1)
		doAddContainerItem(bag, 7731, 1)
		doAddContainerItem(bag, 1984, 1)
		doAddContainerItem(bag, 2456, 1)
		doAddContainerItem(bag, 2190, 1)
		doAddContainerItem(bag, 2182, 1)
		doAddContainerItem(bag, 2409, 1)
		setPlayerStorageValue(cid, 30001, 1)
	end
 	return TRUE
end

this goes in data\creaturescripts\scripts\firstitems.lua just open the file and paste this over whats in there :D

Whats it does:-
when you log in for the first time (after making your character) it will give you a mammoth fur cape, plate legs, aol, dwarven shield, 1 cc, leather boots, steel helmet, arrow and a bp with elvenhair rope, light shovel, blue tome(is spellbook in my server), serpent sword, snakebite rod, wand of vortex and a bow :D
 
Last edited:
Can you label the ID's?
(I can do it myself, but looking up what each ID is, Pain in the Ass.)

Example:
Code:
local firstItems =
{
	2173, -- (Item Name Here)
	2457, -- (Item Name Here)
	7463, -- (Item Name Here)
	2160, -- (Item Name Here)
	2525, -- (Item Name Here)
	2647, -- (Item Name Here)
	2544, -- (Item Name Here)
	2643 -- (Item Name Here)
}
So people can edit the items easily.
Thanks.
 
Instead of:
Code:
		local bag = doPlayerAddItem(cid, 1988, 1)
		doAddContainerItem(bag, 5710, 1)
		doAddContainerItem(bag, 7731, 1)
		doAddContainerItem(bag, 1984, 1)
		doAddContainerItem(bag, 2456, 1)
		doAddContainerItem(bag, 2190, 1)
		doAddContainerItem(bag, 2182, 1)
		doAddContainerItem(bag, 2409, 1)

You can make another table, lets call it inBp, and then:
Top of the script:
Code:
    local inBp = {
        5710, 7731, 1984, 2456, 2190, 2182, 2409
    }
and replace addcontainer lines with:
Code:
    local bag = doPlayerAddItem(cid, 1988, 1)
    for i = 1, table.maxn(inBp) do
        doAddContainerItem(bag, inBp[i], 1)
    end
 
Try putting it below the items which should actually end up at the hand spots.
 
just leave the id 2160 before the plaet legs id then no have problem :D

sorry to whoever i said id write the names into the script for got busy, still busy so....
 
I had problem's forever with having no eqipment when people logged on this helped me so much you are my fucking savior xD


<333
 
I created a script on this type to:

function onLogin(cid)
if getPlayerStorageValue(cid, 300) == -1 then
vargotitens = getPlayerVocation(cid)
end
if vargotitens == 1 then
doPlayerAddItem(cid, 8819, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2662, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 2 then
doPlayerAddItem(cid, 8819, 1)
doPlayerAddItem(cid, 2662, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2182, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 3 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2389, 6)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2481, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 4 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2481, 1)
doPlayerAddItem(cid, 8602, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
end
if vargotitens == 5 then
setPlayerStorageValue(cid, 300, 1)
end
return TRUE
end

I maked a script with this to give items according with the vocation, cool huh???
 
I created a script on this type to:

function onLogin(cid)
if getPlayerStorageValue(cid, 300) == -1 then
vargotitens = getPlayerVocation(cid)
end
if vargotitens == 1 then
doPlayerAddItem(cid, 8819, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2662, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 2 then
doPlayerAddItem(cid, 8819, 1)
doPlayerAddItem(cid, 2662, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2182, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 3 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2389, 6)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2481, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 4 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2481, 1)
doPlayerAddItem(cid, 8602, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
end
if vargotitens == 5 then
setPlayerStorageValue(cid, 300, 1)
end
return TRUE
end

I maked a script with this to give items according with the vocation, cool huh???

Code:
local items = { 
	[1] = { 8819, 8820, 2468, 2509, 2643, 2190 },
	[2] = { 8819, 8820, 2468, 2509, 2643, 2182 },
	[3] = { 2509, 2643, 8923, 8892, 2481, 2389 },
	[4] = { 2643, 2478, 2465, 2481, 2509 }
}
function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) == -1 then
		for voc, item in pairs(items) do
			if getPlayerVocation(cid) == voc then
				local container = doPlayerAddItem(cid, 1988, 1)
				for i = 1, table.maxn(item) do
					doAddContainerItem(container, item[i], 1)
				end
				setPlayerStorageValue(cid, 30001, 1)
			end
		end
	end
	return TRUE
end

Cooler, huh?
 
very nice but what if u want items to appear in the bps (different items per voc)?

like e.g
Knight: plate armor, plate legs, steel helmet, spike sword, dwarven shield, leather boots, backpack
inside bp: knight axe, fire sword, skull staff, uh, 1cc

Sorcerer: x armor, x legs, x shield, x wand, leather boots, backpack
inside bp: sd, 1cc

Druid: x armor, x legs, x shield, x rod, leather boots, backpack
inside bp: sd, 1cc

Paladin: x armor, x legs, x shield, x wand, leather boots, backpack
inside bp: sd, uh, 1cc, spear

xD
 
Last edited:
I created a script on this type to:

function onLogin(cid)
if getPlayerStorageValue(cid, 300) == -1 then
vargotitens = getPlayerVocation(cid)
end
if vargotitens == 1 then
doPlayerAddItem(cid, 8819, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2662, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 2 then
doPlayerAddItem(cid, 8819, 1)
doPlayerAddItem(cid, 2662, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2182, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 3 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2389, 6)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2481, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
elseif vargotitens == 4 then
doPlayerAddItem(cid, 2465, 1)
doPlayerAddItem(cid, 2510, 1)
doPlayerAddItem(cid, 2481, 1)
doPlayerAddItem(cid, 8602, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2468, 1)
doPlayerAddItem(cid, 1988, 1)
vargotitens = 5
end
if vargotitens == 5 then
setPlayerStorageValue(cid, 300, 1)
end
return TRUE
end

I maked a script with this to give items according with the vocation, cool huh???


Yes very cool!!
 
Code:
local items = { 
	[1] = { 8819, 8820, 2468, 2509, 2643, 2190 },
	[2] = { 8819, 8820, 2468, 2509, 2643, 2182 },
	[3] = { 2509, 2643, 8923, 8892, 2481, 2389 },
	[4] = { 2643, 2478, 2465, 2481, 2509 }
}
function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) == -1 then
		for voc, item in pairs(items) do
			if getPlayerVocation(cid) == voc then
				local container = doPlayerAddItem(cid, 1988, 1)
				for i = 1, table.maxn(item) do
					doAddContainerItem(container, item[i], 1)
				end
				setPlayerStorageValue(cid, 30001, 1)
			end
		end
	end
	return TRUE
end

Cooler, huh?


Yes, much cooler =)
 
This is going to be useful for me since I use TFS 3.0 and I can't find any AAC for this one around..
 
Back
Top