Jump to content

Monster kill quest


Recommended Posts

Hello guys, I tried to create a kill quest, but it doesn't work properly ....

 

The quest works well till set_state(kill_monsters) on line 71 , that state doesn't trigger

 

Here is the quest :

quest give_basic_weapon begin
	state start begin
		when login begin
			if pc.getqf("basic_weapon") != 0 then
				return
			end
			send_letter("+Welcome to Metin2")
			q.set_icon("scroll_open_purple.tga")
			set_state(give_start_items)
		end
	end
		
	state give_start_items begin
		when login begin
			if pc.getqf("basic_weapon") != 0 then
				return
			end
			local item_vnum = 19

			if pc.job == 3 then 	-- shaman
				item_vnum = 7009 
			elseif pc.job == 1 then -- ninja
				item_vnum = 1009
			end
			
			local item_count = pc.countitem(item_vnum)
			local equip_weapon = pc.weapon
			if item_count == 0 and equip_weapon != item_vnum then
				pc.give_item2(item_vnum)	-- jobtype weapon
				pc.give_item2(50187)		-- apprentice chest
				pc.give_item2(27003, 200)	-- red potions
				pc.give_item2(27006, 200)	-- blue potions				
				pc.give_item2(50052)		-- armed horse book
				horse.set_level(11)			-- armed horse
				horse.summon()
				horse.ride()
				set_state(welcome_letter)
			end
		end
	end
			
	state welcome_letter begin
		when button or info begin
			addimage(20, 12, "welcome.tga")
			say("")
			say("")
			say("")
			say("")
			say_title("Warmest welcome from Metin2 Team !")
			say("")
			say("Hello adventurer!")
			say("")
			say("Our Staff gives you a warm welcome to Metin2!")
			say("Do not hesitate to contact a GM if you need support")
			say("and please respect our rules.")
			say("")
			wait()
			addimage(20, 12, "welcome.tga")
			say("")
			say("")
			say("")
			say("")
			say("1) Use of Hack, Bots and Bug Exploits is forbidden.")
			say("2) Use only english when writing in call chat.")
			say("3) Do not insult or harass other players.")
			say("4) Do not steal monsters or drops from players")
			say(" belonging to your own kingdom.")
			say("")
			say_reward("Thanks in advance and enjoy your time with us!")
			say("")
			set_state(kill_monsters)		
		end
	end
	state kill_monsters begin
		when letter begin
			send_letter("Your first task!")
		end
		when button or info begin
			say_title("Your first task!")
			say("Hello adventurer!")
			say("In order to get your level 1 equipment")
			say("you need to kill 10 wild dogs.")
			say("")
			say("Good Luck!")
			
			pc.setqf("state", 10)
			q.set_counter("Wild Dogs", 10)
		end
		when 101.kill begin
			local count = pc.getqf("state") - 1

			if count < 10 then
				pc.setqf("state", count)
				q.set_counter("Wild Dogs:", count)
			end

			if count == 0 then
				say_title("You have finished the task!")
				say_reward("Great Job!")
				say_reward("Here is your reward!")
				pc.give_item2(19)
				clear_letter()
				set_state(__COMPLETE__)
			end
		end
	end
	state __COMPLETE__ begin
	end
end


Kind Regards , DaNy3LL

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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