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

I want the starter gear to be difference

Samuro

GameDev
Joined
Aug 7, 2007
Messages
1,845
Reaction score
571
Location
Sweden
Well ask you read on the title I want new starter gear for new characters

Im using TFS 2.5.0 Mystic Spirit
With an in-game account manager
 
Thanks, but I dont think it worked


"Warning: [Event::checkScript] Can not load script. /scripts/firstitems.lua
/data/creaturescripts/scripts/firstitems.lua: 'end' expected (to close to 'function' at line 37) near '"

I did change return true to return TRUE
 
local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2480, count=1}, -- legion helmet
{itemid=2464, count=1}, -- chain armor
{itemid=2468, count=1}, -- studded legs
{itemid=2643, count=1}, -- leather boots
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1} -- shovel
}

local firstItems = {
{ -- SORC ITEMS
{itemid=2190, count=1}, -- wand of vortex
{itemid=2175, count=1} -- spellbook
},
{ -- DRUID ITEMS
{itemid=2182, count=1}, -- snakebite rod
{itemid=2175, count=1} -- spellbook
},
{ -- PALADIN ITEMS
{itemid=2456, count=1}, -- bow
{itemid=2544, count=100} -- 100 arrows
},
{ -- KNIGHT ITEMS
{itemid=2412, count=1}, -- katana
{itemid=2530, count=1} -- copper shield
}
}

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

local storage = 35353
function onLogin(cid)
if getPlayerGroupId(cid) < 3 then
local receivedItems = getPlayerStorageValue(cid, storage)
if receivedItems == -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, storage, 1)
end
return TRUE
end
 
Code:
local commonItems = {
	-- ITEMS ALL VOCS RECEIVE
	{itemid=2480}, -- legion helmet
	{itemid=2464}, -- chain armor
	{itemid=2468}, -- studded legs
	{itemid=2643}, -- leather boots
	{itemid=2120}, -- rope
	{itemid=5710} -- shovel
}

local firstItems = {
	{ -- SORC ITEMS
		{itemid=2190}, -- wand of vortex
		{itemid=2175} -- spellbook
	},
	{ -- DRUID ITEMS
		{itemid=2182}, -- snakebite rod
		{itemid=2175} -- spellbook
	},
	{ -- PALADIN ITEMS
		{itemid=2456}, -- bow
		{itemid=2544, count=100} -- 100 arrows
	},
	{ -- KNIGHT ITEMS
		{itemid=2412}, -- katana
		{itemid=2530} -- copper shield
	}
}

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

local storage = 35353
function onLogin(cid)
	if getPlayerGroupId(cid) < 2 and getPlayerStorageValue(cid, storage) < 1 then
		--[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)
		local giveItems = firstItems[getPlayerVocation(cid)]
		if giveItems 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, storage, 1)
	end
	return TRUE
end
 
Back
Top