Postado Julho 19, 2014 10 anos Gostaria que me ajudassem com uma modificação no script do Max: http://www.tibiaking.com/forum/topic/12228-simple-level-points/ Queria que ao chegar no level 30 de sword por exemplo, ele custasse 40 pontos ao inves de 20, e ao atingir 70 custar 60, etc. Isso com os demais também, menos HP e MP. Creio que as mudanças sejam em um desses aqui:Creaturescripts/scripts/pointSystem.lua 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 Talkactions/scripts/pointSystem.lua 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"}, -- 2 Points to gain 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, "~*~*~ Add Attributes ~*~*~\n\nPoints Available: ".. getPlayerStorageValue(cid, 14574) .."\nLevel Points: ".. 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] == "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 .. " points".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n" end doPlayerPopupFYI(cid, "~*~*~ Add Attributes ~*~*~\n\nPoints needed for skill:\n\n".. msgx .. "\nExample of Use: ".. words .." add,health, 5\n\nPoints available: ".. getPlayerStorageValue(cid, 14574)) end return true end bamp
Postado Julho 19, 2014 10 anos z Editado Junho 15, 2015 9 anos por Danves (veja o histórico de edições)
Postado Julho 19, 2014 10 anos 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, np2 = 3, np3 = 4, np4 = 5, vl = 5, nm = "Hit Points"}, -- 2 Points to gain 10 hp ["energy"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 2, nm = "Mana Points"}, ["magic"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 1, nm = "Magic Level"}, ["shielding"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 1, nm = "Shielding Skill"}, ["sword"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 1, nm = "Sword Skill"}, ["axe"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 1, nm = "Axe Skill"}, ["club"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 1, nm = "Club Skill"}, ["distance"] = {np = 2, np2 = 3, np3 = 4, np4 = 5, vl = 1, nm = "Distance Skill"}, } if (param == "check") then doPlayerPopupFYI(cid, "~*~*~ Add Attributes ~*~*~\n\nPoints Available: ".. getPlayerStorageValue(cid, 14574) .."\nLevel Points: ".. 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] == "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) if getPlayerLevel(cid) <= 29 then setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np) elseif getPlayerLevel(cid) >= 30 and getPlayerLevel(cid) <= 49 then setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np2) elseif getPlayerLevel(cid) >= 50 and getPlayerLevel(cid) <= 69 then setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np3) elseif getPlayerLevel(cid) >= 70 then setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np4) end 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 .. " points".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n" end doPlayerPopupFYI(cid, "~*~*~ Add Attributes ~*~*~\n\nPoints needed for skill:\n\n".. msgx .. "\nExample of Use: ".. words .." add,health, 5\n\nPoints available: ".. getPlayerStorageValue(cid, 14574)) end return true end Skype : emersonaaron Se Te ajudei não me REP+ isso não muda nada! kkkkkkkkkkkk
Postado Julho 19, 2014 10 anos Acho que aí no caso tá mais caro pelo level do jogador, ele quis dizer mais caro por nível da skill, tipo, 30 de sword começa a usar o custo do seu "p3" na sword, etc.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.