Jump to content

Recommended Posts

hey guys! as i have mentioned in the title i rewrote energy gauge display cuz i changed the attribute what you get from energycrystal ...

Now my question: is there any way to track the increasement from a attribute due to an item in python? before (from original code) it was "player.GetStatus (player.ENERGY)" and ofc its working cuz energy attribute was 0 before activating the item but i changed it to melee magic damage increasement so the getStaus thing wont work cuz its just outputting the total amount of the actual attribute

 

	def RefreshStatus(self):
		for invslotnumber in xrange(player.INVENTORY_PAGE_SIZE*4):
			getItemVNum=player.GetItemIndex
			itemVnum = getItemVNum(invslotnumber)
			if itemVnum == 50296:##for item with 10% attribute
				if player.GetItemMetinSocket(invslotnumber, 5) == 1:
					pointEnergy = 10
					leftTimeEnergy = 2
					self.SetEnergy (pointEnergy, leftTimeEnergy, 7200)
				else:
					pointEnergy = 0
					leftTimeEnergy = 0
					self.SetEnergy (pointEnergy, leftTimeEnergy, 7200)
			elif itemVnum == 50297:##for item with 5% attribute
				if player.GetItemMetinSocket(invslotnumber, 5) == 1:
					pointEnergy = 5
					leftTimeEnergy = 1
					self.SetEnergy (pointEnergy, leftTimeEnergy, 7200)
				else:
					pointEnergy = 0
					leftTimeEnergy = 0
					self.SetEnergy (pointEnergy, leftTimeEnergy, 7200)

this was my attempt, its working but if you change character it will display the blue image although there is no item activated somehow, even on a new account

what am i missing? 

 

nvm solved it with setting the energy to 0 before

Edited by ShyD
Link to comment
https://metin2.dev/topic/30313-rewrote-function-for-energy-display/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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.