Jump to content
  • We need you!

    You must register to discover all the features of our community!

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
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™ (see edit history)
  • Love 2
Link to post
Posted (edited)

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 (see edit history)
Link to post
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™ (see edit history)
  • Love 1
Link to post
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.

  • Lucky 1
  • Lmao 2
Link to post
  • 1 month later...
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
Just now, Gurgarath said:

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

Note that this topic isn't an help request.

 

Thanks, I don't have the sash system, but I already know that there is the function

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Current Donation Goals

  • Activity

    1. 2

      [BUG] NPC name view

    2. 4

      Where do i find Guild Chat in source?

    3. 9

      [FIX] Great-Offshop MEMORY-LEAK

    4. 1

      acc system

    5. 9

      [FIX] Great-Offshop MEMORY-LEAK

    6. 4

      Where do i find Guild Chat in source?

    7. 4

      Where do i find Guild Chat in source?

    8. 0

      Extended DS Inventory

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