• 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
 
Its not permanently loss , you just gonna lose the points which u added on certain level when you die and get downgraded on lvl lower. Like you cant keep dyin from 2 lvl to lvl 1 and still gettin free skill points after reaching again lvl 2. I think you understand now
 
Last edited:
Yea, client mods aren't really easy to do.
You can use commands to achieve this tho.

I just recommend to make the "losses" like this:
Level Up => Gain points
Level Down => No loss
Level Up again => No re-gain
Level Up => Gain points
...

A lot easier to make/store.
 
What about that:

After leveling up player gets 5 skills points. Player can check how much skill points he has by command !skillpoints . Then he can spend them on skills , like !skillclub !skillaxe !skillsword !skillmagic etc. The commands "!skillxxxx" aren't showing in game and there are different effect for everyone when used and when u got no skillpoints then there is no effect but information like "You dont have enough skill points to improve that skill" . For safety of that script you get skill points on certain level only once. You dont loss them when u die. For example you cant keep dyin and reaching lvl 2 still getting next skill points you can get them only once a level. I think its easy script for pros like you
 
Try this:
All credits to MaXwEllDeN

Go to creaturescripts/scripts and open the file login.lua and add BEFORE the last return true:
Lua:
      registerCreatureEvent(cid, "PointSystem")

Now on creaturescripts/scripts copy any .lua file and rename it to PointsSystem, now open it up and erase everything inside it, then add:
Lua:
local VocPoints = {
        [1] = 3,
        [2] = 3,
        [3] = 3,
        [4] = 5,
        [5] = 5,
        [6] = 5,
        [7] = 5,
        [8] = 5,
        }
function onAdvance(cid, skill, oldlevel, newlevel)
        if not (VocPoints[getPlayerVocation(cid)]) then
                return true
        end
        if (skill == 8) then
                if (getPlayerStorageValue(cid, 14573) < newlevel) then
                        if (getPlayerStorageValue(cid, 14574) < 0) then
                                setPlayerStorageValue(cid, 14574, 0)
                                setPlayerStorageValue(cid, 14573, 0)
                        end

                        setPlayerStorageValue(cid, 14573, newlevel)
                        setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) + (newlevel - oldlevel) * (VocPoints[getPlayerVocation(cid)]))
                        doSendAnimatedText(getThingPos(cid), "+" .. (newlevel - oldlevel) * (VocPoints[getPlayerVocation(cid)]), 18)
                end
        end

        return true
end

Now open creaturescripts/creaturescripts.xml and add this tag:
Lua:
<event type="advance" name="PointSystem" event="script" value="PointsSystem.lua"/>

@Talkaction

Now go to talkactions/scripts copy any .lua file and rename it to PointsSystem, delete everything inside it and add this:
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(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

Open talkactions/talkactions.xml and add this tag:
Lua:
<talkaction words="!points" event="script" value="PointsSystem.lua"/>

#Configuration

In the file PointsSystem.lua from creaturescripts/scripts:
Lua:
local VocPoints = {
        [1] = 3,
        [2] = 3,
        [3] = 3,
        [4] = 5,
        [5] = 5,
        [6] = 5,
        [7] = 5,
        [8] = 8,
        }
Between brackets is the id of the vocation, and after the equal sign, the amount of points they earn per level.



In the file PointsSystem.lua from talkactions/scripts:
Lua:
local VocPoints = {
        [1] = 3,
        [2] = 3,
        [3] = 3,
        [4] = 5,
        [5] = 5,
        [6] = 5,
        [7] = 5,
        [8] = 8,
        }
Between brackets is the id of the vocation, and after the equal sign, the amount of points they earn per level.(Yes again)



In the file PointsSystem.lua from talkactions/scripts:(Yup, the same as above)
Lua:
        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"},
                }
np - number of points to add the stat
vl - how much will it add aftyer spending the np required.

Example:
Lua:
["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}
With 2 Points you can buy 5 hit points.

Any errors post here, I am not the author of the script, it is from a friend of mine named MaXwEllDeN, but I can and will fix it if you get any errors. This was done using 0.3.6pl1 and I'll only support if you use the same version cuz I am not familiar with other versions but I am sure someone else can fix it if you need.

@Edit: here is a screenshot to ilustrate it:
1fg3dg.jpg

All credits to MaXwEllDeN.
 
Last edited:
I think its possible to make it if you script it but its hard!

why not let them get skills when attacking monsters and skillpoints when they reach samme level so the characters be stronger??


Sory for doublepost!
 
Last edited by a moderator:
@polat_alemdar if u are refering to the script I posted I didn't understand what you want.

#Ontopic
I'm still waiting for a response from the thread owner to see if that's what he/she wanted and if he/she got any bugs and whatnot
 
@polat_alemdar if u are refering to the script I posted I didn't understand what you want.

#Ontopic
I'm still waiting for a response from the thread owner to see if that's what he/she wanted and if he/she got any bugs and whatnot

I dont talked to you i talked to amiroslo :D

anyways im using your script and testing it its and good idea if its working fine i will rep u!
 
Sorry for no response, I was unable to use comp for 2~ days , Now im Fine ^^

At first I would like to thank you for your scirpt , I really appreciate it ! I did exactly as you wrote, theres no errors but when Im typing !points nothing happens. Even on Gm or on player or on player after level reach. Is it adding 5 points after advancing level? I would be really grateful if there will be command to check how much points I have and individual commands to add skill/hp/whateva

Thanks !
 
Back
Top