Jump to content

TIMER_BASED_ON_WEAR, REAL_TIME Fix


Go to solution Solved by 3bd0,

Recommended Posts

  • Contributor

Hi,

 

So if an item have TIMER_BASED_ON_WEAR (Only mounts in my case) or REAL_TIME (some etc junk item) the time does not show on npc shop or itemshop if we have python ingame itemshop.

 

I know there was a fix at least for the TIMER_BASED_ON_WEAR but i just can't find it. Maybe topic deleted, or other forum.

I think the problem is in uitooltip.py Def AppendTimerBasedOnWearLastTime

Can someone share the fix with me for any of them?

Link to comment
Share on other sites

  • 4 weeks later...
  • Solution

Hi,

 

The AppendTimerBasedOnWearLastTime function displays the time left based on socket 0 value, but if the item doesn't actually exist (in an npc_shop for example), the socket 0 value will be 0. A possible fix could be checking if the sokcet value is 0 and in that case display the limit value instead

Link to comment
Share on other sites

  • 1 year later...
  • Contributor
1 hour ago, ReFresh said:

@TMP4 Can you share a solution please? I have the same problem.

uitooltip.py

ITEM_TYPE_UNIQUE:

Spoiler
		elif item.ITEM_TYPE_UNIQUE == itemType:
			if 0 != metinSlot:
				bHasRealtimeFlag = 0
				
				for i in xrange(item.LIMIT_MAX_NUM):
					(limitType, limitValue) = item.GetLimit(i)

					if item.LIMIT_REAL_TIME == limitType:
						bHasRealtimeFlag = 1
				
				if 1 == bHasRealtimeFlag:
					self.AppendMallItemLastTime(metinSlot[0])		
				else:
					time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]

					if 1 == item.GetValue(2): ## ˝Ç˝Ă°Ł ŔĚżë Flag / ŔĺÂř ľČÇصµ ÁŘ´Ů
						if time == 0: #fix
							time = item.GetValue(0)+ app.GetGlobalTimeStamp() #fix
						self.AppendMallItemLastTime(time)
					else:
						if time == 0:
							time = item.GetValue(0)
						self.AppendUniqueItemLastTime(time)

 

 

COSTUME_TYPE_MOUNT with TIMER_BASED_ON_WEAR (you can edit/extend it to other items...)

Spoiler
	def AppendTimerBasedOnWearLastTime(self, metinSlot):
		if 0 == metinSlot[0]:
			if item.COSTUME_TYPE_MOUNT == item.GetItemSubType(): #costume mounts with TIMER_BASED_ON_WEAR
				defaultValue = 0
				for i in xrange(item.LIMIT_MAX_NUM):
					(limitType, defaultValue) = item.GetLimit(i)
					defaultValue += app.GetGlobalTimeStamp()
					if item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
						break

				self.AppendMallItemLastTime(defaultValue)
				
			else:
				self.AppendSpace(5)
				self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
		else:
			endTime = app.GetGlobalTimeStamp() + metinSlot[0]
			self.AppendMallItemLastTime(endTime)		

 

 

WEAPON_QUIVER:

Spoiler
			if app.ENABLE_QUIVER_SYSTEM:
				if itemSubType != item.WEAPON_QUIVER:
					self.__AppendMetinSlotInfo(metinSlot)
					## <!!!> Enable this below if you have the realtimed weapons
					#self.__AppendRealTimeToolTip(itemVnum, metinSlot[0])
					## <!!!>
				elif item.WEAPON_QUIVER == itemSubType:
					bHasRealtimeFlag = 0
					defaultValue = 0
					for i in xrange(item.LIMIT_MAX_NUM):
						(limitType, defaultValue) = item.GetLimit(i)
						defaultValue += app.GetGlobalTimeStamp() #fix
						if item.LIMIT_REAL_TIME == limitType:
							bHasRealtimeFlag = 1
							break

					if bHasRealtimeFlag == 1:
						self.AppendMallItemLastTime(defaultValue if self.isShopItem else metinSlot[0])

 

Do not copy paste, use it for compare. Also the code maybe ugly because I did not intend to share.

Edited by TMP4
  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.