Jump to content

quest problem


Go to solution Solved by .JαyZoN,

Recommended Posts

nothing happens again

quest truhe begin
    state start begin
        when 838383.use begin
			pc.remove_item("838383")
            local box = {
                -- Dropps --
                71150,	53003,	53006,	53007,	53008,	53009,		
                        }
            local give,a = number(0, 1),{}
            local items
            for i = 1, give do
                items = number(1, table.getn(box))
                table.insert(a,i,box[items])
            end
            table.foreach(a,
                function(i,l)
                    pc.give_item2(l)
                end
            )
            item.remove()
        end
    end
end  

on another item this works perfectly and it has subtype 10. I dont'know wha't sthe problem with that box

Link to comment
Share on other sites

quest fcking_chest begin
	state start begin
		when 50011.use begin
			local i = 0
			local items = {
				-- itemId, count, Procent,
				19, 1, 20, 29, 2, 50,
				299, 2, 100, 199, 1, 20,
				279, 2, 100, 159, 1, 20,
				269, 2, 100, 139, 1, 20,
			}
			repeat
				i = i + 3
			until math.random(1, 100) <= items[i]
			pc.give_item2(items[(i-2)], items[(i-1)])
			pc.give_gold(80000)
			pc.remove_item(50011)
		end
	end
end
---------------------------------------------

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

 

Your Quest is too long ^^

Link to comment
Share on other sites

  • Solution

So use my example then. Replace the content with 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

  • Developer

 

 

prem_item[randi][0]

prem_item[randi][1]

 

arrays begin at 0

 

8e57587c0e.png

Also, delete the last coma of your table.

 

 

Why?

 

 

Because I've never got a quest/lua script working with a coma at the end of a lua table.

E.g:

table = {{1,2},{3,4},{5,6},} -> never worked, at least for me.

 

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

 

 

 

prem_item[randi][0]

prem_item[randi][1]

 

arrays begin at 0

 

8e57587c0e.png

Also, delete the last coma of your table.

 

 

Why?

 

 

Because I've never got a quest/lua script working with a coma at the end of a lua table.

E.g:

table = {{1,2},{3,4},{5,6},} -> never worked, at least for me.

 

 

 

5087a0bcfc.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
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



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