Postado Novembro 2, 2017 7 anos Olá pessoal, estou usando um sistema de skill points bem simples, ta tudo certinho, adicionando corretamente todos os dados, porém Magic Level, ele da apenas uma quantidade pequena, quando multipliquei o valor por 22 ele deu o ML inteiro, ai fui testar em kina e deu 21 ml's kkkkkkkkkkkkkk Segue a parte do código onde creio que deve ser modificado elseif (p2[2] == "magic") then player:addManaSpent(math.ceil((Vocation(getPlayerVocation(cid)):getRequiredManaSpent(player:getBaseMagicLevel() + 1) - player:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC))) ---Player receives message on Skill Advance Abaixo o código completo (é claro apenas a parte do talkaction que já está incluído as ações onde está o problema) local SkillPoints = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = 1, [8] = 1, [9] = 1, [10] = 1, [11] = 1, [12] = 1, } function onSay(cid, words, param) local player = Player(cid) local vocation = Player(cid) local voc = getPlayerVocation(cid) if not (SkillPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = param:split(",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["fist"] = 0, ["distance"] = 4 } local attributes = { ["health"] = {np = 5, vl = 5, skn = "Hit Points"}, ["mana"] = {np = 5, vl = 5, skn = "Mana Points"}, ["magic"] = {np = 6, vl = 1 , skn = "Magic Percentual"}, ["shielding"] = {np = 20, vl = 1, skn = "Shielding Skill"}, ["sword"] = {np = 20, vl = 1, skn = "Sword Skill"}, ["axe"] = {np = 20, vl = 1, skn = "Axe Skill"}, ["club"] = {np = 20, vl = 1, skn = "Club Skill"}, ["fist"] = {np = 10, vl = 1, skn = "Fist Skill"}, ["distance"] = {np = 20, vl = 1, skn = "Distance Skill"}, } if (param == "check") then doPlayerPopupFYI(cid, " <> <> <> <> <> <> Attribute Points <> <> <> <> <> <> \n\nPoints Available: ".. getPlayerStorageValue(cid, 14574) .."\nPoints Per Level: ".. SkillPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then local creature = Creature(cid) local cpos = creature:getPosition() if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then doPlayerSendCancel(cid, "you need more attribute points go hunt!") return cpos:sendMagicEffect(CONST_ME_POFF) end if (p2[2] == "health") then player:setMaxHealth(player:getMaxHealth() + attributes[p2[2]].vl * tonumber(p2[3])) player:addHealth(attributes[p2[2]].vl * tonumber(p2[3])) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been rewarded with ".. tonumber(p2[3]) * attributes[p2[2]].vl .. "Hit Points") elseif (p2[2] == "mana") then player:setMaxMana(player:getMaxMana() + attributes[p2[2]].vl * tonumber(p2[3])) player:addMana(attributes[p2[2]].vl * tonumber(p2[3])) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been rewarded with ".. tonumber(p2[3]) * attributes[p2[2]].vl .. "Mana Points") elseif (p2[2] == "magic") then player:addManaSpent(math.ceil((Vocation(getPlayerVocation(cid)):getRequiredManaSpent(player:getBaseMagicLevel() + 1) - player:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC))) ---Player receives message on Skill Advance elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do player:addSkillTries(skillids[p2[2]], player:getVocation():getRequiredSkillTries(skillids[p2[2]], player:getSkillLevel(skillids[p2[2]]) + 1 * 1) - player:getSkillTries(skillids[p2[2]])) --Player receives message on Level Advance end end 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 "" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " points".. add .. " -> " .. v.vl .. " ".. v.skn .. "\n" end doPlayerPopupFYI(cid, " <> <> <> <> <> <> Attribute Points <> <> <> <> <> <> \n\n Attribute Points are used to customize your character\n\nThe added points can not be recovered \n\n".. msgx .. "\nExample of Use: ".. words .." add,health, 1\n\nPoints available: ".. getPlayerStorageValue(cid, 14574)) end return true end REP+ Pra quem me ajudar! obrigado desde já
Postado Novembro 3, 2017 7 anos Hãm, verifique seu vocations.xml a parte (manamultiplier) e/ou Tenta substituir pra: elseif p2[2] == "magic" then for m = 1, tonumber(p2[3]) do doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid)), false) end
Postado Novembro 6, 2017 7 anos Autor Obrigado @Mirkaan Resolvi da seguinte maneira, deixei que mages e pallys conseguissem +1 ml e kinas um percentual na média do 50% pra mais ml baixo e pra menos ml alto elseif (p2[2] == "magic") then if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 11 or getPlayerVocation(cid) == 12 or getPlayerVocation(cid) == 9 or getPlayerVocation(cid) == 10 or getPlayerVocation(cid) == 3 then --doPlayerSendCancel(cid, "Only avaible for mages!") player:addManaSpent(math.ceil((Vocation(getPlayerVocation(cid)):getRequiredManaSpent(player:getBaseMagicLevel() + 1*2) - player:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC))) else player:addManaSpent(player:getVocation():getRequiredManaSpent(player:getBaseMagicLevel() + 1) - player:getManaSpent()) --player:addSkillTries(skillId, player:getVocation():getRequiredSkillTries(skillId, player:getSkillLevel(skillId) + 1) - player:getSkillTries(skillId)) end Obrigado de qlqr maneira! #offtopic @Mirkkan manja algo de mining system pra tfs 1.x +? to com 1.3 e nenhum q acho funciona, tem um que consegui pra 1.2 que parece perfeito, adicionei no action id do axe mas nao da bug, porém tb n funciona... kkkk
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.