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

First Items.. Please help :D

Winnerandy

Experienced Web Design'er
Joined
Oct 23, 2008
Messages
2,251
Reaction score
51
Location
Tellus.
Okey, I want a script that gives vocs from 1-4 different items at the first login after character creation.. I can't find the script in this forum.. So can anybody give me the script/create :D

REP++ for the one who makes the script!
 
Okey, I want a script that gives vocs from 1-4 different items at the first login after character creation.. I can't find the script in this forum.. So can anybody give me the script/create :D

I didnt understood what you ment with "gives vocs from 1-4 different items", but well :p

This is a simplified version from the one I currently use:

(mod version)
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.2" author="TFS (Modified by Guitar Freak)" contact="http://otland.net/members/Guitar-Freak" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 30301,
			items = {123, 117, 112, 113, 110, 115, 114}		-- Generic EQ (i.e Helmet, Armor, Legs, Boots, etc), all vocs will receive them.
		}
		
		weapons = {
		
			sorcerer	= {130},
			druid		= {131},
			paladin		= {135},
			knight		= {140, 141, 142}
		
		}
		
	]]></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
			
			if getCreatureName(cid) ~= "Account Manager" then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome " .. getCreatureName(cid) .. "! You have obtained some items to start out.")
			end

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

			if isFemale(cid) then
				doPlayerAddItem(cid, 121, 1)
			else
				doPlayerAddItem(cid, 111, 1)
			end

		local BP = doPlayerAddItem(cid, 1988, 1)
		
		if isSorcerer(cid) then
			doAddContainerItem(BP, weapons.sorcerer, 1)
		elseif isDruid(cid) then
			doAddContainerItem(BP, weapons.druid, 1)
		elseif isPaladin(cid) then
			doAddContainerItem(BP, weapons.paladin, 1)
		elseif isKnight(cid) then
			for _, it in ipairs(weapons.knight) do
				doAddContainerItem(BP, it, 1)
			end
		end
		
	setPlayerStorageValue(cid, config.storage, 1)
	return true
end
	]]></event>
</mod>

What that one does is that it adds a "generic" equipment to all the vocations, but the weapon received is different to each. Is that what you ment?

Btw, this can probably be scripted cleaner and not so messy as mine but well, it works :peace:
 
Last edited:
Back
Top