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

CreatureEvent Start/First items!!

Xon vanetta

Hurr ...... DURRRRRRRRRRRRRRRR
Joined
Dec 29, 2010
Messages
3,166
Reaction score
112
Location
Winterland
This is My script for Start items.
not 100% made by me.
i post it cuz i only found 1 with a working start script :P

add in Data/creaturescipts.xml
XML:
<event type="login" name="FirstItems" script="firstitems.lua"/>

make a new lua and call it "firstitems.lua" and put this inside data\creaturescripts\scripts.

and this shuold be in the firstitems.lua file

LUA:
local firstKnight =
{
		2647, -- Plate Legs --
		2465, -- Brass Armor --
		2643, -- Leather Boots --
		2525, -- Dwarven Sheild --
		2490  -- Dark Helmet --
}
local firstPaladin =
{
		2660, -- Ranger's Cloak -- 
		8923, -- Ranger's Legs --
		2490, -- Dark Helmet --
		2643, -- Leather Boots --
		2525  -- Dwarven Sheild --
}
local firstDruid =
{
		2643, -- Leather Boots --
		2175, -- Spellbook --
		2490, -- Dark Helmet --
		8819, -- Magician's Robe --
		2478, -- Brass Legs --
		2182  -- Snakebite Rod -- 
}
local firstSorcerer =
{
		2643, -- Leather Boots --
		2175, -- Spellbook --
		8819, -- Magician's Robe -- 
		2478, -- Brass Legs --
		2190, -- Wand Of Vortex -- 
		2490  -- Dark Helmet --
}


function onLogin(cid)

	if getPlayerStorageValue(cid, 30001) == -1 then
	local bag = doPlayerAddItem(cid, 1988, 1) -- Backpack --
		if getPlayerVocation(cid) == 4 then -- if player is knight --
			for i = 1, table.maxn(firstKnight) do
				doPlayerAddItem(cid, firstKnight[i], 1)
			end
			doAddContainerItem(bag, 8209 , 1) -- Sword --
			doAddContainerItem(bag, 2429 , 1) -- Axe -- 
			doAddContainerItem(bag, 2423 , 1) -- Club --
		
		end
		if getPlayerVocation(cid) == 3 then  -- if player is paladin --
			for i = 1, table.maxn(firstPaladin) do
				doPlayerAddItem(cid, firstPaladin[i], 1)
				end
			doAddContainerItem(bag, 2389, 10) -- 10 Spears in bag --		
		end	
		if getPlayerVocation(cid) == 2 then -- if player is druid --
			for i = 1, table.maxn(firstDruid) do
				doPlayerAddItem(cid, firstDruid[i], 1)
			end
		end
		
		if getPlayerVocation(cid) == 1 then -- if player is sorcerer --
			for i = 1, table.maxn(firstSorcerer) do
				doPlayerAddItem(cid, firstSorcerer[i], 1)

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


comments? :D
 
Mod :
HTML:
<?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 = {2237, 2382}
		}
	]]></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

			doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 2)
			setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
	]]></event>
</mod>

http://otland.net/f163/mod-first-items-99737/
 
Back
Top