• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    (Pedido) script skill points server 8.54

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1(Pedido) script skill points server 8.54  Empty (Pedido) script skill points server 8.54 Miér Mayo 16, 2018 2:36 am

    Roo

    Roo
    Miembro
    Miembro
    Hola, Busco un script de skill points para version 8.54
    o algo parecido por nivel o por algo similar Gracias! :3

    3 participantes

    2(Pedido) script skill points server 8.54  Empty Re: (Pedido) script skill points server 8.54 Miér Mayo 16, 2018 12:05 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    data/creaturescripts/scripts registrar en login.lua

    Código:
    registerCreatureEvent(cid, "PointSystem")

    data/creaturescripts/scripts PointsSystem.lua

    Código:
    local VocPoints = {
            [1] = 3,
            [2] = 3,
            [3] = 3,
            [4] = 5,
            [5] = 5,
            [6] = 5,
            [7] = 5,
            [8] = 8,
            }
    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

    data/creaturescripts/ creaturescripts.xml

    Código:
    <event type="advance" name="PointSystem" event="script" value="PointsSystem.lua"/>


    Talkaction

    data/talkactions/scripts PointsSystem.lua


    Código:
    local VocPoints = {
        [1] = 3,
        [2] = 3,
        [3] = 3,
        [4] = 5,
        [5] = 5,
        [6] = 5,
        [7] = 5,
        [8] = 8,
        }
    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 to use two points to add 10 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\n\nPoints available: ".. getPlayerStorageValue(cid, 14574) .."\nPoints per level: ".. 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] == "vitalidade") 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 .. " point".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n"
            end
            doPlayerPopupFYI(cid, "Level Points System\n\nPoints needed to increase stats:\n\n".. msgx .. "\nExample of use: ".. words .." add, vitality, 5\n\nPoints available: ".. getPlayerStorageValue(cid, 14574))
        end
     
        return true
    end

    data/talkactions/talkactions.xml

    Código:
    <talkaction words="!points" event="script" value="PointsSystem.lua"/>


    configuracion

    PointsSystem.lua , data/creaturescripts/scripts


    Código:
    local VocPoints = {
            [1] = 3,
            [2] = 3,
            [3] = 3,
            [4] = 5,
            [5] = 5,
            [6] = 5,
            [7] = 5,
            [8] = 8,
            }

    son puntos por vocacion

    PointsSystem.lua, data/talkactions/scripts

    Código:
    local VocPoints = {
            [1] = 3,
            [2] = 3,
            [3] = 3,
            [4] = 5,
            [5] = 5,
            [6] = 5,
            [7] = 5,
            [8] = 8,
            }

    son puntos por vocacion

    Código:
            local attributes = {
                    ["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}, -- Need to use two points to add 10 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: cantindd de point para comprar

    vl: 5 cantidad de vida o skilll o vitalidad que le entregara al player


    ejemplo

    ["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}

    2 points por la vitalidad 5





    (Pedido) script skill points server 8.54  YNU5B25
    3 participantes
    http://www.tibiaface.com

    Fury

    Fury
    Nuevo Miembro
    Nuevo Miembro
    [Admin] God Maya escribió:data/creaturescripts/scripts registrar en login.lua

    Código:
    registerCreatureEvent(cid, "PointSystem")

    data/creaturescripts/scripts PointsSystem.lua

    Código:
    local VocPoints = {
            [1] = 3,
            [2] = 3,
            [3] = 3,
            [4] = 5,
            [5] = 5,
            [6] = 5,
            [7] = 5,
            [8] = 8,
            }
    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

    data/creaturescripts/ creaturescripts.xml

    Código:
    <event type="advance" name="PointSystem" event="script" value="PointsSystem.lua"/>


    Talkaction

    data/talkactions/scripts PointsSystem.lua


    Código:
    local VocPoints = {
        [1] = 3,
        [2] = 3,
        [3] = 3,
        [4] = 5,
        [5] = 5,
        [6] = 5,
        [7] = 5,
        [8] = 8,
        }
    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 to use two points to add 10 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\n\nPoints available: ".. getPlayerStorageValue(cid, 14574) .."\nPoints per level: ".. 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] == "vitalidade") 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 .. " point".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n"
            end
            doPlayerPopupFYI(cid, "Level Points System\n\nPoints needed to increase stats:\n\n".. msgx .. "\nExample of use: ".. words .." add, vitality, 5\n\nPoints available: ".. getPlayerStorageValue(cid, 14574))
        end
     
        return true
    end

    data/talkactions/talkactions.xml

    Código:
    <talkaction words="!points" event="script" value="PointsSystem.lua"/>


    configuracion

    PointsSystem.lua , data/creaturescripts/scripts


    Código:
    local VocPoints = {
            [1] = 3,
            [2] = 3,
            [3] = 3,
            [4] = 5,
            [5] = 5,
            [6] = 5,
            [7] = 5,
            [8] = 8,
            }

    son puntos por vocacion

    PointsSystem.lua, data/talkactions/scripts

    Código:
    local VocPoints = {
            [1] = 3,
            [2] = 3,
            [3] = 3,
            [4] = 5,
            [5] = 5,
            [6] = 5,
            [7] = 5,
            [8] = 8,
            }

    son puntos por vocacion

    Código:
            local attributes = {
                    ["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}, -- Need to use two points to add 10 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: cantindd de point para comprar

    vl: 5 cantidad de vida o skilll o vitalidad que le entregara al player


    ejemplo

    ["vitality"] = {np = 2, vl = 5, nm = "Hit Points"}

    2 points por la vitalidad 5




    Lo arreglaste :v?

    3 participantes

    4(Pedido) script skill points server 8.54  Empty Re: (Pedido) script skill points server 8.54 Miér Mayo 16, 2018 10:50 pm

    Roo

    Roo
    Miembro
    Miembro
    Very Happy Resuelto Gracias [Admin] God Maya funciono ala perfección Very Happy

    3 participantes

    Contenido patrocinado


    3 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).