• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent 8.54 first items

Ausin

New Member
Joined
Apr 17, 2010
Messages
18
Reaction score
0
Hi, That's Items for lov lv! ;) Who do not tire, making the quest for, LOV lv why? How can ... Make the script, First items?
Tested on TFS AND EVO BY MANIUCZKA

here is the scripts!
Do creaturescripts.xml
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

Do Login.lua

registerCreatureEvent(cid, "FirstItems")

And Doing script called firstitems.lua

function onLogin(cid)
if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50002) == -1 then
if isSorcerer(cid) then
local bag = doPlayerAddItem(cid, 1988, 1)

doAddContainerItem(bag, 2120, 1) -- Rope
doAddContainerItem(bag, 2554, 1) -- shovel
doAddContainerItem(bag, 2152, 100) -- 50 platinum coints

doPlayerAddItem(cid, 2175, 1) -- spellbook
doPlayerAddItem(cid, 2190, 1) -- wand of wortex
doPlayerAddItem(cid, 2463, 1) -- p armor
doPlayerAddItem(cid, 2490, 1) -- dark helmet
doPlayerAddItem(cid, 2647, 1) -- p legs
doPlayerAddItem(cid, 2643, 1) -- leather boots
doPlayerAddItem(cid, 2173, 1) -- amulet of loss
doPlayerAddItem(cid, 2273, 1) -- UH
doPlayerAddItem(cid, 2672, 100) -- DHam

setPlayerStorageValue(cid, 50002, 1)

elseif isDruid(cid) then
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2120, 1) -- rope
doAddContainerItem(bag, 2554, 1) -- shovel
doAddContainerItem(bag, 2152, 100) -- 50 platinum coins

doPlayerAddItem(cid, 2175, 1) -- spellbook
doPlayerAddItem(cid, 2182, 1) -- snakebite rod
doPlayerAddItem(cid, 2463, 1) -- p armor
doPlayerAddItem(cid, 2490, 1) -- dark helmet
doPlayerAddItem(cid, 2647, 1) -- p legs
doPlayerAddItem(cid, 2643, 1) -- leather boots
doPlayerAddItem(cid, 2173, 1) -- amulet of loss
doPlayerAddItem(cid, 2273, 1) -- UH
doPlayerAddItem(cid, 2672, 100) -- DHam

setPlayerStorageValue(cid, 50002, 1)

elseif isPaladin(cid) then
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2120, 1) -- rope
doAddContainerItem(bag, 2554, 1) -- shovel
doAddContainerItem(bag, 2152, 100) -- 50 platinum coins

doPlayerAddItem(cid, 2389, 1) -- spear
doPlayerAddItem(cid, 2456, 1) -- bow
doPlayerAddItem(cid, 2544, 100) -- 100 arrows
doPlayerAddItem(cid, 2463, 1) -- p armor
doPlayerAddItem(cid, 2490, 1) -- dark helmet
doPlayerAddItem(cid, 2647, 1) -- p legs
doPlayerAddItem(cid, 2643, 1) -- leather boots
doPlayerAddItem(cid, 2173, 1) -- amulet of loss
doPlayerAddItem(cid, 2273, 1) -- UH
doPlayerAddItem(cid, 2672, 100) -- DHam

setPlayerStorageValue(cid, 50002, 1)

elseif isKnight(cid) then
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2120, 1) -- rope
doAddContainerItem(bag, 2554, 1) -- shovel
doAddContainerItem(bag, 2152, 100) -- 50 platinum coins
doAddContainerItem(bag, 2439, 1) -- daramanian mace
doAddContainerItem(bag, 8601, 1) -- steel axe

doPlayerAddItem(cid, 2509, 1) -- steel shield
doPlayerAddItem(cid, 8602, 1) -- jagged sword
doPlayerAddItem(cid, 2463, 1) -- p armor
doPlayerAddItem(cid, 2490, 1) -- dark helmet
doPlayerAddItem(cid, 2647, 1) -- p legs
doPlayerAddItem(cid, 2643, 1) -- leather boots
doPlayerAddItem(cid, 2173, 1) -- amulet of loss
doPlayerAddItem(cid, 2273, 1) -- UH
doPlayerAddItem(cid, 2672, 100) -- DHam

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

I think that I helped Please comment
 
You dont need to register onLogin scripts, since only players can login it is auto registered..
 
nope, he should use loops.
anyways this is totally useless, we got better ones around there, as mods too
 
0.3.6pl1 or 0.4 -

This is my latest first items that I have been using, it works perfectly, even in the correct slots.

Enjoy! :thumbup:

Code:
local storage = 64770
function onLogin(cid)
	local config = {
		voc_items = {
			{ -- SORC
				{2190}, -- wand of vortex
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- DRUID
				{2182}, -- snakebite rod
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- PALADIN
				{2410}, -- throwing knife
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			},
			{ -- KNIGHT
				{2409}, -- serpent sword
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			}
		},
		all_items = {
			{2468}, -- studded legs
			{2643} -- leather boots
		},
		extra_items = { -- IN BP
			{2789, 15}, -- brown mushroom
			{2120}, -- rope
			{5710} -- light shovel
		},
		knight_weapons = { -- IN BP
			{2423}, -- clerical mace
			{2429} -- barbarian 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

How to Edit! Remember the comma's!

Code:
{2468}, -- studded legs
{2643} -- leather boots

If the item itself is single, there is no need to put a count. However if you take a look at the brown mushrooms (inside the script) you will notice it says {2789, 15}.

I have configured this to make a count optional.
If you do not put a number, it will add only a single item.


Good luck.
 
Last edited:
This is my latest first items that I have been using, it works perfectly, even in the correct slots.

Enjoy! :thumbup:

data/creaturescripts/scripts/firstitems.lua
Code:
local storage = 64770
function onLogin(cid)
	local config = {
		voc_items = {
			{ -- SORC
				{2190}, -- wand of vortex
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- DRUID
				{2182}, -- snakebite rod
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- PALADIN
				{2410}, -- throwing knife
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			},
			{ -- KNIGHT
				{2409}, -- serpent sword
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			}
		},
		all_items = {
			{2468}, -- studded legs
			{2643} -- leather boots
		},
		extra_items = { -- IN BP
			{2789, 15}, -- brown mushroom
			{2120}, -- rope
			{5710} -- light shovel
		},
		knight_weapons = { -- IN BP
			{2423}, -- clerical mace
			{2429} -- barbarian 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
Nice script, but doesn't this go in the mod folder?
 
Nope, I don't use mods. It can be "modified" into one.

Added tutorial for beginner's, of course.
 
Back
Top