need help on rappelz source code

01/18/2025 12:37 chihab007#1

I'm trying to create an area similar to Battle Arena, but I'm facing an issue with the collision .
I can't seem to make the collision work properly, or I can't find the specific file responsible for it.

The code works fine, and the result seems correct, but it doesn't block or stop the player.
If anyone can help me, I would greatly appreciate it!



ps im using game messeg to check it :
PHP Code:
PlayerAreaManager::Instance().UpdatePlayerPosition(pClientpMsg->xpMsg->y); 
This video showcases what I need:
01/18/2025 18:03 Anothers#2
Hey first look onMoveRequest in captain herlock source code
This is where move requests come from and the result is determined here.
there if( pClient->IsInBattleArena() ) look this code
You should push back to Move info and send the current coordinates or previus coordinates.
If you send the previous position to the movement information
The character will go to the position you sent.
I learned this while writing code for testing purposes, these are some of the information I know.

Have good day
01/18/2025 23:05 chihab007#3
Quote:
Originally Posted by Anothers View Post
Hey first look onMoveRequest in captain herlock source code
This is where move requests come from and the result is determined here.
there if( pClient->IsInBattleArena() ) look this code
You should push back to Move info and send the current coordinates or previus coordinates.
If you send the previous position to the movement information
The character will go to the position you sent.
I learned this while writing code for testing purposes, these are some of the information I know.

Have good day
-------------------
tyyyyyyyyyyyyyyyyyyyy its work
-------------------------------
if any one want fix for it this is the full fix()
------------------------------------------------
PHP Code:
void PlayerAreaManager::UpdatePlayerPosition(StructPlayerplayerint xint y)
{
    
Position newPlayerPos = { x};

    
// تحقق إذا كان اللاعب داخل المنطقة المحظورة
    
bool isInCustomArea IsPointIncludedCCW(customAreaVertices4newPlayerPos);

    if (
isInCustomArea) {
        
// إذا كان داخل المنطقة المحظورة، قم بإرجاعه إلى الموقع السابق
        
Position lastValidPos = { player->GetX(), player->GetY() };

        
// تأكد من أن اللاعب ليس في نفس المكان الذي كان فيه من قبل
        
if (lastValidPos.== && lastValidPos.== y) {
            
// إذا كانت الحركة نفسها، لا تفعل أي شيء
            
return;
        }

        
player->ChangeLocation(lastValidPos.xlastValidPos.y);

        
// إرسال رسالة رفض
        
SendResult(playerTM_CS_MOVE_REQUESTRESULT_ACCESS_DENIED);

        
// استعراض النتيجة في السجل
        
_cprint("Player position reverted: Access denied to restricted area.");

        
// هنا يتم منع أي تحرك آخر داخل المنطقة المحظورة
        
return;
    }

    
// إذا كان خارج المنطقة المحظورة، قم بتحديث الموقع
    
player->ChangeLocation(xy);

--------------------------------
onmovereq
-------------------------------
PHP Code:
    if (PlayerAreaManager::Instance().IsBlocked(playerPos)) {
        
// إذا كان في منطقة محظورة، قم بإرجاعه إلى الموقع السابق
        
ArPosition curPos pClient->GetCurrentPosition(GetArTime());
        
pClient->ChangeLocation(curPos.xcurPos.y);

        
// أعد تعبئة معلومات الحركة بالموقع السابق
        
std::vector<ArPositionvMoveInfo;
        
vMoveInfo.push_back(curPos);

        
// أرسل النتيجة مع الموقع السابق
        
ArcadiaServer::Instance().SetMultipleMove(pClientcurPosvMoveInfopClient->GetRealMoveSpeed(), trueGetArTime());
        
SendResult(pClientpMsg->idRESULT_ACCESS_DENIED);

        
_cprint("Movement denied: Player is in restricted area.");
        return;
    }