Jump to content

Flourine

Inactive Member
  • Posts

    120
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Flourine

  1. 2 godziny temu, ManiacRobert napisał:
    
                    elif self.IsTreasureBox(itemSlotIndex):
                        self.SendMultipleUseItemPacket(itemSlotIndex)    
    

      

    
      def IsTreasureBox(self, slotIndex):
            itemVnum = player.GetItemIndex(slotIndex)
            item.SelectItem(itemVnum)
            
            if item.GetItemType() == item.ITEM_TYPE_GIFTBOX:
                return True            
            treasures = {
                0: 27987,
                1: 50024,
                2: 50025,
                3: 50031,
                4: 50032,
                5: 80003,
            }
            
            if itemVnum in treasures.values():
                return True
                
            return False    
    
    	def SendMultipleUseItemPacket(self, slotIndex):	
    		for i in xrange(player.GetItemCount(slotIndex)):
    			self.__SendUseItemPacket(slotIndex)	

     

    I can't python thats why i did like that.

  2. Hi,

     

    i did command that can be used for auto opener of items (like 27987)

    Spoiler
    
    ACMD(do_fast_opener) 
    {
    
    	std::vector<std::string> vecArgs;
    	split_argument(argument, vecArgs);
    	DWORD whatIsUsed;
    	int howMuch, itemSlot; 
    	str_to_number(whatIsUsed, vecArgs[1].c_str()); 
    	str_to_number(howMuch, vecArgs[2].c_str()); 
    	str_to_number(itemSlot, vecArgs[3].c_str()); 
    	
    	for (int i = 1; i < 3; i++)
    	{
    		if (!*vecArgs[i].c_str() || !isnhdigit(*vecArgs[i].c_str()))
    		{
    			return ; 
    		}
    	}
    	
    	if (!ch->CanWarp())
    		return ;
    	
    	if (howMuch > 500)
    		howMuch = 500;
    	LPITEM item = ch->GetInventoryItem(itemSlot);
    	struct 
    	{
    		DWORD itemVnum;
    	}
    	disabledItems [] = 
    	{
    		{70038},
    		
    	};
    	for (int i = 0; i < (sizeof(disabledItems) / (1 * sizeof(int))); ++i)
    	{
    		if (item->GetVnum() == disabledItems[i].itemVnum)
    		{
    			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("disabled_item") );
    			return;
    		}
    	}
    	if (item)
    	{
    		if (item->GetVnum() == whatIsUsed)	
    		{
    			for (int i = 0; i < howMuch; i++)
    			{
    				ch->UseItem(TItemPos (INVENTORY, itemSlot));
    			}
    
    		}
    	}
    }

     

     

    Code of func. is here https://paste.ubuntu.com/p/YPGX6ZXsXg/

    Example: /fast_opener itemvnum howMuchtoOpen positionOfItem

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