Jump to content

Croqueta

Miembro
  • Contador contenido

    205
  • Ingreso

  • Última visita

  • Días ganados

    8

Todo lo publicado por Croqueta

  1. las reload quest no se puede usar en quests
  2. do local function exportstring( s ) return string.format("%q", s) end function table.save( tbl,filename ) local charS,charE = " ","n" local file,err = io.open( filename, "wb" ) if err then return err end local tables,lookup = { tbl },{ [tbl] = 1 } file:write( "return {"..charE ) for idx,t in ipairs( tables ) do file:write( "-- Table: {"..idx.."}"..charE ) file:write( "{"..charE ) local thandled = {} for i,v in ipairs( t ) do thandled[i] = true local stype = type( v ) if stype == "table" then if not lookup[v] then table.insert( tables, v ) lookup[v] = #tables end file:write( charS.."{"..lookup[v].."},"..charE ) elseif stype == "string" then file:write( charS..exportstring( v )..","..charE ) elseif stype == "number" then file:write( charS..tostring( v )..","..charE ) end end for i,v in pairs( t ) do if (not thandled[i]) then local str = "" local stype = type( i ) if stype == "table" then if not lookup[i] then table.insert( tables,i ) lookup[i] = #tables end str = charS.."[{"..lookup[i].."}]=" elseif stype == "string" then str = charS.."["..exportstring( i ).."]=" elseif stype == "number" then str = charS.."["..tostring( i ).."]=" end if str ~= "" then stype = type( v ) if stype == "table" then if not lookup[v] then table.insert( tables,v ) lookup[v] = #tables end file:write( str.."{"..lookup[v].."},"..charE ) elseif stype == "string" then file:write( str..exportstring( v )..","..charE ) elseif stype == "number" then file:write( str..tostring( v )..","..charE ) end end end end file:write( "},"..charE ) end file:write( "}" ) file:close() end function table.load( sfile ) local ftables,err = loadfile( sfile ) if err then return _,err end local tables = ftables() for idx = 1,#tables do local tolinki = {} for i,v in pairs( tables[idx] ) do if type( v ) == "table" then tables[idx][i] = tables[v[1]] end if type( i ) == "table" and tables[i[1]] then table.insert( tolinki,{ i,tables[i[1]] } ) end end for _,v in ipairs( tolinki ) do tables[idx][v[2]],tables[idx][v[1]] = tables[idx][v[1]],nil end end return tables[1] end end pro ejemplo tabla={ minombre='Noa', ano='23', pais='Alemania' } table.save(tabla,"mitabla.lua") local tabla=table.load("mitabla.lua") for _,i in next, tabla do say(i) end o say("mi nombre es "..tabla.minombre.." tengo "..tabla.ano.." anos y bivo en "..tabla.pais)
  3. se puede escribir mejor, para eso no se nesesita cambiar el state quest teleportar begin state start begin when letter begin send_letter("Teleportar") end when info or button begin say("Donde quieres ir?") local b = select ("Ciudad 1 - Jinno", "Ciudad 2 - Jinno", "Ciudad 1 - Shinsoo", "Ciudad 2 - Shinsoo", "Ciudad 1 - Chunjo", "Ciudad 2 - Chunjo", "Salir") local tele={ {969600, 278400},--Ciudad 1 - Jinno {873100, 242600},--Ciudad 2 - Jinno {469300, 964200},--Ciudad 1 - Shinsoo {360800, 877600},--Ciudad 2 - Shinsoo {55700, 157900},--Ciudad 1 - Chunjo {138500, 234900}--Ciudad 2 - Chunjo } pc.warp(tele[b][1], tele[b][2]) end end end
  4. la funcion "string.trim " no se nesesita poner, para tener lo mejor esribelo asi string.format("%s",item_name(item.get_vnum()))€dit. y para 3 dias esa quest >,> ... afloja
  5. xd pruebalo asi quest itens begin state start begin when IDITEM.use begin if pc.getqf("retirar") == 1 then affect.remove_collect(apply.EXP_DOUBLE_BONUS, 10, 60*60*5) pc.setqf("retirar, 0) elseif pc.getqf("retirar") == 0 then affect.add_collect(apply.EXP_DOUBLE_BONUS, 10, 60*60*5) pc.setqf("retirar", 1) end end end end
  6. los bonus no se van cuando el jugador se baje de la montura? por que la funcion dise asi pc.mount_bonus
  7. quest test begin state start begin when login or levelup begin local tabla= { [5]={10}, -- item 10 [10]={12}, -- item 12 [15]={15}, -- item 15 [20]={19}, -- item 19 } pc.give_item2(tabla[pc.get_level()][1]) chat("as resivido "..item_name(tabla[pc.get_level()][1])) end end end
  8. quest inicio_diferente begin state start begin when letter begin send_letter("Bem Vindo") end when button or info begin say_title("Bem Vindo") say("Olá "..pc.get_name().."") say("Bem vindo ao servidor.") say("") say("O Ferreiro está à tua procura para") say("te dar as boas vindas.") say("Vai até ele, pode ser que te ofereça algo.") local ferreiro = find_npc_by_vnum(20016) if ferreiro != 0 then target.vid("__TARGET__", ferreiro, "Ir ao Ferreiro") end end when __TARGET__.target.click or 20016.chat."Sou Novo Por Aqui" begin local items={{19,11209},{1009,11409},{19,11609},{7009,11809}} target.delete("__TARGET__") say_title("Ferreiro:") say("") say("Olá!") say("és novo por aqui? é a primeira vez que te vejo.") say("Como te chamas?") say("") wait() say_title("Ferreiro:") say("") say("Ah, Então prazer em conhecer-te "..pc.get_name().."") say("Pelo que vejo, não tens qualquer item para") say("começares as tuas aventuras e evoluir.") say("") wait() say_title("Ferreiro:") say("") say("Vá... como és novo na cidade, vou-te oferecer") say("uma armadura e uma espada, ambas a +9, atenção!") say("Não é todos os dias que se arranja algo disto.") wait() if pc.count_item(149) != items[pc.get_job()+1][1] and pc.count_item(11299) != items[pc.get_job()+1][2] then pc.give_item2(149) pc.give_item2(11299) say_title("Ferreiro:") say("") say("Pronto, aqui tens, espero que aproveites") say("os itens e te consigas tornar num guerreiro admirável!") say("") say("Até logo !") set_state(acabou) end end end state acabou begin end end
  9. http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2177716-release-new-game-function-npc-get_vid.html
  10. con esa tabla se puede editat el drop de cada un item en ella por ejemplo {10,1{2}},-- la espada+0 tiene un drop de 50% {11,1{20}},-- la espada+1 tiene un drop de 5% local tab={ {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, {vnum,count,{changce}}, } if tab[math.random(1,table.getn(tab))][3][1]>table.getn(tab) then say("la changce es mui arta") return end pc.give_item2(tab[math.random(1,tab[math.random(1,table.getn(tab))][3][1])][1],tab[math.random(1,table.getn(tab))][2])
  11. pruebalo asi si funciona local rangliste = mysql_query("SELECT * FROM player, quest WHERE player.name NOT LIKE '[%]%' ORDER BY quest.IValue DESC AND szState='asesinatos'","'" .. USER .. "'","'" .. PASSWORD .. "'","player","" .. SERVERIP .. " LIMIT 10;") say_title("Top 10") say("#: Nombre Cantidad de Muertes ") table.foreachi(rangliste,function(index,val) say(index..". "..val[1],val[2]) end)
  12. quest mapa120 begin state start begin when 30121.chat."funciona" with pc.level >=119 begin say(mob_name(30111)..":") say("") say("¡Hola viajero!") say("¿Quiere ir a mundos nunca antes vistos?") say("El dios dragon me a dado el poder para llevarte..") say("") say("¿Quieres que te lleve conmigo?") say("") if select("Entrar","No entrar")==1 then if pc.count_item(27994)==0 then say_title("NPC-QueSuerteMt2:") say_reward("Alto alli ! No puede pasar !") say_reward("Usted necesita una perla.") say_reward("Para entrar en la plaza.") return end pc.remove_item(27994,1) pc.warp( 230400 , 0 ) else say(mob_name(30121)..":") say("") say("Que el dios dragon te protega") say("Que la suerte este en ti.") return end end end end
  13. es similar a la de Nova map_wap.quest pero con commentarios para que sepan que ase algo en la tabla y como creer algo asi when 9009.chat."select in table " begin local tab={ {469300,964200}, --mp1 1 {55700,157900}, --mp1 2 {969600,278400}, --mp1 3 {217800,627200}, --des 1 {221900,502700}, --des 2 {344000,502500}, --des 3 {352300,882700}, --mp2 1 {145700,239800}, --mp2 2 {863800,246000}, --mp2 3 } say() if select("teleportation","cansel")==1 then if pc.is_gm() then s= select("mp1 1","mp1 2","mp1 3","des1 1","des1 2","des1 3","next","cancel") if s==8 then return end if s== 7 then s= select("mp2 1","mp2 2","mp2 3","cancel")+3 end else return end else return end pc.warp(tab[s][1],tab[s][2]) end
  14. para si el jugador mata a uno de su reino que no lo cuenta
  15. when kill with npc.is_pc() and pc.get_empire() ~= npc.get_empire() begin mysql_query("UPDATE player.player SET kills=kills+1 WHERE name='"..pc.get_name().."';") end
  16. melo mire mejor y lo puse asi. when kill with npc.is_pc() and pc.get_empire() != npc.get_empire() and pc.get_map_index() == 103 and game.get_event_flag("reinos_war")== 1 begin game.set_event_flag("reino"..npc.get_empire(),game.get_event_flag("reino"..npc.get_empire())+1) notice_all("Rojo: "..game.get_event_flag("reino1").." Amarillo: "..game.get_event_flag("reino2").." Azul: "..game.get_event_flag("reino3")) if game.get_event_flag("reino"..npc.get_empire() >= 200 then notice_all(locale.empire_names[pc.get_empire()].." ha demostrado ser el reino mas fuerte de todos") game.set_event_flag("reinos_war", 0) end end el error que tiene keko es que el pc.get_empire() te da solo el reino del jugador aktual y no el jugador que mates
  17. esta funcion te da el value mas grande o menor de una tabla function minmax(...) local vmin,vmax for i,v in ipairs{...} do if vmax==nil or v > vmax then vmax=v end if vmin==nil or v < vmin then vmin=v end end return vmin,vmax end vmin,vmax = minmax(4,1,6,1,8,5,8,3) say(vmin,vmax) say(vmin) say(vmax) result >1 8 >1 >8
  18. si usas click, las otras quests de ese npc no sirbe"<-?" por que el click blocea todas las otras actiones en el nps. el chat solo tiene casi la misma funcion como la de click(cuando se usa sola), ella se puede combinar con otras funciones, por ejemplo when vnum.chat with item.vnum()== vnum begin end when vnum.chat with pc.is_gm() begin endel chat con el texto selectiona cosas para la quest, como when vnum.chat."Qien es mas feo?" begin --block end when vum.chat."?oef sam se neiQ" begin --block end
  19. por eso esta ...and pc.get_empire() != npc.get_empire()...
  20. when kill with npc.is_pc() and pc.get_empire() != npc.get_empire() and pc.get_map_index() == 103 and game.get_event_flag("reinos_war")== 1 begin game.set_event_flag("reino"..npc.get_empire(),game.get_event_flag("reino"..npc.get_empire())+1) notice_all("Rojo: "..game.get_event_flag("reino1").." Amarillo: "..game.get_event_flag("reino2").." Azul: "..game.get_event_flag("reino3")) end
×
×
  • Crear nuevo...