Jump to content

LISA

Inactive Member
  • Posts

    7
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by LISA

  1. The Character selection section is introselect.py

    You can use this extension. It contains Enter Key, Arrow Keys, ESC, Arrow Keys

    Add to to the end of introselect.py

    Spoiler
    
    	## KEYFUNCTIONS
    	def OnKeyDown(self, key):
    		if 1 == key:
    			self.ExitSelect()
    		if 2 == key:
    			self.SelectSlot(0)
    		if 3 == key:
    			self.SelectSlot(1)
    		if 4 == key:
    			self.SelectSlot(2)
    		if 5 == key:
    			self.SelectSlot(3)
    			
    		if 28 == key:
    
    			id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID)
    			if 0 == id:
    				self.CreateCharacter()
    
    			else:
    				self.StartGame()
    
    		if 203 == key:
    			self.slot = (self.GetSlotIndex() - 1 + self.SLOT_COUNT) % self.SLOT_COUNT
    			self.SelectSlot(self.slot)
    		if 205 == key:
    			self.slot = (self.GetSlotIndex() + 1) % self.SLOT_COUNT
    			self.SelectSlot(self.slot)
    		return TRUE	
    	## KEYFUNCTIONS END	

     

    kind regards

    LISA

    • Love 1
  2. The closeButton was not initialized. 
    This happened because ENABLE_RENEW_MESSENGER_WHISPER is TRUE, which needs to be FALSE in order to initialize the close button (class attribute).

    Spoiler
    
             if not app.ENABLE_RENEW_MESSENGER_WHISPER:
                self.titleName = GetObject("titlename")
                self.ignoreButton = GetObject("ignorebutton")
                self.reportViolentWhisperButton = GetObject("reportviolentwhisperbutton")
                self.closeButton = GetObject("closebutton")
     
             if app.ENABLE_RENEW_MESSENGER_WHISPER:
                self.titleNameEditBar = GetObject("titlename_editBar")

     

    in order to fix this:

    app.ENABLE_RENEW_MESSENGER_WHISPER = False

    or add the button outside the if condition

    example - Line 100

    Spoiler
    
             
              self.closeButton = GetObject("closebutton")
              self.chatLine = GetObject("chatline")
              self.minimizeButton = GetObject("minimizebutton")
              self.acceptButton = GetObject("acceptbutton")
              self.sendButton = GetObject("sendbutton")
              self.board = GetObject("board")
              self.editBar = GetObject("editbar")
              self.gamemasterMark = GetObject("gamemastermark")
              self.acceptButton = GetObject("acceptbutton")

     

     

     

     

  3. Thanks, 

    vor 9 Stunden schrieb WeedHex:

    pc.give_item2() already stacks the items.

    You must put flag 4 item_proto side.

    @WeedHex Yes you are correct, it stacks ordinary items.

    As you can see in my first post, the flags for the items I try to stack are already set correct.
    The difference here is that the Items I try to add with pc.give_item2 are adders/attribute changers (itemshop items). They behave differently - this seems to be a source issue.

    You can test this by yourself. just use the quest and change the flags.

     

    vor 8 Stunden schrieb Chyu ^^:

    I'm not sure but I guess that pc.give_item() is not stacking items like pc.give_item2() does and that's a difference between them.

    @Chyu ^^The function pc.give_item is depricated, you wont use this any longer since the vnum lookup is incorrect.
    pc.give_item2(vnum,count) is the correct function to use.


    If anyone knows more about this please let me know.

    Thanks in advance

     

     

    • Love 1
  4. Thanks for your reply,

    I tested this now with different vnums for example with 27004 (small blue potion).
    This Item is automatically stacking when added with pc_give_item2 into inventory.

    Is this the source used by pc_give_item2()?

    Spoiler

    char_item.cpp

     

     

    
    void CHARACTER::AutoGiveItem(LPITEM item, bool longOwnerShip)
    {
    	if (NULL == item)
    	{
    		sys_err ("NULL point.");
    		return;
    	}
    	if (item->GetOwner())
    	{
    		sys_err ("item %d 's owner exists!",item->GetID());
    		return;
    	}
    	
    	int cell;
    	if (item->IsDragonSoul())
    	{
    		cell = GetEmptyDragonSoulInventory(item);
    	}
    	else
    	{
    		cell = GetEmptyInventory (item->GetSize());
    	}
    
    	if (cell != -1)
    	{
    		if (item->IsDragonSoul())
    			item->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, cell));
    		else
    			item->AddToCharacter(this, TItemPos(INVENTORY, cell));
    
    		LogManager::instance().ItemLog(this, item, "SYSTEM", item->GetName());
    
    		if (item->GetType() == ITEM_USE && item->GetSubType() == USE_POTION)
    		{
    			TQuickslot * pSlot;
    
    			if (GetQuickslot(0, &pSlot) && pSlot->type == QUICKSLOT_TYPE_NONE)
    			{
    				TQuickslot slot;
    				slot.type = QUICKSLOT_TYPE_ITEM;
    				slot.pos = cell;
    				SetQuickslot(0, slot);
    			}
    		}
    	}
    	else
    	{
    		item->AddToGround (GetMapIndex(), GetXYZ());
    		item->StartDestroyEvent();
    
    		if (longOwnerShip)
    			item->SetOwnership (this, 300);
    		else
    			item->SetOwnership (this, 60);
    		LogManager::instance().ItemLog(this, item, "SYSTEM_DROP", item->GetName());
    	}
    }

     

     

    please correct me if I am wrong.

    Kind regards

    LISA

  5. Hi,

    im currently trying to create my own chest that can drop adders  (1-5) and attribute changers.
    The drop is created into inventory, when  the specific chest is opened (via quest).

    I Implemented support for stacking those adders and changers (c++ / python) . Now I can manually drag and drop them over each other and they will add.
    But they do not stack when added directly to inventory.


    My special_item_group.txt does not contain any of these vnums (its actually empty)
    Antiflags are 0 (serverside and clientside)
    Flags are 4 (serverside and clientside)

    Is there a way to stack them automatically, when given from a chest via pc.give_item2(vnum) ?

     

    chest.quest

    quest chest begin
    	state start begin
    		when 50184.use begin
    			if pc.get_empty_inventory_count() >= 1 then
    				local rnd = number(1,10)
    				if rnd >= 0 and rnd < 2 then
    									
    					pc.give_item2(39029, 2)
    					pc.remove_item(50184,1)
    					
    				elseif rnd >= 2 and rnd <= 3 then
    					pc.give_item2(39004,1)
    					pc.remove_item(50184,1)
    				else 
    					pc.give_item2(39028,5)
    					pc.remove_item(50184,1)
    				end
    			else
    				chat("Not enough inventory space.")
    			end
    		end	
    	end			
    end		

     

    Kind regards

    LISA

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