Postado Junho 15, 2018 6 anos Olá, vim aqui pedir para alguém se possível claro colocar esses scripts para vocações editadas pegarem também o bau de acordo com a vocação, só quem está podendo pegar são as 4 principais vocações. local cfg = { kina= {11350, idsword}, pala = 11350, sorc = 12375, drui = 12375, } function onUse(cid, item) if getPlayerStorageValue(cid, 38495) ~= 1 then if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then doPlayerAddItem(cid, cfg.kina[1], 1) doPlayerAddItem(cid, cfg.kina[2], 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) elseif getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then doPlayerAddItem(cid, cfg.sorc, 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) elseif getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then doPlayerAddItem(cid, cfg.drui, 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) elseif getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then doPlayerAddItem(cid, cfg.pala, 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) end else doPlayerSendCancel(cid, "It's empty.") end return true end Eu tava mexendo, mas deu um probleminha, então, falta as vocações 9,10,11,12 Editado Junho 16, 2018 6 anos por Adm Evolution (veja o histórico de edições)
Postado Junho 15, 2018 6 anos 14 minutos atrás, Adm Evolution disse: Olá, vim aqui pedir para alguém se possível claro colocar esses scripts para vocações editadas pegarem também o bau de acordo com a vocação, só quem está podendo pegar são as 4 principais vocações. local cfg = { kina= {11350, idsword}, pala = 11350, sorc = 12375, drui = 12375, } function onUse(cid, item) if getPlayerStorageValue(cid, 38495) ~= 1 then if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then doPlayerAddItem(cid, cfg.kina[1], 1) doPlayerAddItem(cid, cfg.kina[2], 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) elseif getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then doPlayerAddItem(cid, cfg.sorc, 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) elseif getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then doPlayerAddItem(cid, cfg.drui, 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) elseif getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then doPlayerAddItem(cid, cfg.pala, 1) doPlayerSendTextMessage(cid, 25, "Congratulations!!") doPlayerSetStorageValue(cid, 38495, 1) end else doPlayerSendCancel(cid, "It's empty.") end return true end Eu tava mexendo, mas deu um probleminha, então, falta as vocações 9,10,11,12 Tenta esse: Spoiler function onUse(cid, item, frompos, item2, topos) local expReward = 100 voc = getPlayerVocation(cid) queststatus = getPlayerStorageValue(cid,1001) if voc == 1 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2190,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 2 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2182,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 3 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2410,5) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 4 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2379,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 9 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end else return 0 end return 1 end Onde esta: elseif voc == 9 then -- Coloca sua voc 'nova' if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!" -- Mensagem que irá aparecer ao abrir o baú doPlayerAddItem(cid,2650,1) --| ID do item e quantidade que ira ganhar doPlayerAddItem(cid,2512,1) --| doPlayerAddItem(cid,2649,1) --| doPlayerAddItem(cid,2461,1) --| doPlayerAddItem(cid,2554,1) --| doPlayerAddItem(cid,2120,1) --| doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') -- Mensagem de exp que você ganhou setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") -- Mensagem que ira aparecer quandovocê tentar abrir de novo Editado Junho 15, 2018 6 anos por peterson18 (veja o histórico de edições)
Postado Junho 15, 2018 6 anos @Adm Evolution local t = { [1] = {2160, 30}, {2151, 1}, {2159, 100}, -- [VocID] = {ID do item, Count} // Pode se repetir varias vezes [2] = {2160, 30}, [3] = {2160, 1}, [4] = {2160, 10} } local storage = 23523 -- Storage da quest function onUse(cid, item, fromPosition, itemEx, toPosition) if getCreatureStorage(cid, storage) == -1 then if t[getPlayerVocation(cid)] then local voc = t[getPlayerVocation(cid)] for a, b in pairs(voc) do doPlayerAddItem(cid, b[1], b[2]) end doCreatureSetStorage(cid, storage, 1) doPlayerSendTextMessage(cid, 27, "Parabens.") else doPlayerSendTextMessage(cid, 27, "Sua vocation não tem premio") return false end else doPlayerSendTextMessage(cid, 27, "Voce ja completou essa quest") return false end return true end
Postado Junho 16, 2018 6 anos Autor @Sttorm mas no caso eu irei editar o id das vocs novas e também essa área? doPlayerAddItem(cid, b[1], b[2]) Resolvido, apenas peguei essa parte: elseif getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then e adicionei mais um: or getPlayerVocation(cid) == 7 Ex: elseif getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 11 then Se alguém tiver com essa dúvida faça isso! que irá funcionar.
Postado Junho 16, 2018 6 anos @Adm Evolution Fazer isso é uma gambiarra e perca de tempo, pelo visto você nem chegou a testar a minha script. local t = { [1] = {2160, 30}, {2151, 1}, {2159, 100}, -- [VocID] = {ID do item, Count} // Pode se repetir varias vezes [2] = {2160, 30}, {2151, 10} -- Por exemplo, irá adicionar o item 2160 30 vezes e o item 2151 10 vezes [3] = {2160, 1}, -- Por exemplo, irá adicionar o item 2160 1 vez [4] = {2160, 10} -- Por exemplo, irá adicionar o item 2160 10 vezes } Entre as chaves você vai colocar o ID DA VOCATION , irá colocar um sinal de igual e ir colocando todas as tabelas de item que você queira, por exemplo na imagem a cima. Não tem pra fazer gambiarra se você pode usar uma tabela.
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.