ProfStof 1 Posted August 22, 2014 Share Posted August 22, 2014 Hello there, Many players want to have perfect items or staff members try to create, but it takes a search on the table player.item then change and a reboot, or a wait of 10 minutes for the object is created. It's long, it's slow and it takes time !!! Today I share a quest of my own creation, which lets you create an item with the stones and the bonus in your account or on another player's account is that it is connected or not, without a reboot or wait a dozen of minutes. First we must change the type of the columns in the table player.item to varchar except the column window do not change its type. To do this, you must open the table player.item then on your keyboard press Ctrl + D and change the types. 1- The quest: ------------------------------------------------------------------ -- Quest: Perfect Item -- -- By: Prof-Stof -- -- Skype: XProfStof -- -- This quest is created by Prof-Stof on his server Fechkel MT2 -- -- Thank you not to delete this comment -- ------------------------------------------------------------------ quest perfetc_item begin state start begin when 40002.use with pc . is_gm ( ) begin say_title("Perfect item:") say("") --- l say("Here you can create items with bonuses and") say("stones of your choice.") say("") say("Do not abuse !") say("A bug is anticipated in case of abuse of Use") say("") local s = select("Start manufacturing", "Close") if s==2 then return else say("Enter the player's ID:") local id = tonumber(input()) say("Enter the item's ID:") local item = tonumber(input()) mysql_query("INSERT INTO player.item (owner_id, window, pos, count, vnum) VALUES ('".. id .."', 'MALL', '34', '1', '".. item .."')"); say("Enter the 1st stone ID:") local p1 = tonumber(input()) mysql_query("UPDATE player.item SET socket0='".. p1 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 2nd stone ID:") local p2 = tonumber(input()) mysql_query("UPDATE player.item SET socket1='".. p2 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 3rd stone ID:") local p3 = tonumber(input()) mysql_query("UPDATE player.item SET socket2='".. p3 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 1st bonus ID:") local b1 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype0='".. b1 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 1st bonus value:") local vb1 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue0='".. vb1 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 2nd bonus ID:") local b2 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype1='".. b2 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 2nd bonus value:") local vb2 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue1='".. vb2 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 3rd bonus ID:") local b3 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype2='".. b3 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 3rd bonus value:") local vb3 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue2='".. vb3 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 4th bonus ID:") local b4 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype3='".. b4 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 4th bonus value:") local vb4 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue3='".. vb4 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 5th bonus ID:") local b5 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype4='".. b5 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 5th bonus value:") local vb5 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue4='".. vb5 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 6th bonus ID:") local b6 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype5='".. b6 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 6th bonus value:") local vb6 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue5='".. vb6 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 7th bonus ID:") local b7 = tonumber(input()) mysql_query("UPDATE player.item SET attrtype6='".. b7 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); say("Enter the 7th bonus value:") local vb7 = tonumber(input()) mysql_query("UPDATE player.item SET attrvalue6='".. vb7 .."' WHERE (owner_id='".. id .."' and window='MALL' and pos=34 and count=1)"); end say_title("Perfect item:") say("") --- l say("Your item has been successfully created !") say("Check the Item-Shop inventory.") say("") say("") syschat("Check the Item-Shop inventory.") end end end 2- Bonus list: 1 PV max 2 Max MP 3 VIT 4 INT 5 STR 6 DEX 7 Attack Speed 8 Movement Speed 9 Magic speed 10 HP Recovery 11 Regeneration MP 12 Chance of empoisoner 13 Chance cause dizziness 14 Chance to slow 15 Chance to critically attack 16 Chance of piercing hits 17 Bonus against half-humans 18 Bonus against animals 19 Bonus against the Orcs 20 Bonus against mystics 21 Bonus against the Undead 22 Bonus against Evil 23 Damage absorbed by PV 24 Damage absorbed by MP 25 Chance to make enemies MP 26 Chance to recover when you touch MP 27 Chance to block a blow to the body-to-body 28 Chance to avoid the arrows 29 Défensse sword 30 Défensse sword with 2 hands 31 Défensse dagger 32 Défensse gong 33 Défensse the range 34 Resistance to arrows 35 Fire 36 lightfastness 37 Magic Resistance 38 Wind resistance 39 Chance to deflect an attack in melee 40 Chance to divert a curse 41 Resistance against poison 42 Chance to restore PM 43 Chance to get a bonus EXP 44 Chance to drop double YANG 45 Chance to drop double object 46 Increase in the potion 47 Chance to renovate PV 48 Immunizes against stunning 49 Immunizes against slowing 50 Immunizes against falls 52 Scope of Bow 53 Attack Value 54 Defense 55 Value magic attack 56 Magical Defense 58 Max Stamina 59 Bonus against Warriors 60 Bonus against the Ninja 61 Bonus against the Sura 62 Bonus against Shamans 63 Bonus against monsters 64 Attack Value (%) 65 Defence (%) 66 EXP (%) 67 Chance Drop Item 68 Chance Drop for Yang 69% max HP 70% max PM 71 Damage skill 72 Average Damage 73 Resistance against the damage of competence 74 Resistance against the average damage 76 Bonus EXP CyberCafé 77 iCafe Chance to find Yangs 78 Chance to parry an attack Warrior 79 Chance to parry an attack Ninja 80 Chance to parry an attack Sura 81 Chance to parry an attack Shaman My apologies for language mistakes 1 Link to comment Share on other sites More sharing options...
Denis 1477 Posted August 22, 2014 Share Posted August 22, 2014 Use one mysql_query instead of 18 2 Link to comment Share on other sites More sharing options...
ProfStof 1 Posted August 22, 2014 Author Share Posted August 22, 2014 The quest takes up to 6 variables, if you affect another one it will not be taken, so the item will not be completed, therefore I used yhe UPDATE to guarantee the result Link to comment Share on other sites More sharing options...
Denis 1477 Posted August 22, 2014 Share Posted August 22, 2014 The mysql_query opens each time a new connection(if i remember right) so i think this is a problem. Anyway take a look at this: ------------------------------------------------------------------ -- Quest: Perfect Item -- -- By: Prof-Stof -- -- Skype: XProfStof -- -- This quest is created by Prof-Stof on his server Fechkel MT2 -- -- Thank you not to delete this comment -- ------------------------------------------------------------------ quest perfetc_item begin state start begin when 40002.use with pc . is_gm ( ) begin say_title("Perfect item:") say("") --- l say("Here you can create items with bonuses and") say("stones of your choice.") say("") say("Do not abuse !") say("A bug is anticipated in case of abuse of Use") say("") local s = select("Start manufacturing", "Close") if s==2 then return else local id,item,p1,p2,p3,b1,b2,b3,b4,b5,b6,b7,vb1,vb2,vb3,vb4,vb5,vb6,vb7 say("Enter the player's ID:") id = tonumber(input()) say("Enter the item's ID:") item = tonumber(input()) say("Enter the 1st stone ID:") p1 = tonumber(input()) say("Enter the 2nd stone ID:") p2 = tonumber(input()) say("Enter the 3rd stone ID:") p3 = tonumber(input()) say("Enter the 1st bonus ID:") b1 = tonumber(input()) say("Enter the 1st bonus value:") vb1 = tonumber(input()) say("Enter the 2nd bonus ID:") b2 = tonumber(input()) say("Enter the 2nd bonus value:") vb2 = tonumber(input()) say("Enter the 3rd bonus ID:") b3 = tonumber(input()) say("Enter the 3rd bonus value:") vb3 = tonumber(input()) say("Enter the 4th bonus ID:") b4 = tonumber(input()) say("Enter the 4th bonus value:") vb4 = tonumber(input()) say("Enter the 5th bonus ID:") b5 = tonumber(input()) say("Enter the 5th bonus value:") vb5 = tonumber(input()) say("Enter the 6th bonus ID:") b6 = tonumber(input()) say("Enter the 6th bonus value:") vb6 = tonumber(input()) say("Enter the 7th bonus ID:") b7 = tonumber(input()) say("Enter the 7th bonus value:") vb7 = tonumber(input()) mysql_query("INSERT INTO player.item (owner_id,cwindow,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6) VALUES ('".. id .."', 'MALL', '34', '1', '".. item ..", '"..p1.."', '"..p2.."', '"..p3.."', '"..b1.."', '"..vb1.."', '"..b2.."', '"..vb2.."', '"..b3.."', '"..vb3.."', '"..b4.."', '"..vb4.."' ,'"..b5.."', '"..vb5.."', '"..b6.."', '"..vb6.."', '"..b7.."', '"..vb7.."') "); end say_title("Perfect item:") say("") --- l say("Your item has been successfully created !") say("Check the Item-Shop inventory.") say("") say("") syschat("Check the Item-Shop inventory.") end end end 3 Link to comment Share on other sites More sharing options...
metin2team 766 Posted August 22, 2014 Share Posted August 22, 2014 UPDATE player.item SET socket0='".. p1 .."', socket1='".. p2 .."', socket2='".. p3 .."', ...... etc. 1 Link to comment Share on other sites More sharing options...
Think 117 Posted August 22, 2014 Share Posted August 22, 2014 Please, think this through. You say that creating items on db is long and slow And then propose a solution which: Is just as long. Uses the database. Requires to change everything in item table to varchar (Please, don't! There are types for a reason) Isn't it easier to say "TIP! If you create items on the MALL window it will be reloaded when you check without having to wait 10 minutes."? I don't know... less hassle. I'm sure we all appreciate effort for helping out others nevertheless 2 Link to comment Share on other sites More sharing options...
Night 367 Posted August 22, 2014 Share Posted August 22, 2014 and insted of when 40002.use with pc . is_gm ( ) begin use when 40002.use with pc .get_name == ("[Admin]something") begin its better then having any gm sold your items 3 Link to comment Share on other sites More sharing options...
RatCatcher 77 Posted August 23, 2014 Share Posted August 23, 2014 This is disgusting why the hell you use mysql_query ... pc.give_item2_select(item_vnum) item.set_value(0, 3, 50) item.set_value(1, 4, 50) item.set_value(2, 5, 50) etc ... Enough is enough Link to comment Share on other sites More sharing options...
JachuPL 312 Posted August 23, 2014 Share Posted August 23, 2014 say("Enter the item's ID:") local item = tonumber(input()) put 'null' in query, instead of typing item's id, it will autogive unique ID to item on insert into table, as the column in table is not null and auto-increment Link to comment Share on other sites More sharing options...
kforce 5 Posted August 23, 2014 Share Posted August 23, 2014 I was doing something like this in the past, the idea was to let people in a pvp server create their own items, with max stats etc, so they don't wast time switching the bonus manually or even using a bot. I had to limit the bonus on the items and their values. http://pastebin.com/XPug1ubN It's in portuguese btw. 1 Link to comment Share on other sites More sharing options...
Saud bin abdullah 7 Posted August 27, 2014 Share Posted August 27, 2014 good idea but you write it in bad way but still good 1 Link to comment Share on other sites More sharing options...
Premium Shogun 4605 Posted August 28, 2014 Premium Share Posted August 28, 2014 You don't need to wait to create or edit an item, just put it in the safebox. Also there is a command /full_set on 40k that gives you a full set of items. In any case, I find this code not particularly well written as others said above, but thanks for sharing nevertheless. Link to comment Share on other sites More sharing options...
yagokurt 84 Posted August 28, 2014 Share Posted August 28, 2014 You don't need to wait to create or edit an item, just put it in the safebox. Also there is a command /full_set on 40k that gives you a full set of items. In any case, I find this code not particularly well written as others said above, but thanks for sharing nevertheless. Yes, normaly when i want edit equip for test i do on safebox too, and the 34k have the full_set command too, and give the same default itens than the 40k. Link to comment Share on other sites More sharing options...
Saud bin abdullah 7 Posted August 30, 2014 Share Posted August 30, 2014 ------------------------------------------------------------------ -- Quest: Perfect Item -- -- By: Prof-Stof -- -- Skype: XProfStof -- -- This quest is created by Prof-Stof on his server Fechkel MT2 -- -- Thank you not to delete this comment -- ------------------------------------------------------------------ quest itembonus2 begin state start begin when 9010.take with pc.get_name() == "[SA]Admin" begin if item.get_type() == ITEM_WEAPON or item.get_type() == ITEM_ARMOR or item.get_sub_type() == ARMOR_EAR then local b1,vb1,b2,vb2,b3,vb3,b4,vb4,b5,vb5 say("1: Enter the Bonus ID:") b1 = tonumber(input()) say("1: Enter the Bonus value:") vb1 = tonumber(input()) say("2: Enter the Bonus ID:") b2 = tonumber(input()) say("2: Enter the Bonus value:") vb2 = tonumber(input()) say("3: Enter the Bonus ID:") b3 = tonumber(input()) say("3: Enter the Bonus value:") vb3 = tonumber(input()) say("4: Enter the Bonus ID:") b4 = tonumber(input()) say("4:Enter the Bonus value") vb4 = tonumber(input()) say("5:Enter the Bonus ID:") b5 = tonumber(input()) say("5:Enter the Bonus value") vb5 = tonumber(input()) say("Bonus have been Switched successfully") item.set_value(0, b1, vb1) item.set_value(1, b2, vb2) item.set_value(2, b3, vb3) item.set_value(3, b4, vb4) item.set_value(4, b5, vb5) else syschat("You Cannot Switch Bonus this ITEM") end end end end I think this better Link to comment Share on other sites More sharing options...
Monkey Dungeon 40 Posted August 30, 2014 Share Posted August 30, 2014 ------------------------------------------------------------------ -- Quest: Perfect Item -- -- By: Prof-Stof -- -- Skype: XProfStof -- -- This quest is created by Prof-Stof on his server Fechkel MT2 -- -- Thank you not to delete this comment -- ------------------------------------------------------------------ quest itembonus2 begin state start begin when 9010.take with pc.get_name() == "[SA]Admin" begin if item.get_type() == ITEM_WEAPON or item.get_type() == ITEM_ARMOR or item.get_sub_type() == ARMOR_EAR then local b1,vb1,b2,vb2,b3,vb3,b4,vb4,b5,vb5 say("1: Enter the Bonus ID:") b1 = tonumber(input()) say("1: Enter the Bonus value:") vb1 = tonumber(input()) say("2: Enter the Bonus ID:") b2 = tonumber(input()) say("2: Enter the Bonus value:") vb2 = tonumber(input()) say("3: Enter the Bonus ID:") b3 = tonumber(input()) say("3: Enter the Bonus value:") vb3 = tonumber(input()) say("4: Enter the Bonus ID:") b4 = tonumber(input()) say("4:Enter the Bonus value") vb4 = tonumber(input()) say("5:Enter the Bonus ID:") b5 = tonumber(input()) say("5:Enter the Bonus value") vb5 = tonumber(input()) say("Bonus have been Switched successfully") item.set_value(0, b1, vb1) item.set_value(1, b2, vb2) item.set_value(2, b3, vb3) item.set_value(3, b4, vb4) item.set_value(4, b5, vb5) else syschat("You Cannot Switch Bonus this ITEM") end end end end I think this better Yours is not working When npc 9010 take the Item, that error comes.. The first version is working, thank you Link to comment Share on other sites More sharing options...
Saud bin abdullah 7 Posted August 30, 2014 Share Posted August 30, 2014 ------------------------------------------------------------------ -- Quest: Perfect Item -- -- By: Prof-Stof -- -- Skype: XProfStof -- -- This quest is created by Prof-Stof on his server Fechkel MT2 -- -- Thank you not to delete this comment -- ------------------------------------------------------------------ quest itembonus2 begin state start begin when 9010.take with pc.get_name() == "[SA]Admin" begin if item.get_type() == ITEM_WEAPON or item.get_type() == ITEM_ARMOR or item.get_sub_type() == ARMOR_EAR then local b1,vb1,b2,vb2,b3,vb3,b4,vb4,b5,vb5 say("1: Enter the Bonus ID:") b1 = tonumber(input()) say("1: Enter the Bonus value:") vb1 = tonumber(input()) say("2: Enter the Bonus ID:") b2 = tonumber(input()) say("2: Enter the Bonus value:") vb2 = tonumber(input()) say("3: Enter the Bonus ID:") b3 = tonumber(input()) say("3: Enter the Bonus value:") vb3 = tonumber(input()) say("4: Enter the Bonus ID:") b4 = tonumber(input()) say("4:Enter the Bonus value") vb4 = tonumber(input()) say("5:Enter the Bonus ID:") b5 = tonumber(input()) say("5:Enter the Bonus value") vb5 = tonumber(input()) say("Bonus have been Switched successfully") item.set_value(0, b1, vb1) item.set_value(1, b2, vb2) item.set_value(2, b3, vb3) item.set_value(3, b4, vb4) item.set_value(4, b5, vb5) else syschat("You Cannot Switch Bonus this ITEM") end end end end I think this better Yours is not working When npc 9010 take the Item, that error comes.. The first version is working, thank you really? I did not try it, I'll try it now # Edit it works you have to change name or write with pc.is_gm() if you want You don't need to wait to create or edit an item, just put it in the safebox. Also there is a command /full_set on 40k that gives you a full set of items. In any case, I find this code not particularly well written as others said above, but thanks for sharing nevertheless. Yes, normaly when i want edit equip for test i do on safebox too, and the 34k have the full_set command too, and give the same default itens than the 40k. Link to comment Share on other sites More sharing options...
spectrum 7 Posted April 12, 2021 Share Posted April 12, 2021 (edited) the problem that many do not check if you have an item on position 1 (example 19 level 1 sword) level 1 sword occupies position 1 and 6 in the safebox - deposit adding another weapon on slot 6 overlap normal : https://metin2.download/picture/pJ3tIASQ2GtRwJaBTCgY1hTO2GGYBIAO/.png bug : https://metin2.download/picture/qmx54CuTyVR22HnlsiuHc8QrpwpF1TsL/.png Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now