Jump to content

Quest kills reset at relog


Recommended Posts

Good evening,

The problem is that after Relog the remaining kills of the hunting quests are reset. 

Example:
Kill 50 wild dogs. I kill 3 pieces and there are 47 remaining which still have to be killed. I perform a relog, channel change or something else like that, and the remaining 47 kills are reseted. That means there are 50 again.

quest kampagneteil1 begin 
	state start begin 
		when login or levelup with pc.level >= 0 begin
			notice("New mission available - The Wild Dog Plague.")
			set_state(kampagne1)
		end
	end

	state kampagne1 begin
		when letter begin
			send_letter("The Wild Dog Plague")
		end

		when button or info begin
			say_title("The Wild Dog Plague")
			say("Wild dogs roam the gates of the village.")
			say("Kill 50 of these plagues and you will")
			say("be richly rewarded!")
			say("")
			say_reward("Task: Kill 50x Wild Dog.")
			say_reward("Reward:")
			say_reward("- Weapon+6.")
			say_reward("- 10.000 Yang.")
			set_state(kampagne2)
		end
	end

	state kampagne2 begin
		when letter begin
			pc.setqf("state", 0)
			q.set_counter("Remaining",50)
		end

		when button or info begin
			say_title("The Wild Dog Plague")
			say("I see you are busy earning your reward.")	
			say("")
			say_reward( "You still have to defeat ".." "..50 - pc.getqf("state").." wild dogs ".. pc.get_name() ..".")
			say("")
			say("Continued success!")
		end

		when 101.kill begin
			local count = pc.getqf("state") + 1

			if count <= 50 then
				pc.setqf("state", count)
				q.set_counter("Remaining", 50 - count)

				if count == 50 then
					say_title("The Wild Dog Plague")
					say("")
					say("You have killed all the wild dogs.")
					say("A special reward is waiting for you!")
					say("Get ready for your next job!")
					say("")
					say_reward("- Weapon+6.")
					say_reward("- 10.000 Yang.")
					pc.changegold(10000)
					syschat("You have received 10.000 Yang.")
					if pc.get_job() == 0 then
						pc.give_item2(16, 1)
					elseif pc.get_job() == 1 then
						pc.give_item2(1006, 1)
					elseif pc.get_job() == 2 then
						pc.give_item2(16, 1)
					elseif pc.get_job() == 3 then
						pc.give_item2(7006, 1)
					end
					clear_letter()
					set_quest_state("blah2", "run")
					set_state( __COMPLETE__ )
				end
			end
		end
	end
	state __COMPLETE__ begin
	end
end

 

Link to comment
Share on other sites

    state kampagne1 begin
        when letter begin
            send_letter("The Wild Dog Plague")
        end

        when button or info begin
            say_title("The Wild Dog Plague")
            say("Wild dogs roam the gates of the village.")
            say("Kill 50 of these plagues and you will")
            say("be richly rewarded!")
            say("")
            say_reward("Task: Kill 50x Wild Dog.")
            say_reward("Reward:")
            say_reward("- Weapon+6.")
            say_reward("- 10.000 Yang.")
            q.set_counter("Remaining", 50)
            set_state(kampagne2)
        end
    end

    state kampagne2 begin
        when letter begin
            send_letter("The Wild Dog Plague")
        end

        when button or info begin
            say_title("The Wild Dog Plague")
            say("I see you are busy earning your reward.")    
            say("")
            say_reward( "You still have to defeat ".." "..50 - pc.getqf("state").." wild dogs ".. pc.get_name() ..".")
            say("")
            say("Continued success!")
        end

 

  • Cry 1
  • Love 1
Link to comment
Share on other sites

6 hours ago, Tikrai said:
    state kampagne1 begin
        when letter begin
            send_letter("The Wild Dog Plague")
        end

        when button or info begin
            say_title("The Wild Dog Plague")
            say("Wild dogs roam the gates of the village.")
            say("Kill 50 of these plagues and you will")
            say("be richly rewarded!")
            say("")
            say_reward("Task: Kill 50x Wild Dog.")
            say_reward("Reward:")
            say_reward("- Weapon+6.")
            say_reward("- 10.000 Yang.")
            q.set_counter("Remaining", 50)
            set_state(kampagne2)
        end
    end

    state kampagne2 begin
        when letter begin
            send_letter("The Wild Dog Plague")
        end

        when button or info begin
            say_title("The Wild Dog Plague")
            say("I see you are busy earning your reward.")    
            say("")
            say_reward( "You still have to defeat ".." "..50 - pc.getqf("state").." wild dogs ".. pc.get_name() ..".")
            say("")
            say("Continued success!")
        end

 

It works. Thanks.

Link to comment
Share on other sites

quest kampagneteil1 begin 
	state start begin 
		when login or levelup with pc.level >= 0 begin
			notice("New mission available - The Wild Dog Plague.")
			set_state(kampagne1)
		end
	end

	state kampagne1 begin
		when letter begin
			send_letter("The Wild Dog Plague")
		end

		when button or info begin
			say_title("The Wild Dog Plague")
			say("Wild dogs roam the gates of the village.")
			say("Kill 50 of these plagues and you will")
			say("be richly rewarded!")
			say("")
			say_reward("Task: Kill 50x Wild Dog.")
			say_reward("Reward:")
			say_reward("- Weapon+6.")
			say_reward("- 10.000 Yang.")
			--before that you begin the next state, set your qf, so it won't change
			pc.setqf("state", 50)
			--
			set_state(kampagne2)
		end
	end

	state kampagne2 begin
		when letter begin
			--pc.setqf("state", 0) --no clean qf
			--q.set_counter("Remaining",50) 
			q.set_counter("Remaining", pc.getqf("state")) --when login/letter update this counter. If you left value fix, each login it will set 50.
		end

		when button or info begin
			say_title("The Wild Dog Plague")
			say("I see you are busy earning your reward.")	
			say("")
			--say_reward( "You still have to defeat ".." "..50 - pc.getqf("state").." wild dogs ".. pc.get_name() ..".")
			say_reward( "You still have to defeat "..pc.getqf("state").." wild dogs ".. pc.get_name() ..".") --changed value fix for qf, ok
			say("")
			say("Continued success!")
		end

		when 101.kill begin
			--local count = pc.getqf("state") + 1
			local count = pc.getqf("state") - 1 --in this case, I has set  negative because it begin on max value

			if count <= 50 then
				pc.setqf("state", count)
				--q.set_counter("Remaining", 50 - count)
				q.set_counter("Remaining", count) --set update value

				--if count == 50 then
				if count <= 0 then --when value became 0, then... (automatically quest value clean)
					say_title("The Wild Dog Plague")
					say("")
					say("You have killed all the wild dogs.")
					say("A special reward is waiting for you!")
					say("Get ready for your next job!")
					say("")
					say_reward("- Weapon+6.")
					say_reward("- 10.000 Yang.")
					pc.changegold(10000)
					syschat("You have received 10.000 Yang.")
					if pc.get_job() == 0 then
						pc.give_item2(16, 1)
					elseif pc.get_job() == 1 then
						pc.give_item2(1006, 1)
					elseif pc.get_job() == 2 then
						pc.give_item2(16, 1)
					elseif pc.get_job() == 3 then
						pc.give_item2(7006, 1)
					end
					clear_letter()
					set_quest_state("blah2", "run")
					set_state( __COMPLETE__ )
				end
			end
		end
	end
	state __COMPLETE__ begin
	end
end

 

  • Metin2 Dev 1
Link to comment
Share on other sites

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.