Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

Python - Rareté sur les Objets


Messages recommandés

  • Robot

Centre de Téléchargement

Hidden Content

    Give reaction to this post to see the hidden content.
( Interne )

Ce système indiquera, en fonction des bonus, si l'item que vous possédez est plutôt rare ou non ! 

 

Révélation

173220140944Rarete.jpg

 

Pré-requis:

  • Notepadd++
  • Votre client

 

I. Tutoriel

Révélation

 

A. 2014 +

Révélation

Dépackez votre fichier root et ouvrez le fichier uitooltip.py

Cherchez donc la ligne suivante :

			self.AppendTextLine(locale.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))

Ajoutez ce code en dessous :

	def GetBonusColor(self, attrSlot):
	lista_bonus = [['1','3000'],['2','80'],['3','12'],['4','12'],['5','12'],['6','12'],['7','8'],['8','20'],['9','20'],['10','30'],['11','30'],['12','8'],['13','8'],['14','8'],['15','10'],['16','10'],['17','10'],['18','20'],['19','20'],['20','20'],['21','20'],['22','20'],['23','10'],['24','10'],['25','10'],['26','10'],['27','15'],['28','15'],['29','15'],['30','15'],['31','15'],['32','15'],['33','15'],['34','15'],['35','15'],['36','15'],['37','15'],['38','15'],['39','15'],['41','5'],['43','20'],['44','20'],['45','20'],['48','1'],['53','50'],['71','10'],['72','35']]
	lista_color = [[grp.GenerateColor(051,255,255, 1.0)],[grp.GenerateColor(24,116,205, 1.0)],[grp.GenerateColor(0.63,0.13,0.94, 1.0)],[grp.GenerateColor(0,0.75,1, 1.0)],[grp.GenerateColor(0,0.79,0.34, 1.0)],[grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)],[grp.GenerateColor(193,205,193, 1.0)],[grp.GenerateColor(131,139,131, 1.0)]]
	i2 = 0
	right = 0
	for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
		type = attrSlot[i][0]
		value = attrSlot[i][1]
		if 0 == value:
			continue
		else:
			for line in range(len(lista_bonus)):
				if int(lista_bonus[line-1][0]) == int(type):
					if int(lista_bonus[line-1][1]) == int(value) or int(lista_bonus[line-1][1]) < int(value):
						right = right+1
			i2 = i2+1
	for i3 in [0,1,2,3,4,5,6,7]:
		if int(i2) == int(int(right)+int(i3)):
			i2 = i3
	try:
		return lista_color[i2][0]
	except:
		dbg.TraceError("Fallo al cargar la lista de colores By: \~*CaNsErBeRo*~/")

 

 

 

Cherchez ensuite ce code :

 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)

Remplacez le par ceci :

	def __AppendAttributeInformation(self, attrSlot):
	if 0 != attrSlot:
		TitleColor = self.GetBonusColor(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)
				if attrSlot[3][1] > 0:
					self.AppendTextLine(affectString, TitleColor)
				else:
					self.AppendTextLine(affectString, affectColor)

 

Cherchez ce code :

    def __SetSpecialItemTitle(self):
       self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)

Passez une ligne et ajoutez ceci en dessous :

	def Rango_Bonus(self, attrSlot):
	lista_bonus = [['1','3000'],['2','80'],['3','12'],['4','12'],['5','12'],['6','12'],['7','8'],['8','20'],['9','20'],['10','30'],['11','30'],['12','8'],['13','8'],['14','8'],['15','10'],['16','10'],['17','10'],['18','20'],['19','20'],['20','20'],['21','20'],['22','20'],['23','10'],['24','10'],['25','10'],['26','10'],['27','15'],['28','15'],['29','15'],['30','15'],['31','15'],['32','15'],['33','15'],['34','15'],['35','15'],['36','15'],['37','15'],['38','15'],['39','15'],['41','5'],['43','20'],['44','20'],['45','20'],['48','1'],['53','50'],['71','10'],['72','35']]
	lista_texto = [['[Extreme]',grp.GenerateColor(051,255,255, 1.0)],['[Legendaire]',grp.GenerateColor(24,116,205, 1.0)],['[Epic]',grp.GenerateColor(0.63,0.13,0.94, 1.0)],['[Rare]',grp.GenerateColor(0,0.75,1, 1.0)],['[Commun]',grp.GenerateColor(0,0.79,0.34, 1.0)],['[Normal]',grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)],['[Mauvais]',grp.GenerateColor(193,205,193, 1.0)],['[Tres mauvais]',grp.GenerateColor(131,139,131, 1.0)]]
	i2 = 0
	right = 0
	for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
		type = attrSlot[i][0]
		value = attrSlot[i][1]
		if 0 == value:
			continue
		else:
			for line in range(len(lista_bonus)):
				if int(lista_bonus[line-1][0]) == int(type):
					if int(lista_bonus[line-1][1]) == int(value) or int(lista_bonus[line-1][1]) < int(value):
						right = right+1
			i2 = i2+1
	for i3 in [0,1,2,3,4,5,6,7]:
		if int(i2) == int(int(right)+int(i3)):
			i2 = i3
	try:
		self.AppendTextLine(lista_texto[i2][0], lista_texto[i2][1])
	except:
		dbg.TraceError("Fallo al cargar la lista de bonus By: \~*CaNsErBeRo*~/")

 

 

Puis enfin cherchez ceci :

 def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
       if self.__IsPolymorphItem(itemVnum):
           self.__SetPolymorphItemTitle(metinSlot[0])
       else:
           if self.__IsAttr(attrSlot):
               self.__SetSpecialItemTitle()
               return

           self.__SetNormalItemTitle()

Et remplacez ce code par celui-ci :

	def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
	if localeInfo.IsCANADA():
		if 72726 == itemVnum or 72730 == itemVnum:
			self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
			return

	if self.__IsPolymorphItem(itemVnum):
		self.__SetPolymorphItemTitle(metinSlot[0])
	else:
		if self.__IsAttr(attrSlot):
			itemType = item.GetItemType()
			if item.ITEM_TYPE_ARMOR == itemType or item.ITEM_TYPE_WEAPON == itemType:
				if attrSlot[3][1] > 0:
					self.Rango_Bonus(attrSlot)
			self.__SetSpecialItemTitle()
			return

		self.__SetNormalItemTitle()

 

Sauvegardez & repacker !

 

Information. Vous pouvez modifier les bonus dits "rares" aux lignes lista_bonus, à savoir que le premier nombre correspond à l'ID du bonus et le second représente la valeur rare (Ex : 3000PV)
Information Bis : Vous pouvez modifier le nom & les couleurs des indicateurs à la ligne lista_texto ! 

 

 

B. Petite modification pour les 2013 -

Révélation

Rien de plus simple pour les 2013- dans ce code :

	def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
	if localeInfo.IsCANADA():
		if 72726 == itemVnum or 72730 == itemVnum:
			self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
			return

	if self.__IsPolymorphItem(itemVnum):
		self.__SetPolymorphItemTitle(metinSlot[0])
	else:
		if self.__IsAttr(attrSlot):
			itemType = item.GetItemType()
			if item.ITEM_TYPE_ARMOR == itemType or item.ITEM_TYPE_WEAPON == itemType:
				if attrSlot[3][1] > 0:
					self.Rango_Bonus(attrSlot)
			self.__SetSpecialItemTitle()
			return

		self.__SetNormalItemTitle()

Il faut modifier cette ligne :

	if localeInfo.IsCANADA():

Par  :

	if locale.IsCANADA():

 

Sauvegardez & repackez !

 

 

 

Pour continuer:

Si vous avez un problème n'hésitez pas à poster vos questions dans la section AQS ! 

Source original du système : Just4Metin

  • Metin2 Dev 5
  • Love 9

french_banner.gif

Lien vers le commentaire
Partager sur d’autres sites

  • 3 mois après...
  • Réponses 1
  • Créé
  • Dernière réponse

Meilleurs contributeurs dans ce sujet



Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.