What's new

Creaturescripts addFirstItems(cid) - przydzia? pierwszych item?w.

Status
Not open for further replies.

Raa

Senior User
Joined
Aug 9, 2009
Messages
715
Reaction score
50
Age
29
Prosty skrypt, kt?ry daje pocz?tkowe itemy nowym graczom.
W "data/lib/050-function.lua" dajemy na ko?cu:
Code:
 function addFirstItems(cid)
	local storage = 12445
	local fitems = {2467, 2649, 2643, 1987, 2461, 2050, 2676} --Itemy przydzielane niezale?nie od klasy postaci.
	local vocItems = {
	[1] = {{id=2190, count=1}, {id=2512, count=1}},
	[2] = {{id=2182, count=1}, {id=2512, count=1}},
	[3] = {{id=2389, count=10}, {id=2512, count=1}},
	[4] = {{id=2419, count=1}, {id=2512, count=1}}
	}--itemy przydzielane ze wzgl?du na klas? postaci.
	if getPlayerStorageValue(cid, storage) == -1 then
		for i=1, #vocItems[getPlayerVocation(cid)] do
				doPlayerAddItem(cid, vocItems[getPlayerVocation(cid)][i].id, vocItems[getPlayerVocation(cid)][i].count)
		end
		for i = 1, #fitems do
			doPlayerAddItem(cid, fitems[i], 1)
		end
		setPlayerStorageValue(cid, storage, 1)
	end
	return true
 
 end
Nast?pnie w "creaturescripts/data/login.lua" dajemy gdzie? linijk?
Code:
addPlayerFirstItems(cid)
 
Status
Not open for further replies.
Top