Jump to content

Item antiflag slot effect on open windows


Recommended Posts

Hello devs, I found this tut the other day 

and I did it. It is actually an effect for non-tradable items when the exchange window is open. When this window is open this system basicly covers the non-tradable item's slot with a white color and makes it unusable for this action. I want to do the same for non-sellable items (vendors and myshop) and non-storagable items.

I tried this in my uitooltip

Spoiler

    import shop
    import safebox
    def RefreshBagSlotWindow(self):
        getItemVNum=player.GetItemIndex
        getItemCount=player.GetItemCount
        setItemVNum=self.wndItem.SetItemSlot
        
        for i in xrange(player.INVENTORY_PAGE_SIZE):
            slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
            
            itemCount = getItemCount(slotNumber)
            # itemCount == 0이면 소켓을 비운다.
            if 0 == itemCount:
                self.wndItem.ClearSlot(i)
                continue
            elif 1 == itemCount:
                itemCount = 0
                
            itemVnum = getItemVNum(slotNumber)
            setItemVNum(i, itemVnum, itemCount)
            if exchange.isTrading() and item.IsAntiFlag(item.ANTIFLAG_GIVE):
                self.wndItem.SetUnusableSlot(i)
                self.listUnusableSlot.append(i)
            elif not exchange.isTrading() and item.IsAntiFlag(item.ANTIFLAG_GIVE) and slotNumber in self.listUnusableSlot:
                self.wndItem.SetUsableSlot(i)
                self.listUnusableSlot.remove(i)
             if shop.isShopping() and item.IsAntiFlag(item.ANTIFLAG_SELL):
                 self.wndItem.SetUnusableSlot(i)
                 self.listUnusableSlot.append(i)
             elif not shop.isShopping() and item.IsAntiFlag(item.ANTIFLAG_SELL) and slotNumber in self.listUnusableSlot:
                 self.wndItem.SetUsableSlot(i)
                 self.listUnusableSlot.remove(i)
             if shop.isPrivateShop() and item.IsAntiFlag(item.ANTIFLAG_MYSHOP):
                 self.wndItem.SetUnusableSlot(i)
                 self.listUnusableSlot.append(i)
             elif not shop.isPrivateShop() and item.IsAntiFlag(item.ANTIFLAG_MYSHOP) and slotNumber in self.listUnusableSlot:
                 self.wndItem.SetUsableSlot(i)
                 self.listUnusableSlot.remove(i)
             if safebox.ItemInstanceVector() and item.IsAntiFlag(item.ANTIFLAG_SAVE):
                 self.wndItem.SetUnusableSlot(i)
                 self.listUnusableSlot.append(i)
             elif not safebox.ItemInstanceVector() and item.IsAntiFlag(item.ANTIFLAG_SAVE) and slotNumber in self.listUnusableSlot:
                 self.wndItem.SetUsableSlot(i)
                 self.listUnusableSlot.remove(i)

(ignore the exchange function this one works :P) but I'm getting this syserr

Spoiler

0715 03:47:19619 :: Traceback (most recent call last):

0715 03:47:19619 ::   File "networkModule.py", line 247, in SetGamePhase

0715 03:47:19620 ::   File "game.py", line 101, in __init__

0715 03:47:19620 ::   File "interfaceModule.py", line 289, in MakeInterface

0715 03:47:19620 ::   File "interfaceModule.py", line 173, in __MakeWindows

0715 03:47:19620 ::   File "uiInventory.py", line 263, in __init__

0715 03:47:19620 ::   File "uiInventory.py", line 404, in __LoadWindow

0715 03:47:19620 ::   File "uiInventory.py", line 471, in SetInventoryPage

0715 03:47:19620 ::   File "uiInventory.py", line 574, in RefreshBagSlotWindow

0715 03:47:19620 :: NameError
0715 03:47:19620 :: : 
0715 03:47:19620 :: global name 'safebox' is not defined
0715 03:47:19620 ::

Are there any tuts or tips that can help?

Thanks in advance :)

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

At uiinventory.InventoryWindow().RefreshBagSlotWindow() add

 

        if constInfo.My_Systems["wj_trade_icon"]:
            if shop.IsOpen() and not shop.IsPrivateShop():
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
                    self.wndItem.SetUnusableSlot(True,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

            if safebox.IsOpen():
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_SAFEBOX):
                    self.wndItem.SetUnusableSlot(True,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

            if exchange.isTrading():
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_GIVE):
                    self.wndItem.SetUnusableSlot(True,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

            if uiPrivateShopBuilder.IsBuildingPrivateShop(True):
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_MYSHOP):
                    self.wndItem.SetUnusableSlot(True,i)
                else:
                    self.wndItem.SetUsableSlot(False,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

 

 

Remove the constinfo though.

Link to comment
Share on other sites

21 minutes ago, Denis said:

At uiinventory.InventoryWindow().RefreshBagSlotWindow() add

  Hide contents

        if constInfo.My_Systems["wj_trade_icon"]:
            if shop.IsOpen() and not shop.IsPrivateShop():
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
                    self.wndItem.SetUnusableSlot(True,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

            if safebox.IsOpen():
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_SAFEBOX):
                    self.wndItem.SetUnusableSlot(True,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

            if exchange.isTrading():
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_GIVE):
                    self.wndItem.SetUnusableSlot(True,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

            if uiPrivateShopBuilder.IsBuildingPrivateShop(True):
                if item.IsAntiFlag(item.ITEM_ANTIFLAG_MYSHOP):
                    self.wndItem.SetUnusableSlot(True,i)
                else:
                    self.wndItem.SetUsableSlot(False,i)
            else:
                self.wndItem.SetUsableSlot(False,i)

 

 

Remove the constinfo though.

Hey @Denis, thanks for replying :) I tried this and I got this syserr

Spoiler

0725 01:19:20445 :: Traceback (most recent call last):

0725 01:19:20445 ::   File "networkModule.py", line 247, in SetGamePhase

0725 01:19:20445 ::   File "game.py", line 102, in __init__

0725 01:19:20445 ::   File "interfaceModule.py", line 298, in MakeInterface

0725 01:19:20445 ::   File "interfaceModule.py", line 174, in __MakeWindows

0725 01:19:20445 ::   File "uiInventory.py", line 267, in __init__

0725 01:19:20445 ::   File "uiInventory.py", line 408, in __LoadWindow

0725 01:19:20445 ::   File "uiInventory.py", line 475, in SetInventoryPage

0725 01:19:20445 ::   File "uiInventory.py", line 565, in RefreshBagSlotWindow

0725 01:19:20445 :: TypeError
0725 01:19:20445 :: : 
0725 01:19:20445 :: SetUsableSlot() takes exactly 2 arguments (3 given)
0725 01:19:20445 :: 
 

Btw I don't know why I'm getting this syserr your function gives 2 args (False ,i)

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



  • Similar Content

  • Activity

    1. 0

      Metin2 effect script files (MSE and MSA file) how can convert

    2. 10

      Multi Language System

    3. 0

      We are looking for a C++ and Python programmer

    4. 0

      [Quest Scheduler Request] Is there a way to make a quest run independet of player events? Lets say start quest automatically at server startup?

    5. 111

      Ulthar SF V2 (TMP4 Base)

    6. 0

      Quest function when 102.kill definition whereabouts help

    7. 5

      [M2 FILTER] Customized Client Filter

    8. 0

      [INGAME] RGB Color on chat broken

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