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

[0.4] ChangeVocation Scroll

omigaaad

Banned User
Joined
Jun 29, 2010
Messages
35
Reaction score
8
Code:
<talkaction words="!changevoc" event="script" value="vocations.lua"/>

Lua:
--SCRIPT BY AlcikOTS----tibiaserver.pl--BEST SERVER ONLINE--
-----------------------CONFIG---START-----------------------------------------
local config = {
    removelevel = 35, -- Amount of level taken away.
    itemid = 1964, -- Item ID.
    efekt = 2, -- Effect shown.
    skilafter = 10, -- What skill will the player have after change.
    minimumlevel = 100, -- What will be min level required?
    magafter = 2, -- What magic level will he recive after change?
    --Change only if you have edited your vocations.xml so players get more mana/health/cap each level.
    sorcincrease = {5, 30, 10}, --The amount of health/mana/cap that increases when Sorcerer levels up.
    druidincrease = {5, 30, 10}, --The amount of health/mana/cap that increases when Druid levels up.
    paladinincrease = {10, 10, 20}, --The amount of health/mana/cap that increases when Paladin levels up.
    knightincrease = {15, 5, 25} --The amount of health/mana/cap that increases when Knight levels up.
}
-----------------------CONFIG---END-------------------------------------------
 
function onSay(cid, words, param)
 
if(param == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must say what vocation you want change to.")
        return TRUE
    end
 if(param == "sorcerer") or (param == "druid") or (param == "knight") or (param == "paladin") or (param == "Paladin") or (param == "Druid") or (param == "Sorcerer") or (param == "Knight") or (param == "sorc") or (param == "Sorc") then
        if getPlayerLevel(cid) >= config.minimumlevel then
            if getPlayerItemCount(cid, config.itemid) >= 1 then
                if(param == "sorcerer") or (param == "Sorcerer") or (param == "sorc") or (param == "Sorc") then
                    if getPlayerVocation(cid) > 1 then
                    doPlayerAddLevel(cid, -(config.removelevel))
                        doPlayerSetVocation(cid, 1) -- Sorc
                        setCreatureMaxHealth(cid, (185+(config.sorcincrease[1]*((getPlayerLevel(cid)-8)))))
                        setCreatureMaxMana(cid, (35+(config.sorcincrease[2]*((getPlayerLevel(cid)-8)))))
                        doPlayerSetMaxCapacity(cid, (470+(config.sorcincrease[3]*((getPlayerLevel(cid)-8)))))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to sorcerer.")
                    else doPlayerSendCancel(cid, "You are already a sorcerer.")
                    doSendMagicEffect(getCreaturePosition(cid), 2)
                    return TRUE
                    end   
                end
 
                if(param == "druid") or (param == "Druid") then
                    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) > 2 then
                    doPlayerAddLevel(cid, -(config.removelevel))
                        doPlayerSetVocation(cid, 2) -- Druid
                        setCreatureMaxHealth(cid, (185+(config.druidincrease[1]*((getPlayerLevel(cid)-8)))))
                        setCreatureMaxMana(cid, (35+(config.druidincrease[2]*((getPlayerLevel(cid)-8)))))
                        doPlayerSetMaxCapacity(cid, (470+(config.druidincrease[3]*((getPlayerLevel(cid)-8)))))             
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to druid.") 
                    else doPlayerSendCancel(cid, "You are already a druid.")
                    doSendMagicEffect(getCreaturePosition(cid), 2)
                    return TRUE
                    end
                end
 
                if(param == "paladin") or (param == "Paladin") then
                    if getPlayerVocation(cid) < 3 or getPlayerVocation(cid) > 3 then
                    doPlayerAddLevel(cid, -(config.removelevel))
                    doPlayerSetVocation(cid, 3) -- Sorc
                        setCreatureMaxHealth(cid, (185+(config.paladinincrease[1]*((getPlayerLevel(cid)-8)))))
                        setCreatureMaxMana(cid, (35+(config.paladinincrease[2]*((getPlayerLevel(cid)-8)))))
                        doPlayerSetMaxCapacity(cid, (470+(config.paladinincrease[3]*((getPlayerLevel(cid)-8)))))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to paladin.")
                    else doPlayerSendCancel(cid, "You are already a paladin.")
                    doSendMagicEffect(getCreaturePosition(cid), 2)
                    return TRUE
                    end
                end
 
                if(param == "knight") or (param == "Knight") then
                    if getPlayerVocation(cid) < 4 then
                    doPlayerAddLevel(cid, -(config.removelevel))
                    doPlayerSetVocation(cid, 4) -- Sorc
                        setCreatureMaxHealth(cid, (185+(config.knightincrease[1]*((getPlayerLevel(cid)-8)))))
                        setCreatureMaxMana(cid, (35+(config.knightincrease[2]*((getPlayerLevel(cid)-8)))))
                        doPlayerSetMaxCapacity(cid, (470+(config.knightincrease[3]*((getPlayerLevel(cid)-8)))))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to knight.")     
                    else doPlayerSendCancel(cid, "You are already a knight.")
                    doSendMagicEffect(getCreaturePosition(cid), 2)
                    return TRUE
                    end
                end
              
                doPlayerRemoveItem(cid, config.itemid, 1)
                doPlayerAddMagLevel(cid, -((getPlayerMagLevel(cid))-config.magafter))
                doSendMagicEffect(getCreaturePosition(cid), config.efekt)
                doCreatureAddMana(cid, -((getCreatureMana(cid))-(getCreatureMaxMana(cid))))
                doCreatureAddHealth(cid, -((getCreatureHealth(cid))-(getCreatureMaxHealth(cid))))
                            for a = 0,6 do
                                doPlayerAddSkill(cid, a, -(getPlayerSkillLevel(cid, a)-config.skilafter))
                            end
              
            else doPlayerSendCancel(cid, "You need "..getItemNameById(config.itemid).." to change your vocation.")
            doSendMagicEffect(getCreaturePosition(cid), 2)
            end
        else doPlayerSendCancel(cid, "You don't have enough level. Your level must be "..(config.minimumlevel).." or higher.")
        doSendMagicEffect(getCreaturePosition(cid), 2)
        end
else doPlayerSendCancel(cid, "You must say what vocation you want change to.")
doSendMagicEffect(getCreaturePosition(cid), 2)
end
end
Post automatically merged:

bump
 
Last edited:
Back
Top