Register for your free account! | Forgot your password?

You last visited: Today at 21:33

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[QUEST-RELEASE]Auction System

Discussion on [QUEST-RELEASE]Auction System within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2010
Posts: 30
Received Thanks: 11
[QUEST-RELEASE]Auction System

Hi epvp,

About quest:
It's very simple script in lua for metin2, from .
The script is very short, it have only 1100 line.
The source code by: masodikbela, from hungary.
If be more than 50 records in the tables, it will very laggy

Use:
In the rar archive are two .sql files, you have to put these tables into the player database.
Stuffs in the questlib.lua, put the end of the quest/questlib.lua.
If you want to take something to auction, you have to put the item to the first position in the warehouse.

The quest:
PHP Code:
----------------------------------------------------------------
--------------- 
Author: [TECH]masodikbela ----------------------
--------------- 
Create time2013.01.05. -----------------------
--------------- 
Auction quest for AzorisMt2 --------------------
----------------------------------------------------------------

quest mb_02_auction begin
    state start begin
        when 20355.chat
."Aukcióra" begin
            local owner_id 
mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
            
local id
            
for i,v in ipairs(owner_id) do
                
id v[1]
            
end
            
            local tbla 
mysql_sweb("SELECT auid FROM fwmt2_bela.auction WHERE owner_id='"..id.."' LIMIT 5;")
            
local count = {}
            
            for 
i,v in ipairs(tbla) do
                
table.insert(countv[1])
            
end
            
            
if pc.get_level() < 100 then
                say
("Legalább 100-as szintűnek kell lenned!")
            elseif 
table.getn(count) >= 5 then
                say
("Maximum 5 tárgyad lehet aukción egyszerre!")
            else
                
say_title("Aukció vezető:")
                
say_reward("FIGYELEM! A raktárad első helyén lévő ")
                
say_reward("tárgyat fogod aukcióra küldeni!!!")
                
say_reward("Jól gondold meg[DELAY value;1000]. . .[/DELAY]")
                
say("Biztosan aukcióra szeretnéd bocsájtani ezt")
                
say("a tárgyat?")
                
                
local select1 select("Igen""Nem")
                if 
select1 == 1 then
                    say
("Add meg, hogy hány rúd legyen a kezdő (0 ha nincs)")
                    
say()
                    
local inp input()
                    
                    
                    if 
inp == "" or tonumber(inp) == nil then
                        say
("Nem hagyhatod üresen!")
                    
end
                    
                    
if tonumber(inp) < or tonumber(inp) > 200 then
                        say
("Meg kell adnod egy számot, ami:")
                        
say("- nem kisebb mint 0")
                        
say("- nem nagyobb mint 200")
                        return
                    
end
                    
                    local ipn 
string.format("%.0f"tonumber(inp))
                    
                    
local owner_id mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
                    
local id
                    
for i,v in ipairs(owner_id) do
                        
id v[1]
                    
end
                        
                    local acc_id 
mysql_select("SELECT account_id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
                    
local accid
                    
for i,v in ipairs(acc_id) do
                        
accid v[1]
                    
end
                    
                    local tbl 
mysql_select("SELECT vnum FROM player.item WHERE owner_id="..string.format("%q",accid).." and window='SAFEBOX' and pos='0';")
                    
local vnum 0
                    
                    
for i,v in ipairs(tbl) do
                        
vnum tonumber(v[1])
                    
end
                    
                    
if tonumber(vnum) > 0 then
                        say_reward
("A tárgyad elhelyeztük az aukcióházban")
                    else
                        
say_reward("Nincs tárgyad a raktárad 1. pozícióján!")
                        return
                    
end
                    
                    local table 
mysql_select("SELECT owner_id, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, id FROM player.item WHERE owner_id="..string.format("%q",accid).." and window='SAFEBOX' and pos='0';")
                    for 
i,v in ipairs(table) do
                        
mysql_notsweb("INSERT INTO fwmt2_bela.auction (id, started, date, owner_id, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, minlimit) VALUES ('"..v[24].."', "..string.format("%q",get_time()+60*60*24)..", "..string.format("%q",os.date('%Y%m%d'))..", '"..id.."', '"..v[2].."', '"..v[3].."', '"..v[4].."', '"..v[5].."', '"..v[6].."', '"..v[7].."', '"..v[8].."', '"..v[9].."', '"..v[10].."', '"..v[11].."', '"..v[12].."', '"..v[13].."', '"..v[14].."', '"..v[15].."', '"..v[16].."', '"..v[17].."', '"..v[18].."', '"..v[19].."', '"..v[20].."', '"..v[21].."', '"..v[22].."', '"..v[23].."', '"..ipn.."');")                                
                        
mysql_notselect("DELETE FROM player.item WHERE id='"..v[24].."';")
                    
end
                end
            end
        end
        
        when 20355.chat
."Áruk" begin
            local curpage 
1
            local curloaded 
5
            local data 
mb_02_auction.loaddata()
            
            if 
table.getn(data[1]) < 1 then
                say
("Jelenleg nincs aukció!")
                return
            
end
            
            local auid_list 
data[1]
            
local name_list data[2]
            
            
local menu_list = {}
            --
table.foreach(name_list, function(inametable.insert(menu_listnameend)
            
table.insert(menu_listname_list[1])
            
table.insert(menu_listname_list[2])
            
table.insert(menu_listname_list[3])
            
table.insert(menu_listname_list[4])
            
table.insert(menu_listname_list[5])
            if 
table.getn(name_list) > 5 then
                table
.insert(menu_list"Tovább")
                
table.insert(menu_list"Mégse")
            else
                
table.insert(menu_list"Mégse")
            
end
            local s
=select_table(menu_list)
            
            if 
table.getn(menu_list) <= 6 then
                
if == table.getn(menu_listthen
                    
return
                
end
            
else
                if 
== table.getn(menu_listthen
                    
return
                elseif 
== table.getn(menu_list) - 1 then
                    mb_02_auction
.nextpage(curpage 1curloaded 5auid_listname_list)
                
end
            end
            
            
if table.getn(menu_list) < 7 then
                
if table.getn(menu_list) == 2 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 3 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 4 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 5 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                    elseif 
== 4 then
                        mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 6 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                    elseif 
== 4 then
                        mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list3)
                    elseif 
== 5 then
                        mb_02_auction
.item(auid_list[curloaded], name_list[curloaded], curpagecurloadedauid_listname_list3)
                    
end
                end
            
else
                if 
== 1 then
                    mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                elseif 
== 2 then
                    mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                elseif 
== 3 then
                    mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                elseif 
== 4 then
                    mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list3)
                elseif 
== 5 then
                    mb_02_auction
.item(auid_list[curloaded], name_list[curloaded], curpagecurloadedauid_listname_list3)
                
end
            end
        end
        
        
function loaddata()
            
local tbla mysql_sweb("SELECT auid FROM fwmt2_bela.auction WHERE started > '"..get_time().."';")
            
local tbl = {}
            for 
i,v in ipairs(tbla) do
                
table.insert(tblv[1])
            
end
            
            local name_list 
= {}
            
local auid_list = {}
            
            
table.foreach(tbl
                function(
iauid)
                    
local vnum
                    local vnuam 
mysql_sweb("SELECT vnum FROM fwmt2_bela.auction WHERE auid='"..auid.."';")
                    for 
i,v in ipairs(vnuam) do
                        
vnum v[1]
                    
end
                        
                    local namet 
mysql_select("SELECT locale_name FROM player.item_proto WHERE vnum ='"..vnum.."';")
                    
local name
                    
for i,v in ipairs(namet) do
                        
name v[1]
                    
end
                        
                    table
.insert(auid_listauid)
                    
table.insert(name_listname)
                
end)
            return {
auid_listname_list}
        
end
        
        
function nextpage(curpagecurloadedauid_listname_list)
            
local menu_list = {}
            
local loadbug curloaded 5
            local maradek 
table.getn(auid_list) - loadbug
            
            
if maradek <= 5 then
                
if maradek == 1 then
                    table
.insert(menu_listname_list[curloaded -4])
                    
table.insert(menu_list"Vissza")
                    
table.insert(menu_list"Mégse")
                elseif 
maradek == 2 then
                    table
.insert(menu_listname_list[curloaded -4])
                    
table.insert(menu_listname_list[curloaded -3])
                    
table.insert(menu_list"Vissza")
                    
table.insert(menu_list"Mégse")
                elseif 
maradek == 3 then
                    table
.insert(menu_listname_list[curloaded -4])
                    
table.insert(menu_listname_list[curloaded -3])
                    
table.insert(menu_listname_list[curloaded -2])
                    
table.insert(menu_list"Vissza")
                    
table.insert(menu_list"Mégse")
                elseif 
maradek == 4 then
                    table
.insert(menu_listname_list[curloaded -4])
                    
table.insert(menu_listname_list[curloaded -3])
                    
table.insert(menu_listname_list[curloaded -2])
                    
table.insert(menu_listname_list[curloaded -1])
                    
table.insert(menu_list"Vissza")
                    
table.insert(menu_list"Mégse")
                elseif 
maradek == 5 then
                    table
.insert(menu_listname_list[curloaded -4])
                    
table.insert(menu_listname_list[curloaded -3])
                    
table.insert(menu_listname_list[curloaded -2])
                    
table.insert(menu_listname_list[curloaded -1])
                    
table.insert(menu_listname_list[curloaded])
                    
table.insert(menu_list"Vissza")
                    
table.insert(menu_list"Mégse")
                
end
                
            
else
                
table.insert(menu_listname_list[curloaded -4])
                
table.insert(menu_listname_list[curloaded -3])
                
table.insert(menu_listname_list[curloaded -2])
                
table.insert(menu_listname_list[curloaded -1])
                
table.insert(menu_listname_list[curloaded])
                
table.insert(menu_list"Tovább")
                
table.insert(menu_list"Vissza")
                
table.insert(menu_list"Mégse")
            
end
            
            local s
=select_table(menu_list)
            
            
            if 
== table.getn(menu_list) - 1 then
                mb_02_auction
.prevpage(curpage 1curloaded 5auid_listname_list)
            
end
            
            
if maradek and == table.getn(menu_list) - 2 then
                mb_02_auction
.nextpage(curpage 1curloaded 5auid_listname_list)
            
end
            
            
if == table.getn(menu_listthen
                
return
            
end
            
            
if table.getn(menu_list) < 8 then
                
if table.getn(menu_list) == 3 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list2)
                    
end
                
elseif table.getn(menu_list) == 4 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list2)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list2)
                    
end
                
elseif table.getn(menu_list) == 5 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list2)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list2)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list2)
                    
end
                
elseif table.getn(menu_list) == 6 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list2)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list2)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list2)
                    elseif 
== 4 then
                        mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list2)
                    
end
                
elseif table.getn(menu_list) == 7 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list2)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list2)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list2)
                    elseif 
== 4 then
                        mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list2)
                    elseif 
== 5 then
                        mb_02_auction
.item(auid_list[curloaded], name_list[curloaded], curpagecurloadedauid_listname_list2)
                    
end
                end
            
else
                if 
== 1 then
                    mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list2)
                elseif 
== 2 then
                    mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list2)
                elseif 
== 3 then
                    mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list2)
                elseif 
== 4 then
                    mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list2)
                elseif 
== 5 then
                    mb_02_auction
.item(auid_list[curloaded], name_list[curloaded], curpagecurloadedauid_listname_list2)
                
end
            end
        end
        
        
function prevpage(pageloadedauid_listname_list)
            
            
local menu_list = {}
            
local maradek table.getn(auid_list)
            
            if 
page == 1 then
                
if maradek == 1 then
                    table
.insert(menu_listname_list[loaded -4])
                elseif 
maradek == 2 then
                    table
.insert(menu_listname_list[loaded -4])
                    
table.insert(menu_listname_list[loaded -3])
                elseif 
maradek == 3 then
                    table
.insert(menu_listname_list[loaded -4])
                    
table.insert(menu_listname_list[loaded -3])
                    
table.insert(menu_listname_list[loaded -2])
                elseif 
maradek == 4 then
                    table
.insert(menu_listname_list[loaded -4])
                    
table.insert(menu_listname_list[loaded -3])
                    
table.insert(menu_listname_list[loaded -2])
                    
table.insert(menu_listname_list[loaded -1])
                elseif 
maradek >= 5 then
                    table
.insert(menu_listname_list[loaded -4])
                    
table.insert(menu_listname_list[loaded -3])
                    
table.insert(menu_listname_list[loaded -2])
                    
table.insert(menu_listname_list[loaded -1])
                    
table.insert(menu_listname_list[loaded])
                
end
            
else
                
table.insert(menu_listname_list[loaded -4])
                
table.insert(menu_listname_list[loaded -3])
                
table.insert(menu_listname_list[loaded -2])
                
table.insert(menu_listname_list[loaded -1])
                
table.insert(menu_listname_list[loaded])
            
end
            
            
if page == and table.getn(auid_list) > 5 then
                table
.insert(menu_list"Tovább")
            elseif 
page != 1 then
                table
.insert(menu_list"Tovább")
                
table.insert(menu_list"Vissza")
            
end
            
            table
.insert(menu_list"Mégse")
            
            
local s select_table(menu_list)
            
            if 
== table.getn(menu_listthen
                
return
            
end
            
            
if page == and == table.getn(menu_list) - 1 then
                mb_02_auction
.nextpage(page 1loaded +5auid_listname_list)
            
end
            
            
if page and == table.getn(menu_list) - 2 then
                mb_02_auction
.nextpage(page 1loaded +5auid_listname_list)
            
end
            
            
if page and == table.getn(menu_list) - 1 then
                mb_02_auction
.prevpage(page 1loaded 5auid_listname_list)
            
end
            
            
if == 1 then
                mb_02_auction
.item(auid_list[loaded 4], name_list[loaded 4], pageloadedauid_listname_list1)
            elseif 
== 2 then
                mb_02_auction
.item(auid_list[loaded 3], name_list[loaded 3], pageloadedauid_listname_list1)
            elseif 
== 3 then
                mb_02_auction
.item(auid_list[loaded 2], name_list[loaded 2], pageloadedauid_listname_list1)
            elseif 
== 4 then
                mb_02_auction
.item(auid_list[loaded 1], name_list[loaded 1], pageloadedauid_listname_list1)
            elseif 
== 5 then
                mb_02_auction
.item(auid_list[loaded], name_list[loaded], pageloadedauid_listname_list1)
            
end
        end
        
        
function item(auidnamepageloadedauid_listname_listpg)
            
            
local owid mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
            
local id
            
for i,v in ipairs(owid) do
                
id v[1]
            
end
                    
            local acc_id 
mysql_select("SELECT account_id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
            
local accid
            
for i,v in ipairs(acc_id) do
                
accid v[1]
            
end
        
            local d
            local da
            local namex
            
            local load_d 
mysql_sweb("SELECT lastprice, lastid, started, owner_id, count, socket0, socket1, socket2, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, minlimit FROM fwmt2_bela.auction WHERE auid='"..auid.."';")
            
local lastprice
            local started
            local lastid
            local owner_id
            local count
            local attrtype0
            local attrvalue0
            local socket2
            local socket1
            local socket0
            local attrtype1
            local attrvalue1
            local attrtype2
            local attrvalue2
            local attrtype3
            local attrvalue3
            local attrtype4
            local attrvalue4
            local attrtype5
            local attrvalue5
            local attrtype6
            local attrvalue6
            local minlimit
            
for i,v in ipairs(load_d) do
                
lastprice v[1]
                
lastid v[2]
                
started v[3]
                
owner_id v[4]
                
count v[5]
                
socket0 v[6]
                
socket1 v[7]
                
socket2 v[8]
                
attrtype0 v[9]
                
attrvalue0 v[10]
                
attrtype1 v[11]
                
attrvalue1 v[12]
                
attrtype2 v[13]
                
attrvalue2 v[14]
                
attrtype3 v[15]
                
attrvalue3 v[16]
                
attrtype4 v[17]
                
attrvalue4 v[18]
                
attrtype5 v[19]
                
attrvalue5 v[20]
                
attrtype6 v[21]
                
attrvalue6 v[22]
                
minlimit v[23]
            
end
            
            
if tonumber(lastprice) == and tonumber(minlimit) > 0 then
                say_title
(name.." Ár: "..minlimit.." rúd")
            else
                
say_title(name.." Ár: "..lastprice.." rúd")
            
end
            local savezeit 
tonumber(started)
            
local akzeit get_time()
            
local wartezeit savezeit akzeit
            
if wartezeit 0 then
                local wartemin 
0
                local wartestunde 
0
                
while (wartezeit >= 3600) do
                    
wartestunde wartestunde 1
                    wartezeit 
wartezeit 3600
                end
                
while (wartezeit >= 60) do
                    
wartemin wartemin 1
                    wartezeit 
wartezeit 60
                end
                
if wartestunde 0 then
                    say
("Aukció vége: "..wartestunde.." óra "..wartemin.." perc múlva.")
                elseif 
wartemin 0 then
                    say
("Aukció vége: "..wartemin.." perc és "..wartezeit.." másodperc múlva.")
                else
                    
say("Aukció vége: "..wartezeit.." másodperc múlva.")
                
end
            
else
                
say_reward("Az aukciónak vége!")
            
end
            
            
if tonumber(count) != 1 then
                say
("Darab: "..count)
            
end
            
            
if tonumber(socket0) != and tonumber(socket0) !=and tonumber(socket1) !=3 then
                da 
mysql_select("SELECT locale_name FROM player.item_proto WHERE vnum='"..socket0.."';")
                for 
i,v in ipairs(da) do
                    
v[1]
                
end
                say
("1. kő: "..d)
            
end
            
            
if tonumber(socket1) != and tonumber(socket1) !=and tonumber(socket1) !=3 then
                da 
mysql_select("SELECT locale_name FROM player.item_proto WHERE vnum='"..socket1.."';")
                for 
i,v in ipairs(da) do
                    
v[1]
                
end
                say
("2. kő: "..d)
            
end
            
            
if tonumber(socket2) != and tonumber(socket2) !=and tonumber(socket2) != 21600 then
                da 
mysql_select("SELECT locale_name FROM player.item_proto WHERE vnum='"..socket2.."';")
                for 
i,v in ipairs(da) do
                    
v[1]
                
end 
                say
("3. kő: "..d)
            
end
            
            
if tonumber(attrtype0) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype0))
                
say("1. opt: "..namex..": "..attrvalue0)
            
end
            
            
if tonumber(attrtype1) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype1))
                
say("2. opt: "..namex..": "..attrvalue1)
            
end
            
            
if tonumber(attrtype2) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype2))
                
say("3. opt: "..namex..": "..attrvalue2)
            
end
            
            
if tonumber(attrtype3) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype3))
                
say("4. opt: "..namex..": "..attrvalue3)
            
end
            
            
if tonumber(attrtype4) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype4))
                
say("5. opt: "..namex..": "..attrvalue4)
            
end
            
            
if tonumber(attrtype5) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype5))
                
say("6. opt: "..namex..": "..attrvalue5)
            
end
            
            
if tonumber(attrtype6) != 0 then
                namex 
mb_02_auction.bonus(tonumber(attrtype6))
                
say("7. opt: "..namex..": "..attrvalue6)
            
end
            
            local s 
select("Licitál""Frissít""Vissza")
            
            if 
== 2 then
                local updaterog 
mb_02_auction.giverog()
                if 
tonumber(updaterog) > 0 then
                    say_reward
("Visszakaptál "..tonumber(updaterog).." darab rögöt.")
                
end
                mb_02_auction
.item(auidnamepageloadedauid_listname_listpg)
                
            elseif 
== 3 then
                
if pg == or pg == 3 then
                    mb_02_auction
.prevpage(pageloadedauid_listname_list)
                elseif 
pg == 2 then
                    mb_02_auction
.nextpage(pageloadedauid_listname_list)
                
end
            
elseif == 1 then
                
if tonumber(started) <= get_time() then
                    say
("Az aukciónak vége!")
                    
mb_02_auction.item(auidnamepageloadedauid_listname_listpg)
                else
                    
local xa mysql_sweb("SELECT lastprice FROM fwmt2_bela.auction WHERE auid='"..auid.."';")
                    
local xc
                    
for i,v in ipairs(xa) do
                        
xc v[1]
                    
end
                    
                    
if tonumber(lastprice) - tonumber(xc) != 0 then
                        say
("Megelőztek!")
                        
mb_02_auction.item(auidnamepageloadedauid_listname_listpg)
                    
end
                    
                    local count1 
pc.countitem(80007)
                    
                    if 
count1 tonumber(lastprice) + 1 then
                        say
("Szegény vagy mint a templom egere...")
                        
say("Nincs elég rudad!")
                        
mb_02_auction.item(auidnamepageloadedauid_listname_listpg)
                    
end
                    
                    
if tonumber(lastprice) == and tonumber(minlimit) > 0 then
                        mysql_notsweb
("UPDATE fwmt2_bela.auction SET lastprice=minlimit + 1 WHERE auid='"..auid.."';")
                        
mysql_notsweb("UPDATE fwmt2_bela.auction SET lastid='"..id.."' WHERE auid='"..auid.."';")
                        
pc.removeitem(80007tonumber(minlimit 1))
                    elseif 
tonumber(lastprice) == and tonumber(minlimit) == 0 then
                        mysql_notsweb
("UPDATE fwmt2_bela.auction SET lastprice=lastprice + 1 WHERE auid='"..auid.."';")
                        
mysql_notsweb("UPDATE fwmt2_bela.auction SET lastid='"..id.."' WHERE auid='"..auid.."';")
                        
pc.removeitem(800071)
                    elseif 
tonumber(lastprice) > and tonumber(lastid) != tonumber(idthen
                        local asddwq 
tonumber(lastprice) + 1
                        mysql_notsweb
("INSERT INTO fwmt2_bela.auction_reward (id, count) VALUES ('"..lastid.."', '"..lastprice.."');")
                        
mysql_notsweb("UPDATE fwmt2_bela.auction SET lastprice=lastprice + 1 WHERE auid='"..auid.."';")
                        
mysql_notsweb("UPDATE fwmt2_bela.auction SET lastid='"..id.."' WHERE auid='"..auid.."';")
                        
pc.removeitem(80007tonumber(lastprice)+1)
                    
end
                    
                    mb_02_auction
.item(auidnamepageloadedauid_listname_listpg)
                
end
            end
        end
        
        
function bonus(id)
            
local name
            
if id == 1 then
                name 
"Max TP"
            
elseif id == 2 then
                name 
"Max MP"
            
elseif id == 3 then
                name 
"VIT"
            
elseif id == 4 then
                name 
"INT"
            
elseif id == 5 then
                name 
"ERŐ "
            
elseif id == 6 then
                name 
"ÜGY"
            
elseif id == 7 then
                name 
"Támadó sebesség"
            
elseif id == 8 then
                name 
"Mozgási sebesség"
            
elseif id == 9 then
                name 
"Varázs sebesség"
            
elseif id == 10 then
                name 
"TP regenerálódás"
            
elseif id == 11 then
                name 
"MP regenerálódás"
            
elseif id == 12 then
                name 
"Mérgezési esély"
            
elseif id == 13 then
                name 
"Ájulási esély"
            
elseif id == 14 then
                name 
"Lelassulás esély"
            
elseif id == 15 then
                name 
"Esély kritikus találatra"
            
elseif id == 16 then
                name 
"Esély átható találatra"
            
elseif id == 17 then
                name
="Félemberek elleni erő "
            
elseif id == 18 then
                name 
"Állatok elleni erő "
            
elseif id == 19 then
                name 
"Ork elleni erő "
            
elseif id == 20 then
                name 
"Ezotéria elleni erő "
            
elseif id == 21 then
                name 
"Nemhalottak elleni erő "
            
elseif id == 22 then
                name 
"Ördög elleni erő "
            
elseif id == 23 then
                name 
"Veszteségek a TP-böl eltűnnek"
            
elseif id == 24 then
                name
"Veszteségek az MP-böl eltűnnek"
            
elseif id == 25 then
                name 
"Esély az ellenség Mp-inek átvételére"
            
elseif id == 26 then
                name 
"Esély hogy az MP-t találatnál megtartsd"
            
elseif id == 27 then
                name 
"Esély a testi támadás kivédésére"
            
elseif id == 28 then
                name 
="Esély a nyilak elkerülésére"
            
elseif id == 29 then
                name 
"Kard védelem"
            
elseif id == 30 then
                name 
"Kétkezes védelem"
            
elseif id == 31 then
                name 
"Tőr védekezés"
            
elseif id == 32 then
                name 
"Harang védelem"
            
elseif id == 33 then
                name 
"Legyező védekezés"
            
elseif id == 34 then
                name 
"Nyíl ellenállás"
            
elseif id == 35 then
                name 
"Tűz ellenállás"
            
elseif id == 36 then
                name 
"Villám ellenállás"
            
elseif id == 37 then
                name 
"Mágia ellenállás"
            
elseif id == 38 then
                name 
"Szél ellenállás"
            
elseif id == 39 then
                name 
"Esély a támadás visszaverésére"
            
elseif id == 40 then
                name 
"Esély az átok visszaverésére"
            
elseif id == 41 then
                name 
"Méreg ellenállás"
            
elseif id == 42 then
                name 
"Esély MP visszaállítására"
            
elseif id == 43 then
                name 
"Esély EXP bónuszra"
            
elseif id == 44 then
                name 
"Esély dupla mennyiségű Yang eldobására"
            
elseif id == 45 then
                name 
"Esély dupla mennyiségű tárgy eldobására"
            
elseif id == 46 then
                name 
"Ital hatásnövekedés"
            
elseif id == 47 then
                name 
"Esély TP visszaállítására"
            
elseif id == 48 then
                name 
"Immunis az ájulás ellen"
            
elseif id == 49 then
                name 
"Immunis a lelassulás ellen"
            
elseif id == 50 then
                name 
="Immunis az elesésre"
            
elseif id == 52 then
                name 
"Íjjász hatótávolság"
            
elseif id == 53 then
                name 
"Támadó érték"
            
elseif id == 54 then
                name 
"Védekezés"
            
elseif id == 55 then
                name 
"Mágikus támadó érték"
            
elseif id == 56 then
                name 
"Mágikus védelem"
            
elseif id == 58 then
                name 
"Max. Kitartás"
            
elseif id == 59 then
                name 
"Harcosok elleni erő "
            
elseif id == 60 then
                name 
"Nindzsák elleni erő "
            
elseif id == 61 then
                name 
"Sura elleni erő "
            
elseif id == 62 then
                name 
"Sámán elleni erő "
            
elseif id == 63 then
                name 
"Szörny elleni erő "
            
elseif id == 64 then
                name 
"Támadó érték"
            
elseif id == 65 then
                name 
"Védekezés"
            
elseif id == 66 then
                name 
"EXP"
            
elseif id == 67 then
                name 
"Tárgy ledobási esély"
            
elseif id == 68 then
                name 
"Yang eldobási esély"
            
elseif id == 71 then
                name 
="Készség károk"
            
elseif id == 72 then
                name 
="Átlagos károk"
            
elseif id == 73 then
                name 
"Készség károkkal szembeni ellenállás"
            
elseif id == 74 then
                name 
"Átlagos veszteség ellenállás"
            
elseif id == 76 then
                name 
"EXP bónusz"
            
elseif id == 77 then
                name 
="Tárgy zsákmányolási esély plusz"
            
elseif id == 78 then
                name 
"Védekezési esély harcos támadás ellen"
            
elseif id == 79 then
                name 
"Védekezési esély nindzsatámadás ellen"
            
elseif id == 80 then
                name 
"Védekezési esély Sura támadás ellen"
            
elseif id == 81 then
                name 
"Védekezési esély sámántámadás ellen"
            
else
                
name tostring("Error "..id)
            
end
            
            
return name
        end
        
        when 20355.chat
."Rögök az aukciósházban" begin
            local s 
select("Az aukciósház raktárában lévő rögeid""Végetért aukcióból szerzett rögök""Mégse")
            if 
== 1 then
                local owid 
mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
                
local id
                
for i,v in ipairs(owid) do
                    
id v[1]
                
end
                
                local s 
mysql_sweb("SELECT count FROM fwmt2_bela.auction_reward WHERE id='"..id.."';")
                
local reward = {}
                for 
i,v in ipairs(s) do
                    
table.insert(rewardv[1])
                
end
                
                local totalcount 
0
                
                
if table.getn(reward) > 1 then
                    
for i in mb_02_auction.range(1table.getn(reward)) do
                        
totalcount totalcount tonumber(reward[i])
                    
end
                
else
                    if 
table.getn(reward) == and tonumber(reward[1]) > 0 then
                        totalcount 
tonumber(reward[1])
                    
end
                end
                
                
if tonumber(totalcount) == 0 then
                    say
("Jelenleg az aukcióház nem tartozik neked semmivel.")
                else
                    
local need tonumber(totalcount)
                    
                    while (
need 0) do
                        if 
need >= 200 then
                            pc
.give_item2(80007200)
                            
need need 200
                        
else
                            
pc.give_item2(800071)
                            
need need 1
                        end
                    end
                    mysql_notsweb
("DELETE FROM fwmt2_bela.auction_reward WHERE id='"..id.."';")
                    
say("Kaptál "..tonumber(totalcount).." rögöt.")
                
end
            
elseif == 2 then
                local owid 
mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
                
local id
                
for i,v in ipairs(owid) do
                    
id v[1]
                
end
                
                local s 
mysql_sweb("SELECT auid, lastprice FROM fwmt2_bela.auction WHERE owner_id='"..id.."' and lastprice > '0' and started < '"..get_time().."';")
                
local reward = {}
                
local auid = {}
                for 
i,v in ipairs(s) do
                    
table.insert(auidv[1])
                    
table.insert(rewardv[2])
                
end
                
                local totalcount 
0
                
                
if table.getn(reward) > 1 then
                    
for i in mb_02_auction.range(1table.getn(reward)) do
                        
totalcount totalcount tonumber(reward[i])
                        
mysql_notsweb("UPDATE fwmt2_bela.auction SET owner_id='0' WHERE auid='"..auid[i].."';")
                    
end
                
else
                    if 
table.getn(reward) == and tonumber(reward[1]) > 0 then
                        totalcount 
tonumber(reward[1])
                        
mysql_notsweb("UPDATE fwmt2_bela.auction SET owner_id='0' WHERE auid='"..auid[1].."';")
                    
end
                end
                
                
if tonumber(totalcount) == 0 then
                    say
("Jelenleg az aukcióház nem tartozik neked semmivel.")
                else
                    
local need tonumber(totalcount)
                    while (
need 0) do
                        if 
need >= 200 then
                            pc
.give_item2(80007200)
                            
need need 200
                        
else
                            
pc.give_item2(800071)
                            
need need 1
                        end
                    end
                    say
("Kaptál "..tonumber(totalcount).." rögöt.")
                
end
            end
        end
        
        when 20355.chat
."Nyereményeim" begin
            local owid 
mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
            
local id
            
for i,v in ipairs(owid) do
                
id v[1]
            
end
            
            local s 
mysql_sweb("SELECT auid FROM fwmt2_bela.auction WHERE owner_id='"..id.."' and started < '"..get_time().."' and lastprice='0' LIMIT 1;")
            
local reward 0
            
for i,v in ipairs(s) do
                
reward tonumber(v[1])
            
end
            
            
if tonumber(reward) > 0 then
                say
("Van egy(vagy több) lejárt aukciós tárgyad amire nem")
                
say("licitáltak. A raktárad 1. helyére fog kerülni.")
                
                
local acc_id mysql_select("SELECT account_id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
                
local accid
                
for i,v in ipairs(acc_id) do
                    
accid v[1]
                
end
                
                local raktara 
mysql_select("SELECT id FROM player.item WHERE owner_id='"..accid.."' and window='SAFEBOX' and pos='0' LIMIT 1;")
                
local raktar 0
                
for i,v in ipairs(raktara) do
                    
raktar tonumber(v[1])
                
end
                
                
if tonumber(raktar) > 0 then
                    say
("Van már valami a raktárad 1. helyén! Vedd ki!")
                else
                    
local sss mysql_sweb("SELECT vnum, window, count, socket0, socket1, socket2, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6 FROM fwmt2_bela.auction WHERE auid='"..reward.."';")
                    
                    for 
i,v in ipairs(sss) do
                        
mysql_notselect("INSERT INTO player.item (owner_id, window, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6) VALUES ('"..accid.."', '"..v[2].."', '0', '"..v[3].."', '"..v[1].."', '"..v[4].."', '"..v[5].."', '"..v[6].."', '0', '0', '0', '"..v[7].."', '"..v[8].."','"..v[9].."', '"..v[10].."', '"..v[11].."', '"..v[12].."', '"..v[13].."', '"..v[14].."', '"..v[15].."', '"..v[16].."', '"..v[17].."', '"..v[18].."', '"..v[19].."', '"..v[20].."');")
                    
end
                    
                    mysql_notsweb
("DELETE FROM fwmt2_bela.auction WHERE auid='"..reward.."';")
                    
                    
say()
                    
say_reward("A tárgy bekerült a raktáradba!")
                
end
            
else
                
local s2 mysql_sweb("SELECT auid FROM fwmt2_bela.auction WHERE lastid='"..id.."' and started < '"..get_time().."' LIMIT 1;")
                
local reward2 0
                
for i,v in ipairs(s2) do
                    
reward2 tonumber(v[1])
                
end
                
                
if tonumber(reward2) > 0 then
                    say
("Van egy(vagy több) tárgy amit liciten nyertél.")
                    
say("A raktárad 1. helyére fog kerülni.")
                
                    
local acc_id mysql_select("SELECT account_id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
                    
local accid
                    
for i,v in ipairs(acc_id) do
                        
accid v[1]
                    
end
                    
                    local raktara 
mysql_select("SELECT id FROM player.item WHERE owner_id='"..accid.."' and window='SAFEBOX' and pos='0' LIMIT 1;")
                    
local raktar 0
                    
for i,v in ipairs(raktara) do
                        
raktar tonumber(v[1])
                    
end
                    
                    
if tonumber(raktar) > 0 then
                        say
("Van már valami a raktárad 1. helyén! Vedd ki!")
                    else
                        
local sss mysql_sweb("SELECT vnum, window, count, socket0, socket1, socket2, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6 FROM fwmt2_bela.auction WHERE auid='"..reward2.."';")
                        
                        for 
i,v in ipairs(sss) do
                            
mysql_notselect("INSERT INTO player.item (owner_id, window, pos, count, vnum, socket0, socket1, socket2, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6) VALUES ('"..accid.."', '"..v[2].."', '0', '"..v[3].."', '"..v[1].."', '"..v[4].."', '"..v[5].."', '"..v[6].."', '"..v[7].."', '"..v[8].."','"..v[9].."', '"..v[10].."', '"..v[11].."', '"..v[12].."', '"..v[13].."', '"..v[14].."', '"..v[15].."', '"..v[16].."', '"..v[17].."', '"..v[18].."', '"..v[19].."', '"..v[20].."');")
                        
end
                        
                        local sa 
mysql_sweb("SELECT owner_id, lastprice FROM fwmt2_bela.auction WHERE auid='"..reward2.."';")
                        
local owid 0
                        local countwin
                        
for i,v in ipairs(sa) do
                            
owid tonumber(v[1])
                            
countwin tonumber(v[2])
                        
end
                        
                        
if tonumber(owid) == 0 then
                            mysql_notsweb
("DELETE FROM fwmt2_bela.auction WHERE auid='"..reward2.."';")
                        else
                            
mysql_notsweb("INSERT INTO fwmt2_bela.auction_reward (id, count) VALUES ('"..owid.."', '"..countwin.."');")
                            
mysql_notsweb("DELETE FROM fwmt2_bela.auction WHERE auid='"..reward2.."';")
                        
end
                        
                        say
()
                        
say_reward("A tárgy bekerült a raktáradba!")
                    
end
                
else
                    
say("Nincs semmilyen tárgyad, ami az aukciósháznál van")
                
end
            end
            
            
        end
        
        
function range(abstep)
            if 
not b then
                b 
a
                a 
1
            end
            step 
step or 1
            local f 
=
            
step and
            function(
_lastvalue)
                
local nextvalue lastvalue step
                
if nextvalue <= b then return nextvalue end
            end 
or
            
step and
            function(
_lastvalue)
                
local nextvalue lastvalue step
                
if nextvalue >= b then return nextvalue end
            end 
or
            function(
_lastvalue) return lastvalue end
            
return fnilstep
        end
        
        
function giverog()
            
local owid mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
            
local id
            
for i,v in ipairs(owid) do
                
id v[1]
            
end
            
            local s 
mysql_sweb("SELECT count FROM fwmt2_bela.auction_reward WHERE id='"..id.."';")
            
local reward = {}
            for 
i,v in ipairs(s) do
                
table.insert(rewardv[1])
            
end
                
            local totalcount 
0
                
            
if table.getn(reward) > 1 then
                
for i in mb_02_auction.range(1table.getn(reward)) do
                    
totalcount totalcount tonumber(reward[i])
                
end
            
else
                if 
table.getn(reward) == and tonumber(reward[1]) > 0 then
                    totalcount 
tonumber(reward[1])
                
end
            end
                
            
if tonumber(totalcount) != 0 then
                local need 
tonumber(totalcount)
                while (
need 0) do
                    if 
need >= 200 then
                        pc
.give_item2(80007200)
                        
need need 200
                    
else
                        
pc.give_item2(800071)
                        
need need 1
                    end
                end
                
                mysql_notsweb
("DELETE FROM fwmt2_bela.auction_reward WHERE id='"..id.."';")
            
end
            
            
return totalcount
        end
        
        when 20355.chat
."Kereső " begin
            local curpage 
1
            local curloaded 
5
            
            say_title
("Keresés")
            
say("Itt a tárgyakat kereshetsz nevük szerint.")
            
say("Nem fontos a teljes nevét beírnod.")
            
            
local inp input()
            
            
local data mb_02_auction.loadresult(tostring(inp))
            
            if 
inp == "" or inp == nil then
                say
("Nem hagyhatod üresen!")
                return
            
end
            
            
if table.getn(data[1]) < 1 then
                say
("Nincs találat!")
                return
            
end
            
            local auid_list 
data[1]
            
local name_list data[2]
            
            
local menu_list = {}
            --
table.foreach(name_list, function(inametable.insert(menu_listnameend)
            
table.insert(menu_listname_list[1])
            
table.insert(menu_listname_list[2])
            
table.insert(menu_listname_list[3])
            
table.insert(menu_listname_list[4])
            
table.insert(menu_listname_list[5])
            if 
table.getn(name_list) > 5 then
                table
.insert(menu_list"Tovább")
                
table.insert(menu_list"Mégse")
            else
                
table.insert(menu_list"Mégse")
            
end
            local s
=select_table(menu_list)
            
            if 
table.getn(menu_list) <= 6 then
                
if == table.getn(menu_listthen
                    
return
                
end
            
else
                if 
== table.getn(menu_listthen
                    
return
                elseif 
== table.getn(menu_list) - 1 then
                    mb_02_auction
.nextpage(curpage 1curloaded 5auid_listname_list)
                
end
            end
            
            
if table.getn(menu_list) < 7 then
                
if table.getn(menu_list) == 2 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 3 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 4 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 5 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                    elseif 
== 4 then
                        mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list3)
                    
end
                
elseif table.getn(menu_list) == 6 then
                    
if == 1 then
                        mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                    elseif 
== 2 then
                        mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                    elseif 
== 3 then
                        mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                    elseif 
== 4 then
                        mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list3)
                    elseif 
== 5 then
                        mb_02_auction
.item(auid_list[curloaded], name_list[curloaded], curpagecurloadedauid_listname_list3)
                    
end
                end
            
else
                if 
== 1 then
                    mb_02_auction
.item(auid_list[curloaded 4], name_list[curloaded 4], curpagecurloadedauid_listname_list3)
                elseif 
== 2 then
                    mb_02_auction
.item(auid_list[curloaded 3], name_list[curloaded 3], curpagecurloadedauid_listname_list3)
                elseif 
== 3 then
                    mb_02_auction
.item(auid_list[curloaded 2], name_list[curloaded 2], curpagecurloadedauid_listname_list3)
                elseif 
== 4 then
                    mb_02_auction
.item(auid_list[curloaded 1], name_list[curloaded 1], curpagecurloadedauid_listname_list3)
                elseif 
== 5 then
                    mb_02_auction
.item(auid_list[curloaded], name_list[curloaded], curpagecurloadedauid_listname_list3)
                
end
            end
        end
        
function loadresult(text)
            
local tbla mysql_sweb("SELECT auid FROM fwmt2_bela.auction WHERE started > '"..get_time().."';")
            
local tbl = {}
            for 
i,v in ipairs(tbla) do
                
table.insert(tblv[1])
            
end
            
            local name_list 
= {}
            
local auid_list = {}
            
            
table.foreach(tbl
                function(
iauid)
                    
local vnum
                    local vnuam 
mysql_sweb("SELECT vnum FROM fwmt2_bela.auction WHERE auid='"..auid.."';")
                    for 
i,v in ipairs(vnuam) do
                        
vnum v[1]
                    
end
                        
                    local namet 
mysql_select("SELECT locale_name FROM player.item_proto WHERE vnum ='"..vnum.."';")
                    
local name
                    
for i,v in ipairs(namet) do
                        
name v[1]
                    
end
                        
                    
if string.find(tostring(name), text) > 0 then
                        table
.insert(auid_listauid)
                        
table.insert(name_listname)
                    
end
                end
)
            return {
auid_listname_list}
        
end
    end
end 
Download:
Attached Files
File Type: rar Azoris auction quest by masodikbela.rar (7.2 KB, 405 views)
kicskarii is offline  
Thanks
9 Users
Old 04/04/2013, 22:39   #2
 
[The]Domco's Avatar
 
elite*gold: 45
Join Date: Mar 2011
Posts: 253
Received Thanks: 238
How a short quest ...
[The]Domco is offline  
Old 04/04/2013, 22:50   #3
 
CoTzRaiZ-PaiNx's Avatar
 
elite*gold: 30
Join Date: Oct 2012
Posts: 1,388
Received Thanks: 243
Screens ?
CoTzRaiZ-PaiNx is offline  
Old 04/04/2013, 23:31   #4
 
masodikbela's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 4
Received Thanks: 5
Hmm it seems to me this source or the description not too good...

If someone want to use that, they have to do some modification...

First: they have to replace this

Code:
fwmt2_bela.
to:
Code:
player.
And, it need in the questlib.lua:

Code:
db_user="id"
db_pass="pw"
db_host="localhost"
function mysql_select(query,notselect)
    local tmp=number(11111111,99999999)
	os.execute('mysql -h '..db_host..' -u '..db_user..' -p'..db_pass..' -N -e '..string.format("%q",query)..' 2>&1 > /tmp/'..tmp)
	
	if not notselect then
		local res,i={},1
		local f,e=io.open("/tmp/"..tmp)
		if f then
			local line=f:read("*l")
			while line do
				res[i]={}
				string.gsub(line,"([^\t]+)\t*", function(s)
					table.insert(res[i],s)
				end)
				i=i+1
				line=f:read("*l")
			end
			f:close()
			os.execute("rm /tmp/"..tmp)
		end
		return res
	end
end 

function mysql_notselect(query)
	return mysql_select(query,true)
end
masodikbela is offline  
Thanks
4 Users
Old 04/05/2013, 11:33   #5
 
lollo_9_1's Avatar
 
elite*gold: 100
Join Date: Jun 2009
Posts: 168
Received Thanks: 711
Quote:
Code:
local owner_id = mysql_select("SELECT id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
pc.get_player_id()
Quote:
Code:
local acc_id = mysql_select("SELECT account_id FROM player.player WHERE name='"..pc.get_name().."' LIMIT 1;")
pc.get_account_id()
Quote:
Code:
local namet = mysql_select("SELECT locale_name FROM player.item_proto WHERE vnum ='"..vnum.."';")
item_name(vnum)
lollo_9_1 is offline  
Thanks
1 User
Old 04/05/2013, 13:13   #6
 
elite*gold: 0
Join Date: Jul 2010
Posts: 66
Received Thanks: 5
and quest_functions:

mysql_notselect
mysql_notsweb
mysql_select
mysql_sweb
os.date
string.find
ipairs
makralovag is offline  
Old 04/05/2013, 17:53   #7
 
masodikbela's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 4
Received Thanks: 5
Quote:
Originally Posted by lollo_9_1 View Post
pc.get_player_id()

pc.get_account_id()
Yes its more simple, but some game files don't support this functions...
masodikbela is offline  
Old 04/06/2013, 21:13   #8
 
elite*gold: 0
Join Date: Apr 2012
Posts: 89
Received Thanks: 25
Very very very very very goooooooooood.
xxmehmetcc is offline  
Thanks
1 User
Old 04/06/2013, 21:31   #9
 
kingkorn93's Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 20
Received Thanks: 5
epic fail only bugs not for root server
kingkorn93 is offline  
Reply


Similar Threads Similar Threads
[RELEASE] Pet System Advanced quest
04/18/2020 - Metin2 PServer Guides & Strategies - 120 Replies
hi all, I anticipate that the quest is not quite complete as it is a job that I left a few weeks and I do not think that will complete only for lack of desire. What is missing: to complete the quest really miss a few functions including management and summon pet horse in the application of the bonus for the fighting style I think there is nothing more to add (if I remember correctly). the quest is very flexible, you can add different fighting styles you find already made ​​2 as an...
[Release] Auction System V1 (Hen! CMS)
06/15/2014 - Metin2 PServer Guides & Strategies - 22 Replies
Hi epvp :awesome: Short Video: Auction System by DexterSK :D - YouTube V2 coming soon :D KAFFEIN - All That She Wants (DJ Nejtrino & DJ Stranger Remix) - YouTube
Auction System
03/23/2012 - Shaiya - 1 Replies
Hi Friends, is it possible to change the Auction system in Shaiya in a way, that userer can see what he purchased in the Auction House ( Item Name).



All times are GMT +1. The time now is 21:34.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.