Jump to content
×
×
  • Create New...
  • 0

[QUEST] Add Bonus for skillgroups


MOLOCKI

Question

Hello !

I'm a noob with no LUA expierence. I have a teaching quest, that User can collect her skill group without visit the npc.

I want to add an bonus on all races excepted body warrior and weaponary sura.

 

The Bonus is: affect.add_collect(99, 2, 60*60*24*365*60) -- Metins = 99

I already tryed it with:

if a == 1 then
	affect.add_collect(99, 2, 60*60*24*365*60) -- Metins = 99
end

but I need something like

if ((skill == 0 and a == 2) or (skill == 1) or (skill == 2 and a == 2) or (skill == 3)) then
	affect.add_collect(99, 2, 60*60*24*365*60) -- Metins = 99
end

 

But that doesn't works because skill is an local variable so I can't call them in the last part.

Idk  maybe it's a better way to make it with pc.get_skill_group and pc.get_job but I  don't know.. I'm too nooby :D
 

Maybe someone can help me? would be very friendly ! thanks in advance

 

here's the quest:

quest directskills begin
	state start begin
		when login or levelup with pc.level >= 5 begin
			if pc.get_skill_group() == 0 and pc.getqf("skills", 0) then
				syschat("You have reached level 5, you can now choose your teaching. ")
				syschat("Click on the quest on the left ")
				set_state(run)
			end
		end
	end
	state run begin
		when letter with pc.getqf("skills") == 0 begin
			send_letter(gameforge[LC()][8077])
		end
		when button or info with pc.getqf("skills") == 0 begin
			local all = {
				[0] = {gameforge[LC()][8094], gameforge[LC()][8111]},
				[1] = {gameforge[LC()][8116], gameforge[LC()][8124]},
				[2] = {gameforge[LC()][8129], gameforge[LC()][8136]},
				[3] = {gameforge[LC()][8141], gameforge[LC()][8148]},
			}
		--------------------------------------------		
			local skill = {
				[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]={61, 62, 63, 64, 65, 66},
					[2]={76, 77, 78, 79, 80, 81},
				},
				[3]={
					[1]={91, 92, 93, 94, 95, 96},
					[2]={106, 107, 108, 109, 110, 111}
				},
			}
		---------------------------------------------
			say_title(gameforge[LC()][8077])
			local a = select(all[pc.get_job()][1], all[pc.get_job()][2], gameforge[LC()][11735])
			if a == 1 or a == 2 then
				pc.set_skill_group(tonumber(a))
				pc.clear_skill()
				clear_letter()
				for i = 1, table.getn(skill[pc.get_job()][pc.get_skill_group()]) do
					pc.set_skill_level (skill[pc.get_job()][pc.get_skill_group()], 40)
				end
				pc.setqf("skills", 1)
			elseif a == 3 then
				return
			end
		end
	end
end 

 

Link to comment
Share on other sites

  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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
  • Recently Browsing   0 members

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