Jump to content

[C++] Block alignment in a map update


VegaS™
 Share

Recommended Posts

52f71de7105844e69cf032e80c843dd7.png

 

 

I saw this guy looking hasta .. it provides money for shit, so I wanted to paint a small tutorial sucks these functions.

 

 

[File: Src/game/src/service.h]

#define ENABLE_PROTECT_ALIGNMENT
#ifdef ENABLE_PROTECT_ALIGNMENT
	#define IS_MAPINDEX_PROTECT_ALIGN(map)		(200==(map)||201==(map)||(202)==(map))
#endif

[File: Src/game/src/char_battle.cpp]

//1.) Search:

						if (g_iUseLocale && pkKiller->GetParty())
						{
							FPartyAlignmentCompute f(-20000, pkKiller->GetX(), pkKiller->GetY());
							pkKiller->GetParty()->ForEachOnlineMember(f);

							if (f.m_iCount == 0)
								pkKiller->UpdateAlignment(-20000);

//2.) Delete and replaced with this:

						if (g_iUseLocale && pkKiller->GetParty())
						{
#ifdef ENABLE_PROTECT_ALIGNMENT
							if (IS_MAPINDEX_PROTECT_ALIGN(GetMapIndex()))
							{
								return;
							}	
#endif
							FPartyAlignmentCompute f(-20000, pkKiller->GetX(), pkKiller->GetY());
							pkKiller->GetParty()->ForEachOnlineMember(f);

							if (f.m_iCount == 0)
								pkKiller->UpdateAlignment(-20000);

[File: Src/game/src/char.cpp]

 

//1.) Search:

UpdateAlignment(5 * (dwPlayedTime / 60000));

//2.) Delete and replaced with this:

#ifdef ENABLE_PROTECT_ALIGNMENT
			if (IS_MAPINDEX_PROTECT_ALIGN(GetMapIndex()))
				{	
					return;
				}
				else
				{
					UpdateAlignment(5 * (dwPlayedTime / 60000));
				}
#else
				UpdateAlignment(5 * (dwPlayedTime / 60000));
#endif	

PS: I have not tested this, I just wrote. But in principle it should work.

 

 

----------------------------------------------------------------------------------------- EDIT:

Fcking shit or you can make that easy:

 

[File: Src/game/src/char_battle.cpp]

#ifdef ENABLE_PROTECT_ALIGNMENT
void CHARACTER::UpdateAlignment(int iAmount)
{
	if (IS_MAPINDEX_PROTECT_ALIGN(GetMapIndex()))
	{
		return;
	}	
	else
	{	
		bool bShow = false;
		if (m_iAlignment == m_iRealAlignment)
			bShow = true;
		int i = m_iAlignment / 10;
		m_iRealAlignment = MINMAX(-200000, m_iRealAlignment + iAmount, 200000);
		if (bShow)
		{
			m_iAlignment = m_iRealAlignment;
			if (i != m_iAlignment / 10)
				UpdatePacket();
		}
	}	
}
#endif
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...