Jump to content

Reset skill group


Recommended Posts

  • 2 months later...
  • Premium
1 hour ago, WeedHex said:

It's not possibile to do easly.

In reality, it is.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

quest skill_reset begin
	state start begin
		when 71002.use begin
			if pc.get_level() < 30 or pc.get_level() > 120 then
				say_title(item_name(71002))
				say("")
				say("This item can be used in between level 30 and 120.")
				return
			end
			
			if pc.get_skill_group() == 0 then
				say_title(item_name(71002))
				say("")
				say("You have no skill group.")
				return
			end
			
			say_title(item_name(71002))
			say("")
			say("This scroll will instantly reset")
			say("your skill group, every skill you have")
			say("mastered will be losed in the process.")
			say("")
			say_reward("Notice: You won't lose any character points.")
			say("")
			say("Do you really want to do this?")
			if (select("Yes", "No") == 1) then
			
			pc.clear_skill()
			pc.set_skill_group(0)
			horse.set_level(horse_level)
			char_log(0, "RESET_SKILL", "RESET_SKILL_BY_71002")
			pc.remove_item(71002);
			set_quest_state("skill_group","run")
		end
	end
end

Whatever, shit code :P

  • Love 1

As long as I'll be a threat for you , i will always be your target :3

Link to comment
Share on other sites

  • Active Member

@Braxy Thanks man, but there is still a little problem. Relog is still needed because when I reset skills, skill points aren't reset to 0 and when I take new skills again another than I had before and I put points into them again, nothing happens. I still need to do relog or teleport for get skill points to skills.

I'll be always helpful! 👊 

Link to comment
Share on other sites

6 hours ago, Braxy said:

Whatever, shit code :P

Spoiler



quest skill_reset begin
	state start begin
		when 71002.use begin
			if pc.get_level() < 30 or pc.get_level() > 120 then
				say_title(item_name(71002))
				say("")
				say("This item can be used in between level 30 and 120.")
				return
			end
			
			if pc.get_skill_group() == 0 then
				say_title(item_name(71002))
				say("")
				say("You have no skill group.")
				return
			end
			
			say_title(item_name(71002))
			say("")
			say("This scroll will instantly reset")
			say("your skill group, every skill you have")
			say("mastered will be losed in the process.")
			say("")
			say_reward("Notice: You won't lose any character points.")
			say("")
			say("Do you really want to do this?")
			if (select("Yes", "No") == 1) then
			
			pc.clear_skill()
			pc.set_skill_group(0)
			horse.set_level(horse_level)
			char_log(0, "RESET_SKILL", "RESET_SKILL_BY_71002")
			pc.remove_item(71002);
			set_quest_state("skill_group","run")
		end
	end
end

 

 

I'm not a quester but these are really basic shits which you have to know before write something, you have 'quests which you sell' on that forum, that's very bad.

  • You called x3 times say_title(item_name).
  • You use say("") for make a new row empty, already exist '[ENTER]'.
  • You use item vnum 71002, instead of use item.get_vnum().
  • For questions like Yes, No already exist 'locale.yes, locale.no'.
  • Why you guys start to put ";" at the end of function or returns? Did you know for what is that or just put it and want to look different than another ones?

'Semi-colons in Lua are generally only required when writing multiple statements on a line, stop use it if don't know how is working, you should learn a bit from Lua documentation before write any code and stop do things which others do.

Have fun.

Link to comment
Share on other sites

  • Active Member

And what's the difference between what he wrote and between this?

Spoiler
  • You called x3 times say_title(item_name).
  • You use say("") for make a new row empty, already exist '[ENTER]'.
  • You use item vnum 71002, instead of use item.get_vnum().
  • For questions like Yes, No already exist 'locale.yes, locale.no'.

@Tasho

  • Love 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium

He is talking about good coding practices. No difference in the end.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

19 hours ago, Tasho said:

I'm not a quester but these are really basic shits which you have to know before write something, you have 'quests which you sell' on that forum, that's very bad.

  • You called x3 times say_title(item_name).
  • You use say("") for make a new row empty, already exist '[ENTER]'.
  • You use item vnum 71002, instead of use item.get_vnum().
  • For questions like Yes, No already exist 'locale.yes, locale.no'.
  • Why you guys start to put ";" at the end of function or returns? Did you know for what is that or just put it and want to look different than another ones?

'Semi-colons in Lua are generally only required when writing multiple statements on a line, stop use it if don't know how is working, you should learn a bit from Lua documentation before write any code and stop do things which others do.

Have fun.

Am i the only one who read the "Whatever, shit code" phrase?

Dude the thing isn't written by me... I just gave him what he asked.

And for god sake why the hell are we talking about code when you don't even bother to help him with your "properly written code"?

19 hours ago, ReFresh said:

@Braxy Here you can see the problem:

  Reveal hidden contents

 

As i said this is a game bug, doesn't have anything to do with the quest file.

As long as I'll be a threat for you , i will always be your target :3

Link to comment
Share on other sites

  • Premium

Tasho are you speaking about what you do and think? KKKK

You write a lot of bullshits

 

quest skill_reset begin
    state start begin
        function __tasho__()
            if pc.count_item(71002)>0 then
                pc.remove_item(71002,1)
                set_quest_state("skill_group","run")
                pc.clear_skill()
                pc.set_skill_group(0)
                char_log(0, "RESET_SKILL", "RESET_SKILL_BY_71002")
            end
        end

        when 71002.use begin
            say_title(item_name(71002))
            say()
            if pc.get_level() < 30 or pc.get_level() > 120 then
                say("This item can be used between level 30 and 120.")
                return
            end
            if pc.get_skill_group() == 0 then
                say("You have no skill group.")
                return
            end
            say("This scroll will instantly reset")
            say("your skill group, every skill you have")
            say("mastered will be losed in the process.")
            say()
            say_reward("Notice: You won't lose any character points.")
            say()
            say("Do you really want to do this?")
            local tasho=select("Yes", "No")
            if tasho == 1 then
                if pc.get_skill_group() != 0 then
                    skill_reset.__tasho__()
                end
            else
                setskin(NOWINDOW)
                return
            end
        end
    end
end

Link to comment
Share on other sites

  • 2 years later...
  • 6 months later...

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.