Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. local indice = tonumber(arg[1]);
  2. local texto = "";
  3.  
  4. local filter = arg[2];
  5. local personagem = sheet;
  6.  
  7. if indice == nil or indice < 1 or indice > 6 then
  8. indice, texto = choose("Que teste deseja fazer?", {"Força", "Destreza", "Constituição", "Inteligência", "Sabedoria", "Carisma"}, 1);
  9. end;
  10. if filter == "all" or filter == "pc" or filter == "pcOnline" or filter=="npc" then
  11. personagem = getCharacterSheet(chooseCharacter("Qual personagem deseja testar "..texto.."?", filter));
  12. elseif filter == "mine" then
  13. personagem = getCharacterSheet(chooseCharacterOfPlayer("Qual personagem deseja testar "..texto.."?", myPlayer));
  14. end;
  15.  
  16. local teste = "1d20+";
  17. if indice == 1 then
  18. teste = teste .. math.floor((tonumber(personagem.atributos.forca) or 10) / 2) - 5;
  19. rolar(teste, "Teste de Força de " .. (personagem.nome or "Nome"));
  20. elseif indice == 2 then
  21. teste = teste .. math.floor((tonumber(personagem.atributos.destreza) or 10) / 2) - 5;
  22. rolar(teste, "Teste de Destreza de " .. (personagem.nome or "Nome"));
  23. elseif indice == 3 then
  24. teste = teste .. math.floor((tonumber(personagem.atributos.constituicao) or 10) / 2) - 5;
  25. rolar(teste, "Teste de Constituição de " .. (personagem.nome or "Nome"));
  26. elseif indice == 4 then
  27. teste = teste .. math.floor((tonumber(personagem.atributos.inteligencia) or 10) / 2) - 5;
  28. rolar(teste, "Teste de Inteligência de " .. (personagem.nome or "Nome"));
  29. elseif indice == 5 then
  30. teste = teste .. math.floor((tonumber(personagem.atributos.sabedoria) or 10) / 2) - 5;
  31. rolar(teste, "Teste de Sabedoria de " .. (personagem.nome or "Nome"));
  32. elseif indice == 6 then
  33. teste = teste .. math.floor((tonumber(personagem.atributos.carisma) or 10) / 2) - 5;
  34. rolar(teste, "Teste de Carisma de " .. (personagem.nome or "Nome"));
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement