OTHispano
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

Ir abajo
avatar
Maniatiko™
Baneado
Mensajes Mensajes : 9

[Mod] Points system Empty [Mod] Points system

Dom Abr 22, 2012 7:34 pm
Reputación del mensaje :100% (1 voto)

Hola Invitado, hoy te traego este mod muy funcional perfecto para ots low rate
[/b

[b]¿En que consiste?

consiste de que cada que subas level este mod te dara tales puntos (depedende tu vocacion),
con los cuales podras comprarlos(cambiarlos) con algun skill


¿como se usa?
Solo escribes dentro del juego el comando !points y estara la tabla,
ahi veras cuantos puntos tienes,necesitas, y para comprar por ejemplo vida(hp) tienes
que hacerle asi : !points add,health,1 depende de los puntos que portes


Aqui imagenes:
Spoiler:



Ahora instalacion

@Creaturescripts
Primero nos vamos a data/creaturescripts/scripts y abrimos el archivo login.lua,
con algun editor de texto agregamos esta linea antes de return true.

Código:

registerCreatureEvent(cid, "PointSystem")

Ahora nos vamos de nuevo a data/creaturescript/scripts ,copie cualquier archivo
con extension .lua y lo nombras pointssystem,abrelo con algun editor de texto y deletea todo
y copia en el lo siguiente:

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
Y en creaturescripts.xml agregamos esto:
Código:

<event type="advance" name="PointSystem" event="script" value="PointsSystem.lua"/>

@Talkactions
Ahora te vas a data/talkactions/scripts ,copiamos cualquier archivo con
extension .lua, borramos su contenido ,lo llamamos pointssystem y agregamos lo siguiente

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 = {
                ["health"] = {np = 2, vl = 5, nm = "Hit Points"}, -- Precisa usar 2 points para adicionar 10 de 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, "~*~*~ Agregar Atributos ~*~*~\n\nPuntos Disponibles: ".. getPlayerStorageValue(cid, 14574) .."\nPuntos por 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, "Usted no tiene suficientes puntos para distribuir!")
                        return doSendMagicEffect(getThingPos(cid), 2)
                end

                if (p2[2] == "health") 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, "~*~*~ Agregar Atributos ~*~*~\n\nPuntos necesarios para agregar los skills:\n\n".. msgx .. "\nEjemplo de uso: ".. words .." add,

health, 5\n\nPuntos disponibles: ".. getPlayerStorageValue(cid, 14574))
        end

        return true
end

Ahora en talkactions.xml agregamos lo siguiente:
Código:

<talkaction words="!points" event="script" value="PointsSystem.lua"/>


CONFIGURACION!
El archivo pointssystem.lua que esta en data/creaturscripts/scripts:
Código:

local VocPoints = {
                [1] = 3,
                [2] = 3,
                [3] = 3,
                [4] = 5,
                [5] = 5,
                [6] = 5,
                [7] = 5,
                [8] = 8,
                }
Los numeros que estan entre [] son las id de las vocaciones, esto significa que los numeros
que estan al lado derecho son los points que se les dara a dicha vocacion al subir de level


Ahora el archivo pointssystem.lua que esta en /data/talkactions/scripts :
Código:

local VocPoints = {
        [1] = 3,
        [2] = 3,
        [3] = 3,
        [4] = 5,
        [5] = 5,
        [6] = 5,
        [7] = 5,
        [8] = 8,
        }
Los numeros que estan entre [] son las id de las vocaciones, esto significa que los numeros
que estan al lado derecho son los points que se les dara a dicha vocacion al subir de level


Código:

local attributes = {
                ["health"] = {np = 2, vl = 5, nm = "Hit Points"}, -- Precisa usar 2 points para adicionar 10 de 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=cantidad de puntos que se necesitan.

vl=Cantidad de skill que adicionara.
Ejemplo:

Código:

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


CREDITOS:MaXwEllDeN 100%
YO solo traduci el script a español y coloque imagenes

avatar
Royal Ghouz™
Miembro
Mensajes Mensajes : 10

[Mod] Points system Empty Re: [Mod] Points system

Dom Abr 22, 2012 7:51 pm
exelente Maniatiko™
+rep
Volver arriba
Permisos de este foro:
No puedes responder a temas en este foro.