Jump to content

Colored Quest Scrolls - V1


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

Hey all,

 

Today I will explain to you how to use different designs for your quest scrolls like WoM.

 

Setting up the system

 

1) Copy your scroll designs to ui/game/quest/questicon in the client. I have attached the WoM scrolls as example.

2) Open uiCharacter.py and insert the code that appears between comments:

		if questCount > quest.QUEST_MAX_NUM:
			self.questScrollBar.Show()
		else:
			self.questScrollBar.Hide()

		for i in questRange[:questCount]:
			(questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
			# start colored scrolls
			if questName[0] == '*':
				questName = questName[1:]
			elif questName[0] == '&':
				questName = questName[1:]
			elif questName[0] == '~':
				questName = questName[1:]
			elif questName[0] == '+':
				questName = questName[1:]
			# end colored scrolls
			self.questNameList[i].SetText(questName)
			self.questNameList[i].Show()
			self.questLastCountList[i].Show()
			self.questLastTimeList[i].Show()

3) Open interfaceModule.py

Replace this part:

		if locale.IsEUROPE():
			btn.SetUpVisual(locale.GetLetterCloseImageName())
			btn.SetOverVisual(locale.GetLetterOpenImageName())
			btn.SetDownVisual(locale.GetLetterOpenImageName())
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE
with this:
		if locale.IsSINGAPORE() or locale.IsEUROPE():
			if name[0] == '*':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_blue.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				name = name[1:]
			elif name[0] == '~':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_golden.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				name = name[1:]
			elif name[0] == '&':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_green.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '+':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_purple.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(locale.GetLetterCloseImageName())
				btn.SetOverVisual(locale.GetLetterOpenImageName())
				btn.SetDownVisual(locale.GetLetterOpenImageName())
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE

Usage

 

After you modified your client, there will be 4 color codes that you can use at the start of your quest's title to enable the colored scroll: Blue (*), Golden (~), Green (&) and Purple (+). You also have to add the q.set_icon function containing the filename of the scroll picture. Here is an example of how to make a quest scroll blue:

when login with game.get_event_flag("worldbookday") == 1 begin
	send_letter("*World Book Day")
	q.set_icon("scroll_open_blue.tga")
	local v=find_npc_by_vnum(20023)
	if v!=0 then
		target.vid("__TARGET__", v, "Soon")
	end
end

And it looks like this:

Spoiler

171421clip-2014-02-05-at-01.07.55-.jpg

That's all you can also add new codes easily or use your own quest scroll designs. Enjoy!

  • Metin2 Dev 18
  • kekw 1
  • Confused 1
  • Good 6
  • Love 1
  • Love 56
Link to comment
Share on other sites

  • 2 weeks later...
  • Honorable Member

For files 40250:

 

interfacemodule:

		# QUEST_LETTER_IMAGE
		##!! 20061026.levites.Äù½ºÆ®_À̹ÌÁö_±³Ã¼
		import item
		if "item"==iconType:
			item.SelectItem(int(iconName))
			buttonImageFileName=item.GetIconImageFileName()
		else:
			buttonImageFileName=iconName

		if localeInfo.IsEUROPE():
			if name[0] == '*':
				btn.SetUpVisual("locale/cz/icon/scroll_close_green.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_green.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '&':
				btn.SetUpVisual("locale/cz/icon/scroll_close_blue.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_blue.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_blue.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
				btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
				btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
				if "highlight" == iconType:
					btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga")
					btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga")
					btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga")
				else:
					btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
					btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
					btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE

uicharacter:

		for i in questRange[:questCount]:
			(questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
			if questName[0] == '*':
				questName = questName[1:]
			elif questName[0] == '&':
				questName = questName[1:]
			elif questName[0] == '~':
				questName = questName[1:]
			self.questNameList[i].SetText(questName)
			self.questNameList[i].Show()
			self.questLastCountList[i].Show()
			self.questLastTimeList[i].Show()
  • Love 5

plechi-frost-dungeon.gif

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

 

For files 40250:

 

interfacemodule:

		# QUEST_LETTER_IMAGE
		##!! 20061026.levites.Äù½ºÆ®_À̹ÌÁö_±³Ã¼
		import item
		if "item"==iconType:
			item.SelectItem(int(iconName))
			buttonImageFileName=item.GetIconImageFileName()
		else:
			buttonImageFileName=iconName

		if localeInfo.IsEUROPE():
			if name[0] == '*':
				btn.SetUpVisual("locale/cz/icon/scroll_close_green.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_green.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '&':
				btn.SetUpVisual("locale/cz/icon/scroll_close_blue.tga")
				btn.SetOverVisual("locale/cz/icon/scroll_open_blue.tga")
				btn.SetDownVisual("locale/cz/icon/scroll_open_blue.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
				btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
				btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
				if "highlight" == iconType:
					btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga")
					btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga")
					btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga")
				else:
					btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
					btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
					btn.SetDownVisual(localeInfo.GetLetterOpenImageName())				
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE

uicharacter:

		for i in questRange[:questCount]:
			(questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
			if questName[0] == '*':
				questName = questName[1:]
			elif questName[0] == '&':
				questName = questName[1:]
			elif questName[0] == '~':
				questName = questName[1:]
			self.questNameList[i].SetText(questName)
			self.questNameList[i].Show()
			self.questLastCountList[i].Show()
			self.questLastTimeList[i].Show()

You wrong man ... if you want to work this , you have to add or remove one more variable.

Example :

 in your uicharacter code says:

                 if questName[0] == '*':

                questName = questName[1:]

            elif questName[0] == '&':

                questName = questName[1:]

            elif questName[0] == '~':

                questName = questName[1:]

This means variables for ~ , * and & .. but in interfacemodule is declared only * and &...

 

You have to complete the interfacemodule .. or to remove the line :

                 elif questName[0] == '~':

                questName = questName[1:]

from uicharacter..

 

Sorry for my bad english ^_^

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

With little changes it works perfectly in the 40250 client you have just to change some little things, go in notepad++ or whatelse you use to edit the .py files and replace all 

locale.

in the code from this system to 

localeInfo.

then it will works perfectly in the 40250 client.

just for the people who doesn´t understand my really bad english here is the code for interfacemodule.py
 

if localeInfo.IsSINGAPORE() or localeInfo.IsEUROPE():
			if name[0] == '&':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_blue.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_blue.tga")
				name = name[1:]
			elif name[0] == '~':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_golden.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_golden.tga")
				name = name[1:]
			elif name[0] == '*':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_green.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_green.tga")
				name = name[1:]
			elif name[0] == '+':
				btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/scroll_close_purple.tga")
				btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/scroll_open_purple.tga")
				name = name[1:]
			else:
				btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
				btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
				btn.SetDownVisual(localeInfo.GetLetterOpenImageName())
		else:
			btn.SetUpVisual(buttonImageFileName)
			btn.SetOverVisual(buttonImageFileName)
			btn.SetDownVisual(buttonImageFileName)
			btn.Flash()
		# END_OF_QUEST_LETTER_IMAGE
  • Love 2
Link to comment
Share on other sites

How to fix it?

 

050102415_enhqsre.jpg

 

 

You write a no exist file in

q.set_icon("here")

The options for this system are:

q.set_icon("scroll_open_blue.tga")
q.set_icon("scroll_open_golden.tga")
q.set_icon("scroll_open_green.tga")
q.set_icon("scroll_open_purple.tga")

If you are sure that quest side is right check in the icon folder that

scroll_open_blue.tga
scroll_open_golden.tga
scroll_open_green.tga
scroll_open_purple.tga

exists

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium

I have applyed everything good into my 34k client, no error, but :

 

pbQyfKP.jpg

Scroll files must not be in locale, but in one folder in etc/questicon .

Edited by Metin2 Dev
Core X - External 2 Internal

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Bronze

i have it in ymir work/ui/game/questicon in patch3.epk

 

edit: i got it look here ;)

 

WfKC7l2.jpg

 

thanks

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I modified a little bit the function send_letter so you don't need to write q.set_icon(x)

function send_letter(name)
	local files = 
	{
		["*"] = "scroll_open_blue.tga",
		["~"] = "scroll_open_golden.tga",
		["&"] = "scroll_open_green.tga",
		["+"] = "scroll_open_purple.tga",
	}
	local chr = string.sub(name,1,1)
	if chr == '*' or chr == '~' or chr == '&' or chr == '+' then q.set_icon(files[chr]) end
	makequestbutton(name) 
	set_skin(NOWINDOW) 
	q.set_title(name) 
	q.start() 
end
  • Love 4
Link to comment
Share on other sites

 

I modified a little bit the function send_letter so you don't need to write q.set_icon(x)

function send_letter(name)
	local files = 
	{
		["*"] = "scroll_open_blue.tga",
		["~"] = "scroll_open_golden.tga",
		["&"] = "scroll_open_green.tga",
		["+"] = "scroll_open_purple.tga",
	}
	local chr = string.sub(name,1,1)
	if chr == '*' or chr == '~' or chr == '&' or chr == '+' then q.set_icon(files[chr]) end
	makequestbutton(name) 
	set_skin(NOWINDOW) 
	q.set_title(name) 
	q.start() 
end
SCROll_BLUE = "*"
SCROLL_GOLD = "~" 
SCROLL_GREEN = "&"
SCROLL_PURPLE = "+"
SCROLL_TABLE = {SCROll_BLUE = "scroll_open_blue.tga",[SCROLL_GOLD] = "scroll_open_golden.tga" ,[SCROLL_GREEN] = "scroll_open_green.tga",[SCROLL_PURPLE]="scroll_open_purple.tga"}

function send_letter(name,scroll_type=nil)
    if SCROLL_TABLE[scroll_type] then 
		q.set_icon(SCROLL_TABLE[scroll_type]) 
		name = name..scroll_type
	end
    makequestbutton(name)
    set_skin(NOWINDOW)
    q.set_title(name)
    q.start()
end

I think is better using the scroll type as a parameter.

  • Love 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • Premium

Not working :|||||||||

ZIPEcYi.png

Your problem, you should learn to do a client by yourself, this is working 100%, i tested.

Edited by Metin2 Dev
Core X - External 2 Internal

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • 3 weeks later...

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.