Tiico™ Posted May 22, 2013 Report Share Posted May 22, 2013 Hola foreros , bueno a pedido de algunos amigos "mios xd" estaban buscando una quest la cual el item deseado al hacer click te de a elegir 3 items por el items conseguido (el items que acabamos de hacer click), luego de elegir el items , le de las gracias bla bla bla .... y se remueva el item... es muy facil pero como son principiantes no saben mucho.... Ni mas ni menos les dejo la quest Quest explicada quest Nombre de la quest begin state start begin when ID del item a usar.use begin say_tittle ("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say(Yo te dare a elegir los siguientes items") local main_set = select ("Nombre1","Nombre2","Nombre3","Cancelar") ------ Puedes agregar más "select" if main_set == 1 then ----- En este caso "if main_set == 1 then" es de el "select" llamado Nombre1 pc.give_item2 ("ID del item a dar" , Cantidad) chat("Has recibido tu items satisfactoriamente") item.remove() ------ "item.remove()" es para remover el ID del item a usar elseif main_set == 2 then ----- En este caso (recuerden que primero va "if" despues viene "elseif" hasta donde quieran llegar) "elseif main_set == 2 then" es de el "select" llamado Nombre2 pc.give_item2 ("ID del item a dar" , Cantidad) chat("Has recibido tu items satisfactoriamente") item.remove() elseif main_set == 3 then ----- Luego "elseif main_set == 3 then" es de el "select" llamado Nombre3 pc.give_item2 ("ID del item a dar" , Cantidad) chat("Has recibido tu items satisfactoriamente") item.remove() elseif main_set == 4 then return ----------- Siempre cuando el "select" sea Cancelar generalmente va "return" aqui end --------- End correspondiente al if situado en la 10° linea end ------- End correspondiente al begin situado en la 3° linea end ------- End correspondiente al begin situado en la 2° linea end ------ End correspondiente al begin situado en la 3° linea Quest limpia quest Nombre de la quest begin state start begin when ID del item a usar.use begin say_tittle ("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say(Yo te dare a elegir los siguientes items") local main_set = select ("Nombre1","Nombre2","Nombre3","Cancelar") if main_set == 1 then pc.give_item2 ("ID del item a dar" , Cantidad) chat("Has recibido tu items satisfactoriamente") item.remove() elseif main_set == 2 then pc.give_item2 ("ID del item a dar" , Cantidad) chat("Has recibido tu items satisfactoriamente") item.remove() elseif main_set == 3 then pc.give_item2 ("ID del item a dar" , Cantidad) chat("Has recibido tu items satisfactoriamente") item.remove() elseif main_set == 4 then return end end end end Bueno ojala les haya gustado , solo metin2zone , (no soy tan pro pero igual me defiendo en las quest)... si hay algun error no duden en comentar xD que andaba haciendola rapido Quote Link to comment Share on other sites More sharing options...
Sonia Posted May 22, 2013 Report Share Posted May 22, 2013 unas fotos mejor seria Quote Link to comment Share on other sites More sharing options...
Tiico™ Posted May 22, 2013 Author Report Share Posted May 22, 2013 unas fotos mejor seria No es necesario fotos Quote Link to comment Share on other sites More sharing options...
KeKo Posted May 22, 2013 Report Share Posted May 22, 2013 Buf, mucho codigo: quest Nombre de la quest begin state start begin when IDdelitem.use begin say_tittle ("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say(Yo te dare a elegir los siguientes items") local main_set = select ("Nombre1","Nombre2","Nombre3","Cancelar") local items = { {iditem1, cantidad}, {iditem2, cantidad}, {iditem3, cantidad} } if main_set != 4 then pc.give_item2(items[main_set][1],items[main_set][2]) chat("Has recibido tu item satisfactoriamente") item.remove() end end end end Quote Link to comment Share on other sites More sharing options...
PACI Posted May 22, 2013 Report Share Posted May 22, 2013 local items = { {"iditem1", cantidad}, {"iditem2", cantidad}, {"iditem3", cantidad} } if main_set != 4 then pc.give_item2(items[main_set][1],items[main_set][2]) KeKo podrías hacer una guía de esas tablas, que yo las he visto ya muchas veces pero aun no las acabo de entender :| Quote Link to comment Share on other sites More sharing options...
SeMa™ Posted May 22, 2013 Report Share Posted May 22, 2013 Buf, mucho codigo: quest Nombre de la quest begin state start begin when IDdelitem.use begin say_tittle ("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say(Yo te dare a elegir los siguientes items") local main_set = select ("Nombre1","Nombre2","Nombre3","Cancelar") local items = { {"iditem1", cantidad}, {"iditem2", cantidad}, {"iditem3", cantidad} } if main_set != 4 then pc.give_item2(items[main_set][1],items[main_set][2]) chat("Has recibido tu item satisfactoriamente") item.remove() end end end end Si ahorras código con arrays pero en los say dice: say("Si tu me das el Nombre del item") say(Yo te dare a elegir los siguientes items") hay no faltaría un local nombre = tonumber(input()) if nombre == "hola" then pc.give_item2(loquesea, 1) elseif nombre == "" then say("No has escrito nada ") end xD Quote Link to comment Share on other sites More sharing options...
KeKo Posted May 22, 2013 Report Share Posted May 22, 2013 KeKo podrías hacer una guía de esas tablas, que yo las he visto ya muchas veces pero aun no las acabo de entender :| Todavia estoi aprendiendo a usarlas, ultimamente como las uso mas ya me voi acostumbrando y en realidad era uno de los capitulos del curso de lua que ibamos a hacer pero no se llego a completar. Asi que si veo que las voi entendiendo del todo lo hare P.D: Sema ya se que no dice los nombres, pero es porque lo ha puesto para que tu completes. PACI 1 Quote Link to comment Share on other sites More sharing options...
Tiico™ Posted May 22, 2013 Author Report Share Posted May 22, 2013 e_e aun soy principiante tantos codigos no me se , los basicos y algunos medio dificiles Quote Link to comment Share on other sites More sharing options...
KeKo Posted May 22, 2013 Report Share Posted May 22, 2013 e_e aun soy principiante tantos codigos no me se , los basicos y algunos medio dificiles Jaja tranqui no pasa nada, mis quests las suele coger noa y acabar con 3 veces menos codigo xd Yo lo pongo x si alguien quiere echarle un ojo a la sintaxis Quote Link to comment Share on other sites More sharing options...
Croqueta Posted May 27, 2013 Report Share Posted May 27, 2013 tenia un poco aburimiento ustedes tubieron todo el mismo error falso say(Yo te dare a elegir los siguientes items") correcto say("Yo te dare a elegir los siguientes items") v1 quest Nombre de la quest begin state start begin when ID del item a usar.use begin say_tittle ("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say("Yo te dare a elegir los siguientes items") local ta={"Nombre1","Nombre2","Nombre3","Cancelar"} local give_item={vnumitem1,vnumitem2,vnumitem3}-- se puede meter muchos items local main_set = select_table(ta) if main_set==table.getn(ta) then return end pc.give_item2(give_item[main_set], Cantidad) chat("Has recibido el item "..item_name(give_item[main_set]))--lee el item automatico item.remove() end end end v2 quest Nombre de la quest begin state start begin when ID del item a usar.use begin say_tittle("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say("Yo te dare a elegir los siguientes items") local ta={"Nombre1","Nombre2","Nombre3","Cancelar"} local give_item= { {"item1","item1count"}, {"item2","item2count"}, {"item3","item3count"}, }-- se puede meter muchos items local main_set = select_table(ta) if main_set==table.getn(ta) then return end pc.give_item2(give_item[main_set][1], give_item[main_set][2]) chat("Has recibido el item "..item_name(give_item[main_set][1]))--lee el item automatico item.remove() end end end Quote Link to comment Share on other sites More sharing options...
Croqueta Posted May 27, 2013 Report Share Posted May 27, 2013 Jaja tranqui no pasa nada, mis quests las suele coger noa y acabar con 3 veces menos codigo xd Yo lo pongo x si alguien quiere echarle un ojo a la sintaxis gracias, pero como tu lo isistes es tambien muy corto Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.