Jump to content
  • 0

Exp in party


MrKarpiuk

Question

4 answers to this question

Recommended Posts

  • 0

Here it is i didnt test, but i think it works.

quest party_bonus begin
	state start begin
		function party_member_counting()
			local pids = {party.get_member_pids()}

			for i, pid in pids do
	            local player_count = player_count + 1
			end
			return player_count
		end
		function party_give_bonus(count)
			local pids = {party.get_member_pids()}
			for i, pid in pids do
				q.begin_other_pc_block(pid)
	            affect.add_collect(apply. ,count*10, 60*60*60*60*60)
	            pc.setqf("party_bonus", 1)
	            pc.setqf("party_members_last", party_bonus.party_member_counting())
	            q.end_other_pc_block(pid)
			end
		end
		function party_remove_bonus(count)
			local pids = {party.get_member_pids()}
			for i, pid in pids do
				q.begin_other_pc_block(pid)
	            affect.remove_collect(apply. ,count*10, 60*60*60*60*60)
	            pc.setqf("party_bonus", 0)
	            pc.setqf("party_members_last", party_bonus.party_member_counting())
	            q.end_other_pc_block(pid)
			end
		end
		when kill with not npc.is_pc() and party.is_party() begin
			local party_member_count = party_bonus.party_member_counting()
			if pc.getqf("party_bonus") == 0 then
				party_bonus.party_give_bonus(party_member_count)
			else
				if party_member_count == pc.getqf("party_members_last") then
					return
				else
					party_bonus.party_remove_bonus(pc.getqf("party_members_last"))
					party_bonus.party_give_bonus(party_member_count)
				end
			end
		end
		when kill with not party.is_party() begin
			if pc.getqf("party_bonus") == 1 then
				party_bonus.party_remove_bonus()
				pc.delqf("party_bonus")
				pc.delqf("party_members_last")
			end
		end
	end
end

PS: add in affect.add_collect(apply. HEREADDTHEBONUS) and the same to addect.remove_colllect.

 

Kind Regards,

Frozen

  • Love 2
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


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