Postado Agosto 25, 2020 4 anos .Qual servidor ou website você utiliza como base? TFS 0.4 Qual o motivo deste tópico? Alterar o script do Spellbook Você tem o código disponível? Se tiver publique-o aqui: function onUse(cid, item, fromPosition, itemEx, toPosition) local t = {} for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if(spell.level ~= 0) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.level) then if(i ~= 1) then line = "\n" end line = line .. "Spells for Level " .. spell.level .. "\n" prevLevel = spell.level end text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n" end doShowTextDialog(cid, item.itemid, text) return true end Prezados colegas, boa tarde. Gostaria de pedir ajuda para adicionar descrição às magias do spellbook. Sou péssimo em script mas minha ideia é adicionar um tabela tipo essa local spelldesc = { Exori vis = "Causa dano elétrico", } no script acima e introduzir a informação "Causa dano elétrico" na linha text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n" do spellbook. Alguém saberia como me ajudar? Grato pela atenção!
Postado Agosto 27, 2020 4 anos Solução so to com tfs 1.3 então não posso testa, mas tenta ai e me fala oq da local desc = { ["exori flam"] = "Dano do tipo 'fire' no alvo.", ["exori vis"] = "Dano do tipo 'energy' no alvo.", ["exori ice"] = "Dano do tipo 'ice' no alvo." } function onUse(cid, item, fromPosition, itemEx, toPosition) local t = {} for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if(spell.level ~= 0) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.level) then if(i ~= 1) then line = "\n" end line = line .. "Spells for Level " .. spell.level .. "\n" prevLevel = spell.level end local description = desc[spell.name] or "Sem descrição." text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " = "..description.." : " .. spell.mana .. "\n" end doShowTextDialog(cid, item.itemid, text) return true end Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Postado Agosto 28, 2020 4 anos Autor No momento estou na rua, acho q só vou conseguir testar amanhã. Mas já quero deixar aqui meu muito obrigado pela ajuda! Edit: mano, funcionou 99%, só tive que mudar as words das spells pelo nome delas (exemplo: de "exori vis" para Energy Strike. Muitíssimo obrigado! Editado Agosto 28, 2020 4 anos por gnomoffc (veja o histórico de edições)
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.