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

Super hard script! Adding skills after level reaching !

morp164

New Member
Joined
Jul 13, 2010
Messages
44
Reaction score
0
Hello . I've looking for that scripts on whole internet but I unfortunately didnt find it. I really need an option to improve skills after level advance. Like after reaching level you receive 5 skill points which you can use to upgrade your skills. You can spend them on magic level,fist fighting,club fighting,sword fighting,axe fighting,distance fighting,shielding or fishing. Of course after lose level by dead you lose the points which you had added, and you are able to add them again after reach the same level again.

I made da picture to show you how I imagine that


Also Its gonna be awesome if the pluses are blinking like the gif

You're my last hope ! Help me
 
I tested it too. it doesnt work. Btw. Is there any command to check how much skill points I have?

edit.
nvm I tested it on no vocataion.

But still looking for commands to check pointz :S

@edit
JUST Found it!

Love u :X
 
Found bug

Cant add more than
37 club
37 axe
37 sword
38 distance
52 shielding
~~dont remeber exactly the numbers~~

also could you or someone

1)
make that script does different effect for every skill adding

2)
add fist there :X

3)
love u
 
Gonna have to run some tests when I get on my computer, but I don't remember having those bugs... You using 0.3.6pl1? Also does it show any console error if you try to add more then those numbers?
 
I guess that it would be possible to enable some kind of talkaction for the players to level up whatever skill they like? That way you don't need a custom client.

I haven't read the previous posts in the thread, don't flame me :)
 
There are no errors in console. Im testing it on no voc (I've added it to scripts). When im typing for example !points add,club,1 then it adds clubs until i reach 37 club then when im typing theres the effects, but the skill is staying on 37
same with other skills
 
Just found that:

Adding magic levels doesnt work.

On druid i can add max like 50~ club;axe;sword , on no-voc - about 30-40 , on knights about 200 . Huh? Is there any limits?

Please respond :X
 
I can't seem to find out a way to add mlvl correctly, it adds up 99% then ou have to manually get it up and when you do you can add 99% again... I can't fix it, I'm sorry.
Tried even with db queries... didn't have much luck.
erhaps anyone else can try and fix it?
 
I changed some vocations.xml, now I can add more , but it grows up to 255 then starts from 0. In database i can see skill 300~ , but is it possible to show it in console?

luigilc@@
waiting for that magic lvl , I believe in you! :D

@@edit
Oh no!
 
It can't show more than 255 on Tibia client because it has some limitatons, it restarts counting but it is still a high number, also if you edit that part on vocations.xml you are gonna be messng with player skills, they are gonna get it too fast, and sorcerers will be able to get a high skill at axe for example.
I'd say leave it as it was and increase the amount of points needed to upgrade that skill.
On the magic level thing, I haven't given up, I'm still trying to figure it out but will need some time.
 
Got the mlvl one working, checking for bugs, will edit this post in ~5mins

@EDIT

Alright, didn't fully test it but as far as I can tell it shouldn't have any bugs.

In talkactions/scripts/PointSystem.lua replace the one you were using with this one:
Lua:
local VocPoints = {
    [1] = 3,
    [2] = 3,
    [3] = 3,
    [4] = 5,
    [5] = 5,
    [6] = 5,
    [7] = 5,
    [8] = 5,
    }
function onSay(cid, words, param)
    if not (VocPoints[getPlayerVocation(cid)]) then
        return false
    end
 
    local param = param:lower()
    local p2 = string.explode(param, ",")
    if (getPlayerStorageValue(cid, 14574) < 0) then
        setPlayerStorageValue(cid, 14574, 0)
    end
 
    local skillids = {
        ["shielding"] = 5,
        ["sword"] = 2,
        ["axe"] = 3,
        ["club"] = 1,
        ["distance"] = 4
        }
 
    local attributes = {
        ["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}, -- Need 2 points to add 5 hp
        ["energy"] = {np = 4, vl = 2, nm = "Mana Points"},
        ["magic"] = {np = 30, vl = 1, nm = "Magic Level"},
        ["shielding"] = {np = 40, vl = 1, nm = "Shielding Skill"},
        ["sword"] = {np = 20, vl = 1, nm = "Sword Skill"},
        ["axe"] = {np = 20, vl = 1, nm = "Axe Skill"},
        ["club"] = {np = 20, vl = 1, nm = "Club Skill"},
        ["distance"] = {np = 20, vl = 1, nm = "Distance Skill"},
        }
    if (param == "check") then
        doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574) .."\nPoints per lvl: ".. VocPoints[getPlayerVocation(cid)])
    elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then
        if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then
            doPlayerSendCancel(cid, "You do not have enough points to distribute!")
            return doSendMagicEffect(getThingPos(cid), 2)
        end
 
        if (p2[2] == "vitality") then
            setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + attributes[p2[2]].vl * tonumber(p2[3]))
            doCreatureAddHealth(cid, attributes[p2[2]].vl * tonumber(p2[3]))
        elseif (p2[2] == "energy") then
            setCreatureMaxMana(cid, getCreatureMaxMana(cid) + attributes[p2[2]].vl * tonumber(p2[3]))
            doCreatureAddMana(cid, attributes[p2[2]].vl * tonumber(p2[3]))
	elseif (p2[2] == "magic") then
            doPlayerAddMagLevel(cid, attributes[p2[2]].vl * tonumber(p2[3]))
        elseif(skillids[p2[2]]) then
            for a = 1, tonumber(p2[3]) do
                doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false)
            end
        end
 
 
        doSendMagicEffect(getThingPos(cid), 29)
        doSendMagicEffect(getThingPos(cid), 30)
        doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * attributes[p2[2]].np, 180)
        setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np)
    else
        local msgx = ""
        for i, v in pairs(attributes) do
            local add = (v.np > 1) and "s" or ""
            msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n"
        end
        doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nNecessary points to increase the stats:\n\n".. msgx .. "\nUsage example: ".. words .." add, vitality, 5\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574))
    end
 
    return true
end

Edit it as you like, you can go to page 2 and check the how-to on the older script post.

Post any bugs/doubts
 
Last edited:
Got the mlvl one working, checking for bugs, will edit this post in ~5mins

@EDIT

Alright, didn't fully test it but as far as I can tell it shouldn't have any bugs.

In talkactions/scripts/PointSystem.lua replace the one you were using with this one:
Lua:
local VocPoints = {
    [1] = 3,
    [2] = 3,
    [3] = 3,
    [4] = 5,
    [5] = 5,
    [6] = 5,
    [7] = 5,
    [8] = 5,
    }
function onSay(cid, words, param)
    if not (VocPoints[getPlayerVocation(cid)]) then
        return false
    end
 
    local param = param:lower()
    local p2 = string.explode(param, ",")
    if (getPlayerStorageValue(cid, 14574) < 0) then
        setPlayerStorageValue(cid, 14574, 0)
    end
 
    local skillids = {
        ["shielding"] = 5,
        ["sword"] = 2,
        ["axe"] = 3,
        ["club"] = 1,
        ["distance"] = 4
        }
 
    local attributes = {
        ["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}, -- Need 2 points to add 5 hp
        ["energy"] = {np = 4, vl = 2, nm = "Mana Points"},
        ["magic"] = {np = 30, vl = 1, nm = "Magic Level"},
        ["shielding"] = {np = 40, vl = 1, nm = "Shielding Skill"},
        ["sword"] = {np = 20, vl = 1, nm = "Sword Skill"},
        ["axe"] = {np = 20, vl = 1, nm = "Axe Skill"},
        ["club"] = {np = 20, vl = 1, nm = "Club Skill"},
        ["distance"] = {np = 20, vl = 1, nm = "Distance Skill"},
        }
    if (param == "check") then
        doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574) .."\nPoints per lvl: ".. VocPoints[getPlayerVocation(cid)])
    elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then
        if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then
            doPlayerSendCancel(cid, "You do not have enough points to distribute!")
            return doSendMagicEffect(getThingPos(cid), 2)
        end
 
        if (p2[2] == "vitality") then
            setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + attributes[p2[2]].vl * tonumber(p2[3]))
            doCreatureAddHealth(cid, attributes[p2[2]].vl * tonumber(p2[3]))
        elseif (p2[2] == "energy") then
            setCreatureMaxMana(cid, getCreatureMaxMana(cid) + attributes[p2[2]].vl * tonumber(p2[3]))
            doCreatureAddMana(cid, attributes[p2[2]].vl * tonumber(p2[3]))
	elseif (p2[2] == "magic") then
            doPlayerAddMagLevel(cid, attributes[p2[2]].vl * tonumber(p2[3]))
        elseif(skillids[p2[2]]) then
            for a = 1, tonumber(p2[3]) do
                doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false)
            end
        end
 
 
        doSendMagicEffect(getThingPos(cid), 29)
        doSendMagicEffect(getThingPos(cid), 30)
        doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * attributes[p2[2]].np, 180)
        setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np)
    else
        local msgx = ""
        for i, v in pairs(attributes) do
            local add = (v.np > 1) and "s" or ""
            msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n"
        end
        doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nNecessary points to increase the stats:\n\n".. msgx .. "\nUsage example: ".. words .." add, vitality, 5\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574))
    end
 
    return true
end

Edit it as you like, you can go to page 2 and check the how-to on the older script post.

Post any bugs/doubts

I've copied it and nothing changed. Still cant add magic lvl. Tried on some vocations , Tried copy again and again , still !points add,magic,1 doesnt work.
Also can you add there fist fighting?
 
Sorry I forgot to post the function...
Go to data/lib/050-function and search for doPlayerAddMagLevel and replace it with this one.
Lua:
function doPlayerAddMagLevel(cid, amount)
	for i = 1, amount do
		doPlayerAddSpentMana(cid, math.ceil((getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid)) / getConfigInfo('rateMagic')))
	end
	return true
end
Truly sorry man... it was pretty late here so I was kinda tired.

@Edit Sure I can try and add fist fighting, give me a few mins.

@Edit2
Here is the script with fist fightning:
Lua:
local VocPoints = {
    [1] = 3,
    [2] = 3,
    [3] = 3,
    [4] = 5,
    [5] = 5,
    [6] = 5,
    [7] = 5,
    [8] = 5,
    }
function onSay(cid, words, param)
    if not (VocPoints[getPlayerVocation(cid)]) then
        return false
    end
 
    local param = param:lower()
    local p2 = string.explode(param, ",")
    if (getPlayerStorageValue(cid, 14574) < 0) then
        setPlayerStorageValue(cid, 14574, 0)
    end
 
    local skillids = {
		["fist"] = 0,
        ["shielding"] = 5,
        ["sword"] = 2,
        ["axe"] = 3,
        ["club"] = 1,
        ["distance"] = 4
        }
 
    local attributes = {
	["fist"] = {np = 1, vl = 1, nm = "Fist Skill"},
        ["vitality"] = {np = 1, vl = 5, nm = "Hit Points"},
        ["energy"] = {np = 1, vl = 2, nm = "Mana Points"},
        ["magic"] = {np = 1, vl = 1, nm = "Magic Level"},
        ["shielding"] = {np = 1, vl = 1, nm = "Shielding Skill"},
        ["sword"] = {np = 1, vl = 1, nm = "Sword Skill"},
        ["axe"] = {np = 1, vl = 1, nm = "Axe Skill"},
        ["club"] = {np = 1, vl = 1, nm = "Club Skill"},
        ["distance"] = {np = 1, vl = 1, nm = "Distance Skill"},
        }
    if (param == "check") then
        doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574) .."\nPoints per lvl: ".. VocPoints[getPlayerVocation(cid)])
    elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then
        if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then
            doPlayerSendCancel(cid, "You do not have enough points to distribute!")
            return doSendMagicEffect(getThingPos(cid), 2)
        end
 
        if (p2[2] == "vitality") then
            setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + attributes[p2[2]].vl * tonumber(p2[3]))
            doCreatureAddHealth(cid, attributes[p2[2]].vl * tonumber(p2[3]))
        elseif (p2[2] == "energy") then
            setCreatureMaxMana(cid, getCreatureMaxMana(cid) + attributes[p2[2]].vl * tonumber(p2[3]))
            doCreatureAddMana(cid, attributes[p2[2]].vl * tonumber(p2[3]))
	elseif (p2[2] == "magic") then
            doPlayerAddMagLevel(cid, attributes[p2[2]].vl * tonumber(p2[3]))
        elseif(skillids[p2[2]]) then
            for a = 1, tonumber(p2[3]) do
                doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false)
            end
        end
 
 
        doSendMagicEffect(getThingPos(cid), 29)
        doSendMagicEffect(getThingPos(cid), 30)
        doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * attributes[p2[2]].np, 180)
        setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np)
    else
        local msgx = ""
        for i, v in pairs(attributes) do
            local add = (v.np > 1) and "s" or ""
            msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n"
        end
        doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nNecessary points to increase the stats:\n\n".. msgx .. "\nUsage example: ".. words .." add, vitality, 5\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574))
    end
 
    return true
end

Edit the values necessary for each skill here, because I put them all on 1 for testing purposes.
Lua:
    local attributes = {
	["fist"] = {np = 1, vl = 1, nm = "Fist Skill"},
        ["vitality"] = {np = 1, vl = 5, nm = "Hit Points"}, -- Need 1 points to add 5 hp
        ["energy"] = {np = 1, vl = 2, nm = "Mana Points"},
        ["magic"] = {np = 1, vl = 1, nm = "Magic Level"},
        ["shielding"] = {np = 1, vl = 1, nm = "Shielding Skill"},
        ["sword"] = {np = 1, vl = 1, nm = "Sword Skill"},
        ["axe"] = {np = 1, vl = 1, nm = "Axe Skill"},
        ["club"] = {np = 1, vl = 1, nm = "Club Skill"},
        ["distance"] = {np = 1, vl = 1, nm = "Distance Skill"},
        }
where:
np = number of points necessary
vl = value that configured np will add

If any bug/mistake/doubt, post it here
 
Last edited:
You dont need to apologize to me. You are doing really great work.

The fist works perfectly , but the magic not. I just changed it in my data/lib/050-function but it nothing changed. Still eats points without adding mlvl :/
 
Last edited:
Back
Top