Jump to content
Forgot your email address? ×
×
×
  • Create New...
  • 0

Rainbow stone question


Rumor

Question

quest regenbogen begin 
    state start begin 
            when 50512.use  begin 
                 
                say_title("Rainbow stone:")                  
                if pc.job ==0 then 
                say("Choose your class") 
                 
                local s=select("Arahan","Partisan") 
                 
                if s==1 then 
                pc.set_skill_group(1) 
                pc.set_skill_level(1 ,59) 
                pc.set_skill_level(2 ,59) 
                pc.set_skill_level(3 ,59) 
                pc.set_skill_level(4 ,59) 
                pc.set_skill_level(5 ,59)
                -- pc.set_skill_level(6 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                if s==2 then 
                pc.set_skill_group(2) 
                pc.set_skill_level(16 ,59) 
                pc.set_skill_level(17 ,59) 
                pc.set_skill_level(18 ,59) 
                pc.set_skill_level(19 ,59) 
                pc.set_skill_level(20 ,59)
                -- pc.set_skill_level(21 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                elseif pc.job ==1 then 
                say("Choose your class") 
                 
                local s=select("Ninja","Archer") 
                 
                if s==1 then 
                pc.set_skill_group(3) 
                pc.set_skill_level(31 ,59) 
                pc.set_skill_level(32 ,59) 
                pc.set_skill_level(33 ,59) 
                pc.set_skill_level(34 ,59) 
                pc.set_skill_level(35 ,59)
                -- pc.set_skill_level(36 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                if s==2 then 
                pc.set_skill_group(4) 
                pc.set_skill_level(46 ,59) 
                pc.set_skill_level(47 ,59) 
                pc.set_skill_level(48 ,59) 
                pc.set_skill_level(49 ,59) 
                pc.set_skill_level(50 ,59)
                -- pc.set_skill_level(51 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                elseif pc.job ==2 then 
                say("Choose your class") 
                local s=select("Black Magic","Mirage") 
                 
                if s==1 then 
                pc.set_skill_group(5) 
                pc.set_skill_level(76 ,59) 
                pc.set_skill_level(77 ,59) 
                pc.set_skill_level(78 ,59) 
                pc.set_skill_level(79 ,59) 
                pc.set_skill_level(80 ,59) 
                pc.set_skill_level(81, 59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                if s==2 then 
                pc.set_skill_group(6) 
                pc.set_skill_level(61 ,59) 
                pc.set_skill_level(62 ,59) 
                pc.set_skill_level(63 ,59) 
                pc.set_skill_level(64 ,59) 
                pc.set_skill_level(65 ,59) 
                pc.set_skill_level(66 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                elseif pc.job ==3 then 
                say("Choose your class") 
                local s=select("Lightning","Dragon") 
                 
                if s==1 then 
                pc.set_skill_group(7) 
                pc.set_skill_level(106 ,59) 
                pc.set_skill_level(107 ,59) 
                pc.set_skill_level(108 ,59) 
                pc.set_skill_level(109 ,59) 
                pc.set_skill_level(110 ,59) 
                pc.set_skill_level(111 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
                 
                if s==2 then 
                --Drachen 
                pc.set_skill_group(8) 
                pc.set_skill_level(91 ,59) 
                pc.set_skill_level(92 ,59) 
                pc.set_skill_level(93 ,59) 
                pc.set_skill_level(94 ,59) 
                pc.set_skill_level(95 ,59) 
                pc.set_skill_level(96 ,59) 
                pc.remove_item(50512, 1) 
                say_yellow("Your skills are now perfect.") 
                end 
            end 
        end 
    end 
end 

If the player doesn't reset his skills and choose another sub-class it won't assign their skill levels. It's as if set_skill_group is not working. Should I add the function here to reset skills from skill reset scroll?

Link to comment

15 answers to this question

Recommended Posts

  • 0
quest regenbogen begin
	state start begin
		when 50512.use begin
			local data = {
				[0] = {
					[1] = {1,2,3,4,5},
					[2] = {16,17,18,19,20},
				},
				
				[1] = {
					[1] = {31,32,33,34,35},
					[2] = {46,47,48,49,50},
				},
				
				[2] = {
					[1] = {76,77,78,79,80,81},
					[2] = {61,62,63,64,65,66},
				},
				
				[3] = {
					[1] = {106,107,108,109,110,111},
					[2] = {91,92,93,94,95,96},
				},
				
				["classNames"] = {
					[0] = {"Arahan","Partisan","Close"},
					[1] = {"Ninja","Archer","Close",},
					[2] = {"Black Magic","Mirage","Close"},
					[3] = {"Lighting","Dragon","Close"},
				},
			}
			
			say_title("Rainbow Stone:")
			say("")
			--
			say("Choose your class")
			local s = select_table(data["classNames"][pc.get_job()])
			if(s >= table.getn(data["classNames"][pc.get_job()])) then
				return
			end
			pc.set_skill_group(s)
			for i = 1,table.getn(data[pc.get_job()][s]),1 do
				pc.set_skill_level(data[pc.get_job()][s][i],59)
			end
			pc.remove_item(50512,1)
			say_yellow("Your skills are now perfect.. ")
		end
	end
end

Regards.

  • Love 1

Plain logic saves lives.

Link to comment
  • 0

quest doesn't work, just does this:

7aQ77.jpg

SYSERR: Feb 26 04:37:06 :: RunState: LUA_ERROR: [string "regenbogen"]:28: attempt to compare number with nil
SYSERR: Feb 26 04:37:06 :: WriteRunningStateToSyserr: LUA_ERROR: quest regenbogen.start click
SYSERR: Feb 26 04:37:11 :: RunState: LUA_ERROR: [string "regenbogen"]:28: attempt to compare number with nil
SYSERR: Feb 26 04:37:11 :: WriteRunningStateToSyserr: LUA_ERROR: quest regenbogen.start click
SYSERR: Feb 26 04:38:04 :: RunState: LUA_ERROR: [string "regenbogen"]:28: attempt to compare number with nil
SYSERR: Feb 26 04:38:04 :: WriteRunningStateToSyserr: LUA_ERROR: quest regenbogen.start click
SYSERR: Feb 26 04:38:10 :: Analyze: login phase does not handle this packet! header 66
SYSERR: Feb 26 04:38:11 :: Analyze: Handshake phase does not handle packet 66 (fd 34)
SYSERR: Feb 26 04:38:21 :: RunState: LUA_ERROR: [string "regenbogen"]:28: attempt to compare number with nil
SYSERR: Feb 26 04:38:21 :: WriteRunningStateToSyserr: LUA_ERROR: quest regenbogen.start click
Link to comment
  • 0

There is a mistake [1] = {"Ninja","Archer","Close",},
it should be without a comma like:

quest regenbogen begin
    state start begin
        when 50512.use begin
            local data = {
                [0] = {
                    [1] = {1,2,3,4,5},
                    [2] = {16,17,18,19,20},
                },
                 
                [1] = {
                    [1] = {31,32,33,34,35},
                    [2] = {46,47,48,49,50},
                },
                 
                [2] = {
                    [1] = {76,77,78,79,80,81},
                    [2] = {61,62,63,64,65,66},
                },
                 
                [3] = {
                    [1] = {106,107,108,109,110,111},
                    [2] = {91,92,93,94,95,96},
                },
                 
                ["classNames"] = {
                    [0] = {"Arahan","Partisan","Close"},
                    [1] = {"Ninja","Archer","Close"}, -- there was no needed comma 
                    [2] = {"Black Magic","Mirage","Close"},
                    [3] = {"Lighting","Dragon","Close"},
                },
            }
             
            say_title("Rainbow Stone:")
            say("")
            --
            say("Choose your class")
            local s = select_table(data["classNames"][pc.get_job()])
            if(s >= table.getn(data["classNames"][pc.get_job()])) then
                return
            end
            pc.set_skill_group(s)
            for i = 1,table.getn(data[pc.get_job()][s]),1 do
                pc.set_skill_level(data[pc.get_job()][s][i],59)
            end
            pc.remove_item(50512,1)
            say_yellow("Your skills are now perfect.. ")
        end
    end
end

Hope it works!

  • Love 1
Link to comment
  • 0
quest regenbogen begin
	state start begin
		when 50512.use begin
			local sk = special.active_skill_list[pc.get_job()+1][pc.get_skill_group()]
			for i = 1, table.getn(sk) do
				if pc.get_skill_level(sk[i]) < 40 then
					pc.set_skill_level(sk[i], 40)
					item.remove()
					syschat("Your skills are now perfect.")
				end
			end
		end
	end
end

when you return 0 and server doesn't boot:

unknown.png

Link to comment
  • 0
  • Moon

quest regenbogen begin
	state start begin
		when 50512.use begin
			local sk = special.active_skill_list[pc.get_job()+1][pc.get_skill_group()]
			for i = 1, table.getn(sk) do
				if pc.get_skill_level(sk[i]) < 40 then
					pc.set_skill_level(sk[i], 40)
					item.remove()
					syschat("Your skills are now perfect.")
				end
			end
		end
	end
end

 

Dont put the item.remove into the for loop

put it after the for loop

 

Link to comment
  • 0

huh I don't understand how that is a working quest, it doesn't list the skills at all. What I'm saying is the quest still just says "Choose your skills" and has a button to click that closes the window, you can never choose which skills you want :(.

Link to comment
  • 0

Try that:

quest regenbogen begin
	state start begin
		when 50512.use begin
			local job_name = {
				[0] = {"Arahan","Partisan"},
                [1] = {"Ninja","Archer"},
                [2] = {"Black Magic","Mirage"},
                [3] = {"Lighting","Dragon"},
			}
			local skill_index = {
				[0] = {
					[1] = {1,2,3,4,5},
					[2] = {16,17,18,19,20},
				},
					 
				[1] = {
					[1] = {31,32,33,34,35},
					[2] = {46,47,48,49,50},
				},
					 
				[2] = {
					[1] = {76,77,78,79,80,81},
					[2] = {61,62,63,64,65,66},
				},
				 
				[3] = {
					[1] = {106,107,108,109,110,111},
					[2] = {91,92,93,94,95,96},
				},
			}
			say_title("Rainbow Stone")
			say("")
			say("Choose your class!")
			local a = select(job_name[pc.get_job()][1], job_name[pc.get_job()][2], "Cancel")
			if tonumber(a) != 3 or tonumber(a) != 0 then
                             return
                        else
				say_title("Your skillpath was changed succesfully!")
				pc.set_skill_group(tonumber(a))
				for i=1, table.getn(skill_index[pc.get_job()][tonumber(a)]) do
					pc.set_skill_level(skill_index[pc.get_job()][tonumber(a)][i],59)
				end
				item.remove()
				say("Now, your skills are on the Perfect Master Level!")
				say("Good luck!")
			end
		end
	end
end

 

Link to comment
  • 0

That one just says "Choose your class"

and lists the classes..

when I click it, it does nothing.. just closes the popup and the stone stays in the inventory and skills don't change at all.

Can you guys test this stuff before you reply

Link to comment
  • 0

Try this:

quest regenbogen begin
	state start begin
		when 50512.use begin
			local job_name = {{"Arahan", "Partisan"},{"Ninja","Archer"},{"Black Magic","Mirage"},{"Lighting","Dragon"}}
			local sk = special.active_skill_list[pc.get_job()+1][pc.get_skill_group()]
			say_title(item_name(item.vnum))
			say"[ENTER]Choose your class!"
			table.insert(job_name[pc.get_job()+1], "Close")
			local a = select_table(job_name[pc.get_job()+1]) 
			if a < table.getn(job_name[pc.get_job()+1]) then
				pc.set_skill_group(a)
				for i = 1, table.getn(sk) do 
					if pc.get_skill_level(sk[i]) < 40 then
						pc.set_skill_level(sk[i], 40)
					end
				end
				say("Now, your skills are on the Perfect Master Level![ENTER]Good luck!")
				pc.remove_item(item.vnum, 1)
			end
		end
	end
end

when you return 0 and server doesn't boot:

unknown.png

Link to comment
  • 0
quest perfect begin
state start begin
when 50512.use begin
table.foreachi(special.active_skill_list[pc.get_job()+1][pc.get_skill_group()],function(r,skill) pc.set_skill_level(skill,59) end)

item.remove()
pc.remove_item(50512)

say_title("blabla:")
say("Now, your skills are on the Perfect Master Level")
end
end
end
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


  • Read our Rules
  • Activity

    1. 18

      Fix unknown header 100% server: 1k player online francec

    2. 29

      Metin2 Project - How to create à Metin2 private server on virtual machine

    3. 40

      Changelogs

    4. 1

      I'm looking for a partner

    5. 5

      Help in implementing a switch bot

    6. 0

      Error FoxFS source install

    7. 5

      Help in implementing a switch bot

    8. 1

      I'm looking for a partner

    9. 5

      inventory problem

  • Recently Browsing

    • No registered users viewing this page.

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.