Jump to content

Recommended Posts

  • Premium

Hi there,

 

i create this quest just for test

Spoiler
quest clear_test begin
    state start begin
		when 40003.use begin
			set_state(teAst)
		end
	end
	state teAst begin	
		when letter begin
			send_letter("first send ")
		end
		when button or info begin
			say_title("Title here [ENTER]")
			say("This is first letter test line")
			wait()
			send_letter("second send ")
			set_state(teBst)
		end
	end
	
	state teBst begin	
		when letter begin
			target.vid("__TARGET__", find_npc_by_vnum(20354), " Find me ")
		end
		
		when button or info begin
			say_title("letter here")
			say("This is second letter test line")
			wait()
			send_letter("Third send. Why icon don't go? ")
		end
		
		when __TARGET__.target.click begin
			clear_letter()
			target.delete("__TARGET__")
			say_title("NPC here")
			say("This is NPC test line")
			wait()
			set_state(start)
		end
	end
end

 

the quest is working. But i can't remove the icon from here

 

After i click in NPC, quest end... but the icon stay. Why?! Any help

edit: What i whant is:

Clear the letter icon when i talk with NPC. If quest end... no reason to icon stay (and have to press to clean him)

Edited by Metin2 Dev
Core X - External 2 Internal
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

  • Premium

no one?

 

edit: Other exemple:

 

Spoiler
quest letter_test begin
    state start begin
		
		when 40003.use begin
			if (select("Only letter", "NPC letter") == 2) then
				set_state(npc)
				return
			end
			set_state(reward)
		end
		
	end
	state reward begin
		
		when letter begin
			send_letter("teste ")
		end
		
		when button or info begin
			clear_letter()
			say_title("Title: [ENTER]")
			say("Say [ENTER]")
			wait()
			set_state(start)
		end
	end
	
	state npc begin
		
		when letter begin
			send_letter("find npc ")
			target.vid("__TARGET__", find_npc_by_vnum(20082), " find him ")
		end
		
		when button or info begin
			say_title("Title: [ENTER]")
			say("Say [ENTER]")
			wait()
			send_letter("find npc ")
		end
		
		when __TARGET__.target.click begin
			target.delete("__TARGET__")
			say_title(mob_name(npc.get_race())..":[ENTER]")
			say("bah !! ")
			wait()
			clear_letter()
			set_state(start)
		end
	end
		
	
end

 

I don't understand why NPC dont clear letter

Edited by EnKor
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150797
Share on other sites

  • Premium
function clear_letter() q.done() end

So

    int quest_done(lua_State* L)
    {
        CQuestManager& q = CQuestManager::instance();

        if (q.GetCurrentPC())
            q.GetCurrentPC()->SetCurrentQuestDoneFlag();
        return 0;
    }

Soooo if I'm not wrong, you are out of instance. You can't there, the game won't know which quest you want to clear.

 

Ps. Is not really safe to check only target.click on NPC talk.

Edited by WeedHex
Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150799
Share on other sites

  • Premium
3 minutes ago, WeedHex said:
function clear_letter() q.done() end

So

    int quest_done(lua_State* L)
    {
        CQuestManager& q = CQuestManager::instance();

        if (q.GetCurrentPC())
            q.GetCurrentPC()->SetCurrentQuestDoneFlag();
        return 0;
    }

Soooo if I'm not wrong, you are out of instance. You can't there, the game won't know wich quest you want to clear.

 

Ps. Is not really safe to check only target.click on NPC talk.

So, how can i make it? any help please!

I only dont understand why NPC cant clear letter... but, letter can make it. I have upload one quest exemple. What do i have wrong in there?

if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150800
Share on other sites

Maybe not the solution, but why this?

[...]
clear_letter()
			set_state(start)

To clear the quest correctly, you need to create an empty state like this:

clear_letter()
set_state(__COMPLETE__)
end

    end
state __COMPLETE__ begin
end
    end
  

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150803
Share on other sites

  • Premium
3 minutes ago, covfefe said:

Maybe not the solution, but why this?

[...]
clear_letter()
			set_state(start)

To clear the quest correctly, you need to create an empty state like this:

clear_letter()
set_state(__COMPLETE__)
end

    end
state __COMPLETE__ begin
end
    end
  

nop. NPC can´t clear the letter in here: https://metin2.download/picture/LdY257L0FasSf487huFGFgAoT6gKGWDW/.png

even if i finish the quest with a empty state. That icon stay!

But only if i send clear_letter() from NPC

 

Edited by Metin2 Dev
Core X - External 2 Internal
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150804
Share on other sites

  • Premium

i dont look in other servers ?

100% mainline + novaline in here

 

edit: Can we force game.py or interface.py to update in order to check if the quest button is valid or not!? (Because this is one "ghost button")

Edited by EnKor
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150812
Share on other sites

  • Premium

Soluction:

I dont know if this is the best one, and maybe its not.... but it's what we have until someone can make it better.

 

open: interfacemodule.py and edit like:

 

Spoiler
	def BINARY_RecvQuest(self, index, name, iconType, iconName):
		btn = self.__FindQuestButton(index)
		
		if 0 != btn:
			self.__DestroyQuestButton(btn)

		btn = uiWhisper.WhisperButton()
		[...]


//Edit like:
	def BINARY_RecvQuest(self, index, name, iconType, iconName):
		btn = self.__FindQuestButton(index)
		
		if 0 != btn:
			self.__DestroyQuestButton(btn)
		
		if name.find("deleteme") != -1:
			btn.SetEvent(0)
			self.questButtonList.insert(1, btn)
			self.questButtonList.remove(btn)
			self.__ArrangeQuestButton()
			return

		btn = uiWhisper.WhisperButton()
		[...]

 

in quest if you send:

send_letter("deleteme")

Spoiler
when __TARGET__.target.click begin
			target.delete("__TARGET__")
			say_title(mob_name(npc.get_race())..":[ENTER]")
			say("bah !! ")
			wait()
			send_letter("deleteme")
			clear_letter()
			set_state(start)
		end

 

Icon will not show.  

 

Like i say, it's not the best soluction... but i belive its ok

Edited by EnKor
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/29355-clear_letter-fixbug/#findComment-150827
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.