Jump to content

Extend item_proto vnums


Recommended Posts

Hello metin2devs, as you probably already know weapons/armors etc. retrieved by the Client have a limitation on the vnum (up to 65.535).
So I thought about posting my solution to this maybe someone will need it..
 

Server Side

  1. service.h 
    //Add
    #define __VNUM_EXTEND__
  2. char.h
     
    //Search for -> WORD		parts[PART_MAX_NUM];
    
    //Replace with:
    #ifdef __VNUM_EXTEND__
    	DWORD			parts[PART_MAX_NUM];
    #else
    	WORD			parts[PART_MAX_NUM];
    #endif
      
    
    //Search for -> void			SetPart(BYTE bPartPos, WORD wVal);
    
    //Replace with:
    #ifdef __VNUM_EXTEND__
    		void			SetPart(BYTE bPartPos, DWORD wVal);
    #else
    		void			SetPart(BYTE bPartPos, WORD wVal);
    #endif
    
    //Search for -> WORD			GetPart(BYTE bPartPos) const;
      
    //Replace with:
    #ifdef __VNUM_EXTEND__
    		DWORD			GetPart(BYTE bPartPos) const;
    #else
    		WORD			GetPart(BYTE bPartPos) const;
    #endif
    
    //Search for -> WORD			GetOriginalPart(BYTE bPartPos) const;
    
    //Replace with:
    #ifdef __VNUM_EXTEND__
    		DWORD			GetOriginalPart(BYTE bPartPos) const;
    #else
    		WORD			GetOriginalPart(BYTE bPartPos) const;
    #endif
  3. char.cpp
     
    //Search for:
    void CHARACTER::SetPart(BYTE bPartPos, WORD wVal)
    {
    	assert(bPartPos < PART_MAX_NUM);
    	m_pointsInstant.parts[bPartPos] = wVal;
    }
    //Replace with:
    #ifdef __VNUM_EXTEND__
    void CHARACTER::SetPart(BYTE bPartPos, DWORD wVal)
    {
    	assert(bPartPos < PART_MAX_NUM);
    	m_pointsInstant.parts[bPartPos] = wVal;
    }
    #else
    void CHARACTER::SetPart(BYTE bPartPos, WORD wVal)
    {
    	assert(bPartPos < PART_MAX_NUM);
    	m_pointsInstant.parts[bPartPos] = wVal;
    }
    #endif
    
    //Search for:
    WORD CHARACTER::GetPart(BYTE bPartPos) const
    {
    	assert(bPartPos < PART_MAX_NUM);
    	return m_pointsInstant.parts[bPartPos];
    }
    //Replace with:
    DWORD CHARACTER::GetPart(BYTE bPartPos) const
    {
    	assert(bPartPos < PART_MAX_NUM);
    	return m_pointsInstant.parts[bPartPos];
    }
    #else
    WORD CHARACTER::GetPart(BYTE bPartPos) const
    {
    	assert(bPartPos < PART_MAX_NUM);
    	return m_pointsInstant.parts[bPartPos];
    }
    #endif
    
    //Search for:
    WORD CHARACTER::GetOriginalPart(BYTE bPartPos) const
    {
    	switch (bPartPos)
    	{
    		case PART_MAIN:
    			if (!IsPC())
    				return GetPart(PART_MAIN);
    			else
    				return m_pointsInstant.bBasePart;
    
    		case PART_HAIR:
    			return GetPart(PART_HAIR);
    
    		default:
    			return 0;
    	}
    }
    //Replace with:
    #ifdef __VNUM_EXTEND__
    DWORD CHARACTER::GetOriginalPart(BYTE bPartPos) const
    {
    	switch (bPartPos)
    	{
    		case PART_MAIN:
    			if (!IsPC()) // Return the current part as it is if it is not a PC
    				return GetPart(PART_MAIN);
    			else
    				return m_pointsInstant.bBasePart;
    
    		case PART_HAIR:
    			return GetPart(PART_HAIR);
    
    		default:
    			return 0;
    	}
    }
    #else
    WORD CHARACTER::GetOriginalPart(BYTE bPartPos) const
    {
    	switch (bPartPos)
    	{
    		case PART_MAIN:
    			if (!IsPC())
    				return GetPart(PART_MAIN);
    			else
    				return m_pointsInstant.bBasePart;
    
    		case PART_HAIR:
    			return GetPart(PART_HAIR);
    
    		default:
    			return 0;
    	}
    }
    #endif
  4. packet.h
     
    //Search for -> WORD        awPart[CHR_EQUIPPART_NUM];
    
    //Replace with:
    #ifdef __VNUM_EXTEND__
    	DWORD		awPart[CHR_EQUIPPART_NUM];
    #else
    	WORD        awPart[CHR_EQUIPPART_NUM];
    #endif


    Client Side

  5. Locale_inc.h
     

    //Add
    #define __VNUM_EXTEND__
  6.  packet.h
     
    //Search for -> WORD        awPart[CHR_EQUIPPART_NUM];
    
    //Replace with:
    #ifdef __VNUM_EXTEND__
    	DWORD			awPart[CHR_EQUIPPART_NUM];
    #else
        WORD        awPart[CHR_EQUIPPART_NUM];
    #endif

     

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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