Item-shop la npc

  • Autor subiect Ionut
  • Dată creare
  • Răspunsuri: Răspunsuri 4
  • Vizualizări: Vizualizări 2K
I

Ionut

Nume Quest: Item-shop la npc
Ce face mai exact questul: iti ofera posibilitatea de a cumpara obiecte dintr-un quest cu monede dragon.
Quest-ul merge perfect,l-am testat inainte de a-l posta.
Quest:
Cod:
quest magazin_itemshop begin
    state start begin
        when 20093.chat."Magazinul item-shop" begin
local monede = mysql_query("SELECT coins from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
                say_title("Magazin item-shop")
                say("")
                say("Salut |cff56ff00|H|h"..pc.get_name().."|h|r ,")
                say("Aici poti sa-ti cheltuiesi monedele dragon obtinute")
                say("in fiecare ora de activitate pe server.")
                say("")
                say("Ai |cffffa700|H|h"..monede.."|h|r monede dragon.")
                say("")
                say("Slecteaza optiunea dorita:")
                say("")
                say("")
                say("")
local selecteaza = select ("Deschide magazin" , "Iesire")   
                if selecteaza == 1 then
                say_title("Magazin item-shop")
local lista_iteme = select(
"Sabie+0 (Pret:10)",
"Sabie+9 (Pret:100)",
"Piatra curcubeu (Pret:250)",
"Sabie lunga+9 (Pret:30)",
"Sabie lunga+0 (Pret:45)",
"Iesire"
)
local valori_iteme = {
-- ID ITEM | CANTITATE | PRET -
{10,1,10},
{19,1,100},
{50512,1,250},
{29,1,30},
{20,1,45},
}

                if lista_iteme != 6 then
local monede = mysql_query("SELECT coins from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
                if monede < valori_iteme[lista_iteme][3] then
                syschat("|cff56ff00|H|h[Metin2A]|h|r : Nu ai suficiente monede dragon in cont, mai ai nevoie de |cffffa700|H|h"..valori_iteme[lista_iteme][3]-monede.."|h|r monede dragon.")
                return
                end
                    pc.give_item2(valori_iteme[lista_iteme][1],valori_iteme[lista_iteme][2])
local selectare_tabel = mysql_query("SELECT coins from account.account WHERE id="..pc.get_account_id().." LIMIT 1")
local stergere_puncte = mysql_query("UPDATE account.account SET coins ='"..(selectare_tabel.coins[1]-valori_iteme[lista_iteme][3]).."' WHERE id="..pc.get_account_id().." LIMIT 1")
                    syschat("|cff56ff00|H|h[Metin2A]|h|r : Au fost retrase din contul tau |cffffa700|H|h"..valori_iteme[lista_iteme][3].."|h|r monede dragon.")
                end
            end
        end
    end
end
 
  • Like
Reacții: [Mr]Demonul