Jump to content
fuuton97

[QUEST]Item Aleatorio.

Recommended Posts

Hola, les vengo a traer esta quest mu útil para dar un item aleatorio, tiene 100 probabilidades, puedes aumentarlo con el math.random, das un item y te da otro, algo así como lo que tiene Guabina.

 

quest fuutoncete begin
state start begin
  when 20095.chat."Item Aleatorio" begin
  
   if pc.count_item(50027) < 1 then
    say("Lo siento te falta el item")

    else
    local futon = math.random(1, 100)
  
    if futon == 1 then
    pc.remove_item(50027, 1)
    pc.give_item2(71095, 1)
    elseif futon == 2 then
    pc.remove_item(50027, 1)
    pc.give_item2(27994, 1)
    elseif futon == 3 then
    pc.remove_item(50027, 1)
    pc.give_item2(22982, 1)
    elseif futon == 4 then
    pc.remove_item(50027, 1)
    pc.give_item2(27993, 1)
    elseif futon == 5 then
    pc.remove_item(50027, 1)
    pc.give_item2(27992, 1)
    elseif futon == 6 then
    pc.remove_item(50027, 1)
    pc.give_item2(22989, 1)
    elseif futon == 7 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 8 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 9 then
    pc.remove_item(50027, 1)
    pc.give_item2(22991, 1)
    elseif futon == 10 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 11 then
    pc.remove_item(50027, 1)
    pc.give_item2(22992, 1)
    elseif futon == 12 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 13 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 14 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 15 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 16 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 17 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 18 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 19 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 20 then
    pc.remove_item(50027, 1)
    pc.give_item2(51110, 1)
    elseif futon == 21 then
    pc.remove_item(50027, 1)
    pc.give_item2(51120, 1)
    elseif futon == 22 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 23 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 24 then
    pc.remove_item(51130, 1)
    pc.give_item2(72050, 1)
    elseif futon == 25 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 26 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 27 then
    pc.remove_item(50027, 1)
    pc.give_item2(51140, 1)
    elseif futon == 28 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 29 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 30 then
    pc.remove_item(50027, 1)
    pc.give_item2(11150, 1)
    elseif futon == 31 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 32 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 33 then
    pc.remove_item(50027, 1)
    pc.give_item2(22986, 1)
    elseif futon == 34 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 35 then
    pc.remove_item(50027, 1)
    pc.give_item2(22987, 1)
    elseif futon == 36 then
    pc.remove_item(50027, 1)
    pc.give_item2(22988, 1)
    elseif futon == 37 then
    pc.remove_item(50027, 1)
    pc.give_item2(22980, 1)
    elseif futon == 38 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 39 then
    pc.remove_item(50027, 1)
    pc.give_item2(22984, 1)
    elseif futon == 40 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 41 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 42 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 43 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 47 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 48 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 49 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 50 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 51 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 52 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 53 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 54 then
    pc.remove_item(50027, 1)
    pc.give_item2(22985, 1)
    elseif futon == 55 then
    pc.remove_item(50027, 1)
    pc.give_item2(29330, 1)
    elseif futon == 56 then
    pc.remove_item(50027, 1)
    pc.give_item2(29340, 1)
    elseif futon == 57 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 58 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 59 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 60 then
    pc.remove_item(50027, 1)
    pc.give_item2(29390, 1)
    elseif futon == 61 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 62 then
    pc.remove_item(50027, 1)
    pc.give_item2(29380, 1)
    elseif futon == 63 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 64 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 65 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 66 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 67 then
    pc.remove_item(50027, 1)
    pc.give_item2(29350, 1)
    elseif futon == 68 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 69 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 70 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 71 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 72 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 73 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 74 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 75 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 76 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 77 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 78 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 79 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 80 then
    pc.remove_item(50027, 1)
    pc.give_item2(30110, 1)
    elseif futon == 81 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 82 then
    pc.remove_item(50027, 1)
    pc.give_item2(30170, 1)
    elseif futon == 83 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 84 then
    pc.remove_item(50027, 1)
    pc.give_item2(30140, 1)
    elseif futon == 85 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 86 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 87 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 88 then
    pc.remove_item(50027, 1)
    pc.give_item2(30150, 1)
    elseif futon == 89 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 90 then
    pc.remove_item(50027, 1)
    pc.give_item2(30160, 1)
    elseif futon == 91 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 92 then
    pc.remove_item(50027, 1)
    pc.give_item2(30120, 1)
    elseif futon == 93 then
    pc.remove_item(50027, 1)
    pc.give_item2(11110, 1)
    elseif futon == 94 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 95 then
    pc.remove_item(50027, 1)
    pc.give_item2(11120, 1)
    elseif futon == 96 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 97 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 98 then
    pc.remove_item(50027, 1)
    pc.give_item2(11130, 1)
    elseif futon == 99 then
    pc.remove_item(50027, 1)
    pc.give_item2(72050, 1)
    elseif futon == 100 then
    pc.remove_item(50027, 1)
    pc.give_item2(11140, 1)
    end
   end
  end
end
end

Saludos, espero que les guste.

Share this post


Link to post
Share on other sites

Cuando hablas con el npc con la id "20095" y tienes el item 50027 ejecuta la orden matemática "Random" osea, aleatorio del 1 al 100 y a continuación tienes la lista de items que te puede dar dependiendo del número que te toque.

Share this post


Link to post
Share on other sites

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])

Share this post


Link to post
Share on other sites

No entiendo porque haces una quest para eso estando special_item_group.txt que hace exactamente lo mismo. Aparte de que con ese código te suspenden en primero de programación, usa tablas por dios.

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...