Jump to content

quest problem


Go to solution Solved by .JαyZoN,

Recommended Posts

quest feggarokouta begin
state start begin

    when 50011.use begin
    local randi = number(1,22)
    local prem_item = {
        [1] = { 71018,1 }, --evlogia
        [2] = { 71028,1 }, --epi8esi drakou 8eou
        [3] = { 71027,1 }, --zwh drakoy 8eou
        [4] = { 71029,1 }, --efiia drakou 8eou
        [5] = { 50821,1 }, --Elixier der Sonne (S)
        [6] = { 50822,1 }, --Elixier des Mondes (S)
        [7] = { 50823,1 }, --Erfahrungsring
        [8] = { 50825,1 }, --Zauber-Ei
        [9] = { 50826,1 }, --Leerer Korb
        [10] = { 50903,1 }, --Regenbogenstein
        [11] = { 50703,15 }, --Rappen-Siegel
        [12] = { 27002,120 }, --Segen des Drachen
        [13] = { 27005,120 }, --Segen des Drachen
        [14] = { 50704,15 }, --Segen des Drachen
        [15] = { 71035,1 }, --Segen des Drachen
        [16] = { 71014,1 }, --Segen des Drachen
        [17] = { 71050,1 }, --Segen des Drachen
        [18] = { 71101,1 }, --Segen des Drachen
		[19] = { 71113,1 }, --Segen des Drachen
		[20] = { 71108,1 }, --Segen des Drachen
		[21] = { 71113,1 }, --Segen des Drachen
		[21] = { 71110,1 }, --Segen des Drachen
		[22] = { 71142,1 }, --Segen des Drachen
        }
        pc.give_item2(prem_item[randi][1],prem_item[randi][2])
		pc.give_gold("80000")
        pc.remove_item("50011")
    end

When you right click on it nothing happens. I have it in the quest folder

 

Thanks in advance

Link to comment
Share on other sites

quest feggarokouta begin
state start begin
 
    when 50011.use begin
    local randi = number(1,22)
    local prem_item = {
        [1] = { 71018,1 }, --evlogia
        [2] = { 71028,1 }, --epi8esi drakou 8eou
        [3] = { 71027,1 }, --zwh drakoy 8eou
        [4] = { 71029,1 }, --efiia drakou 8eou
        [5] = { 50821,1 }, --Elixier der Sonne (S)
        [6] = { 50822,1 }, --Elixier des Mondes (S)
        [7] = { 50823,1 }, --Erfahrungsring
        [8] = { 50825,1 }, --Zauber-Ei
        [9] = { 50826,1 }, --Leerer Korb
        [10] = { 50903,1 }, --Regenbogenstein
        [11] = { 50703,15 }, --Rappen-Siegel
        [12] = { 27002,120 }, --Segen des Drachen
        [13] = { 27005,120 }, --Segen des Drachen
        [14] = { 50704,15 }, --Segen des Drachen
        [15] = { 71035,1 }, --Segen des Drachen
        [16] = { 71014,1 }, --Segen des Drachen
        [17] = { 71050,1 }, --Segen des Drachen
        [18] = { 71101,1 }, --Segen des Drachen
        [19] = { 71113,1 }, --Segen des Drachen
        [20] = { 71108,1 }, --Segen des Drachen
        [21] = { 71113,1 }, --Segen des Drachen
        [21] = { 71110,1 }, --Segen des Drachen
        [22] = { 71142,1 }, --Segen des Drachen
        }
        pc.give_item2(prem_item[randi][1],prem_item[randi][2])
        pc.give_gold("80000")
        pc.remove_item("50011")
    end
end
end

like this?

Link to comment
Share on other sites

  • Developer

prem_item[randi][0]

prem_item[randi][1]

 

arrays begin at 0

 

As Mart said, the first index of a lua table is 1. That means, you don't really need (in this case) to write [idx].

 

8e57587c0e.png

Also, delete the last coma of your table.

 

Another thing you can use is table.getn(prem_item) on the number function, that would mean that the randi variable should be after the table. But that's not really necessary, it's up to you.

Edited by Metin2 Dev
Core X - External 2 Internal

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

Try this;

quest feggarokouta begin
    state start begin
        when 50011.use begin
            local randi = number(1,22)
            local prem_item = {
                {71018, 1}, --evlogia
                {71028, 1}, --epi8esi drakou 8eou
                {71027, 1}, --zwh drakoy 8eou
                {71029, 1}, --efiia drakou 8eou
                {50821, 1}, --Elixier der Sonne (S)
                {50822, 1}, --Elixier des Mondes (S)
                {50823, 1}, --Erfahrungsring
                {50825, 1}, --Zauber-Ei
                {50826, 1}, --Leerer Korb
                {50903, 1}, --Regenbogenstein
                {50703, 15}, --Rappen-Siegel
                {27002, 120}, --Segen des Drachen
                {27005, 120}, --Segen des Drachen
                {50704, 15}, --Segen des Drachen
                {71035, 1}, --Segen des Drachen
                {71014, 1}, --Segen des Drachen
                {71050, 1}, --Segen des Drachen
                {71101, 1}, --Segen des Drachen
                {71113, 1}, --Segen des Drachen
                {71108, 1}, --Segen des Drachen
                {71113, 1}, --Segen des Drachen
                {71110, 1}, --Segen des Drachen
                {71142, 1}, --Segen des Drachen
            }
            pc.give_item2(prem_item[randi][1], prem_item[randi][2])
            pc.give_gold("80000")
            pc.remove_item("50011")
        end
    end
end
Link to comment
Share on other sites

doesn't work 

 

Just to mention something no box in the game can be opened not even the box from the reaper that gives75lvl weapons

 

Connect to the database with navicat and look for the item type of value 50011. (18 would be correct)

Otherwise try this;

quest checkboxreaction begin
    state start begin
        when 50011.use begin
            syschat("50011: OK!")
        end
    end
end
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.