Jump to content

Recommended Posts

  • Bot

try this:

Spoiler

quest change_empire begin
	state start begin

		when 71054.use begin
			if get_time() < pc.getqf("next_use_time") then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			elseif get_time() < pc.getqf("next_use_time") and pc.get_sex() == 1 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			end
			say_title("")
			say("")
			if change_empire.move_pc() == true then
				pc.setqf("next_use_time", get_time() + 86400 * 7)
			end
		end

		function move_pc()

			if pc.is_engaged() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end

			if pc.is_married() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end

			if pc.is_polymorphed() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end

			if pc.has_guild() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end
			if pc.money < 5000000 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end
			say_title("")
			local s = select("Shinsoo", "Chunjo", "Jinno", "Nothing")
			if 4 == s then
				return false
			end
			say("")
			say("")
			say("")
			local a = select("Yes", "No")
			if a == 2 then
				return false
			end
			local ret = pc.change_empire(s)
			local oldempire = pc.get_empire()
			if ret == 999 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				pc.change_gold(-5000000)
				pc.remove_item(71054, 1)
				char_log(0, "CHANGE_EMPIRE",string.format(gameforge.change_empire._240_stringFormat, oldempire, s))
				local selection = select("Relog now", "Later")
				local x = pc.get_local_x()
				local y = pc.get_local_y()
				if selection == 1 then
					pc.warp(x,y)
				elseif selection == 2 then
					return
				end
				return true
			else
				if ret == 1 then
					say_title("")
					say("")
					say("")
					say("")
					say("")
				elseif ret == 2 then
					say_title("")
					say("")
					say_reward("")
				elseif ret == 3 then
					say_title("")
					say("")
					say_reward("")
				end
			end
			return false
		end
	end
end

 

Edit: 

Your warp will not work.

				local selection = select("Relog now ", "Later ")
				local x = pc.get_local_x()
				local y = pc.get_local_y()
				if selection == 1 then
					pc.warp(x,y)
				elseif selection == 2 then
					return
				end

It must be like this:

				local selection = select("Relog now", "Later")
				local x = pc.get_x()
				local y = pc.get_y()
				if selection == 1 then
					pc.warp(x*100,y*100)
				elseif selection == 2 then
					return
				end

 

english_banner.gif

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100937
Share on other sites

  • Active+ Member

@WLsj24 Thanks but quest is still closed when I click on Yes. Because there's missing one "end" but idk where I have to place it. I tried to place it at the end of the file but still the same problem here.

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100940
Share on other sites

  • Bot
8 minutes ago, ReFresh said:

@WLsj24 Thanks but quest is still closed when I click on Yes. Because there's missing one "end" but idk where I have to place it. I tried to place it at the end of the file but still the same problem here.

I have tried the quest, it works correctly, make sure to charge it well. ;)
 

Here you have the same quest, commenting all the ends, so you can see that no end is missing.

quest change_empire begin
	state start begin

		when 71054.use begin
			if get_time() < pc.getqf("next_use_time") then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			elseif get_time() < pc.getqf("next_use_time") and pc.get_sex() == 1 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			end -- enf of if get_time() < pc.getqf("next_use_time") then
			say_title("")
			say("")
			if change_empire.move_pc() == true then
				pc.setqf("next_use_time", get_time() + 86400 * 7)
			end -- end of if change_empire.move_pc() == true then
		end -- enf of when 71054.use begin

		function move_pc()

			if pc.is_engaged() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- enf of if pc.is_engaged() then

			if pc.is_married() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- end of if pc.is_married() then

			if pc.is_polymorphed() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- end of if pc.is_polymorphed() then

			if pc.has_guild() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end --end of if pc.has_guild() then

			if pc.money < 5000000 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- end of if pc.money < 5000000 then

			say_title("")
			local s = select("Shinsoo", "Chunjo", "Jinno", "Nothing")
			if 4 == s then
				return false
			end -- end of if 4 == s then (s if for local s = select("Shinsoo", "Chunjo", "Jinno", "Nothing"))
			say("")
			say("")
			say("")
			local a = select("Yes", "No")
			if a == 2 then
				return false
			end -- end of if a == 2 then (a is for local a = select("Yes", "No"))
			local ret = pc.change_empire(s)
			local oldempire = pc.get_empire()
			if ret == 999 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				pc.change_gold(-5000000)
				pc.remove_item(71054, 1)
				char_log(0, "CHANGE_EMPIRE",string.format(gameforge.change_empire._240_stringFormat, oldempire, s))
				local selection = select("Relog now", "Later")
				local x = pc.get_x()
				local y = pc.get_y()
				if selection == 1 then
					pc.warp(x*100,y*100)
				elseif selection == 2 then
					return
				end --end of if selection == 1 then (selection is for local selection = select("Relog now", "Later"))
				return true
			else
				if ret == 1 then
					say_title("")
					say("")
					say("")
					say("")
					say("")
				elseif ret == 2 then
					say_title("")
					say("")
					say_reward("")
				elseif ret == 3 then
					say_title("")
					say("")
					say_reward("")
				end -- end of if ret == 1 then
			end --end of if ret == 999 then
			return false
		end -- end of function move_pc()
	end --end of state start begin
end --end of quest change_empire begin

 

  • Love 1

english_banner.gif

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100941
Share on other sites

  • Bot
59 minutes ago, ReFresh said:

@WLsj24 Yeah, thanks so much and can you fix a text overflow here?:


		when 71054.use begin
			if get_time() < pc.getqf("next_use_time") then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			elseif get_time() < pc.getqf("next_use_time") and pc.get_sex() == 1 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			end -- enf of if get_time() < pc.getqf("next_use_time") then
			say_title("") -- this text is overflowed by all return things under function move_pc()
			say("")
			if change_empire.move_pc() == true then
				pc.setqf("next_use_time", get_time() + 86400 * 7)
			end -- end of if change_empire.move_pc() == true then
		end -- enf of when 71054.use begin

Text is overflowed by for example:

            if pc.money < 5000000 then
                say_title(" ")
                say("")
                say("")
                say("")
                say(".")
                return false

So you can see in this:

            say_title("") -- this text is overflowed by all return things under function move_pc()
            say("")
            if change_empire.move_pc() == true then

this:

            say_title("") -- this text is overflowed by all return things under function move_pc()
            say("")

            if pc.money < 5000000 then
                say_title(" ")
                say("")
                say("")
                say("")
                say(".")
                return false

Both things error and the text are displayed.

It must be like when I got error it will be shown separately.

I do not understand very well what you mean, I suppose you mean that this text appears in all conditional, right? And all the conditionals already have that text, what you can do is remove the same text from the conditionals, or delete the text that is above all.

english_banner.gif

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100950
Share on other sites

  • Active+ Member
On 4/22/2018 at 7:24 PM, WLsj24 said:

I do not understand very well what you mean, I suppose you mean that this text appears in all conditional, right? And all the conditionals already have that text, what you can do is remove the same text from the conditionals, or delete the text that is above all.

Edited by ReFresh

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100952
Share on other sites

  • Bot
33 minutes ago, ReFresh said:

add wait() at the end of if (before of end obviously)

Edited by Metin2 Dev
Core X - External 2 Internal

english_banner.gif

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100954
Share on other sites

  • Bot
Spoiler
23 minutes ago, ReFresh said:

@WLsj24 It's not about the wait() it's about two texts which need to be separately.

First text is text which is shown when I click on item and second text is an error. So here must be something like if statement somewhere around the first text.

This statements are errors.



			if pc.is_engaged() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- enf of if pc.is_engaged() then

			if pc.is_married() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- end of if pc.is_married() then

			if pc.is_polymorphed() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- end of if pc.is_polymorphed() then

			if pc.has_guild() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end --end of if pc.has_guild() then

			if pc.money < 5000000 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			end -- end of if pc.money < 5000000 then

And this is main text:



		when 71054.use begin
			if get_time() < pc.getqf("next_use_time") then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			elseif get_time() < pc.getqf("next_use_time") and pc.get_sex() == 1 then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			end -- enf of if get_time() < pc.getqf("next_use_time") then
			say_title("Empire transfer ")
			say("")
			say("You want to transfer to another empire? ")
			say("No problem, you just need some Yang. ")
			say("")
			say("1. You need 50000 Yang. ")
			say("2. You need 50000 Yang. ")
			say_reward("3. You need 50000 Yang. ")
			say("")
			say("Select your empire ")
			say("")	
			if change_empire.move_pc() == true then
				pc.setqf("next_use_time", get_time() + 86400 * 7)
			end -- end of if change_empire.move_pc() == true then
		end -- enf of when 71054.use begin

 

 

Oh, you mean if your character is married and polymorphed, will he show the two texts?

If so, then you must change the if for elseif,

like this:

			if pc.is_married() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			-- end -- This end should obviously be deleted.
			elseif pc.is_polymorphed() then
				say_title("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return false
			-- end -- This end should obviously be deleted.
			elseif pc.blabla() then
				say("blabla")
			elseif pc.blabla() then
				say("blabla")
			elseif pc.blabla() then
				say("blabla")
			elseif pc.blabla() then
				say("blabla")
			end

 

english_banner.gif

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100956
Share on other sites

  • Premium

WTF Guys??

 

return false  not need to block a reading.

Just use on a function.

 

You can use also 10 if  or 9 elseif not change.

 

if condiction() then

    chat("you cant")

   return

end

 

 

local omg = select("Yes", "No")

if omg == 1 then

    --dothings for yes

else

     return

end

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100976
Share on other sites

  • Active+ Member

@WLsj24 No, as first it will show the empire selection anytime I use the item with some text and then when I click on some empire and I don't meeet conditions it will show error text but on the next page not on the same page as empire selection. I hope you understand me now.

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/18482-quest-problem/#findComment-100983
Share on other sites

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.