Ir para conteúdo

Featured Replies

Postado

 

 

Este é um tutorial mostrando como adicionar mais blocos à janela do OTClient. ( Aumente a tela)

image.thumb.png.5368f262c0fa5e7b7735455db5b7329e.png

em const.h

Procure por :  #define NETWORKMESSAGE_MAXSIZE

Para evitar alguns Bug de renderização em alguns locais do mapa aumente o valor

Citar

#define NETWORKMESSAGE_MAXSIZE 177777

Protocolgame.cpp

Procure Por:

Citar

//negative offset means that the action taken place is on a lower floor than ourself
    int32_t offsetz = myPos.z - z;
    return ((x >= myPos.x - 8 + offsetz) && (x <= myPos.x + 9 + offsetz) &&
        (y >= myPos.y - 6 + offsetz) && (y <= myPos.y + 7 + offsetz));
}

 

Substitua por :

Citar

//negative offset means that the action taken place is on a lower floor than ourself
    int32_t offsetz = myPos.z - z;
    return ((x >= myPos.x - Map::maxClientViewportX + offsetz) && (x <= myPos.x + (Map::maxClientViewportX+1) + offsetz) &&
     (y >= myPos.y - Map::maxClientViewportY + offsetz) && (y <= myPos.y + (Map::maxClientViewportY+1) + offsetz));
}

 

Procure Por:

Citar

if(oldPos.y > newPos.y) // north, for old x
                {
                    msg->AddByte(0x65);
                    GetMapDescription(oldPos.x - 8, newPos.y - 6, newPos.z, 18, 1, msg);
                }
                else if(oldPos.y < newPos.y) // south, for old x
                {
                    msg->AddByte(0x67);
                    GetMapDescription(oldPos.x - 8, newPos.y + 7, newPos.z, 18, 1, msg);
                }

                if(oldPos.x < newPos.x) // east, [with new y]
                {
                    msg->AddByte(0x66);
                    GetMapDescription(newPos.x + 9, newPos.y - 6, newPos.z, 1, 14, msg);
                }
                else if(oldPos.x > newPos.x) // west, [with new y]
                {
                    msg->AddByte(0x68);
                    GetMapDescription(newPos.x - 8, newPos.y - 6, newPos.z, 1, 14, msg);
                }
            }
        }
    }

 

Substitua por :

Citar

if(oldPos.y > newPos.y) // north, for old x
                {
                    msg->AddByte(0x65);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }
                else if(oldPos.y < newPos.y) // south, for old x
                {
                    msg->AddByte(0x67);
                    GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
                }

                if(oldPos.x < newPos.x) // east, [with new y]
                {
                    msg->AddByte(0x66);
                    GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
                else if(oldPos.x > newPos.x) // west, [with new y]
                {
                    msg->AddByte(0x68);
                    GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
                }
            }
        }
    }

 

Procure Por:

Citar

GetMapDescription(pos.x - 8, pos.y - 6, pos.z, 18, 14, msg);

Substitua por :

Citar

GetMapDescription(pos.x - Map::maxClientViewportX, pos.y - Map::maxClientViewportY, pos.z, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, msg);

 

Procure Por:

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 5, 18, 14, 3, skip); //(floor 7 and 6 already set)
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 4, 18, 14, 4, skip);
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 3, 18, 14, 5, skip);
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 2, 18, 14, 6, skip);
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 1, 18, 14, 7, skip);
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, 0, 18, 14, 8, skip);
        if(skip >= 0)

 

Substitua por :

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 5, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 3, skip); //(floor 7 and 6 already set)
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 4, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 4, skip);
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 3, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 5, skip);
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 6, skip);
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 1, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 7, skip);
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, 0, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, 8, skip);
        if(skip >= 0)

Procure Por:

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, oldPos.z - 3, 18, 14, 3, skip);
        if(skip >= 0)

 

Substitua por :

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, oldPos.z - 3, (Map::maxClientViewportX+1), (Map::maxClientViewportY+1)*2, 3, skip);
        if(skip >= 0)

 

Procure Por:

Citar

//moving up a floor up makes us out of sync
    //west
    msg->AddByte(0x68);
    GetMapDescription(oldPos.x - 8, oldPos.y + 1 - 6, newPos.z, 1, 14, msg);

    //north
    msg->AddByte(0x65);
    GetMapDescription(oldPos.x - 8, oldPos.y - 6, newPos.z, 18, 1, msg);
}

 

Substitua por :

Citar

//moving up a floor up makes us out of sync
    //west
    msg->AddByte(0x68);
    GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y - (Map::maxClientViewportY-1), newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);

    //north
    msg->AddByte(0x65);
    GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
}

 

Procure Por:

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z, 18, 14, -1, skip);
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 1, 18, 14, -2, skip);
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 2, 18, 14, -3, skip);
        if(skip >= 0)

 

Substitua por :

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -1, skip);
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 1, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -2, skip);
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -3, skip);
        if(skip >= 0)

 

Procure Por:

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 2, 18, 14, -3, skip);
        if(skip >= 0)

 

Substitua por :

Citar

int32_t skip = -1;
        GetFloorDescription(msg, oldPos.x - Map::maxClientViewportX, oldPos.y - Map::maxClientViewportY, newPos.z + 2, (Map::maxClientViewportX+1)*2, (Map::maxClientViewportY+1)*2, -3, skip);
        if(skip >= 0)

 

<><>>>><><><><> Esses 2 ultimo não e obrigatório

Procure Por:

Citar

//moving down a floor makes us out of sync
    //east
    msg->AddByte(0x66);
    GetMapDescription(oldPos.x + 9, oldPos.y - 1 - 6, newPos.z, 1, 14, msg);

    //south
    msg->AddByte(0x67);
    GetMapDescription(oldPos.x - 8, oldPos.y + 7, newPos.z, 18, 1, msg);
}

 

Substitua por :

Citar

//moving down a floor makes us out of sync
//east
msg.addByte(0x66);
GetMapDescription(oldPos.x + Map::maxClientViewportX+1, oldPos.y - (Map::maxClientViewportY+1), newPos.z, 1, ((Map::maxClientViewportY+1)*2), msg);
//south
msg.addByte(0x67);
GetMapDescription(oldPos.x - Map::maxClientViewportX, oldPos.y + (Map::maxClientViewportY+1), newPos.z, ((Map::maxClientViewportX+1)*2), 1, msg);

-----------------------------------------------------------------------protocolgame.cpp FIM------------------------------------------------------------------------------------

Agora em: Map.h

 

Procure Por:

Citar

        static const int32_t maxViewportX = 11; //min value: maxClientViewportX + 1
        static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1
        static const int32_t maxClientViewportX = 8;
        static const int32_t maxClientViewportY = 6;

Altere os valor do jeito que você quiser o meu coloquei 15 x 15

Substitua por :

Citar

        static const int32_t maxViewportX = 11; //min value: maxClientViewportX + 1
        static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1
        static const int32_t maxClientViewportX = 15;
        static const int32_t maxClientViewportY = 15;

----------------------------------------------------------------------Map.h FIM ----------------------------------------------------------------------------------------------

Agora No OTClient : Map.cpp

Utilizei: 0.6.6

Procure Por:

Citar

void Map::resetAwareRange()
{
   AwareRange range;
   range.left = 8;
   range.top = 6;
   range.bottom = 7;
   range.right = 9;
   setAwareRange(range);
}

Substitua por :

Citar

void Map::resetAwareRange()
{
   AwareRange range;
   range.left = 15; //Change this to = maxClientViewportX   //15 foi o valor que coloquei no map.h do servidor Altere para o valor que você colocou no map.h
   range.top = 15; //Change this to = maxClientViewportY  //15 foi o valor que coloquei no map.h do servidor Altere para o valor que você colocou no map.h
   range.bottom = range.top+1;
   range.right = range.left+1;
   setAwareRange(range);
}

 

 

1465691620_TwyIHBJ(2).png.61e5ef8e0cd4a73e66aa174832d027ae.png

 

Site

https://pokezbr.com/

Fã Page

https://facebook.com/pokezbr

Youtube

https://www.youtube.com/channel/UCCGEYknwLtDfyoah-jiNfsA

1465691620_TwyIHBJ(2).png.61e5ef8e0cd4a73e66aa174832d027ae.png

Eu sou:

Scripter: 25%

Mapper: 85%

Programador: 40%

Website : 36%

1465691620_TwyIHBJ(2).png.61e5ef8e0cd4a73e66aa174832d027ae.png

 

  • Respostas 7
  • Visualizações 4.5k
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

  • 1 month later...
Postado
Em 02/12/2019 em 20:59, flahrenheit disse:

Amigo, baixei varios Otclient e em nenhum encontrei esse arquivo map.ccp

 

é map.cpp  e é na source isso, voce pode baixar a source no github do otclient.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo