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

Created chars starting with nothign

8683984

New Member
Joined
Jun 5, 2009
Messages
95
Reaction score
2
Location
Sweden
When a guy logs in with theyr new created char they start with a club weapon, i want them to start with their vocation weapon Ecample: druid start with snakebite rod etc.

how do i do that?


I remember that i did this before but i don't remember how to do it.
 
\data\creaturescripts\scripts\firstitems and put this
local commonItems = {
-- ITEMS ALL VOCS RECEIVE all vocations will receive this items
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1}, -- shovel
{itemid=2420, count=1}, -- machete
{itemid=2789, count=10}, -- brown mushrooms
{itemid=2305, count=1}, -- fire bomb rune
{itemid=2261, count=1}, -- destroy field rune
}

local firstItems = {
{ -- SORC ITEMS sorcerer items
{itemid=2323, count=1}, -- hat of the mad

},
{ -- DRUID ITEMS druid items
{itemid=2323, count=1}, -- hat of the mad

},
{ -- PALADIN ITEMS paladin items
{itemid=2493, count=1}, -- demon helmet

},
{ -- KNIGHT ITEMS knight items
{itemid=2493, count=1}, -- demon helmet

}
}

for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end

function onLogin(cid)
if getPlayerGroupId(cid) < 2 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems ~= 1 then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

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

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your first items!")
end
setPlayerStorageValue(cid, 67708, 1)
end
end
return TRUE
end


then go to data\creaturescripts\creature scripts xml and put this : <event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
 
Back
Top