Developer PACI 921 Posted February 24, 2014 Developer Share Posted February 24, 2014 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hello. I made this quest some time ago, I was still using rev 34083 and iMer posted a very useful lib. So, thanks to the quest functions which this lib has included, it allowed me to do something like belt system, but without belt inventory. Also, nowadays, we have that crap systems full, and that's why I post this here. Now first of all, iMer's stuff: This is the hidden content, please Sign In or Sign Up or libgame_item2_pc2.so This is the hidden content, please Sign In or Sign Up or libstdc++.so.6 And now the quest: quest belt_system begin state start begin function is_belt() return item.vnum >= 18000 and item.vnum <= 18089 end function equip_belt() item2.equip(11) pc.setqf('belt', item.vnum) end when 18000.use or 18001.use or 18002.use or 18003.use or 18004.use or 18005.use or 18006.use or 18007.use or 18008.use or 18009.use or 18010.use or 18011.use or 18012.use or 18013.use or 18014.use or 18015.use or 18016.use or 18017.use or 18018.use or 18019.use or 18020.use or 18021.use or 18022.use or 18023.use or 18024.use or 18025.use or 18026.use or 18027.use or 18028.use or 18029.use or 18030.use or 18031.use or 18032.use or 18033.use or 18034.use or 18035.use or 18036.use or 18037.use or 18038.use or 18039.use or 18040.use or 18041.use or 18042.use or 18043.use or 18044.use or 18045.use or 18046.use or 18047.use or 18048.use or 18049.use or 18050.use or 18051.use or 18052.use or 18053.use or 18054.use or 18055.use or 18056.use or 18057.use or 18058.use or 18059.use or 18060.use or 18061.use or 18062.use or 18063.use or 18064.use or 18065.use or 18066.use or 18067.use or 18068.use or 18069.use or 18070.use or 18071.use or 18072.use or 18073.use or 18074.use or 18075.use or 18076.use or 18077.use or 18078.use or 18079.use or 18080.use or 18081.use or 18082.use or 18083.use or 18084.use or 18085.use or 18086.use or 18087.use or 18088.use or 18089.use begin local v = item.vnum local bonus = {{item2.get_attr(0)}, {item2.get_attr(1)}, {item2.get_attr(2)}, {item2.get_attr(3)}, {item2.get_attr(4)}, {item2.get_attr(5)}, {item2.get_attr(6)}} if belt_system.is_belt() and v ~= pc.getqf('belt') then belt_system.equip_belt() elseif item.select_cell(101) then item.remove() pc2.give_or_drop_item_and_select(v) for i = 1, table.getn(bonus) do if tonumber(bonus[i][1]) > 0 then item2.set_attr(i-1, bonus[i][1], bonus[i][2]) end end else belt_system.equip_belt() end end when 20090.take with belt_system.is_belt() begin local maintab = { [0] = { {18000, 1, 50}, {18010, 2, 20}, {18020, 44, 1}, {18030, 44, 1}, {18040, 78, 1}, {18050, 79, 1}, {18060, 80, 1}, {18070, 81, 1}, {18080, 63, 1} }, [1] = { {18000, 1, 50}, {18010, 2, 20}, {18020, 44, 1}, {18030, 44, 1}, {18040, 78, 1}, {18050, 79, 1}, {18060, 80, 1}, {18070, 81, 1}, {18080, 63, 1} }, [2] = { {18000, 1, 100}, {18010, 2, 40}, {18020, 44, 1}, {18030, 44, 1}, {18040, 78, 1}, {18050, 79, 1}, {18060, 80, 1}, {18070, 81, 1}, {18080, 63, 1} } } if pc.count_item(18900) < 1 then syschat("You dont have "..item_name(18900)..".") return end for i = 0, 2 do for k = 1, table.getn(maintab[i]) do if item.vnum >= maintab[i][k][1] and item.vnum <= maintab[i][k][1]+9 and item2.get_attr(i) == 0 then if number(1,3) == 1 then item2.set_attr(i, maintab[i][k][2], maintab[i][k][3]) syschat('Your belt received a bonus.') else syschat('Wasnt possible to put a bonus in your belt.') end end end pc.remove_item(18900, 1) end end end end It also wasn't possible to add the stones to belt's, so I made also a NPC which gives your belt a bonus in exchange for that item. All we have to do in clientside, is adding a new line on our inventorywindow.py which is localed in locale. So we search this: {"index":EQUIPMENT_START_INDEX+10, "x":75, "y":35, "width":32, "height":32}, And we write down the following line: {"index":EQUIPMENT_START_INDEX+11, "x":39, "y":106, "width":32, "height":32}, We also need equipment_bg_without_ring.tga, or with_ring as you wish. And change the inventory image path to that file. That's all. Special thanks to iMer who had written the lib that made this possible, and without cmdchats and affects, because, since the item is equipped into a true slot, the bonuses are defined on item_proto, like a normal weapon, armor, etc. 6 1 4 20 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Maslovicz 76 Posted February 24, 2014 Share Posted February 24, 2014 Good work Link to comment Share on other sites More sharing options...
Premium Jfirewall 280 Posted February 24, 2014 Premium Share Posted February 24, 2014 part client icon and base_bg item_proto cliente type 28 see bonus. https://mega.co.nz/#!AEdimJJC!biuB14HGK_q4uPjR_KQYl_V2X687AOnk0Bumv3ShbQA 2 Link to comment Share on other sites More sharing options...
Mehti 76 Posted February 24, 2014 Share Posted February 24, 2014 Thanks bro.. Link to comment Share on other sites More sharing options...
Premium Galet 510 Posted June 22, 2014 Premium Share Posted June 22, 2014 Thanks ! Screen ? Link to comment Share on other sites More sharing options...
M4cheteros 2 Posted July 2, 2014 Share Posted July 2, 2014 Credit ? Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted July 2, 2014 Author Developer Share Posted July 2, 2014 (edited) If I made it, it's quite obvious. Thanks ! Screen ? Edited August 16, 2022 by Metin2 Dev Core X - External 2 Internal 3 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Destiny 12 Posted August 27, 2014 Share Posted August 27, 2014 What type we put to item? Where we put libs? PS: I installed the quest,added {"index":EQUIPMENT_START_INDEX+11, "x":39, "y":106, "width":32, "height":32}, i coyped the libs to /usr/lib and still dont work type belts is 34 Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted August 27, 2014 Author Developer Share Posted August 27, 2014 Items with quest should have ITEM_QUEST (18) as type. http://stackoverflow.com/questions/426230/what-is-the-ld-preload-trick LD_PRELOAD (32 bits) or LD_32_PRELOAD (64 bits), depending on your OS. In your start shell script: LD_PRELOAD = "/path/to/ libgame_item2_pc2.so" Before: ./game when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Destiny 12 Posted August 27, 2014 Share Posted August 27, 2014 I have to make a LD just for libgame_item2_pc2.so ? Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted August 27, 2014 Author Developer Share Posted August 27, 2014 I have to make a LD just for libgame_item2_pc2.so ? Yes, sorry I posted without finishing what I wanted to say. Check out my last post again. when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Destiny 12 Posted August 27, 2014 Share Posted August 27, 2014 I made the LD and symlinks in channels etc SYSERR: Aug 27 16:30:05 :: RunState: LUA_ERROR: [string "belt_system"]:1: attempt to index global `item2' (a nil value) SYSERR: Aug 27 16:30:05 :: WriteRunningStateToSyserr: LUA_ERROR: quest belt_system.start click Edit : It works, the lib shoud have 444 permisions not 777 Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted August 27, 2014 Author Developer Share Posted August 27, 2014 It doesn't load the library, you made something wrong. when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Destiny 12 Posted August 27, 2014 Share Posted August 27, 2014 It doesn't load the library, you made something wrong. The permisions shoud be 444 not 777 ,so that's why Thank you! Link to comment Share on other sites More sharing options...
Night 366 Posted August 27, 2014 Share Posted August 27, 2014 What type we put to item? Where we put libs? PS: I installed the quest,added {"index":EQUIPMENT_START_INDEX+11, "x":39, "y":106, "width":32, "height":32}, i coyped the libs to /usr/lib and still dont work type belts is 34 you must add it to your start script (first lib) the scound one add it to lib (it shouldnt be even add installing gcc should be more then enough + some config on /etc/make.conf Link to comment Share on other sites More sharing options...
Xero 9 Posted August 27, 2014 Share Posted August 27, 2014 when use with item.get_vnum() >= 18000 and item.get_vnum() <= 18089 begin something like this doesn't work ? and thanks for sharing 1 Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted August 27, 2014 Author Developer Share Posted August 27, 2014 Nope, when I tried it didn't work. when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Vectors 1 Posted August 28, 2014 Share Posted August 28, 2014 not wearing belts libgame_item2_pc2.so" ./game core dumped :S Link to comment Share on other sites More sharing options...
Sentox 1 Posted September 8, 2014 Share Posted September 8, 2014 I think you can duplicate the items in your belt system like guild storage system. Link to comment Share on other sites More sharing options...
Undead 0 Posted December 8, 2014 Share Posted December 8, 2014 item_proto client ?????? Link to comment Share on other sites More sharing options...
Management Karbust 4884 Posted December 8, 2014 Management Share Posted December 8, 2014 Metin2 PT Client -> locale_pt -> item_proto... Basically, official clients -> locale -> item proto -.-" Link to comment Share on other sites More sharing options...
bluedrago 28 Posted December 30, 2014 Share Posted December 30, 2014 no work! library OK quest OK icons and querys all OK but when you click in belt no work ..no equip! and we need client part ...uiinventory etc etc case $chs in 1*) echo -e "033[31m iniciando database ..033[0m" cd /usr/game/db env LD_32_PRELOAD="/usr/game/share/dblib/db_notxt.so" ./db & sleep 2 clear echo -e "033[31m n Auth inditasa ..033[0m" cd /usr/game/auth ./auth & sleep 2 clear echo -e "033[31m n CH1 iniciando ..033[0m" cd /usr/game/channel1 env LD_32_PRELOAD="/usr/game/share/gamelib/kickhackfix.so:/usr/game/share/gamelib/libgame_item2_pc2.so" ./game & sleep 2 clear echo -e "033[31m n Game99 iniciando ..033[0m" cd /usr/game/game99 env LD_32_PRELOAD="/usr/game/share/gamelib/kickhackfix.so:/usr/game/share/gamelib/libgame_item2_pc2.so" ./game & sleep 2 clear echo -e "033[32m n servidor iniciado! CH1033[0m" Link to comment Share on other sites More sharing options...
Happinessx37 0 Posted January 24, 2015 Share Posted January 24, 2015 The same problem like up. Link to comment Share on other sites More sharing options...
Former Staff Shisui 490 Posted January 24, 2015 Former Staff Share Posted January 24, 2015 Use a client that already has that system. Link to comment Share on other sites More sharing options...
Remix 45 Posted January 24, 2015 Share Posted January 24, 2015 when use with item.get_vnum() >= 18000 and item.get_vnum() <= 18089 begin something like this doesn't work ? and thanks for sharing "when use" doesn't work it needs a vnum for the item it's not like "when kill" Link to comment Share on other sites More sharing options...
Recommended Posts