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

[1.X] First Items for Vocation

highsanta

Advanced OT User
Joined
Dec 20, 2023
Messages
399
Solutions
3
Reaction score
175
Lua:
local firstItems = {


    [0] = {
        2650, -- jacket
        1987, -- bag
        2674, -- apple
    },
    [1] = { -- Sorcerer
        2463, -- steel helmet
        2457, -- plate armor
        2647, -- plate legs
        3982, -- crocodile boots
        2525, -- dwarven shield
        1988, -- backpack
        2160, -- cc
        2120, -- rope
        2554, --shovel
        
        
        
        -- Add Sorcerer's item ID here
    },
    [2] = { -- Druid
        -- Add Druid's item ID here
    },
    [3] = { -- Paladin
        -- Add Paladin's item ID here
    },
    [4] = { -- Knight
        -- Add Knight's item ID here
    }
}

function onLogin(player)
    if player:getLastLoginSaved() == 0 then
        local vocation = player:getVocation():getId()
        local items = firstItems[vocation]
        if items then
            for i = 1, #items do
                player:addItem(items[i], 1)
            end
        end
        --player:addItem(player:getSex() == 0 and 2651 or 2650, 1)
        --player:addItem(ITEM_BAG, 1):addItem(2674, 1)
    end
    return true
end

XML:
    <event type="login" name="FirstItems" script="firstitems.lua" />
 
Back
Top