Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Finding a function within the sourcecode

Initiate Mage
Joined
Sep 27, 2017
Messages
3
Reaction score
1
Hello, I have come to understand that, within the game, there is a mechanism by which the monsters teleport on to you if they were stuck at about the same position for a long enough time (about 25 seconds), I've tried to find that function in hope to maybe fix the well known "position bug" that people refer to when it comes to hit and run.. I could see why such function would exist since it could prevent exploiting the game by not getting hit whilst on a high object of some sort, which is why I assumed that its actually a function from the first place anyways xd..

any idea what the function name is? and if that's even an accurate examination at all lol

thanks!
 
Last edited:
Newbie Spellweaver
Joined
May 7, 2017
Messages
34
Reaction score
6
I don't know much about this issue, but have you tried looking in AIMonster.cpp. It seems like its probably somewhere in that file that such logic should be defined.
 
Initiate Mage
Joined
Sep 27, 2017
Messages
3
Reaction score
1
I don't know much about this issue, but have you tried looking in AIMonster.cpp. It seems like its probably somewhere in that file that such logic should be defined.

Not sure, seems like a good place to begin with though, thanks!
 
Initiate Mage
Joined
Sep 27, 2017
Messages
3
Reaction score
1
Thanks guys, making some progress.. managed to find the part where it does that teleport thingy

if( TIMEGETTIME > m_tmAttack ) // 공격 못한지 20초 지났냐?
{
m_tmAttack = TIMEGETTIME + s_tmAttack; // 타이머 리셋
// 5초전 좌표와 지금 좌표의 거리를 계산.
D3DXVECTOR3 vDist = pMover->GetPos() - m_vOldPos;
vDist.y = 0; // 옆으로 살짝움직였는데 산위로 확 올라갔을땐 거리가 엄청 멀수 있다. 그래서 이렇게 한것.
if( IsInRange( vDist, 2.0f ) ) // 2미터를 못벗어났다면 어딘가에 갖혔다는 뜻.
{
if( pMover->GetSpeed( pMover->m_pActMover->m_fSpeed ) > 0 ) // 마법적으로 움직이지 못하게 된상태에선 워프하면 안됨.
{
D3DXVECTOR3 vTarget = pTarget->GetPos();
pMover->SetPos( vTarget ); // 갖혔으면 타겟쪽으로 바로 워프.
g_UserMng.AddSetPos( pMover, pMover->GetPos() );
}
}
#if __VER < 9 // __AI_0509
else
{
m_tmReturnToBegin = TIMEGETTIME; // 다시 돌아갈땐 시간을 재기시작. x초간은 맞아도 반격안하고 계속 간다.
if( dwAIState == STATE_STAND )
DoReturnToBegin();
SendAIMsg( AIMSG_SETSTATE, dwAIState );
return TRUE;
}
#endif // __AI_0509
m_vOldPos = pMover->GetPos(); // 현재 좌표를 저장함.
}

hopefully the theory is correct and it will help fix the position bug..

as far as LAN server goes, the bug does not occur during tests, though like I said, those lines of code prevent exploiting areas in which monsters are stuck and cannot attack you back while you AOE, so a better coding needs to be done.
 
Last edited:
Back
Top