Jump to content

Red & Blue Potion Effect


Recommended Posts

Hello @all,

 

this is i think my first Release pls dont hate me for my codestyle im a noob :)

 

https://gyazo.com/1ceddb601c76ca4db9bac292804e7ee3

 

Install:

 

Search in uiinventory.py: def RefreshBagSlotWindow(self): inside this: self.wndItem.DeactivateSlot(slotNumber)

 

add: 

				if itemVnum >= 72723 and itemVnum <= 72726:
					metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]# <!> globalSlotNumber may be different <!>
					if isActivated:
						self.wndItem.ActivateSlot(i, (238.00 / 255.0), (000.00 / 255.0), (000.00 / 255.0), 1.0)
					else:
						self.wndItem.DeactivateSlot(slotNumber)
				
				if itemVnum >= 72727 and itemVnum <= 72730:
					metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]# <!> globalSlotNumber may be different <!>
					if isActivated:
						self.wndItem.ActivateSlot(i, (000.00 / 255.0), (000.00 / 255.0), (238.00 / 255.0), 1.0)
					else:
						self.wndItem.DeactivateSlot(slotNumber)

this is all pls dont hate me .....

 

have a nice day all :)

Link to post
  • Moderator
Quote
				if itemVnum >= 72723 and itemVnum <= 72726:
					metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]# <!> globalSlotNumber may be different <!>
					if isActivated:
						self.wndItem.ActivateSlot(i, (238.00 / 255.0), (000.00 / 255.0), (000.00 / 255.0), 1.0)
					else:
						self.wndItem.DeactivateSlot(slotNumber)
				
				if itemVnum >= 72727 and itemVnum <= 72730:
					metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]# <!> globalSlotNumber may be different <!>
					if isActivated:
						self.wndItem.ActivateSlot(i, (000.00 / 255.0), (000.00 / 255.0), (238.00 / 255.0), 1.0)
					else:
						self.wndItem.DeactivateSlot(slotNumber)

 

I didn't tested your code, but how you implemented this it's bad because you called multiple times ActivateSlot and DeactivateSlot for no reason (before your code already there're other conditions that are called), so you create small visual bugs for a millisecond. 

So, you could include it in the default code like this:

 

Search for:

Spoiler
				isActivated = 0 != metinSocket[0]

				if isActivated:
					self.wndItem.ActivateSlot(slotNumber)
					potionType = 0;
					if constInfo.IS_AUTO_POTION_HP(itemVnum):
						potionType = player.AUTO_POTION_TYPE_HP
					elif constInfo.IS_AUTO_POTION_SP(itemVnum):
						potionType = player.AUTO_POTION_TYPE_SP

					usedAmount = int(metinSocket[1])
					totalAmount = int(metinSocket[2])
					player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))

				else:
					self.wndItem.DeactivateSlot(slotNumber)

Replace with:

Spoiler
				isActivated, usedAmount, totalAmount = metinSocket[:3]
				if isActivated:
					potionType = 0
					if constInfo.IS_AUTO_POTION_HP(itemVnum):
						potionType = player.AUTO_POTION_TYPE_HP
						self.wndItem.ActivateSlot(slotNumber, (238.00 / 255.0), (000.00 / 255.0), (000.00 / 255.0), 1.0)
						
					elif constInfo.IS_AUTO_POTION_SP(itemVnum):
						potionType = player.AUTO_POTION_TYPE_SP
						self.wndItem.ActivateSlot(slotNumber, (000.00 / 255.0), (000.00 / 255.0), (238.00 / 255.0), 1.0)

					player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, slotNumber)
				else:
					self.wndItem.DeactivateSlot(slotNumber)

 


Also you should say that the function ActivateSlot by default doesn't have those features.

 

Meme for the math method:

troll-math-divide-by-zero

Edited by VegaS™
  • Love 3
Link to post

Geht danke für deinen Beitrag, :) :) :) okay, ich verstehe, aber eine Frage ist gehört:

 

isActivated, usedAmount, totalAmount = metinSocket[:3]

wichtig? aber warum das? 

Aber ich muss meinen Fehler beheben :) :)

Edited by Bizzy
Link to post
  • Moderator
18 minutes ago, Bizzy said:
isActivated, usedAmount, totalAmount = metinSocket[:3]

important? but why that?

 

a, b, c = 1, 2, 3
a, b, c = (1, 2, 3)
(a, b, c) = 1, 2, 3
(a, b, c) = (1, 2, 3)

All of the methods are doing same.

isActivated = 0 != metinSocket[0]
usedAmount = int(metinSocket[1])
totalAmount = int(metinSocket[2])

# examples
isActivated, usedAmount, totalAmount = map(int, metinSocket[:3])
isActivated, usedAmount, totalAmount = metinSocket[:3]
isActivated, usedAmount, totalAmount = metinSocket[0], metinSocket[1], metinSocket[2]
isActivated, usedAmount, totalAmount = metinSocket

I choosed metinSocket[:3], for being sure that's reading just the first three items from the list, because other people have 3+ sockets.

 

Please follow the rules:

Rules

§1 Language

(1.1) Language

The language in this board is english. If you want to post something in your own language always add an english translation. The only exception for this rule is this section: Private Servers

 

Edited by VegaS™
  • Love 1
Link to post
  • Honorable Member
Quote
000.00 / 255.0

?

 

Btw, whom have more sockets they should know if they use an external addon that is different and doesn't compatible with their codes, so they need to change it.

This is a rule on every each addon.

  • Good 1
  • Lmao 2
Link to post
  • 1 month later...
  • Engineer
On 10/17/2020 at 1:11 AM, wubservice said:

ActivateSlot() takes exactly 2 arguments (6 given)
 

can anybody help me?

You don't have the correct function. Check every source with sash, it has it.

Note that this topic isn't an help request.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • 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.