Lσяdρяiмє® 37 Posted November 28, 2013 quest caixalivros2 begin state start begin when 50131.use begin say_title("Caixa do Livro de Habilidades") say("") say("Escolhe um tipo:") say("") say("") local s = select("Corpo", "Mental", "Adagas", "Arco", "Armas", "Magia", "Dragao", "Cura", "Cancelar") local classes = math.random(1,8) local corpo = {{50401, 1}, {50402, 1}, {50403, 1}, {50404, 1},{50405, 1}} local mental = {{50416, 1}, {50417, 1}, {50418, 1}, {50419, 1},{50420, 1}} local adagas = {{50431, 1}, {50432, 1}, {50433, 1}, {50434, 1},{50435, 1}} local arco = {{50446, 1}, {50447, 1}, {50448, 1}, {50449, 1},{50450, 1}} local armas = {{50461, 1}, {50462, 1}, {50463, 1}, {50464, 1},{50465, 1},{50466, 1}} local magia = {{50476, 1}, {50477, 1}, {50478, 1}, {50479, 1},{50480, 1},{50481, 1}} local dragao = {{50491, 1}, {50492, 1}, {50493, 1}, {50494, 1},{50495, 1},{50496, 1}} local cura = {{50506, 1}, {50507, 1}, {50508, 1}, {50509, 1},{50510, 1},{50511, 1}} if 1==s then if classes == 1 then pc.give_item2(corpo[math.random(1,5)][1]) pc.remove_item(50132, 1) elseif 2==s then elseif classes == 2 then pc.give_item2(mental[math.random(1,5)][1]) pc.remove_item(50132, 1) elseif 3==s then elseif classes == 3 then pc.give_item2(adagas[math.random(1,5)][1]) pc.remove_item(50132, 1) elseif 4==s then elseif classes == 4 then pc.give_item2(arco[math.random(1,5)][1]) pc.remove_item(50132, 1) elseif 5==s then elseif classes == 5 then pc.give_item2(armas[math.random(1,6)][1]) pc.remove_item(50132, 1) elseif 6==s then elseif classes == 6 then pc.give_item2(magia[math.random(1,6)][1]) pc.remove_item(50132, 1) elseif 7==s then elseif classes == 7 then pc.give_item2(dragao[math.random(1,6)][1]) pc.remove_item(50132, 1) elseif 8==s then elseif classes == 8 then pc.give_item2(cura[math.random(1,6)][1]) pc.remove_item(50132, 1) elseif 9==s then say("") say("Nao te preocupes, podes na mesma") say("abrir a caixa outravez!") say("") wait() end end end endend Alguem me sabe dizer o erro nesta quest que fiz? Cumprimentos Share this post Link to post Share on other sites
0 Lσяdρяiмє® 37 Posted November 28, 2013 Estou a tentar criar uma quest que ao escolher um tipo de habilidade me dê um manual random desse tipo de habilidade. Não sei se está bem feita, tentei fazê-la com os conhecimentos que adquiri. Share this post Link to post Share on other sites
0 'PACI 2,317 Posted November 28, 2013 local array = { [1] = {livro1,livro2,livro3,...}, [2] = {livro1,livro2,livro3,...}, [3] = {livro1,livro2,livro3,...}, [4] = {livro1,livro2,livro3,...}, [5] = {livro1,livro2,livro3,...}, [6] = {livro1,livro2,livro3,...}, [7] = {livro1,livro2,livro3,...}, [8] = {livro1,livro2,livro3,...}}if s != 9 then pc.give_item2(array[s][math.random(1,6)]) pc.remove_item(50132, 1) end[] -> opções{} -> ids livros 2 NicolauMelo and Lσяdρяiмє® reacted to this Share this post Link to post Share on other sites
0 Lσяdρяiмє® 37 Posted November 29, 2013 Assim? quest caixalivros2 begin state start begin when 50131.use begin say_title("Caixa do Livro de Habilidades") say("") say("Escolhe um tipo:") say("") say("") local s = select("Corpo", "Mental", "Adagas", "Arco", "Armas", "Magia", "Dragao", "Cura", "Cancelar") local array = { [1] = {50401,50402,50403,50404,50405}, [2] = {50416,50416,50416,50416,50416}, [3] = {50431,50431,50431,50431,50431}, [4] = {50446,50446,50446,50446,50446}, [5] = {50461,50461,50461,50461,50461,50461}, [6] = {50476,50477,50478,50479,50480,50481}, [7] = {50491,50492,50493,50494,50495,50496}, [8] = {50506,50507,50508,50509,50510,50511},} if s != 9 then pc.give_item2(array[s][math.random(1,6)]) pc.remove_item(50131, 1) elseif 9==s then say("") say("Nao te preocupes, podes na mesma") say("abrir a caixa outravez!") say("") wait() end end endend Share this post Link to post Share on other sites
0 Avarath 1 Posted November 29, 2013 Estar elseif 9==s Ou elseif s==9 é igual?.. Share this post Link to post Share on other sites
0 Lσяdρяiмє® 37 Posted November 29, 2013 Ok ja consegui. Muito Obrigado Pacificador pela ajuda dou-te Share this post Link to post Share on other sites
0 SINVAL o.O 728 Posted November 29, 2013 Estar elseif 9==s Ou elseif s==9 é igual?.. Não correto é elseif s == 9 Share this post Link to post Share on other sites
0 'PACI 2,317 Posted November 29, 2013 Não correto é elseif s == 9É igual... Share this post Link to post Share on other sites
Alguem me sabe dizer o erro nesta quest que fiz?
Cumprimentos
Share this post
Link to post
Share on other sites