Jump to content

Recommended Posts

  • Former Staff

M2 Download Center

This is the hidden content, please
( Internal )

Hi,

 

It shows in the description of your item that it's possible to add a bonus to it. It works up to 7 bonuses.

 

Révélation

132926t11.png132926t22.png

 

 

Tutorial

 

Révélation

 

1. uitooltip.py

Révélation

Find :







	CONDITION_COLOR = 0xffBEB47D

Add :







	BONUS_COLOR = 0xffE5E58A

In : 







	def __AppendAttributeInformation

Find :







		if 0 != attrSlot:

Add :







			count = 0

Find :







				if affectString:
					affectColor = self.__GetAttributeColor(i, value)
					self.AppendTextLine(affectString, affectColor)

Add :







				if value > 0:
					count = count+1

			if (count == 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):
				self.AppendTextLine(localeInfo.TOOLTIP_ITEM_BONUS_FIRSTADD, self.BONUS_COLOR)

			if (count < 7 and count != 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):
				self.AppendTextLine(localeInfo.TOOLTIP_ITEM_BONUS_NEXTADD, self.BONUS_COLOR)

 

 

2. locale_game.txt

Révélation






TOOLTIP_ITEM_BONUS_FIRSTADD	Vous pouvez ajouter des bonus
TOOLTIP_ITEM_BONUS_NEXTADD	Vous pouvez ajouter un bonus supplémentaire

 

 

 

Sincerly,

ASIKOO

  • Metin2 Dev 29
  • Good 6
  • Love 21
Link to comment
https://metin2.dev/topic/24114-uitooltip-bonus-slot-available/
Share on other sites

  • Forum Moderator

Thanks for release, already i did something like this in a topic from 2019, so here's:

 

 5SKFcab.png qitNeab.png gq6ofab.png

 

  • locale/en/locale_game.txt
ATTR_6TH_7TH_POSSIBILITY	You can add an additional bonus.
  • root/uiToolTip.py

 

This is the hidden content, please


 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 34
  • Good 8
  • Love 22
36 minutes ago, VegaS™ said:

Thanks for release, already i did something like this in a topic from 2019, so here's:

 

 5SKFcab.png qitNeab.png gq6ofab.png

 

  • locale/en/locale_game.txt

ATTR_6TH_7TH_POSSIBILITY	You can add an additional bonus.
  • root/uiToolTip.py

# Search for:
	def __AppendAttributeInformation(self, attrSlot):
		if 0 != attrSlot:
			for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
				type = attrSlot[i][0]
				value = attrSlot[i][1]

				if 0 == value:
					continue

				affectString = self.__GetAffectString(type, value)
				if affectString:
					affectColor = self.__GetAttributeColor(i, value)
					self.AppendTextLine(affectString, affectColor)
# Replace with:
	def __AppendAttributeInformation(self, attrSlot, attrRareStart = player.ITEM_ATTRIBUTE_SLOT_MAX_NUM, attrRareCount = 2):
		if not self.__IsAttr(attrSlot):
			return

		attrCount = 0
		for attrIndex, (attrType, attrValue) in enumerate(attrSlot):
			if attrValue:
				affectString = self.__GetAffectString(attrType, attrValue)
				if affectString:
					self.AppendTextLine(affectString, self.__GetAttributeColor(attrIndex, attrValue))
					attrCount += 1

		if attrCount in range(attrRareStart, (attrRareStart + attrRareCount) + 1):
			self.AppendTextLine(localeInfo.ATTR_6TH_7TH_POSSIBILITY, self.CONDITION_COLOR)


 

 

Thanks for release

this is better
but your code still good VegaS

Edited by Metin2 Dev
Core X - External 2 Internal
  • Premium

sorry  ;)  nice release @ASIKOO always be Bot :)

 

Edited by SukH

" Don`t pretend things change if you always do the same thing"

"Don`t give up on a dream for how long it will take, time will pass the same"

  • Honorable Member
41 minutes ago, Cunoo said:

Anyone know how to block description for ARROW? Because in code is declared:


item.GetItemType() == item.ITEM_TYPE_WEAPON

Its a bug because arrow with bonuses is impossible..

Spoiler

if (count == 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or item.GetItemType() == item.ITEM_TYPE_WEAPON):

if (count == 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):

Spoiler

if (count < 7 and count != 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or item.GetItemType() == item.ITEM_TYPE_WEAPON):

if (count < 7 and count != 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):

Spoiler

		enum EWeaponSubTypes
		{
			WEAPON_SWORD,
			WEAPON_DAGGER,
			WEAPON_BOW,
			WEAPON_TWO_HANDED,
			WEAPON_BELL,
			WEAPON_FAN,
			WEAPON_ARROW,
			WEAPON_NUM_TYPES,

			WEAPON_NONE = WEAPON_NUM_TYPES+1,
		};

 

 

  • Love 3

 

  • Former Staff
2 hours ago, Mali61 said:
  Reveal hidden contents
  Reveal hidden contents
  Reveal hidden contents

 

 

Well seen for the arrows

thx :) 

if value > 0:
					count = count+1

nonsense, remove the if value, just add count = count + 1 bc otherwise, weapons or armors with - bonus like toxicsword or smth like this wont get the tooltip.

 

and for official like, use this:

 

			if (count > 4 and count < 7) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):
				self.AppendTextLine(localeInfo.TOOLTIP_ITEM_BONUS_NEXTADD, self.BONUS_COLOR)

it only shows when you have already 4 bonus in item, not for first bonus. (for me, i use it only to show for 6 and 7. bonus, not for 5th.) if you want for 5th bonus, edit the count > 4 to count > 3.)

Edited by Mafuyu
  • Lmao 1

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.