Jump to content

sunter

Inactive Member
  • Posts

    3
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by sunter

  1. On 10/31/2017 at 5:33 PM, metin2-factory said:

    Small update #2

    If you have installed my official like new elemental bonuses. follow the small guide below to view element icon of a target that wears

    the new rings, like in official.

    CxLhHukNSNe0fnTg7Ks24w.png

     

    open char.cpp,look for: 

    
    #ifdef ELEMENT_TARGET

    replace the entire content of the #ifdef, until the #endif with the following:

    
    #ifdef ELEMENT_TARGET
    	p.bElement = 0;
    	BYTE elementBase = 0;
    	DWORD raceFlag;
    	if (m_pkChrTarget)
    	{
    		if (m_pkChrTarget->IsMonster() && (raceFlag = m_pkChrTarget->GetMobTable().dwRaceFlag) >= RACE_FLAG_ATT_ELEC)
    		{
    			for (int i = RACE_FLAG_ATT_ELEC; i > 1; i /= 2)
    			{
    				elementBase++;
    			}
    			DWORD curElementBase = elementBase;
    			const int ELEMENT_BASE_FLAG = pow(2, elementBase);
    			for (int i = RACE_FLAG_ATT_ELEC; i <= RACE_FLAG_ATT_DARK; i *= 2)
    			{
    				curElementBase++;
    				int diff = raceFlag - i;
    				if (abs(diff) < ELEMENT_BASE_FLAG)
    					break;
    			}
    			p.bElement = curElementBase - elementBase;
    		}
    		else if (m_pkChrTarget->IsPC())
    		{
    			LPITEM pItem = m_pkChrTarget->GetWear(WEAR_RING1);
    			if (pItem)
    			{
    				const int BASE_ELEMENT = APPLY_ATTBONUS_ELEC;
    				for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
    				{
    					if (pItem->GetNewAttributeType(i) >= APPLY_ATTBONUS_ELEC && pItem->GetSocket(i) <= APPLY_ATTBONUS_DARK)
    					{
    						p.bElement = pItem->GetNewAttributeType(i) - BASE_ELEMENT + 1;
    						break;
    					}
    				}
    			}
    		}
    	}
    
    #endif

     

    Compile server and that's it. now, when you select a target that wear a ring with elemental bonuses, an element icon will appear next to the target.

     

     

    Error Compile 

     

    char.cpp: In member function 'void CHARACTER::SetTarget(CHARACTER*)':
    char.cpp:5622: error: call of overloaded 'pow(int, BYTE&)' is ambiguous
    /usr/include/math.h:210: note: candidates are: double pow(double, double)
    /usr/include/c++/4.2/cmath:373: note:                 long double std::pow(long double, int)
    /usr/include/c++/4.2/cmath:369: note:                 float std::pow(float, int)
    /usr/include/c++/4.2/cmath:365: note:                 double std::pow(double, int)
    /usr/include/c++/4.2/cmath:361: note:                 long double std::pow(long double, long double)
    /usr/include/c++/4.2/cmath:357: note:                 float std::pow(float, float)

     

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