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

Starting items

helvetti

New Member
Joined
Oct 16, 2008
Messages
115
Reaction score
0
Location
Finland
Can anyone make me script in the mod/firstitems.xml
knights get:
plate armor - 2463
plate legs - 2647
steel helmet - 2457
dark shield - 2521
morning star - 2394
leather boots - 2643

Druids get:
magician's robe - 8819
blue legs - 7730
snakebite rod - 2182
dark shield - 2521
leather boots - 2643
mage hat - 8820

Sorcerer gets same but
weapon: wand of vortex - 2190

Paladin get:
3spears - 2389
plate legs - 2647
plate armor - 2463
steel helmet - 2457
dark shield - 2521
leather boots - 2643

and all gets backpack wich includes 3cc - 2160
backpack - 1988

Im using TFS 0.3.6
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		STORAGE = 30001
		commonItems = {
			{itemid=2160, count=3, inContainer = true}, -- 2 platinum coins
			{itemid=2643} -- leather boots
		}
		firstItems = {
			{ -- Sorcerer	
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2190}, -- wand of vortex
				{itemid=8819}, -- magician's robe
				{itemid=8820}, -- mage hat
				{itemid=7730}  -- blue legs
			},
			{ -- Druid
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2182}, -- snakebite rod
				{itemid=8819}, -- magician's robe
				{itemid=8820}, -- mage hat
				{itemid=7730}  -- blue legs
			},
			{ -- Paladin
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2389, count=3}, -- 3 spears
				{itemid=2463}, -- plate armor
				{itemid=2457}, -- steel helmet
				{itemid=2647}  -- plate legs
			},
			{ -- Knight
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2394}, -- morning star
				{itemid=2463}, -- plate armor
				{itemid=2457}, -- steel helmet
				{itemid=2647}  -- plate legs
			}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

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

		function onLogin(cid)
			if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
				for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
					if isItemContainer(v.itemid) then
						backpack = doPlayerAddItem(cid, v.itemid, 1)
					elseif v.inContainer then
						doAddContainerItem(backpack, v.itemid, v.count or 1)
					else
						doPlayerAddItem(cid, v.itemid, v.count or 1)
					end
				end
				setPlayerStorageValue(cid, STORAGE, 1)
			end
			return true
		end
	]]></event>
</mod>
 
Back
Top