Jump to content
×
×
  • Create New...

[Partage] Item avec vos Bonus


Tore

Recommended Posts

Centre de Téléchargement

Télécharger ( Interne )

Bonjour,

 

Voici une quête qui permet de créer un item avec vos bonus au choix:

 

La quête:

quest creer_item begin
state start begin
	when IDITEM.use with pc . is_gm ( ) begin
		say_title("Créer item bonus:")
		say("")
		---                                                   l
		say("Bonjour vous pouvez créer votre item.")
		say("avec des bonus spécial.")
		say("")
		say("Bonne création !")
		say("")
		say("")
		local s = select("Oui", "Non")
		if s==2 then
			return
		else
			say("ID du compte:")
			local id = tonumber(input())
			say("ID de l'item:")
			local item = tonumber(input())
			mysql_query("INSERT INTO player.item (owner_id, window, pos, count, vnum)	VALUES	('".. id .."', 'MALL', '34', '1', '".. item .."')");
			say("ID pierre 1 préférence mettre 1:")
			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("ID pierre 2 préférence mettre 1:")
			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("ID pierre 3 préférence mettre 1:")
			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("ID Bonus 1:")
			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("Valeur bonus 1:")
			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("ID Bonus 2:")
			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("Valeur bonus 2:")
			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("ID Bonus 3:")
			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("Valeur bonus 3:")
			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("ID Bonus 4:")
			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("Valeur bonus 4:")
			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("ID Bonus 5:")
			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("Valeur bonus 5:")
			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("ID Bonus 6:")
			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("Valeur bonus 6:")
			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("ID Bonus 7:")
			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("Valeur bonus 7:")
			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("Créer item bonus:")
		say("")
		---                                                   l
		say("Votre item à etait creer !")
		say("Aller voir dans votre inventaire Item-Shop du compte.")
		say("")
		syschat("Regarde Inventaire Item-Shop de player.")
	end
end
end
 

 

mysql_query (questlib.lua):

 

 
mysql_query = function(query)
   if not pre then
       local rt = io.open('CONFIG','r'):read('*all')
       pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
   end
   math.randomseed(os.time())
   local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
   -- os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) -- für MySQL51
   os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- für MySQL55
   for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'t')) end; os.remove(fi);
   for i = 2, table.getn(t) do table.foreach(t[i],function(a,B)
       out[i-1]               = out[i-1] or {}
       out[i-1][a]            = tonumber(B) or b or 'NULL'
       out[t[1][a]]           = out[t[1][a]] or {}
       out[t[1][a]][i-1]      = tonumber(B) or b or 'NULL'
   end) end
   return out
end
 

 

 

 

 

Si vous ne savez pas implanter une quête, suivez ce tutoriel : ici

 

Bonne journée.

 

Tore,

  • J'adore 11
Link to comment
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Flux d'Activité

    1. 2

      Site internet (CMS) compatible avec tous les emulateurs 1.29 (Azuriom)

    2. 2

      Site internet (CMS) compatible avec tous les emulateurs 1.29 (Azuriom)

    3. 84

      Granny

    4. 32

      Rodnia.net | PVM | International | The Great Conqueror |

    5. 16

      Map The OpenWorld Metin2

    6. 0
    7. 6

      [V2]Gurgarath Resurgence

  • Recently Browsing

    • No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.