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

promotion doll

Solution
There is a table that will make your life easier... enter the correct vocations, for example, ID 1 for Sorcerer. When clicking on any item, he will gain a new vocation with ID 5, which is Master Sorcerer. It's very simple that way.

Revscripts.
Lua:
local ITEM_ID_VOCS = 6527

local vocationTransformations = {
    [1] = 5, --Master Sorcerer
    [2] = 6,--Elder Druid
    [3] = 7, --Royal Paladin
    [4] = 8, --Elite Knight
}

local VocsAction = Action()

function VocsAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local currentVocation = player:getVocation():getId()
    local newVocation = vocationTransformations[currentVocation]

    if newVocation then
        player:setVocation(Vocation(newVocation))
        local id =...
So as you asked and you should just change if vocation >= 5 and vocation <= 8 then
Depending on your vocation number
Lua:
        <action itemid="2349" script="promotion note.lua"/>

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local vocation = player:getVocation():getId()
    if vocation >= 5 and vocation <= 8 then
        vocation = vocation + 4
        player:setVocation(vocation)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        item:remove()
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
    end
    return true
end
 
There is a table that will make your life easier... enter the correct vocations, for example, ID 1 for Sorcerer. When clicking on any item, he will gain a new vocation with ID 5, which is Master Sorcerer. It's very simple that way.

Revscripts.
Lua:
local ITEM_ID_VOCS = 6527

local vocationTransformations = {
    [1] = 5, --Master Sorcerer
    [2] = 6,--Elder Druid
    [3] = 7, --Royal Paladin
    [4] = 8, --Elite Knight
}

local VocsAction = Action()

function VocsAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local currentVocation = player:getVocation():getId()
    local newVocation = vocationTransformations[currentVocation]

    if newVocation then
        player:setVocation(Vocation(newVocation))
        local id = player:getId()
        local name = player:getName()
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        player:getPosition():sendMagicEffect(10)
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry, you don't have a vocation transformation defined for your current type.")
    end
end

VocsAction:id(ITEM_ID_VOCS)
VocsAction:register()
 
Solution
There is a table that will make your life easier... enter the correct vocations, for example, ID 1 for Sorcerer. When clicking on any item, he will gain a new vocation with ID 5, which is Master Sorcerer. It's very simple that way.

Revscripts.
Lua:
local ITEM_ID_VOCS = 6527

local vocationTransformations = {
    [1] = 5, --Master Sorcerer
    [2] = 6,--Elder Druid
    [3] = 7, --Royal Paladin
    [4] = 8, --Elite Knight
}

local VocsAction = Action()

function VocsAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local currentVocation = player:getVocation():getId()
    local newVocation = vocationTransformations[currentVocation]

    if newVocation then
        player:setVocation(Vocation(newVocation))
        local id = player:getId()
        local name = player:getName()
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        player:getPosition():sendMagicEffect(10)
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry, you don't have a vocation transformation defined for your current type.")
    end
end

VocsAction:id(ITEM_ID_VOCS)
VocsAction:register()
very good Congratulations!!
 
There is a table that will make your life easier... enter the correct vocations, for example, ID 1 for Sorcerer. When clicking on any item, he will gain a new vocation with ID 5, which is Master Sorcerer. It's very simple that way.

Revscripts.
Lua:
local ITEM_ID_VOCS = 6527

local vocationTransformations = {
    [1] = 5, --Master Sorcerer
    [2] = 6,--Elder Druid
    [3] = 7, --Royal Paladin
    [4] = 8, --Elite Knight
}

local VocsAction = Action()

function VocsAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local currentVocation = player:getVocation():getId()
    local newVocation = vocationTransformations[currentVocation]

    if newVocation then
        player:setVocation(Vocation(newVocation))
        local id = player:getId()
        local name = player:getName()
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        player:getPosition():sendMagicEffect(10)
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sorry, you don't have a vocation transformation defined for your current type.")
    end
end

VocsAction:id(ITEM_ID_VOCS)
VocsAction:register()
worked thanks dude
 
Back
Top