• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Eel Bug/Asal Glitch Fixes

Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
Eel Bug:
-File:mover.cpp under the restat process [ CMover::ReState() ]
Code:
	time_t tmCur = (time_t)( CTime::GetCurrentTime().GetTime() );
	for( int i = 0 ; i < SM_MAX ; ++i )
	{
		if( m_dwSMTime[i] > 0 )
		{
			
		ItemProp* aItemprop = prj.GetItemProp( g_AddSMMode.dwSMItemID[i] );
			if( aItemprop )
			{
				if( i == SM_MAX_HP50 )
				{
					ResetDestParam( aItemprop->dwDestParam[0], m_nPlusMaxHitPoint, 1 );
					((CUser*)this)->AddSMMode( SM_MAX_HP50, 0 );
					m_dwSMTime[i] = 0;
				}
				g_dpDBClient.SendLogSMItemUse( "2", (CUser*)this, NULL, aItemprop );
			}
			else
			{
				WriteLog( "%s, %d\r\n\tNo SMItem dwSMItemID[%d] : %d / Name : %s", __FILE__, __LINE__, i, g_AddSMMode.dwSMItemID[i], m_szName );
			}
			
		}
	}

Asal Glitch:
-File:AttackArbiter.cpp under the PostAsalraalaikum process [ CAttackArbiter::postAsalraalaikum() ]
Code:
	int nMP = m_pAttacker->GetManaPoint();						// ÀÏ´Ü ¹Þ¾Æ³õ°í
	int nPercent = m_pAttacker->GetManaPointPercent();
	if( m_pAttacker->IsPlayer() && m_pAttacker->IsSMMode( SM_MAINTAIN_MP ) == FALSE && nPercent < 100 )		// MP À¯·á¾ÆÀÌÅÛ ¸Ô¾úÀ»¶§´Â MP´â¸é ¾ÈµÈ´Ù.
		m_pAttacker->SetPointParam( DST_MP, 0 );				// 0À¸·Î ¸¸µë.
					if( m_pAttacker->GetHitPoint() >  m_pAttacker->GetMaxHitPoint() )
					 {
						 return ( ( ( m_pAttacker->GetStr() / 10 ) * dwSkillLevel ) * 0 );
					 }
					else if( m_pAttacker->GetManaPoint() >  m_pAttacker->GetMaxManaPoint() )
					{
						return ( ( ( m_pAttacker->GetStr() / 10 ) * dwSkillLevel ) * 0 );
					}
					else
					{
	return ( ( ( m_pAttacker->GetStr() / 10 ) * dwSkillLevel ) * ( 5 + nMP / 10 ) + nAddDmg );
					}
 
Flyff Developer
Loyal Member
Joined
Apr 6, 2009
Messages
1,873
Reaction score
384
the asal fix is cool, I already have something similar in my source
but about the restat fix... why do you manually check if they have a grilled eel active? there's a function for checking if they have that type of item active. here's how:
Code:
IsSMMode(SM_MAX_HP50)
 
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
I've never tried it like that, but you still need to get the item itself in order for
Code:
ResetDestParam( aItemprop->dwDestParam[0], m_nPlusMaxHitPoint, 1 );
 
Flyff Developer
Loyal Member
Joined
Apr 6, 2009
Messages
1,873
Reaction score
384
well, just from looking at the code for a few seconds, couldn't you do this?
Code:
ItemProp* aItemprop = prj.GetItemProp( g_AddSMMode.dwSMItemID[SM_MAX_HP50] );
 
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
No idea, lmfao. I'm still new to c++ for the most part.
 
Flyff Developer
Loyal Member
Joined
Apr 6, 2009
Messages
1,873
Reaction score
384
ah, I see. so am I, but I seem to have a coder's brain lol
I don't know much about C++ specifically, but I excel at understanding the coding logic xD

here, I'll rewrite your coding in a way that makes sense to me:
Code:
	time_t tmCur = (time_t)( CTime::GetCurrentTime().GetTime() );
	ItemProp* aItemprop = prj.GetItemProp( g_AddSMMode.dwSMItemID[SM_MAX_HP50] );
	if( aItemprop && IsSMMode(SM_MAX_HP50) )
	{
		ResetDestParam( aItemprop->dwDestParam[0], m_nPlusMaxHitPoint, 1 );
		((CUser*)this)->AddSMMode( SM_MAX_HP50, 0 );
		m_dwSMTime[i] = 0;
		g_dpDBClient.SendLogSMItemUse( "2", (CUser*)this, NULL, aItemprop );
	}
	else
	{
		WriteLog( "%s, %d\r\n\tNo SMItem dwSMItemID[%d] : %d / Name : %s", __FILE__, __LINE__, i, g_AddSMMode.dwSMItemID[i], m_szName );
	}

The reason you can do it is because of this line:
Code:
if( i == SM_MAX_HP50 )
if i == SM_MAX_HP50 already, then there's no reason you can't do this:
Code:
ItemProp* aItemprop = prj.GetItemProp( g_AddSMMode.dwSMItemID[SM_MAX_HP50] );
I replaced the i with the value you were already checking for anyways
 
Last edited:
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
In that case you also need to change
Code:
m_dwSMTime[i] = 0;
And the difference between your edit and mine, is that mine checks for different items as well, not just eels. It checks for any item that uses an SM Mode. With your code it will try to delete an eel every time you restat, even if one's not active. Mine also checks if the timer of any SM Mode item is more than 0.
 
Flyff Developer
Loyal Member
Joined
Apr 6, 2009
Messages
1,873
Reaction score
384
oh, right. that's because I forgot something xD let me edit it real quick lol

edit: there, it's fixed now
 
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
well, you also forgot
Code:
m_dwSMTime[i] = 0;
:p But yeah both ways work just as efficient.
 
Skilled Illusionist
Joined
Jun 2, 2006
Messages
344
Reaction score
123
I believe this belongs in the tutorials section? I might be wrong tho.

You guys look cute fiddling with the source like this, keep on with the good work, this is how you learn it. :3
 
Custom Title Activated
Loyal Member
Joined
Sep 9, 2008
Messages
1,949
Reaction score
390
This should answer a lot of pservers questions. I visit a lot of them, and most have no idea how to fix these glitches.

And yes, perhaps this does belong in the tutorial section.

In the future you should compare the original code to the fix so people can understand why they are copy/pasting stuff blindly.

Thanks just the same.
 
i sell platypus
Loyal Member
Joined
Jun 26, 2009
Messages
2,640
Reaction score
1,326
Moved to the tutorial section.
 
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
By asal glitch, I mean gear swapping. Making them hit much higher.

In the future you should compare the original code to the fix so people can understand why they are copy/pasting stuff blindly.

Thanks just the same.
The only reason I didn't go into detail is so that whomever uses can try and figure it out for themselves. Most likely everyone will just copy/paste it, but meh.
 
Not working on UnitedFlyf
Loyal Member
Joined
Apr 21, 2009
Messages
1,385
Reaction score
934
By asal glitch, I mean gear swapping. Making them hit much higher.


The only reason I didn't go into detail is so that whomever uses can try and figure it out for themselves. Most likely everyone will just copy/paste it, but meh.

Anyone can CODE this by looking at the source and figuring it out for themselves, you're just spoonfeeding them.
 
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
Pretty much. :l But for most people they wont bother attempting to fix these types of minor glitches/bugs anyway.
 
Back
Top