Ir para conteúdo
  • Cadastre-se

Normal [ADD ML TFS 1.3] Skill Points Help!


Posts Recomendados

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á

Link para o post
Compartilhar em outros sites

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

 

Link para o post
Compartilhar em outros sites

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

 

 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo