Jump to content
metin2dev
Sign in to follow this  
PACI

[Release] Quest Categories

Recommended Posts

Hi there.

While cleaning out "my closet", I found this thing I developed between 2014-2015 - maybe(?) - for my, at that moment, server. Since it's now closed, and I won't use it, I'm sharing it with you guys.

Note: Didn't do the scrollbar, wasn't needed for me, so yeah.

9eedbf683f.jpg

Now, let's start with opening your locale_game.txt and adding these lines:

QUESTCATEGORY_0	Main Quests
QUESTCATEGORY_1	Sub Quests
QUESTCATEGORY_2	Collect Quests
QUESTCATEGORY_3	Levelup Quests
QUESTCATEGORY_4	Scroll Quests
QUESTCATEGORY_5	System Quests

Alright, now find your characterwindow.py (uiscript?) and you can either comment Quest_Page children or simply remove them all.

Moving on to your interfaceModule.py find this line self.BINARY_RecvQuest(index, name, "file", localeInfo.GetLetterImageName()) and replace it with self.wndCharacter.questCategory.RecvQuest(self.BINARY_RecvQuest, index, name)

Ok, then we are at the most, let's say, difficult part of this. Open your uiCharacter.py and just as you did in your characterwindow.py, remove or simply comment any single line related to quests. You can just search for these vars:

	        self.questShowingStartIndex
	        self.questScrollBar
	        self.questSlot
	        self.questNameList
	        self.questLastTimeList
	        self.questLastCountList


Once you did that, you just:

# Find these lines
        self.soloEmotionSlot = self.GetChild("SoloEmotionSlot")
        self.dualEmotionSlot = self.GetChild("DualEmotionSlot")
        self.__SetEmotionSlot()

# And add the following
        import uiQuestCategory
        self.questCategory = uiQuestCategory.QuestCategoryWindow(self.pageDict["QUEST"])

# Find this
    def OnUpdate(self):
        self.__UpdateQuestClock()

# Replace it with
    def OnUpdate(self):
        self.questCategory.OnUpdate()


And we're done with the client-side. I attached some extra elements needed (such as the main python file (uiQuestCategory.py) and some image resources).
Remember to edit the path linked to these images in that file.

For the server-side... Well, screw it, uploaded it too. Too lazy to write.
It has only a new quest function (q.getcurrentquestname()) and a few things to add in your questlib.lua.

Btw, not sure if  you have it, but if not, just add this extra function in ui.Button() (ui.py - class Button).

	def SetTextAlignLeft(self, text, height = 4):

		if not self.ButtonText:
			textLine = TextLine()
			textLine.SetParent(self)
			textLine.SetPosition(27, self.GetHeight()/2)
			textLine.SetVerticalAlignCenter()
			textLine.SetHorizontalAlignLeft()
			textLine.Show()
			self.ButtonText = textLine

		#Äù½ºÆ® ¸®½ºÆ® UI¿¡ ¸ÂÃç À§Ä¡ ÀâÀ½
		self.ButtonText.SetText(text)
		self.ButtonText.SetPosition(27, self.GetHeight()/2)
		self.ButtonText.SetVerticalAlignCenter()
		self.ButtonText.SetHorizontalAlignLeft()

Forgot the source part, fml, here it is. Add it to your questlua_quest.cpp.

	int quest_get_current_quest_name(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		PC* pPC = q.GetCurrentPC();
	
		lua_pushstring(L, pPC->GetCurrentQuestName().c_str());
		return 1;
	}

	void RegisterQuestFunctionTable()
	{
		luaL_reg quest_functions[] = 
		{
			{ "getcurrentquestname",	quest_get_current_quest_name},
			{ NULL,						NULL						}
		};

		CQuestManager::instance().AddLuaFunctionTable("q", quest_functions);
	}

 

Now, finally, have fun and bye!

questcategory.7z

server-side.7z

  • Like 16

Share this post


Link to post
Share on other sites
3 hours ago, AlexKenT said:

Can you leave your uicharacter.py ?

Yeah, pls

Share this post


Link to post
Share on other sites

It was already on my server, decided not to publish it since it was mostly extracted from WoM2, but now it's been 3 years so you've made the good choice, you nailed it sir :D

Share this post


Link to post
Share on other sites
2 hours ago, AlexKenT said:

 and scroll?

 

On 2/2/2017 at 4:20 AM, PACI said:

Note: Didn't do the scrollbar, wasn't needed for me, so yeah.

 

  • Like 1

Share this post


Link to post
Share on other sites

I just want to ask if the ticked box remains after you closed the window, like wom2, because this is the only bug I have now and I never fixed it, just to see if you have the same problem that I have since I implemented the system ^^

Share this post


Link to post
Share on other sites

It's beautiful!

I have a problem:

 

1)

 

 

Ps: How do I assign a mission its type? (Main quests, sub quests)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×