antiblock
Rodnia | Alpha & Omega
  • Chatbox

    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
єxŧєrмiηαŧєr

Passar Quest Para Npc

Question

Boas cria passar esta quest para npc troco o 95005.use por idnpc.chat não aparece nada no npc e tambem a uma que é 95005.take 

 

quest:

 

 

----------------------------------------------
--Nome: Trocar Gold por Moedas
--Data: 11 de Dezembro de 2012
----------------------------------------------
quest moedas begin    
        state start begin
                when 95005.use begin
                        local gold             = pc.gold;
                        local count            = math.floor(gold / 1000000000);
                        say_title("Troca de Moedas");
                        say("Aqui podes trocar Yang por Moedas");
                        say("E Moedas por Yang");
                        say("");
                        say("");
                        say_reward("O que desejas fazer?");
                        local s = select("Yang->Moedas" , "Moedas->Yang","Cancelar");
                        if s == 3 then return end
                        if s == 1 then
                            say_title("Yang->Moedas");
                            say("Atualmente tens ".. gold .. " Yang");
                            say("Podes trocar por:");
                            say_title("- ".. count .. " Moedas de 1kkk ");
                            say_reward("Tens a certeza?");
                            local sel = select("Avançar ", "Cancelar");
                            if sel == 2 then return end
                            if gold < 1000000000 then
                                say_title("Erro!");
                                say("Não tens Yang necessário para fazer a troca!");
                                return
                            end
                            pc.changegold(-1000000000);
                            pc.give_item2(95002 , 1);
                            return
                        elseif s == 2 then
                            if pc.count_item(95002) < 1 then
                                say_title("ERRO!")
                                say("Não possuis nenhuma moeda de 1KKK");
                                return
                            end
                            local rm = 2000000000 - gold;
                            if rm <= 1000000000 then
                                say_title("Moedas->Yang");
                                say("Aqui podes trocar as moedas de 1KKK por Yang");
                                say("");
                                say("");
                                say_reward("Não posso trocar nenhuma Moeda");
                                say_reward("Porque a diferença entre o teu dinheiro e os 2KKK");
                                say_reward("É inferior a uma moeda de 1KKK");
                                say("E não quero que bugues o teu dinheiro");
                                return
                            end
                            say_title("Moedas->Yang");
                            say("Aqui podes trocar as moedas de 1KKK por Yang");
                            say("Posso-te trocar 1 Moeda de 1KKK, mais não posso!");
                            say("");
                            say_reward("Desejas fazê-lo?");
                            local sx = select("Sim!" , "Cancelar");
                            if sx == 2 then
                                return
                            end
                            pc.remove_item(95002 , 1)
                            pc.changegold(1000000000)
                        end
                end
             
                when 95005.take with
                item.vnum == 95002 or
                item.vnum == 95002 or
                item.vnum == 95002 begin
                    local gold = pc.gold;
                    local name = {}
                    name[95002] = "1KKK";
                    name[95002] = "5KKK";
                    name[95002] = "10KKK";
                    local value = {}
                    value[95002] = 1000000000;
                    value[95002] = 5000000000;
                    value[95002] = 10000000000;
                    say_title("Troca de Moedas");
                    say("Tens aí ".. item.get_count() .. " Moedas de ".. name[item.get_vnum()] .. "");
                    say("");
                    say("");
                    say_reward("O que desejas fazer?");
                    local sel = select("Trocar por Yang" , "Destrocar" , "Cancelar");
                    if sel == 3 then
                        return
                    end
                    if sel == 1 then
                        if gold + item.get_count() * value[item.get_vnum()] > 2000000000 then
                            say_title("ERRO!")
                            say("Não posso trocar essas moedas todas");
                            say("Senão o teu dinheiro buga!");
                            say("");
                            say("Separa as Moedas em quantidades menores usando a tecla SHIFT");
                            say("E depois volta a arrastar para aqui!");
                            return
                        end
                        pc.changegold(item.get_count() * value[item.get_vnum()]);
                        item.remove()
                    elseif sel == 2 then
                        local count =    item.get_count();
                        local real_money = count * value[item.get_vnum()];
                        local m            = math.floor(real_money / 1000000000);
                        local m2        = math.floor(real_money / 5000000000);
                        local m3        = math.floor(real_money / 10000000000);
                        say_title("Destrocar");
                        say("Aqui podes trocar moedas por moedas de valores diferentes");
                        say("Podes trocar por:")
                        say_title("- ".. m .. " Moedas de 1kkk ");
                        say_title("- ".. m2 .. " Moedas de 5kkk ");
                        say_title("- ".. m3 .. " Moedas de 10kkk ");
                        say_reward("Escolhe!");
                        local selx = select("1kkk" , "5kkk" , "10kkk" , "Cancelar");
                        if selx == 4 then
                            return
                        end
                        if selx == 1 then
                            if m <= 0 then
                                say_title("ERRO!");
                                say("Essas moedas não chegam para isto!");
                                return
                            end
                            if item.get_vnum() == 95002 then
                                pc.remove_item(95002, m)
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, math.floor(m / 5 ) )
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, math.floor(m / 10) ) -- 4 de 10KKK gera 40 de 1KKK e são removidas 4 de 10KKK
                            end
                            pc.give_item2(95002 , m);
                        elseif selx == 2 then
                            if m2 <= 0 then
                                say_title("ERRO!");
                                say("Essas moedas não chegam para isto!");
                                return
                            end
                            if item.get_vnum() == 95002 then
                                pc.remove_item(95002, m2 * 5  )
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, m2)
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, math.floor(m2 / 2) )
                            end
                            pc.give_item2(95002 , m2);
                        elseif selx == 3 then
                            if m3 <= 0 then
                                say_title("ERRO!");
                                say("Essas moedas não chegam para isto!");
                                return
                            end
                            if item.get_vnum() == 95002 then
                                pc.remove_item(95002, m3 * 10)
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, m3 * 2) -- 4 de 5KKK gera 2 de 10KKK e são removidas as 4 de 5KKK
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, m3 )
                            end
                                pc.give_item2(95002 , m3);
                        end
                    end
                end    
        end            
end

 

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0

----------------------------------------------

--Nome: Trocar Gold por Moedas
--Data: 11 de Dezembro de 2012
----------------------------------------------
quest moedas begin    
        state start begin
                when 95005.chat."Yang por Moedas." begin
                        local gold             = pc.gold;
                        local count            = math.floor(gold / 1000000000);
                        say_title("Troca de Moedas");
                        say("Aqui podes trocar Yang por Moedas");
                        say("E Moedas por Yang");
                        say("");
                        say("");
                        say_reward("O que desejas fazer?");
                        local s = select("Yang->Moedas" , "Moedas->Yang","Cancelar");
                        if s == 3 then return end
                        if s == 1 then
                            say_title("Yang->Moedas");
                            say("Atualmente tens ".. gold .. " Yang");
                            say("Podes trocar por:");
                            say_title("- ".. count .. " Moedas de 1kkk ");
                            say_reward("Tens a certeza?");
                            local sel = select("Avançar ", "Cancelar");
                            if sel == 2 then return end
                            if gold < 1000000000 then
                                say_title("Erro!");
                                say("Não tens Yang necessário para fazer a troca!");
                                return
                            end
                            pc.changegold(-1000000000);
                            pc.give_item2(95002 , 1);
                            return
                        elseif s == 2 then
                            if pc.count_item(95002) < 1 then
                                say_title("ERRO!")
                                say("Não possuis nenhuma moeda de 1KKK");
                                return
                            end
                            local rm = 2000000000 - gold;
                            if rm <= 1000000000 then
                                say_title("Moedas->Yang");
                                say("Aqui podes trocar as moedas de 1KKK por Yang");
                                say("");
                                say("");
                                say_reward("Não posso trocar nenhuma Moeda");
                                say_reward("Porque a diferença entre o teu dinheiro e os 2KKK");
                                say_reward("É inferior a uma moeda de 1KKK");
                                say("E não quero que bugues o teu dinheiro");
                                return
                            end
                            say_title("Moedas->Yang");
                            say("Aqui podes trocar as moedas de 1KKK por Yang");
                            say("Posso-te trocar 1 Moeda de 1KKK, mais não posso!");
                            say("");
                            say_reward("Desejas fazê-lo?");
                            local sx = select("Sim!" , "Cancelar");
                            if sx == 2 then
                                return
                            end
                            pc.remove_item(95002 , 1)
                            pc.changegold(1000000000)
                        end
                end
             
                when 95005.take with
                item.vnum == 95002 or
                item.vnum == 95002 or
                item.vnum == 95002 begin
                    local gold = pc.gold;
                    local name = {}
                    name[95002] = "1KKK";
                    name[95002] = "5KKK";
                    name[95002] = "10KKK";
                    local value = {}
                    value[95002] = 1000000000;
                    value[95002] = 5000000000;
                    value[95002] = 10000000000;
                    say_title("Troca de Moedas");
                    say("Tens aí ".. item.get_count() .. " Moedas de ".. name[item.get_vnum()] .. "");
                    say("");
                    say("");
                    say_reward("O que desejas fazer?");
                    local sel = select("Trocar por Yang" , "Destrocar" , "Cancelar");
                    if sel == 3 then
                        return
                    end
                    if sel == 1 then
                        if gold + item.get_count() * value[item.get_vnum()] > 2000000000 then
                            say_title("ERRO!")
                            say("Não posso trocar essas moedas todas");
                            say("Senão o teu dinheiro buga!");
                            say("");
                            say("Separa as Moedas em quantidades menores usando a tecla SHIFT");
                            say("E depois volta a arrastar para aqui!");
                            return
                        end
                        pc.changegold(item.get_count() * value[item.get_vnum()]);
                        item.remove()
                    elseif sel == 2 then
                        local count =    item.get_count();
                        local real_money = count * value[item.get_vnum()];
                        local m            = math.floor(real_money / 1000000000);
                        local m2        = math.floor(real_money / 5000000000);
                        local m3        = math.floor(real_money / 10000000000);
                        say_title("Destrocar");
                        say("Aqui podes trocar moedas por moedas de valores diferentes");
                        say("Podes trocar por:")
                        say_title("- ".. m .. " Moedas de 1kkk ");
                        say_title("- ".. m2 .. " Moedas de 5kkk ");
                        say_title("- ".. m3 .. " Moedas de 10kkk ");
                        say_reward("Escolhe!");
                        local selx = select("1kkk" , "5kkk" , "10kkk" , "Cancelar");
                        if selx == 4 then
                            return
                        end
                        if selx == 1 then
                            if m <= 0 then
                                say_title("ERRO!");
                                say("Essas moedas não chegam para isto!");
                                return
                            end
                            if item.get_vnum() == 95002 then
                                pc.remove_item(95002, m)
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, math.floor(m / 5 ) )
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, math.floor(m / 10) ) -- 4 de 10KKK gera 40 de 1KKK e são removidas 4 de 10KKK
                            end
                            pc.give_item2(95002 , m);
                        elseif selx == 2 then
                            if m2 <= 0 then
                                say_title("ERRO!");
                                say("Essas moedas não chegam para isto!");
                                return
                            end
                            if item.get_vnum() == 95002 then
                                pc.remove_item(95002, m2 * 5  )
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, m2)
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, math.floor(m2 / 2) )
                            end
                            pc.give_item2(95002 , m2);
                        elseif selx == 3 then
                            if m3 <= 0 then
                                say_title("ERRO!");
                                say("Essas moedas não chegam para isto!");
                                return
                            end
                            if item.get_vnum() == 95002 then
                                pc.remove_item(95002, m3 * 10)
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, m3 * 2) -- 4 de 5KKK gera 2 de 10KKK e são removidas as 4 de 5KKK
                            elseif item.get_vnum() == 95002 then
                                pc.remove_item(95002, m3 )
                            end
                                pc.give_item2(95002 , m3);
                        end
                    end
                end    
        end            
end
 
tenta agora.

Share this post


Link to post
Share on other sites
antiblock
Elveron
  • 0

when 95005.chat "Yang por Moedas." begin

 

se não der mete assim

 

when 95005.click "Yang por Moedas." begin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this