CA

Como Adicionar Items Nos Players?

Por caverna, 19 de abr. de 2010 em Archived

7
1k
cavernaC
19 de abril de 2010 às 15:17

Fala galera, queria saber como adiciona items para os players, pois quando crio um novo personagem, ele vem sem itens. Tem como ajudar ai?

dragonlordeD
19 de abril de 2010 às 15:23

Isso é no firstitems.lua

Vou deixar o script do Magus aqui:

local firstItems =
{
[0] = { -- No-vocation (sem vocação)
	2398, -- Mace
	2512, -- Wooden Shield
	2649, -- Leather Legs
	2170, -- Silver Amulet
	2461, -- Leather Helmet
	2467, -- Leather Armor
	2643, -- Leather Boots
},

[1] = { --Sorcerer
	2525, -- Shield
	2190, -- Weapon
	2661, -- Necklace
	2457, -- Helmet
	2463, -- Armor
	2647, -- Legs
	2643 -- Boots
},

[2] = { --Druid
	2525, -- Shield
	2182, -- Weapon
	2661, -- Necklace
	2457, -- Helmet
	2463, -- Armor
	2647, -- Legs
	2643 -- Boots
},

[3] = { --Paladin
	2455, -- Weapon
	{2543,100}, -- Ammunition,Count
	2661, -- Necklace
	2457, -- Helmet
	2463, -- Armor
	2647, -- Legs
	2643 -- Boots
},

[4] = { --Knight
	2383, -- Weapon (Sword)
	2428, -- Weapon (Axe)
	2422, -- Weapon (Club)
	2525, -- Shield
	2661, -- Necklace
	2457, -- Helmet
	2463, -- Armor
	2647, -- Legs
	2643 -- Boots
}
}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) <= 0 then
	local bag = doPlayerAddItem(cid, 1988, 1) -- Backpack
	doAddContainerItem(bag, 2554, 1) -- Shovel
	doAddContainerItem(bag, 2120, 1) -- Rope

	local mergeidx = getPlayerVocation(cid)
	for k,v in ipairs(firstItems[mergeidx]) do
	local isArray = type(v) == "table"
	doPlayerAddItem(cid, (isArray and v[1] or v), (isArray and v[2] or 1))
	end

	setPlayerStorageValue(cid, 30001, 1)
end

return TRUE
end 

 

obs: é 1 creature script é so substituir...

 

Se te ajudei da REP++ ai ;)

Editado Abril 19 por Dragonlordez

cavernaC
19 de abril de 2010 às 15:26

Onde encontro esse arquivo para poder adicionar esse script?

dragonlordeD
19 de abril de 2010 às 15:29

data/creature scripts/scripts/firstitems.lua

cavernaC
19 de abril de 2010 às 15:32

Não tem. =/

Não tem que mecher em algum arquivo do site?

dragonlordeD
19 de abril de 2010 às 15:34

Se não tiver cria o arquivo e bota isso no creaturescripts.xml

<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

cavernaC
19 de abril de 2010 às 16:15

Não adiantou. :(