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

About "firstitems" with crying damson

Status
Not open for further replies.

zkum

corruption
Joined
May 9, 2009
Messages
2,300
Reaction score
53
Location
Sweden
Hello, as you all know the new version of crying damson has been released with some nice futures. A new folder called mods is pretty nice, there is one script there called "firstitems". That script gives you start item when you logout, but i cant make it work ;/
please help

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 = {1988, 2789}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

		function onLogin(cid)
			if(getPlayerStorageValue(cid, config.storage) > 0) then
				return true
			end

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

			if(getPlayerVocation(cid) == Knight) then
				doPlayerAddItem(cid, 2409, 1)
				doPlayerAddItem(cid, 2513, 1)
				doPlayerAddItem(cid, 2481, 1)
				doPlayerAddItem(cid, 2465, 1)
				doPlayerAddItem(cid, 2648, 1)
				doPlayerAddItem(cid, 2643, 1)
				doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2789, 10)
				doPlayerAddItem(cid, 2428, 1)
				doPlayerAddItem(cid, 2394, 1)
			elseif (getPlayerVocation(cid) == Paladin) then
				doPlayerAddItem(cid, 2389, 5)
				doPlayerAddItem(cid, 2529, 1)
				doPlayerAddItem(cid, 2480, 1)
				doPlayerAddItem(cid, 2660, 1)
				doPlayerAddItem(cid, 2507, 1)
				doPlayerAddItem(cid, 2643, 1)
				doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2789, 10)
			elseif (getPlayerVocation(cid) == Druid) then
				doPlayerAddItem(cid, 2182, 1)
				doPlayerAddItem(cid, 2175, 1)
				doPlayerAddItem(cid, 8820, 1)
				doPlayerAddItem(cid, 8819, 1)
				doPlayerAddItem(cid, 2468, 1)
				doPlayerAddItem(cid, 2643, 1)
				doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2789, 10)
			elseif (getPlayerVocation(cid) == Sorcerer) then
				doPlayerAddItem(cid, 2190, 1)
				doPlayerAddItem(cid, 2175, 1)
				doPlayerAddItem(cid, 8820, 1)
				doPlayerAddItem(cid, 8819, 1)
				doPlayerAddItem(cid, 2468, 1)
				doPlayerAddItem(cid, 2643, 1)
				doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2789, 10)
			end

			setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
	]]></event>
</mod>

I want so you start with the items (as you can see in the code) for based on vocation. plx help.

+rep
regards, zkum
 
Test this one, I got it here from otland but cannot remember the maker of it :P, so I won't be able to give credits ^^

LUA:
local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2459, count=1}, -- iron helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=2643, count=1}, -- leather boots
{itemid=2160, count=2}, -- crystal coin
{itemid=2173, count=1}, -- aol
{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=8602, count=1}, -- jagged sword
{itemid=2439, count=1}, -- daramanian mace
{itemid=8601, count=1}, -- steel axe
{itemid=2525, count=1} -- dwarven shield
}
}

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 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems ~= 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, 67708, 1)
end
end
return TRUE
end
 
Test this one, I got it here from otland but cannot remember the maker of it :P, so I won't be able to give credits ^^

LUA:
local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2459, count=1}, -- iron helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=2643, count=1}, -- leather boots
{itemid=2160, count=2}, -- crystal coin
{itemid=2173, count=1}, -- aol
{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=8602, count=1}, -- jagged sword
{itemid=2439, count=1}, -- daramanian mace
{itemid=8601, count=1}, -- steel axe
{itemid=2525, count=1} -- dwarven shield
}
}

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 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems ~= 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, 67708, 1)
end
end
return TRUE
end

its JDB's?'
http://otland.net/f82/new-first-items-40857/
yea but i want it when you login, not that u have to click on a chest and u get ur items ._. thx anyway
 
Ye it was JDB's :P I didnt had time to look it up so... the credits goes to JDB for it ;) But that script is for firstitems.lua and when you login you will get the items directly without clicking chests
 
Ye it was JDB's :P I didnt had time to look it up so... the credits goes to JDB for it ;) But that script is for firstitems.lua and when you login you will get the items directly without clicking chests

oh! i see know, lolz xD thx. :)
+rep!
 
Test this one, I got it here from otland but cannot remember the maker of it :P, so I won't be able to give credits ^^

LUA:
local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2459, count=1}, -- iron helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=2643, count=1}, -- leather boots
{itemid=2160, count=2}, -- crystal coin
{itemid=2173, count=1}, -- aol
{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=8602, count=1}, -- jagged sword
{itemid=2439, count=1}, -- daramanian mace
{itemid=8601, count=1}, -- steel axe
{itemid=2525, count=1} -- dwarven shield
}
}

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 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems ~= 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, 67708, 1)
end
end
return TRUE
end

Code:
[08/08/2009 15:08:07] Loading firstitems.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/firstitems.xml
[08/08/2009 15:08:07] Line: 1, Info: Start tag expected, '<' not found
[08/08/2009 15:08:07] failed!

Didnt worked with that code :( helpz
 
Code:
[08/08/2009 15:08:07] Loading firstitems.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/firstitems.xml
[08/08/2009 15:08:07] Line: 1, Info: Start tag expected, '<' not found
[08/08/2009 15:08:07] failed!

Didnt worked with that code :( helpz

Because it isnt a mod;( you need to make that:)
 
Status
Not open for further replies.
Back
Top