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

FirstItems. The Best '-'

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
i need one script (mods) first items :p
the first time the player enters the server, it adds items.

PS: the script speak was added items druid e etc :p ;


(add 25 platinium coins).

equal the emporia.vapus.net '-'
thx
 
-makr0 :hey man :D??
-unknown :what?
-makr0 :say bump for me??
-unknown :yep
- unknown : bring
up
my
post

-makr0 :thx
-unknown ::D
 
appers??
*PlayerName* you now have the first Sorcerer items.
or
*PlayerName* you now have the first Druid items.
or
*PlayerName* you now have the first Sample items.
or
*PlayerName* you now have the first Knight items.

--
nop '-'
 
Add this after 'setPlayerStorageValue(cid, storage, 1)'

Code:
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getCreatureName(cid) .. ", you now have the first " .. isSorcerer(cid) and "Sorcerer" or isDruid(cid) and "Druid" or isPaladin(cid) and "Paladin" or isKnight(cid) and "Knight" .. " items.")
 
Code:
			{ -- SORC
				{2190}, -- wand of vortex
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819}, -- mage robe
				{2464} -- chain armor
			},
			{ -- DRUID
				{2182}, -- snakebite rod
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819}, -- mage robe
				{2464} -- chain armor
			},
			{ -- PALADIN
				{2455}, -- crossbow
				{2544}, -- arrow
				{2463}, -- plate armor
				{2647}, -- plate legs
				{2457}, -- steel helment
				{2464} -- chain armor
			},
			{ -- KNIGHT
				{2409}, -- serpent sword
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			}
		},
		all_items = {
			{2643} -- leather boots
		},
		extra_items = {
			{2152, 25}

have one bug?

and mods version (what put arrow 100x)
 
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Darkhaos" contact="None" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		local items =
		{
			voc =
			{
				{
					{item = 2190}, -- wand of vortex
					{item = 2175}, -- spellbook
					{item = 8820}, -- mage hat
					{item = 8819} -- mage robe
				},
				{
					{item = 2182}, -- snakebite rod
					{item = 2175}, -- spellbook
					{item = 8820}, -- mage hat
					{item = 8819} -- mage robe
				},
				{
					{item = 2410}, -- throwing knife
					{item = 2530}, -- copper shield
					{item = 2480}, -- legion helmet
					{item = 2464} -- chain armor
				},
				{
					{item = 2409}, -- serpent sword
					{item = 2530}, -- copper shield
					{item = 2480}, -- legion helmet
					{item = 2464} -- chain armor
				}
			},
			all = {
				{item = 2468}, -- studded legs
				{item = 2643} -- leather boots
			},
			extra = {
				{item = 2789, count = 15},
				{item = 2120},
				{item = 5710}
			},
			knightWeapons = {
				{item = 2423}, -- clerical mace
				{item = 2429} -- barbarian axe
			}
		}

		local storage = 67777
		local c = nil
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

	function onLogin(cid)

		if(getCreatureStorage(cid, storage) < 1 then
			for i = 1, 4 do
				if getPlayerVocation(cid) == i then
					for t = 1, table.maxn(items.voc[i]) do
						c = 1
						if tonumber(items.voc[i][t].count) then
							c = items.voc[i][t].count
						end
						doPlayerAddItem(cid, items.voc[i][t].item, c)
					end
				end
			end

			for i = 1, table.maxn(items.all) do
				c = 1
				if tonumber(items.all[i].count) then
					c = items.all[i].count
				end
				doPlayerAddItem(cid, items.all[i].item, c)
			end
	
			for i = 1, table.maxn(items.extra) do
				c = 1
				if tonumber(items.extra[i].count) then
					c = items.extra[i].count
				end
				doPlayerAddItem(cid, items.extra[i].item, c)
			end

			if isKnight(cid) then
				for i = 1, table.maxn(items.knightWeapons) do
					c = 1
					if tonumber(items.knightWeapons[i].count) then
						c = items.extra[i].count
					end
					doPlayerAddItem(cid, items.knightWeapons[i].item, c)
				end
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received the " .. getVocationInfo(getPlayerVocation(cid)).name .. "'s first items.")
			doCreatureSetStorage(cid, storage, 1)
		end
		return true
	end
	]]></event>
</mod>
 
Back
Top