Jump to content
Elite™

Levelup(Metin2.es)

Recommended Posts


----------------------------------

-- Cazeria

-- Traducida como el metin2.es

-- Creditos: Eliteâ„¢

----------------------------------

quest levelup begin

state run begin

when letter begin

local current = pc.getqf("current")

local completed_level = pc.getqf("complete");

if current == 0 and

pc.get_level() > completed_level and

pc.get_level() > 1 and

pc.get_level() < 60 then

local lev = pc.get_level()

pc.setqf("buttonstate", 2)

makequestbutton("Comenzar tarea "..lev.."")

pc.setqf("current", lev)

pc.setqf("select", 1)

pc.setqf("remain", special.levelup_quest[lev][2])

setskin(NOWINDOW)

end

setstate(start)

end

end

state start begin

when info begin

local lev = pc.getqf("current")

if lev == 0 then return end

setskin(SCROLL)

setbgimage('level_bg.tga')

local s = pc.getqf("select")

if s == 0 then s = 1 end

addimage(20,12,special.levelup_img[special.levelup_quest[lev][s*2-1]])

setcolor(0,0,0)

say("¡Elimina a ",mob_name(special.levelup_quest[lev][s*2-1])," !")

say("Número de objetivos: "..special.levelup_quest[lev][s*2])

raw_script("Recompensa: ".. special.levelup_quest[lev][5].."% de experiencia.")

say("")

if lev <= table.getn(special.levelup_reward1) then

raw_script(" "..item_name(special.levelup_reward1[lev][pc.job+1]))

else

raw_script(" ".."Objeto Aleatorio")

end

raw_script(newline)

levelup.show_mob_pos(lev)

select("Confirmar")

clearmapsignal()

setskin(NOWINDOW)

end

when login begin

local lev = pc.getqf("current")

if lev != 0 then

if pc.getqf("remain") <= 0 then

setskin(NOWINDOW)

pc.setqf("buttonstate", 3)

makequestbutton(""..lev.." misión - terminada")

else

setskin(NOWINDOW)

pc.setqf("buttonstate", 1)

makequestbutton("Comenzar tarea "..lev.." ")

end

end

end

when button begin

local lev = pc.getqf("current")

if lev == 0 then return end

if pc.getqf("buttonstate") == 3 then

local s = pc.getqf("select")

if s == 0 then s = 1 end

say_title(" "..lev.." misión - terminada")

say("Bien, has terminado con éxito la misión.")

wait()

if lev <= 20 then

if lev <= table.getn(special.levelup_reward1) then

pc.give_item("Nivel "..lev.." Objeto",

special.levelup_reward1[lev][pc.job+1])

else

local v = number(1,100)

if v <= special.levelup_reward3[1][1] then

pc.give_item("Nivel "..lev.." Objeto",

special.levelup_reward3[1][2],special.levelup_reward3[1][3])

elseif v <= special.levelup_reward3[2][1] then

pc.give_item("Nivel "..lev.." Objeto",

special.levelup_reward3[2][2],special.levelup_reward3[2][3])

elseif v <= special.levelup_reward3[3][1] then

pc.give_item("Nivel "..lev.." Objeto",

special.levelup_reward3[3][2],special.levelup_reward3[3][3])

elseif v <= special.levelup_reward3[4][1] then

pc.give_item("Nivel "..lev.." Objeto",

special.levelup_reward3[4][2],special.levelup_reward3[4][3])

else

pc.give_item("Nivel "..lev.." Objeto",

special.levelup_reward3[5][2],special.levelup_reward3[5][3])

end

end

pc.give_exp_perc("Nivel "..lev.." Experiencia",

lev, special.levelup_quest[lev][5])

if lev == 12 or lev == 14 or lev == 16 or lev == 18 or lev == 20 then

pc.give_item2(50083)

say_reward(item_name(50083) .. " recibido.")

end

else

local ll = lev - 20

if lev < 26 then

local n = table.getn(special.levelup_reward_item_21[ll])

local t = special.levelup_reward_item_21[ll][number(1, n)]

say_reward("Recompensa: ")

if type(t) == 'table' then

pc.give_item2(t[1], t[2])

say_reward("Recibido "..item_name(t[1])..

""..t[2].."")

else

pc.give_item2(t)

say_reward("Recibido "..item_name(t)..

"")

end

end

local reward_gold = special.levelup_reward_gold21

local reward_exp = special.levelup_reward_exp21

if lev >= 31 and lev <= 40 then

reward_gold = special.levelup_reward_gold31

reward_exp = special.levelup_reward_exp31

elseif lev >= 41 and lev <= 50 then

reward_gold = special.levelup_reward_gold41

reward_exp = special.levelup_reward_exp41

elseif lev >= 51 and lev <= 60 then

reward_gold = special.levelup_reward_gold51

reward_exp = special.levelup_reward_exp51

end

 

n = number(0, 99)

local i = 0

for i = 1, table.getn(reward_gold) do

if n < reward_gold[2] then

pc.change_money(reward_gold[1])

say_reward("Recibes "..reward_gold[1].." Yang.")

break

else

n = n - reward_gold[2]

end

end

 

n = number(0, 99)

i = 0

for i = 1, table.getn(reward_exp) do

if n < reward_exp[2] then

pc.give_exp_perc("Nivel"..lev.." Experiencia",

lev, reward_exp[1])

say_reward("Recibes "..reward_exp[1].."% de Experiencia.")

break

else

n = n - reward_exp[2]

end

end

say("")

end

local old_lev = lev

lev = lev + 1

 

if lev > 1 and lev < 60 and pc.level >= lev then

pc.setqf("buttonstate", 2)

makequestbutton(" "..lev.." misión")

pc.setqf("current", lev)

pc.setqf("select", 1)

pc.setqf("remain",special.levelup_quest[lev][2])

setskin(NOWINDOW)

return

else

pc.setqf("complete", old_lev)

pc.setqf("current", 0)

q.done()

end

elseif pc.getqf("buttonstate") == 2 then

local lev = pc.getqf("current")

if lev == 0 then

q.done()

end

say_title("Tarea de caza:")

say("Para la siguiente tarea de caza, tienes que")

say("elegir cuál de los dos monstruos quieres matar.")

local sel = select(

mob_name(special.levelup_quest[lev][1]).." "..special.levelup_quest[lev][2].." ",

mob_name(special.levelup_quest[lev][3]).." "..special.levelup_quest[lev][4].." "

)

 

 

setskin(SCROLL)

setbgimage('level_bg.tga')

pc.setqf("select", sel)

addimage(20, 12, special.levelup_img[special.levelup_quest[lev][sel*2-1]])

setcolor(0,0,0)

say("¡Elimina a ",mob_name(special.levelup_quest[lev][sel*2-1])," .!")

say("Número de objetivos: "..special.levelup_quest[lev][sel*2])

raw_script("Recompensa: ".. special.levelup_quest[lev][5].."% de experiencia")

say("")

if lev <= table.getn(special.levelup_reward1) then

raw_script(" "..item_name(special.levelup_reward1[lev][pc.job+1]))

else

say("")

raw_script(" ".." Objeto aleatorio")

end

raw_script(newline)

levelup.show_mob_pos(lev)

local s = select("¡Bien! ¡Vamos!")

if s == 1 then

setskin(NOWINDOW)

pc.setqf("remain",special.levelup_quest[lev][sel*2])

syschat("<Tarea> ", mob_name(special.levelup_quest[lev][sel*2-1])," "..

special.levelup_quest[lev][sel*2].." número de victorias.")

q.set_title("mata "..mob_name(special.levelup_quest[lev][sel*2-1]).." ")

q.set_counter("Restantes : ", pc.getqf("remain"))

q.start()

end

setskin(NOWINDOW)

clearmapsignal()

elseif pc.getqf("buttonstate") == 1 then

local s = pc.getqf("select")

if s == 0 then s = 1 end

local lev = pc.getqf("current")

if lev != 0 then

say_title("Tarea de caza:")

say("Tienes que matar")

say(pc.getqf("remain").." Número de este tipo:",mob_name(special.levelup_quest[lev][s*2-1]), "")

say("más para completar la misión de caza.")

local ss = select("Información sobre la misión de caza","Continuar")

 

 

if ss == 1 then

setskin(SCROLL)

setbgimage('level_bg.tga')

addimage(20,12,special.levelup_img[special.levelup_quest[lev][s*2-1]])

setcolor(0,0,0)

say("¡Elimina a ",mob_name(special.levelup_quest[lev][s*2-1])," !")

say("Número de objetivos: "..special.levelup_quest[lev][s*2])

raw_script("Recompensa: ".. special.levelup_quest[lev][5].."% de experiencia")

say("")

if lev <= table.getn(special.levelup_reward1) then

raw_script(" "..item_name(special.levelup_reward1[lev][pc.job+1]))

else

raw_script(" ".." Objeto Aleatorio")

end

raw_script(newline)

q.set_title("mata ", mob_name(special.levelup_quest[lev][s*2-1]), " ")

q.set_counter("Restantes : ", pc.getqf("remain"))

q.start()

levelup.show_mob_pos(lev)

select("Confirmar")

setskin(NOWINDOW)

clearmapsignal()

end

setskin(NOWINDOW)

q.set_title(" matar "..mob_name(special.levelup_quest[lev][s*2-1]).." ")

q.set_counter("Restantes:",

pc.getqf("remain"))

--q.set_icon(string.format("level_%02d.sub", lev))

q.start()

end

end

pc.setqf("buttonstate", -1)

end

when levelup begin

local lev = pc.getqf("current");

if lev == 0 then

lev = pc.level

 

if lev < 2 or lev > 60 then return end

pc.setqf("buttonstate", 2)

makequestbutton(""..lev.." misión")

pc.setqf("current", lev)

pc.setqf("select", 1)

pc.setqf("remain", special.levelup_quest[lev][2])

setskin(NOWINDOW)

end

end

when kill begin

local sel = pc.getqf("select")

if sel == 0 then

sel = 1

end

local lev = pc.getqf("current")

if lev != 0 and npc.race == (special.levelup_quest[lev][sel*2-1]) and pc.getqf("buttonstate") == -1 then

local remain = pc.getqf("remain") - 1

if remain <= 0 then

pc.setqf("remain", 0)

q.set_counter_value(0)

setskin(NOWINDOW)

makequestbutton(" "..lev.." Misión - terminada")

pc.setqf("buttonstate", 3)

else

pc.setqf("remain", remain)

q.set_counter_value(remain)

end

end

end

function show_mob_pos(lev)

map_index = pc.get_map_index()

if map_index <= 0 then

test_chat("show_mob_pos: map_index("..map_index..") < 0")

return

end

if map_index > table.getn(special.lvq_map) then

test_chat("show_mob_pos: map_index("..map_index..") > max("..table.getn(special.lvq_map)..")")

return

end

lev_quest_list = special.lvq_map[map_index]

if not lev_quest_list then

test_chat("show_mob_pos: special.lvq_map[map_index("..map_index..")] is nil")

return

end

mob_pos_list = lev_quest_list[lev]

if not mob_pos_list then

test_chat("show_mob_pos: special.lvq_map[map_index("..map_index..")][lev("..lev..")] is nil")

return

end

table.foreachi(

mob_pos_list,

function (n, mob_pos)

test_chat("addmapsignal("..mob_pos[1]..", "..mob_pos[2]..")")

addmapsignal(mob_pos[1]*100, mob_pos[2]*100)

end

)

setmapcenterposition(200, 0)

end

end

end

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...