• 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
 
you must ask for a help

Read again my posts dude. I am really thankful to luigilc, he did really great job , but I am kinda disappointed too ,I've though the forum is full of specialists or pros , but like u see only him (and now Marencian too -thanks ^^) is able to help me , maybe other are unexperienced or smth like that but dude dont tell me shit I'm not asking for help please. I really appreciate every attempts to help . Btw ur post looks like spam , but I am anyway thankful to you too at least you've refreshed the thread

I only read a few posts here and there in this thread, but it sounded like you were having some trouble with adding magic level?
This might not make a lot of sense, but the results addskilltries, addmanaspent and addmaglevel seem to vary from computer to computer
if addmaglevel is not working correctly for you, try using doPlayerAddSpentMana(cid, (getPlayerRequiredMana~~

Not sure if you have solved your problems yet, but hope this helps anyway!
Good Luck

If Im understand that method , it should work like the player which decides to add magic level, will get the amount of mana which is required to advance on next magic level right? I wish there player would be not able to improve his magic level by using mana , only by skill points , is it still possible? Though about making magic level rate like 0x, and adding this into script. And theres another problem , how to add it? I've though about it :


doPlayerAddMagLevel(cid, attributes[p2[2]].vl * tonumber(p2[3]))

change into


doPlayerAddSpentMana(cid, attributes[p2[2]].vl * tonumber(p2[3]))

but where put the "getPlayerRequiredMana"

Or should I add these somewhere else in the scripts?

Thanks all . Hope u will answer my questions.
 
bump

@edit
Just repaired the problem with magic level.

Can someone add there a different effect for every skill adding?? Thanks

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
Also if its possible , can someone add there a blockade, The player cant add more than 255 in one skill , for example - Player has 255 point in axe and he types the command to add more axe skill and then there is showing up the message he cant add more points into axe max is 255 etc , and he isnt loosing points for that mistake , he is able now to add those points somewhere else. Thanks (Obviously I'll add by myself an information about max skill which would be shown when player types !points)
 
Last edited:
@up simply add an if to the attribute you want blocked. I might do that later as I'm not on my pc atm.

@onTopic I didn't post anything else because the way I made the script it was fully functional on the 3 pcs I tested, as I couldn't reproduce the error with the mlvl thing I couldn't do anything as nothing was wrong with it (at least for me).

I'll be reading up this thread as I missed some pages so I might add something later, again, if I get to my pc.

Also I want to say that I am nowhere near a high level scripter, I can only do some basic stuff, so I apologize if any of my scripts or scripts I post fail, most are a bit old and I edit them to fit my prefered tfs (0.3.6pl1)
Any doubt or suggestion post here, I will be watching this thread from now on and trying to get the script to work 100% within your requests/suggestions
 
So could you add it into this script? (Different effect for every skill adding and the blockade which I've described in last post) :)
 
Back
Top