Jump to content

How To Add Pets - Bonus in Description


Recommended Posts

  • Premium

There is a small configuration to get bonus of pet.

Maybe somebody use it. 

How it looks in game:

 

In uitooltip.py -. search (item.ITEM_TYPE_QUEST == itemType:)

and after this statement:

            if itemVnum >= 53001 and itemVnum <= 53026:
                self.AppendSpace(5)
                for g in xrange(item.ITEM_APPLY_MAX_NUM):
                    (affectType, affectValue) = item.GetAffect(g)
                    affectString = self.__GetAffectString(affectType, affectValue)
                    if affectString:
                        affectColor = self.GetChangeTextLineColor(affectValue)
                        self.AppendTextLine(affectString, affectColor)

its all.

PS: If you dont have a item.ITEM_TYPE_QUEST == itemType:

Just find         elif item.ITEM_TYPE_USE == itemType:

and after add item.ITEM_TYPE_QUEST == itemType:

Looks like:

 elif item.ITEM_TYPE_USE == itemType:

.....

.....

elif  item.ITEM_TYPE_QUEST == itemType:

 

This is nothing special but i think it looks good :D 

  • Metin2 Dev 1
  • Love 6
Link to comment
Share on other sites

  • 2 weeks later...
  • Premium

i tried to make it also with costume mount

Spoiler

        elif item.ITEM_TYPE_COSTUME == itemType:
            self.__AppendLimitInformation()

 

and this for show the bounses

Spoiler

        elif item.ITEM_TYPE_COSTUME == itemType:
            if itemVnum >= 52001 and itemVnum <= 52200:
                self.AppendSpace(5)
                for g in xrange(item.ITEM_APPLY_MAX_NUM):
                    (affectType, affectValue) = item.GetAffect(g)
                    affectString = self.__GetAffectString(affectType, affectValue)
                    if affectString:
                        affectColor = self.GetChangeTextLineColor(affectValue)
                        self.AppendTextLine(affectString, affectColor)
            for i in xrange(item.LIMIT_MAX_NUM):
                (limitType, limitValue) = item.GetLimit(i)

Spoiler

        if app.ENABLE_COSTUME_SYSTEM:
            if item.ITEM_TYPE_COSTUME == itemType:
                isCostumeItem = 1
                isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
                isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
                isCostumeMount = item.COSTUME_TYPE_MOUNT == itemSubType
                if app.ENABLE_COSTUME_WEAPON_SYSTEM:
                    isCostumeWeapon = item.COSTUME_TYPE_WEAPON == itemSubType
                isCostumeAcce = item.COSTUME_TYPE_ACCE == itemSubType

but it doesn't work

btw syserr is clean

  • Love 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • Premium

Code updated, that one posted wasn`t complete on my client (wasn`t appending the info to the space).

 

        ## Start of Pet System Bonus info ##
        elif itemVnum >= 53001 and itemVnum <= 53999:
            self.AppendSpace(5)
            for g in xrange(item.ITEM_APPLY_MAX_NUM):
                (affectType, affectValue) = item.GetAffect(g)
                affectString = self.__GetAffectString(affectType, affectValue)
                if affectString:
                    affectColor = grp.GenerateColor(0.3824, 0.5804, 0.9824, 1.0) # You can play here for the text color.
                    self.AppendTextLine(affectString, affectColor)
            self.__AppendAttributeInformation(attrSlot)
        ## End of Pet System Bonus info ##


Some screenshots:

dVIxszi.jpg

 

 

For who doesn`t have a brain, here is the tabulation:

0mI3Jjp.png
Hope it will be useful to someone.

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

  • Premium

Snippet updated to show the LIMIT information in the proto if there are any.

 

		## Start of Pet System Bonus info ##
		elif itemVnum >= 53001 and itemVnum <= 53999:
			self.AppendSpace(5)
			for g in xrange(item.ITEM_APPLY_MAX_NUM):
				(affectType, affectValue) = item.GetAffect(g)
				affectString = self.__GetAffectString(affectType, affectValue)
				if affectString:
					affectColor = grp.GenerateColor(0.3824, 0.5804, 0.9824, 1.0) # You can play here for the text color.
					self.AppendTextLine(affectString, affectColor) 
			self.__AppendAttributeInformation(attrSlot)
			bHasRealtimeFlag = 0
			for i in xrange(item.LIMIT_MAX_NUM):
				(limitType, limitValue) = item.GetLimit(i)
				if item.LIMIT_REAL_TIME == limitType:
					bHasRealtimeFlag = 1
			if bHasRealtimeFlag == 1:
				self.AppendMallItemLastTime(metinSlot[0])
		## End of Pet System Bonus info ##

Result:

3Y9a0iT.png

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

  • Premium


[IMG]

 

 
        ## Start of Pet/Mount System Bonus info ##
        elif itemVnum >= 53001 and itemVnum <= 53999 or item.GetItemSubType() == item.COSTUME_TYPE_MOUNT:
            self.AppendSpace(5)
            for g in xrange(item.ITEM_APPLY_MAX_NUM):
                (affectType, affectValue) = item.GetAffect(g)
                affectString = self.__GetAffectString(affectType, affectValue)
                if affectString:
                    affectColor = grp.GenerateColor(0.3824, 0.5804, 0.9824, 1.0) # You can play here for the text color.
                    self.AppendTextLine(affectString, affectColor)
            self.__AppendAttributeInformation(attrSlot)
            bHasRealtimeFlag = 0
            for i in xrange(item.LIMIT_MAX_NUM):
                (limitType, limitValue) = item.GetLimit(i)
                if item.LIMIT_REAL_TIME == limitType:
                    bHasRealtimeFlag = 1
            if bHasRealtimeFlag == 1:
                self.AppendMallItemLastTime(metinSlot[0])
        ## End of Pet/Mount System Bonus info ##





Sorry, reupdated with the mount in the check aswell, i didn`t have any limits on that seal but if you have any they will apply as for the pets.
Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 2 weeks later...

make this improvement I hope it's useful
 

			if itemVnum >= 53001 and itemVnum <= 53026:
				self.AppendSpace(5)
				self.__AppendPetIcon(itemVnum)
				for g in xrange(item.ITEM_APPLY_MAX_NUM):
					(affectType, affectValue) = item.GetAffect(g)
					affectString = self.__GetAffectString(affectType, affectValue)
					if affectString:
						# affectColor = self.GetChangeTextLineColor(affectValue)
						affectColor = grp.GenerateColor(0.3824, 0.5804, 0.9824, 1.0) # You can play here for the text color.
						self.AppendTextLine(affectString, affectColor)
				self.__AppendAttributeInformation(attrSlot)
				bHasRealtimeFlag = 0
				for i in xrange(item.LIMIT_MAX_NUM):
					(limitType, limitValue) = item.GetLimit(i)
					if item.LIMIT_REAL_TIME == limitType:
						bHasRealtimeFlag = 1
				if bHasRealtimeFlag == 1:
					self.AppendMallItemLastTime(metinSlot[0])

search:
def __AppendItemIcon(self, itemVnum):

paste:

 

	def __AppendPetIcon(self, itemVnum):
		itemImage = ui.ImageBox()
		itemImage.SetParent(self)
		itemImage.Show()
		
		itemImage.LoadImage(item.GetIconImageFileName())
		itemImage.SetPosition((self.toolTipWidth/2) - itemImage.GetWidth()/2, self.toolTipHeight)
		self.toolTipHeight += itemImage.GetHeight()
		self.childrenList.append(itemImage)
		self.ResizeToolTip()

 

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...
  • Premium
La 13.11.2017 la 22:05, North a spus:

Code updated, that one posted wasn`t complete on my client (wasn`t appending the info to the space).

 


        ## Start of Pet System Bonus info ##
        elif itemVnum >= 53001 and itemVnum <= 53999:
            self.AppendSpace(5)
            for g in xrange(item.ITEM_APPLY_MAX_NUM):
                (affectType, affectValue) = item.GetAffect(g)
                affectString = self.__GetAffectString(affectType, affectValue)
                if affectString:
                    affectColor = grp.GenerateColor(0.3824, 0.5804, 0.9824, 1.0) # You can play here for the text color.
                    self.AppendTextLine(affectString, affectColor)
            self.__AppendAttributeInformation(attrSlot)
        ## End of Pet System Bonus info ##


Some screenshots:

dVIxszi.jpg

 

 

For who doesn`t have a brain, here is the tabulation:

0mI3Jjp.png
Hope it will be useful to someone.

I did exactly same but it doesn't work.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 1

spacer.png

Link to comment
Share on other sites

  • 1 month later...
La 03.06.2019 la 14:09, Jawwad a spus:

I did exactly same but it doesn't work.

Search:

elif item.ITEM_TYPE_QUEST == itemType:

Replace:

		elif item.ITEM_TYPE_QUEST == itemType:
			if itemVnum >= 53001 and itemVnum <= 53026:
				self.AppendSpace(5)
				for g in xrange(item.ITEM_APPLY_MAX_NUM):
					(affectType, affectValue) = item.GetAffect(g)
					affectString = self.__GetAffectString(affectType, affectValue)
					if affectString:
						affectColor = self.GetChangeTextLineColor(affectValue)
						self.AppendTextLine(affectString, affectColor)

 

Link to comment
Share on other sites

  • 2 years later...
		### Use ###
		elif item.ITEM_TYPE_USE == itemType:
			self.__AppendLimitInformation()
            elif  item.ITEM_TYPE_QUEST == itemType:
                        if itemVnum >= 53001 and itemVnum <= 53026:
                self.AppendSpace(5)
                for g in xrange(item.ITEM_APPLY_MAX_NUM):
                    (affectType, affectValue) = item.GetAffect(g)
                    affectString = self.__GetAffectString(affectType, affectValue)
                    if affectString:
                        affectColor = self.GetChangeTextLineColor(affectValue)
                        self.AppendTextLine(affectString, affectColor)

i add like this on uitooltip.py

my client syserr says :

0306 12:47:06853 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:23) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiAffectShower.py(line:8) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 1059)

0306 12:47:06853 :: ============================================================================================================
0306 12:47:06853 :: Abort!!!!

can someone help ?

Link to comment
Share on other sites

  • Contributor

@ kenoZ

N-vtelen.png

If you still don't understand:

Spoiler
		### Use ###
		elif item.ITEM_TYPE_USE == itemType:
			self.__AppendLimitInformation()
		elif  item.ITEM_TYPE_QUEST == itemType:
			if itemVnum >= 53001 and itemVnum <= 53026:
				self.AppendSpace(5)
				for g in xrange(item.ITEM_APPLY_MAX_NUM):
					(affectType, affectValue) = item.GetAffect(g)
					affectString = self.__GetAffectString(affectType, affectValue)
					if affectString:
						affectColor = self.GetChangeTextLineColor(affectValue)
						self.AppendTextLine(affectString, affectColor)

 

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

6 minutes ago, TMP4 said:

@ kenoZ

N-vtelen.png

If you still don't understand:

  Reveal hidden contents
		### Use ###
		elif item.ITEM_TYPE_USE == itemType:
			self.__AppendLimitInformation()
		elif  item.ITEM_TYPE_QUEST == itemType:
			if itemVnum >= 53001 and itemVnum <= 53026:
				self.AppendSpace(5)
				for g in xrange(item.ITEM_APPLY_MAX_NUM):
					(affectType, affectValue) = item.GetAffect(g)
					affectString = self.__GetAffectString(affectType, affectValue)
					if affectString:
						affectColor = self.GetChangeTextLineColor(affectValue)
						self.AppendTextLine(affectString, affectColor)

 

Thank you for this nice description, this helped me alot 🙂

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

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 60

      Inbuild GR2 Animation

    2. 2

      wait() function bug

    3. 0

      Remove Party Role Bonuses

    4. 1

      Fix CBar3D

    5. 1

      set_quest_state not working

    6. 1

      Fix CBar3D

    7. 1

      Game Source Code - where to call void methods to spawn mobs, move mobs and others - in game source side -?

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.