Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

[Partage] Item avec vos Bonus


Tore

Messages recommandés

Centre de Téléchargement

Hidden Content

    Give reaction to this post to see the hidden content.
( 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,

  • Love 11
Lien vers le commentaire
Partager sur d’autres sites

  • Réponses 3
  • Créé
  • Dernière réponse

Meilleurs contributeurs dans ce sujet

  • 1 an après...


  • brilliantdiscord_widget
  • Flux d'Activité

    1. 37
    2. 21

      Metin2 en 2020 peut-on en parler?

    3. 0

      METIN2Project

    4. 3

      Ressources - UnPack - Metin2 Client - Officiel

    5. 0

      Barre des tâches d'argent étendue

    6. 16

      Redémarrage automatique des channels

    7. 16

      Multi Logo GM / SGM / GA

  • En ligne récemment

    • Aucun utilisateur enregistré regarde cette page.

Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.