Jump to content
  • 0
Cripplez

solved [Help] Permanent bonus by quest

Question

Posted (edited)

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 (see edit history)

Share this post


Link to post

6 answers to this question

Recommended Posts

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

  • Love 3

Share this post


Link to post
  • 0
Posted (edited)
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 (see edit history)
  • Lmao 1

Share this post


Link to post
  • 0
Posted (edited)
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 (see edit history)
  • Love 1

Share this post


Link to post
  • 0

I'll give you an hint.

 

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

  • Love 1

Share this post


Link to post
  • 0
1 minute ago, Syreldar said:

I'll give you an hint.

 

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

Yes this is possible too.. :D

Share this post


Link to post
  • 0

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.

 

Share this post


Link to post

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.

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