Lua:
function armPlayer(cid)
Helm = {2497, 2493, 2506, 2471, 2323, 2496, 5741, 2474, 9778}
arm = {2656, 2487, 8867, 2503, 2466, 8869, 8877, 2486, 8890}
leg = {2488, 2469, 2470, 2495, 7894, 9777, 7885, 7895, 7730}
boot = {2195, 9932, 7892, 2646, 7893, 7891, 2641, 5462, 7886}
amulet = {2198, 10220, 10219, 10221, 2171, 2197, 2131}
ring = {2168, 2164, 2165, 2169}
potion = {7588, 7589}
b1 = {2313, 2304}
bow = {7438, 7367, 8849, 8850, 8851, 8852, 8853}
weap = {2407, 7449, 7748, 2438, 7405, 7436, 7419, 7751, 7456, 7434, 7388, 7429, 7756, 7774, 7430, 7451, 2421}
rod = {2183, 8912, 2181, 8910}
wand = {8921, 2187, 8920, 8922}
shield = {2532, 2534, 2535, 2519, 2520, 2522, 2514, 2539, 2542}
book = {8918, 8900, 8903, 8902, 8901, 8904}
ammo = {7368, 7366, 7365, 7364, 2399, 7839, 7840, 2545, 2410}
local function r(n) return math.random(n) end
local randDist, randWeapon, randDef, randBows, randH, randArmor, randLeg, randBoots, randAmulets, randRings, randWands, randRods, randBooks = r(#ammo), r(#weap), r(#shield), r(#bow), r(#Helm), r(#arm), r(#leg), r(#boot), r(#amulet), r(#ring), r(#wand), r(#rod), r(#book)
local commonItems = {
{itemid=Helm[randH], count=1}, -- HELMET
{itemid=arm[randArmor], count=1}, -- ARMOR
{itemid=leg[randLeg], count=1}, -- LEG
{itemid=boot[randBoots], count=1}, -- BOTAS
{itemid=amulet[randAmulets], count=1}, -- AMULETOS
{itemid=ring[randRings], count=1}, -- ANILLO
}
local firstItems = {
{ -- SORC ITEMS
{itemid=wand[randWands], count=1}, -- wand
{itemid=book[randBooks], count=1}, -- book
},
{ -- DRUID ITEMS
{itemid=rod[randRods], count=1}, -- rod
{itemid=book[randBooks], count=1}, -- book
},
{ -- PALADIN ITEMS
{itemid=ammo[randDist], count=99}, -- Municion
{itemid=bow[randBows], count=1}, -- bow/crossbow
{itemid=shield[randDef], count=1}, -- Escudo
},
{ -- KNIGHT ITEMS
{itemid=weap[randWeapon], count=1}, -- arma
{itemid=shield[randDef], count=1}, -- Escudo
}
}
for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end
--[[local backpack = ]]doPlayerAddItem(cid, 10518, 1)
--local giveItems = firstItems[3]
local giveItems = firstItems[getPlayerVocation(cid)]
if giveItems ~= nil then
for _, v in ipairs(giveItems) do
--doAddContainerItem(backpack, v.itemid, v.count or 1)
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end
end
Last edited: