Jump to content

Recommended Posts

Version of Files : XXX

Hello, I'm trying to make one or more quest that gives you ATTBONUS_HUMAN every 20 level.

I mean, at level 20 it will give you permanently +10 halfhuman, at level 40 again +10, level 60 +10 halfhuman, etc..

So that at level 100 you will have a total of 50 halfhuman permanently
Do you know how can this be done? Thank you


I tried with this but someone lose the bonus when relog
 

quest test_human_1 begin
	state start begin
	
		when login or levelup with pc.get_level() >= 20 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 10, 60*60*24*365*60)
			q.done()
			set_quest_state("test_human_2")
			set_state("__complete")
		end
	end
	state __complete begin
	end
end
quest test_human_2 begin
	state start begin
	
		when login or levelup with pc.get_level() >= 40 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 10, 60*60*24*365*60)
			q.done()
			set_quest_state("test_human_3")
			set_state("__complete")
		end
	end
	state __complete begin
	end
end

//and the same quest till level 100

 

Edited by Cripplez
Link to comment
https://metin2.dev/topic/23979-help-permanent-bonus-by-quest/
Share on other sites

quest up_hh begin
	state start begin
	
		function Give_HH()
			affect.add_collect(apply.ATTBONUS_HUMAN, 10, 3600*24*30*360*60)
			chat("+20% HH)
		end
		
		when levelup with pc.get_level() == 20 begin -- lv 20
			up_hh.Give_HH() -- function
		end
		
		when levelup with pc.get_level() == 40 begin -- lv 40
			up_hh.Give_HH() -- function
		end
		
		when levelup with pc.get_level() == 60 begin -- lv 60
			up_hh.Give_HH() -- function
		end
		
		when levelup with pc.get_level() == 80 begin -- lv 80
			up_hh.Give_HH() -- function
		end
		
		when levelup with pc.get_level() == 100 begin -- lv 100
			up_hh.Give_HH() -- function
		end
	end
end

It is not ideal, but it should work, to prevent bugs, check if you have already received the bonus.

Edited by Klaus
  • Lmao 1
affect.add_collect
affect.remove_collect

 You can use this.. Its so ugly but works.

Edit:
 

If you want quest whats work..

20lv - 3
40lv - 5
60lv - 10
80lv - 12
100lv - 20

3+5+10+12+20 = 50 at 100lv..

I mean this is better than after 20lv´s receive 10.. This is better balanced for actual lv..

quest human begin
	state start begin
		when login or levelup with pc.get_level() >= 20 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 3, 60*60*24*365*60)
			set_state(lv40)
		end
	end
	state lv40 begin
		when login or levelup with pc.get_level() >= 40 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 5, 60*60*24*365*60)
			set_state(lv60)
		end
	end
	state lv60 begin
		when login or levelup with pc.get_level() >= 60 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 10, 60*60*24*365*60)
			set_state(lv80)
		end
	end
	state lv80 begin
		when login or levelup with pc.get_level() >= 80 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 12, 60*60*24*365*60)
			set_state(lv100)
		end
	end
	state lv100 begin
		when login or levelup with pc.get_level() >= 100 begin
			affect.add_collect(apply.ATTBONUS_HUMAN, 20, 60*60*24*365*60)
			set_state(__COMPLETE__)
		end
	end
	state __COMPLETE__ begin
	end
end

 

Edited by Cunoo
  • Love 1
  • Honorable Member

I'll give you an hint.

 

20 -> -20 --> 40 -> -40 --> 60 -> -60

  • Love 1

 

"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

Thank you all :)
I solved with different value of the bonus

1 hour ago, WeedHex said:

affect.add_collect

Can't save same type/value in SQL player.affect so it will overwrite.

You MUST change value, to save different collects.

 

Regards.

 

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.