Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- removelevel = 0, -- Amount of level taken away.
- itemid = 8982, -- 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 receive 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, 15, 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 to change to.")
- return TRUE
- end
- param = string.lower(param)
- if param == "sorcerer" or param == "druid" or param == "knight" or param == "paladin" or param == "sorc" then
- if getPlayerLevel(cid) >= config.minimumlevel then
- if getPlayerItemCount(cid, config.itemid) >= 1 then
- local vocation = getPlayerVocation(cid)
- local level = getPlayerLevel(cid) - 8
- if param == "sorcerer" or param == "master sorcerer" then
- if vocation ~= 1 then
- doPlayerAddLevel(cid, -config.removelevel)
- doPlayerSetVocation(cid, 1) -- Sorc
- setCreatureMaxHealth(cid, 185 + (config.sorcincrease[1] * level))
- setCreatureMaxMana(cid, 35 + (config.sorcincrease[2] * level))
- doPlayerSetMaxCapacity(cid, 470 + (config.sorcincrease[3] * level))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to sorcerer.")
- else
- doPlayerSendCancel(cid, "You are already a sorcerer.")
- doSendMagicEffect(getCreaturePosition(cid), config.efekt)
- return TRUE
- end
- elseif param == "druid" or param == "elder druid" then
- if vocation ~= 2 then
- doPlayerAddLevel(cid, -config.removelevel)
- doPlayerSetVocation(cid, 2) -- Druid
- setCreatureMaxHealth(cid, 185 + (config.druidincrease[1] * level))
- setCreatureMaxMana(cid, 35 + (config.druidincrease[2] * level))
- doPlayerSetMaxCapacity(cid, 470 + (config.druidincrease[3] * level))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to druid.")
- else
- doPlayerSendCancel(cid, "You are already a druid.")
- doSendMagicEffect(getCreaturePosition(cid), config.efekt)
- return TRUE
- end
- elseif param == "paladin" or param == "royal paladin" then
- if vocation ~= 3 then
- doPlayerAddLevel(cid, -config.removelevel)
- doPlayerSetVocation(cid, 3) -- Paladin
- setCreatureMaxHealth(cid, 185 + (config.paladinincrease[1] * level))
- setCreatureMaxMana(cid, 35 + (config.paladinincrease[2] * level))
- doPlayerSetMaxCapacity(cid, 470 + (config.paladinincrease[3] * level))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to paladin.")
- else
- doPlayerSendCancel(cid, "You are already a paladin.")
- doSendMagicEffect(getCreaturePosition(cid), config.efekt)
- return TRUE
- end
- elseif param == "knight" then
- if vocation ~= 4 then
- doPlayerAddLevel(cid, -config.removelevel)
- doPlayerSetVocation(cid, 4) -- Knight
- setCreatureMaxHealth(cid, 185 + (config.knightincrease[1] * level))
- setCreatureMaxMana(cid, 35 + (config.knightincrease[2] * level))
- doPlayerSetMaxCapacity(cid, 470 + (config.knightincrease[3] * level))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to knight.")
- else
- doPlayerSendCancel(cid, "You are already a knight.")
- doSendMagicEffect(getCreaturePosition(cid), config.efekt)
- 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), config.efekt)
- end
- else
- doPlayerSendCancel(cid, "You don't have enough level. Your level must be " .. config.minimumlevel .. " or higher.")
- doSendMagicEffect(getCreaturePosition(cid), config.efekt)
- end
- else
- doPlayerSendCancel(cid, "You must say what vocation you want to change to.")
- doSendMagicEffect(getCreaturePosition(cid), config.efekt)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement