tristano98 6 Posted September 20, 2017 Share Posted September 20, 2017 (edited) Hello, i'm have this little bug in inventory with costume bonus Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted September 20, 2017 Developer Share Posted September 20, 2017 Probrably it'is for the wrong type/flag into item proto My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
tristano98 6 Posted September 22, 2017 Author Share Posted September 22, 2017 On 20/9/2017 at 4:23 PM, riku11 said: Probrably it'is for the wrong type/flag into item proto you have this system? Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted September 24, 2017 Developer Share Posted September 24, 2017 No man , I just read the python code responsible for the effect in question. def OverInItem(self, overSlotPos): overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos) self.wndItem.SetUsableItem(False) if mouseModule.mouseController.isAttached(): attachedItemType = mouseModule.mouseController.GetAttachedType() if player.SLOT_TYPE_INVENTORY == attachedItemType: attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex() if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): self.wndItem.SetUsableItem(True) self.ShowToolTip(overSlotPos) return self.ShowToolTip(overSlotPos) if self.__CanUseSrcItemToDstItem -> green image on item that methods : def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos): "대상 아이템에 사용할 수 있는가?" if srcSlotPos == dstSlotPos: return False if item.IsRefineScroll(srcItemVNum): if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos): return True elif item.IsMetin(srcItemVNum): if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos): return True elif item.IsDetachScroll(srcItemVNum): if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos): return True elif item.IsKey(srcItemVNum): if player.CanUnlock(srcItemVNum, dstSlotPos): return True elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: return True else: useType=item.GetUseType(srcItemVNum) if "USE_CLEAN_SOCKET" == useType: if self.__CanCleanBrokenMetinStone(dstSlotPos): return True elif "USE_CHANGE_ATTRIBUTE" == useType: if self.__CanChangeItemAttrList(dstSlotPos): return True elif "USE_ADD_ATTRIBUTE" == useType: if self.__CanAddItemAttr(dstSlotPos): return True elif "USE_ADD_ATTRIBUTE2" == useType: if self.__CanAddItemAttr(dstSlotPos): return True elif "USE_ADD_ACCESSORY_SOCKET" == useType: if self.__CanAddAccessorySocket(dstSlotPos): return True elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType: if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum): return True; elif "USE_PUT_INTO_BELT_SOCKET" == useType: dstItemVNum = player.GetItemIndex(dstSlotPos) item.SelectItem(dstItemVNum) if item.ITEM_TYPE_BELT == item.GetItemType(): return True return False so the problem is probably the type/flags of item assigned (into proto) to the item in question. My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
tristano98 6 Posted September 25, 2017 Author Share Posted September 25, 2017 14 hours ago, riku11 said: No man , I just read the python code responsible for the effect in question. def OverInItem(self, overSlotPos): overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos) self.wndItem.SetUsableItem(False) if mouseModule.mouseController.isAttached(): attachedItemType = mouseModule.mouseController.GetAttachedType() if player.SLOT_TYPE_INVENTORY == attachedItemType: attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex() if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): self.wndItem.SetUsableItem(True) self.ShowToolTip(overSlotPos) return self.ShowToolTip(overSlotPos) if self.__CanUseSrcItemToDstItem -> green image on item that methods : def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos): "대상 아이템에 사용할 수 있는가?" if srcSlotPos == dstSlotPos: return False if item.IsRefineScroll(srcItemVNum): if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos): return True elif item.IsMetin(srcItemVNum): if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos): return True elif item.IsDetachScroll(srcItemVNum): if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos): return True elif item.IsKey(srcItemVNum): if player.CanUnlock(srcItemVNum, dstSlotPos): return True elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: return True else: useType=item.GetUseType(srcItemVNum) if "USE_CLEAN_SOCKET" == useType: if self.__CanCleanBrokenMetinStone(dstSlotPos): return True elif "USE_CHANGE_ATTRIBUTE" == useType: if self.__CanChangeItemAttrList(dstSlotPos): return True elif "USE_ADD_ATTRIBUTE" == useType: if self.__CanAddItemAttr(dstSlotPos): return True elif "USE_ADD_ATTRIBUTE2" == useType: if self.__CanAddItemAttr(dstSlotPos): return True elif "USE_ADD_ACCESSORY_SOCKET" == useType: if self.__CanAddAccessorySocket(dstSlotPos): return True elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType: if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum): return True; elif "USE_PUT_INTO_BELT_SOCKET" == useType: dstItemVNum = player.GetItemIndex(dstSlotPos) item.SelectItem(dstItemVNum) if item.ITEM_TYPE_BELT == item.GetItemType(): return True return False so the problem is probably the type/flags of item assigned (into proto) to the item in question. My OverInItem is this Spoiler def OverInItem(self, overSlotPos): if app.ENABLE_HIGHLIGHT_SYSTEM: stat = 0 slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos) itemVnum = player.GetItemIndex(slotNumber) if constInfo.IS_AUTO_POTION(itemVnum): metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] if slotNumber >= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex: slotNumber -= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex isActivated = 0 != metinSocket[0] if isActivated: stat = 1 if not stat: if slotNumber in self.liHighlightedItems: self.wndItem.DeactivateSlot(overSlotPos) try: if app.ENABLE_SASH_SYSTEM: if not slotNumber in self.listAttachedSashs: self.liHighlightedItems.remove(slotNumber) else: self.liHighlightedItems.remove(slotNumber) except: pass overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos) self.wndItem.SetUsableItem(FALSE) if mouseModule.mouseController.isAttached(): attachedItemType = mouseModule.mouseController.GetAttachedType() if player.SLOT_TYPE_INVENTORY == attachedItemType: attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex() if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return self.ShowToolTip(overSlotPos) Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted September 25, 2017 Developer Share Posted September 25, 2017 Is the same things.... for the relative part of the green image on item My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
tristano98 6 Posted September 26, 2017 Author Share Posted September 26, 2017 12 hours ago, riku11 said: Is the same things.... for the relative part of the green image on item how to fix the problem? Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted September 26, 2017 Developer Share Posted September 26, 2017 I'm not a guesser, and so having not way to see what you did , I can not tell you the fix that's best to do.... I can tell u a "dirty" methods to resolve the problem...... change this: if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): with this : if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos) or attachedItemVNum == ID_OF_YOUR_WRONG_ITEM: where ID_OF_YOUR_WRONG_ITEM is a number (vnum of your problematic item) this is a shit method man , but probably it works.... If you want to fix with a much cleaner method , post everything we need. edited with correct if statement , sorry My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
tristano98 6 Posted September 26, 2017 Author Share Posted September 26, 2017 2 hours ago, riku11 said: I'm not a guesser, and so having not way to see what you did , I can not tell you the fix that's best to do.... I can tell u a "dirty" methods to resolve the problem...... change this: if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): with this : if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos) or attachedItemVNum == ID_OF_YOUR_WRONG_ITEM: where ID_OF_YOUR_WRONG_ITEM is a number (vnum of your problematic item) this is a shit method man , but probably it works.... If you want to fix with a much cleaner method , post everything we need. edited with correct if statement , sorry not work ... Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted September 26, 2017 Developer Share Posted September 26, 2017 could you post the line you changed? My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
tristano98 6 Posted September 26, 2017 Author Share Posted September 26, 2017 5 minutes ago, riku11 said: could you post the line you changed? add this Spoiler if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): if attachedItemVNum == 70063 or attachedItemVNum == 70064: self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted September 26, 2017 Developer Share Posted September 26, 2017 Just now, tristano98 said: add this Hide contents if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos): if attachedItemVNum == 70063 or attachedItemVNum == 70064: self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return Is not the same man .. if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos) or attachedItemVNum == 70063 or attachedItemVNum == 70064: self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return that's right not copy paste by this code because the web page have not "tab" write it like that without paste it 1 My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
tristano98 6 Posted September 26, 2017 Author Share Posted September 26, 2017 9 minutes ago, riku11 said: Is not the same man .. if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos) or attachedItemVNum == 70063 or attachedItemVNum == 70064: self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return that's right not copy paste by this code because the web page have not "tab" write it like that without paste it SOLVED <3 Link to comment Share on other sites More sharing options...
Premium North 1175 Posted September 27, 2017 Premium Share Posted September 27, 2017 its not better to add something like itemtype = costume? something like this but a better approach would be separate the item type with a new COSTUME_WITH_BONUS type if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos) or attachedItemVNum.GetItemType() == ITEM_TYPE_COSTUME: self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2426 Posted October 6, 2017 Developer Share Posted October 6, 2017 On 27/9/2017 at 1:05 PM, Fleon said: its not better to add something like itemtype = costume? something like this but a better approach would be separate the item type with a new COSTUME_WITH_BONUS type if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos) or attachedItemVNum.GetItemType() == ITEM_TYPE_COSTUME: self.wndItem.SetUsableItem(TRUE) self.ShowToolTip(overSlotPos) return attachedItemVnum is the costume change bonuses is not costume . My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Premium North 1175 Posted October 6, 2017 Premium Share Posted October 6, 2017 6 hours ago, riku11 said: attachedItemVnum is the costume change bonuses is not costume . o dang my mistake then, didn`t check 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now