Am si eu un quest de vouchere pe lua mai vechi, ele merg la forma initiala dar as dori cand apas pe voucher sa imi apara in chat ai primit % MD
Ma poate ajuta cineva cu modificarea?
TicketVouchers.lua
Cod: Selectaţi tot
quest TicketVoucher begin
state start begin
when 80014.use or 80015.use or 80016.use or 80017.use begin
TicketVoucherLib.GiveMD(item.get_vnum(), pc.get_account_id());
end
end
endCod: Selectaţi tot
--[[ ~~ Init TicketVoucherLib class ]]
TicketVoucherLib = {};
TicketVoucherLib.ReturnData = function()
if (TicketVoucherLib.data == nil) then
TicketVoucherLib.data = {
["80014"] = 50,
["80015"] = 100,
["80016"] = 150,
["80017"] = 200
};
end -- if
return TicketVoucherLib.data;
end -- func
TicketVoucherLib.ReturnItemVnum = function(vNum) return tostring(vNum); end
TicketVoucherLib.isAvailable = function()
if not pc.can_warp() then say("Trebuie sa astepti 10 secunde pentru a continua!") return false; end -- if
if (pc.count_item(item.get_vnum()) == 0) then say("Nu ai obiectul in inventar!") return false; end -- if
return true;
end -- func
TicketVoucherLib.GiveMD = function(vNum ,aId)
local data = TicketVoucherLib.ReturnData();
local MD_Value = data[TicketVoucherLib.ReturnItemVnum(vNum)];
if TicketVoucherLib.isAvailable() then return mysql_direct_query("UPDATE account.account SET coins = coins + "..MD_Value.." WHERE id = "..aId..";"), item.remove(); end -- if
return false;
end -- func



