Ir para conteúdo
  • Cadastre-se

OTClient Aumentando o campo de visão do jogador - Adding more tiles to game window


Posts Recomendados

 

 

Acredito que é interessante que este tutorial esteja também no TibiaKing. 

Créditos ao Flatlander e Animera pelo tutorial inicial. Realizei algumas atualizações.

 

Descrição: Com estas alterações nas sources do servidor e do OTC você conseguirá aumentar a visão do jogador (terá mais SQMs disponíveis na tela.)

 

separador.png

Server sources.

No arquivo const.h altere isso:

#define NETWORKMESSAGE_MAXSIZE 24590

Para isso:

#define NETWORKMESSAGE_MAXSIZE 49180

 

No arquivo protocolgame.cpp

Em

bool ProtocolGame :: canSee (int32_t x, int32_t y, int32_t z) const

Altere isso:

if ((x >= myPos.getX() - 8 + offsetz) && (x <= myPos.getX() + 9 + offsetz) &&
     (y >= myPos.getY() - 6 + offsetz) && (y <= myPos.getY() + 7 + offsetz)) {

Para isso:

 if ((x >= myPos.getX() - Map::maxClientViewportX + offsetz) && (x <= myPos.getX() + (Map::maxClientViewportX+1) + offsetz) &&
     (y >= myPos.getY() - Map::maxClientViewportY + offsetz) && (y <= myPos.getY() + (Map::maxClientViewportY+1) + offsetz)) {

 

Em

void ProtocolGame :: sendMapDescription (const Position & pos)

 Altere isso:

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

Para isso:

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

 

 

 Em

void ProtocolGame :: sendMoveCreature (const Creature * criatura, const Position & newPos, int32_t newStackPos, const Position & oldPos, int32_t oldStackPos, bool teleport)

 Altere isso:

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);
}

Para isso:

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);
}

 

 Em

void ProtocolGame :: MoveUpCreature (NetworkMessage & msg, const Creature * criatura, const Position & newPos, const Position & oldPos)

 Altere isso:

if (newPos.z == 7) {
   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);

Para isso:

if (newPos.z == 7) {
   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);

 Logo abaixo, altere isso:

else if (newPos.z > 7) {
   int32_t skip = -1;
   GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, oldPos.getZ() - 3, 18, 14, 3, skip);

 Para isso:

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

Logo abaixo, altere isso:

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

Para isso:

//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);

 

 Em

void ProtocolGame :: MoveDownCreature (NetworkMessage & msg, const Creature * criatura, const Position & newPos, const Position & oldPos)

 Altere isso:

//going from surface to underground
if (newPos.z == 8) {
   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);

Para isso:

//going from surface to underground
if (newPos.z == 8) {
   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);

Logo abaixo, altere:

//going further down
else if (newPos.z > oldPos.z && newPos.z > 8 && newPos.z < 14) {
   int32_t skip = -1;
   GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 2, 18, 14, -3, skip);

Para isso:

//going further down
else if (newPos.z > oldPos.z && newPos.z > 8 && newPos.z < 14) {
   int32_t skip = -1;
   GetFloorDescription(msg, oldPos.x - 8, oldPos.y - 6, newPos.z + 2, 18, 14, -3, skip);

E logo abaixo disso, altere:

//moving down a floor makes us out of sync
//east
msg.addByte(0x66);
GetMapDescription(oldPos.x + 9, oldPos.y - 7, newPos.z, 1, 14, msg);
//south
msg.addByte(0x67);
GetMapDescription(oldPos.x - 8, oldPos.y + 7, newPos.z, 18, 1, msg);

Para isso:

//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);

 

Estas alterações são aplicadas para o TFS 1.x, se você estiver utilizando o TFS 1.3 ou superior, você deve substituir AddByte para addByte e se você estiver alterando as sources do TFS abaixo do TFS 1.x você ainda deve realizar as seguintes alterações em protocolgame.cpp

Alterar isso:

void ProtocolGame::AddMapDescription(NetworkMessage_ptr msg, const Position& pos)
{
  msg->put<char>(0x64);
  msg->putPosition(player->getPosition());
  GetMapDescription(pos.x - 8, pos.y - 6, pos.z, 18, 14, msg);
}

Para isso:

void ProtocolGame::AddMapDescription(NetworkMessage_ptr msg, const Position& pos)
{
  msg->put<char>(0x64);
  msg->putPosition(player->getPosition());
  GetMapDescription(pos.x - 8, pos.y - 6, pos.z, 18, 14, msg);
}

 

Estas são todas as alterações em protocolgame.cpp

 

Client sources

Agora no arquivo map.cpp

Altere isso:

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

Para isso:

{
   AwareRange range;
   range.left = 8; //Altere este 8 para o mesmo valor que você clocou do maxClientViewportX em map.h
   range.top = 6; //Altere este 6 para o mesmo valor que você clocou do maxClientViewportY em map.h
   range.bottom = range.top+1;
   range.right = range.left+1;
   setAwareRange(range);
}

 

 

E no arquivo creature.cpp

Altere isso

bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRangeX, int32_t viewRangeY)
{
   if (myPos.z <= 7) {
       //we are on ground level or above (7 -> 0)
       //view is from 7 -> 0
       if (pos.z > 7) {
           return false;
       }
   } else if (myPos.z >= 8) {
       //we are underground (8 -> 15)
       //view is +/- 2 from the floor we stand on
       if (Position::getDistanceZ(myPos, pos) > 2) {
           return false;
       }
   }

   const int_fast32_t offsetz = myPos.getZ() - pos.getZ();
   return (pos.getX() >= myPos.getX() - viewRangeX + offsetz) && (pos.getX() <= myPos.getX() + viewRangeX + offsetz)
       && (pos.getY() >= myPos.getY() - viewRangeY + offsetz) && (pos.getY() <= myPos.getY() + viewRangeY + offsetz);
}

Para isso:

bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRangeX, int32_t viewRangeY)
{
   if (myPos.z <= 7) {
       //we are on ground level or above (7 -> 0)
       //view is from 7 -> 0
       if (pos.z > 7) {
           return false;
       }
   } else if (myPos.z >= 8) {
       //we are underground (8 -> 15)
       //view is +/- 2 from the floor we stand on
       if (Position::getDistanceZ(myPos, pos) > 2) {
           return false;
       }
   }

   const int_fast32_t offsetz = myPos.getZ() - pos.getZ();
   return (pos.getX() >= myPos.getX() - Map::maxViewportX + offsetz) && (pos.getX() <= myPos.getX() + Map::maxViewportX + offsetz)
       && (pos.getY() >= myPos.getY() - Map::maxViewportY + offsetz) && (pos.getY() <= myPos.getY() + Map::maxViewportY + offsetz);
}

 

 

Fim! Estas são todas as alterações, eu adicionei algumas novas atualizações e melhorias além das descritas no tópico original, obrigado novamente ao Flatlander e Animera.

 

separador.png

 

 

Editado por EddyHavoc (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • EddyHavoc mudou o título para Aumentando o campo de visão do jogador - Adding more tiles to game window
  • 4 weeks later...
  • 2 months later...

@CaduGTX As alterações que você fez nas Sources do Servidor aparentemente estão corretas.


A tela ficou desta forma porquê você precisa aplicar agora as alterações nas Sources do OTClient conforme explicado no tópico.

 

Spoiler

Client sources

Agora no arquivo map.cpp

Altere isso:


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

Para isso:


{
   AwareRange range;
   range.left = 8; //Altere este 8 para o mesmo valor que você clocou do maxClientViewportX em map.h
   range.top = 6; //Altere este 6 para o mesmo valor que você clocou do maxClientViewportY em map.h
   range.bottom = range.top+1;
   range.right = range.left+1;
   setAwareRange(range);
}

 

 

E no arquivo creature.cpp

Altere isso


bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRangeX, int32_t viewRangeY)
{
   if (myPos.z <= 7) {
       //we are on ground level or above (7 -> 0)
       //view is from 7 -> 0
       if (pos.z > 7) {
           return false;
       }
   } else if (myPos.z >= 8) {
       //we are underground (8 -> 15)
       //view is +/- 2 from the floor we stand on
       if (Position::getDistanceZ(myPos, pos) > 2) {
           return false;
       }
   }

   const int_fast32_t offsetz = myPos.getZ() - pos.getZ();
   return (pos.getX() >= myPos.getX() - viewRangeX + offsetz) && (pos.getX() <= myPos.getX() + viewRangeX + offsetz)
       && (pos.getY() >= myPos.getY() - viewRangeY + offsetz) && (pos.getY() <= myPos.getY() + viewRangeY + offsetz);
}

Para isso:


bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRangeX, int32_t viewRangeY)
{
   if (myPos.z <= 7) {
       //we are on ground level or above (7 -> 0)
       //view is from 7 -> 0
       if (pos.z > 7) {
           return false;
       }
   } else if (myPos.z >= 8) {
       //we are underground (8 -> 15)
       //view is +/- 2 from the floor we stand on
       if (Position::getDistanceZ(myPos, pos) > 2) {
           return false;
       }
   }

   const int_fast32_t offsetz = myPos.getZ() - pos.getZ();
   return (pos.getX() >= myPos.getX() - Map::maxViewportX + offsetz) && (pos.getX() <= myPos.getX() + Map::maxViewportX + offsetz)
       && (pos.getY() >= myPos.getY() - Map::maxViewportY + offsetz) && (pos.getY() <= myPos.getY() + Map::maxViewportY + offsetz);
}

 

 

 

Link para o post
Compartilhar em outros sites
1 minuto atrás, EddyHavoc disse:

@CaduGTX As alterações que você fez nas Sources do Servidor aparentemente estão corretas.


A tela ficou desta forma porquê você precisa aplicar agora as alterações nas Sources do OTClient conforme explicado no tópico.

 

  Mostrar conteúdo oculto

Client sources

Agora no arquivo map.cpp

Altere isso:





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

Para isso:





{
   AwareRange range;
   range.left = 8; //Altere este 8 para o mesmo valor que você clocou do maxClientViewportX em map.h
   range.top = 6; //Altere este 6 para o mesmo valor que você clocou do maxClientViewportY em map.h
   range.bottom = range.top+1;
   range.right = range.left+1;
   setAwareRange(range);
}

 

 

E no arquivo creature.cpp

Altere isso





bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRangeX, int32_t viewRangeY)
{
   if (myPos.z <= 7) {
       //we are on ground level or above (7 -> 0)
       //view is from 7 -> 0
       if (pos.z > 7) {
           return false;
       }
   } else if (myPos.z >= 8) {
       //we are underground (8 -> 15)
       //view is +/- 2 from the floor we stand on
       if (Position::getDistanceZ(myPos, pos) > 2) {
           return false;
       }
   }

   const int_fast32_t offsetz = myPos.getZ() - pos.getZ();
   return (pos.getX() >= myPos.getX() - viewRangeX + offsetz) && (pos.getX() <= myPos.getX() + viewRangeX + offsetz)
       && (pos.getY() >= myPos.getY() - viewRangeY + offsetz) && (pos.getY() <= myPos.getY() + viewRangeY + offsetz);
}

Para isso:





bool Creature::canSee(const Position& myPos, const Position& pos, int32_t viewRangeX, int32_t viewRangeY)
{
   if (myPos.z <= 7) {
       //we are on ground level or above (7 -> 0)
       //view is from 7 -> 0
       if (pos.z > 7) {
           return false;
       }
   } else if (myPos.z >= 8) {
       //we are underground (8 -> 15)
       //view is +/- 2 from the floor we stand on
       if (Position::getDistanceZ(myPos, pos) > 2) {
           return false;
       }
   }

   const int_fast32_t offsetz = myPos.getZ() - pos.getZ();
   return (pos.getX() >= myPos.getX() - Map::maxViewportX + offsetz) && (pos.getX() <= myPos.getX() + Map::maxViewportX + offsetz)
       && (pos.getY() >= myPos.getY() - Map::maxViewportY + offsetz) && (pos.getY() <= myPos.getY() + Map::maxViewportY + offsetz);
}

 

 

 

Acho que meu client ja tem essas configs, baixei recentemente no OTCV8.

Então no caso, isso só funcionaria no otclient? 
Sei que não rodaria no tibia 12, mas ele nem loga, crashando, pra isso talvez teria que ter alguma verificação de client para aplicar?

Editado por CaduGTX (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
3 minutos atrás, CaduGTX disse:

Acho que meu client ja tem essas configs, baixei recentemente no OTCV8.

Então no caso, isso só funcionaria no otclient? 
Sei que não rodaria no tibia 12, mas ele nem loga, crashando, pra isso talvez teria que ter alguma verificação de client para aplicar?


No Tibia 12 não deve rodar, é exclusivo para OTClient, (OTCV8 é OTClient.)

As sources do OTCV8 não são públicas, porém eles disponibilizaram Features onde é possível habilitar esta modificação. Você terá que pesquisar ou migrar para um OTClient Open Source.
 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Kiman174
      GRIMHAVEN SEASON 4
      LAUNCHING APRIL 18TH 19:00 CEST
       
      Join our community and stay up to date:
      Official Discord Server
       
       
       
       
       
      Step into a world where passion meets innovation—welcome to Grimhaven MMORPG! Born from a heartfelt passion project, Grimhaven has evolved into an extraordinary realm where every pixel on our meticulously crafted Real Map tells a story. Leveraging the classic legacy of version 8.6 and elevated by inventive custom content, our server transcends traditional gameplay, inviting you into a living, breathing adventure at every turn.
       
       
      Explore sprawling landscapes, battle formidable foes, and uncover hidden lore as you journey through environments that blend classic mechanics with innovative systems. Every corner of Grimhaven pulses with life and mystery, inviting you to forge alliances, challenge epic quests, and redefine what you thought possible in an open Tibia server. With each update, our dedicated team pushes the envelope, ensuring that every raid, dungeon, and social encounter feels fresh and electrifying.
       
       
      Whether you're a seasoned adventurer or new to the realm, Grimhaven offers a thrilling escape into a world where the spirit of discovery and the thrill of combat come together in perfect harmony. Embrace the extraordinary—your adventure begins now in Grimhaven MMORPG!
       
       
      What Makes Grimhaven Stand Out?
       
      With over thousands of hours of development and 4000+ commits, Grimhaven stands out with its unique blend of classic and innovative MMORPG features. Built on an authentic Real Map with 8.6 mechanics and expanded with carefully designed custom content, the experience is unmatched. The server offers rates starting from 12x, stunning HD visuals, and intricately scripted quests that immerse you in a dynamic narrative. From challenging custom raid bosses to a refined item system inspired by classic action RPGs, every element is thoughtfully crafted to deliver an engaging and ever-evolving adventure, all backed by a dedicated team ensuring a top-tier gaming experience.
       
       
       
      Custom Zones :
      Explore meticulously designed zones that promise unique challenges and unparalleled rewards.
       

       
       
       
      Unique Randomly Generated Dungeons :
      As if that's not enough, brace yourselves for our unique dungeons. Each one is randomly generated, ensuring that no adventure is ever the same. The thrill of exploring the unknown awaits you in every twist and turn.
       


       

       
       


       
       
       
      Scripted and Mechanically Challenging Quests:
      Immerse yourself in intricately designed quests that push your strategic prowess and combat skills, all brought to life by the remarkable creativity of our quest designer and mapper.
       

       

       


       
       
      Mighty Bosses:
      Confront colossal adversaries, each boasting unique abilities and intricate mechanics that challenge your tactics and teamwork, turning every encounter into an unforgettable battle.
       


       
       
       
      Ancient and Mythic Monsters:
      Encounter legendary beasts, ancient guardians, and mythical creatures that not only test your skills and courage but also offer tougher challenges, richer loot drops, and enhanced experience rewards.
       

       
       
       
      Magical Attributes & Crafting:
      Discover a world of enchantment where magical items not only have a chance to drop in the wild, but can also be expertly crafted to bestow unique and powerful attributes on your gear.
       
       

       

       
       
       
      Custom Events :
      We keep the excitement rolling with unique, server-wide events that'll keep you on the edge of your seat. Expect the unexpected!
       
       



       
       
       
      This glimpse barely scratches the surface—there's a TON more content that would overwhelm this thread! To dive even deeper, visit our official wiki at Grimhaven Wiki (https://wiki.grimhaven.net) and create your account today at Latestnews - Grimhaven (https://www.grimhaven.net/) .   
       
      Gear up for an unforgettable adventure starting April 18th 19:00 CEST.
      Dive into a realm of epic rewards, heart-pounding quests, and intense PVP battles where you'll test your skills against others.
      Join a vibrant community of adventurers, embrace the thrill of discovery, and answer the call to glory on the battlefield!
    • Por yezzin
      FALA RAPAZIADA CANSADOS DE JOGAR EM SERVIDORES QUE FECHAM TODA HORA E ADM'S QUE NÃO LIGAM PARA O GAME?
      APRESENTO NTO STORM.

      ⚡NTO STORM⚡
       
       💖Versão 8.60 com OLD e OTC
       💖Task system;
       💖Saga system;
      💖 Outfit/skin system;
       💖Raridade system;
       💖Elo/Kage system;
       💖buff/Aura system;
      💖 Market system;
      💖 Autoloot system;
      💖 Mapa 100% proprio e novinho;
       💖Diversas quest de todos os niveis;
      💖 Vocaçao do dia;
       💖Cast System;
       💖Shop no Game
       💖Mercado Negro;
      💖Upgrade Set;
      💖Refinamento de Armas e Shields;
       💖Evento(castle,Guild castle, eventos, task, bonus, sorteios!
       
      https://discord.gg/un9uewM3Ds
      VOA !!
    • Por OT Archive
      OTClient Redemption (mehah) para navegadores
      Em nome da OTServList Brasil e do OT Archive, adaptei o OTClient Redemption para rodar em navegadores web.
       
       
      Source: https://github.com/mehah/otclient/pull/894 Guia de compilação e uso: https://github.com/OTArchive/otclient/wiki/Guia-‐-OTClient-Redemption-Web Demo sem assets: https://demo.otarchive.com Versão modular: https://webclient.otarchive.com Vídeo demonstrando o client se conectando a um servidor:  


       
       
      Em caso de dúvidas sobre o client web ou sobre servidores com suporte a websockets, por favor poste aqui.
       
      Disponibilizou um client web para seu servidor? Me avise para que eu inclua seu OT na categoria Web na OTServList Brasil, com um botão "Jogar Agora".
    • Por Heyron
      Elysia OT (Global Full 8.60)   IP: elysiaot-global.servegame.com   ✔︎ Login pelo Account Manager 1/1, não temos site. ✔︎ Login zerado é Cast System.   XP (Rates): Stages = Sim Experience = 50.0 Skill = 15.0 Magic = 5.0 Loot = 1.0 Spawn = 1.0 Protection Level: 30   ✔︎ Sem itens VIP. ✔︎ Premiação ao upar nível 20, 50 e 80. ✔︎ Itens iniciais por vocação. ✔︎ Free Bless até o level 50. ✔︎ Danos de spells balanceados. ✔︎ Sem fast attack ou ataque rápido (padrão 2seg). ✔︎ Sem itens infinitos, exceto munição de Paladin.           Jogue agora!   IP: elysiaot-global.servegame.com Versão: 8.60      
    • Por L3K0T
      TUTORIAL BY L3K0T PT~EN
       
      Olá pessoal, trago a vocês uma atualização que fiz no sistema, contendo 3 novas funcionalidades de movimentação de itens e uma proteção contra Elf Bot. Estas adições foram cuidadosamente implementadas para aperfeiçoar a experiência de jogo e manter a integridade do seu servidor.
      As novas funcionalidades têm a função vital de impedir que jogadores deixem itens indesejados em locais inapropriados, como na entrada de sua casa, em cima de seus depósitos ou em teleportes. Agora, apenas proprietários, subproprietários e convidados têm permissão para manipular itens nesses locais.
      Este pacote de atualização foi meticulosamente revisado para evitar abusos por parte de jogadores mal-intencionados e garantir um ambiente de jogo justo e equilibrado para todos os usuários.
       
       
       
      Iniciando o Tutorial
      1Abra o arquivo "creatureevents.cpp" com o editor de sua preferência. Eu pessoalmente recomendo o Notepad++. 
       
       
      Em creatureevents.cpp:
      return "onPrepareDeath"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "onMoveItem"; case CREATURE_EVENT_MOVEITEM2: return "onMoveItem2";  
      Em:
      return "cid, deathList"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "moveItem, frompos, topos, cid"; case CREATURE_EVENT_MOVEITEM2: return "cid, item, count, toContainer, fromContainer, fromPos, toPos";  
      Em:
      m_type = CREATURE_EVENT_PREPAREDEATH; Adicione abaixo:
      else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM; else if(tmpStr == "moveitem2") m_type = CREATURE_EVENT_MOVEITEM2;  
      Procure por:
      bool CreatureEvents::playerLogout(Player* player, bool forceLogout) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGOUT && (*it)->isLoaded() && !(*it)->executeLogout(player, forceLogout) && result) result = false; } return result; } Adicione abaixo:
      uint32_t CreatureEvents::executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos) { // fire global event if is registered for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_MOVEITEM) { if(!(*it)->executeMoveItem(actor, item, frompos, pos)) return 0; } } return 1; }  
      Em:
      bool CreatureEvents::playerLogin(Player* player) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGIN && (*it)->isLoaded() && !(*it)->executeLogin(player) && result) result = false; } if (result) { for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { CreatureEvent* event = *it; if(event->isLoaded() && ( event->getRegister() == "player" || event->getRegister() == "all") ) player->registerCreatureEvent(event->getName()); } } return result; } Adicione Abaixo:
      uint32_t CreatureEvent::executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos) { //onMoveItem(moveItem, frompos, position, cid) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(pos); std::stringstream scriptstream; env->streamThing(scriptstream, "moveItem", item, env->addThing(item)); env->streamPosition(scriptstream, "position", frompos, 0); env->streamPosition(scriptstream, "position", pos, 0); scriptstream << "local cid = " << env->addThing(actor) << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(pos); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); LuaInterface::pushThing(L, item, env->addThing(item)); LuaInterface::pushPosition(L, frompos, 0); LuaInterface::pushPosition(L, pos, 0); lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(4); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } } uint32_t CreatureEvent::executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack) { //onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(player->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; env->streamThing(scriptstream, "item", item, env->addThing(item)); scriptstream << "local count = " << count << std::endl; env->streamThing(scriptstream, "toContainer", toContainer, env->addThing(toContainer)); env->streamThing(scriptstream, "fromContainer", fromContainer, env->addThing(fromContainer)); env->streamPosition(scriptstream, "fromPos", fromPos, fstack); env->streamPosition(scriptstream, "toPos", toPos, 0); scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[30]; sprintf(desc, "%s", player->getName().c_str()); env->setEvent(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(player->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); LuaInterface::pushThing(L, item, env->addThing(item)); lua_pushnumber(L, count); LuaInterface::pushThing(L, toContainer, env->addThing(toContainer)); LuaInterface::pushThing(L, fromContainer, env->addThing(fromContainer)); LuaInterface::pushPosition(L, fromPos, fstack); LuaInterface::pushPosition(L, toPos, 0); //lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(7); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } }  
       
       
      Agora em em creatureevents.h:
      CREATURE_EVENT_PREPAREDEATH, Adicione abaixo:
      CREATURE_EVENT_MOVEITEM, CREATURE_EVENT_MOVEITEM2  
      Em:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList); Adicione abaixo:
      uint32_t executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
      Em:
      bool playerLogout(Player* player, bool forceLogout); Abaixo adicone também
      uint32_t executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
       
      Agora em em game.cpp:
      if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if(ret == RET_NOERROR) return true; player->sendCancelMessage(ret); return false; } Altere para:
      if (!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } bool success = true; CreatureEventList moveitemEvents = player->getCreatureEvents(CREATURE_EVENT_MOVEITEM2); for (CreatureEventList::iterator it = moveitemEvents.begin(); it != moveitemEvents.end(); ++it) { Item* toContainer = toCylinder->getItem(); Item* fromContainer = fromCylinder->getItem(); if (!(*it)->executeMoveItem2(player, item, count, fromPos, toPos, (toContainer ? toContainer : 0), (fromContainer ? fromContainer : 0), fromStackpos) && success) success = false; } if (!success) return false; if (g_config.getBool(ConfigManager::ANTI_PUSH)) { std::string antiPushItems = g_config.getString(ConfigManager::ANTI_PUSH_ITEMS); IntegerVec tmpVec = vectorAtoi(explodeString(antiPushItems, ",")); if (tmpVec[0] != 0) { for (IntegerVec::iterator it = tmpVec.begin(); it != tmpVec.end(); ++it) { if (item->getID() == uint32_t(*it) && player->hasCondition(CONDITION_EXHAUST, 1)) { player->sendTextMessage(MSG_STATUS_SMALL, "Please wait a few seconds to move this item."); return false; } } } } int32_t delay = g_config.getNumber(ConfigManager::ANTI_PUSH_DELAY); if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, delay, 0, false, 1)) player->addCondition(condition); if (!g_creatureEvents->executeMoveItems(player, item, mapFromPos, mapToPos)) return false; ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if (ret != RET_NOERROR) { player->sendCancelMessage(ret); return false; } player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::ACTIONS_DELAY_INTERVAL) - 10); return true; }  
      Agora em configmanager.h
      ADMIN_ENCRYPTION_DATA Adicione abaixo:
      ANTI_PUSH_ITEMS,  
      em:
      STAMINA_DESTROY_LOOT, Adicione abaixo:
      ANTI_PUSH_DELAY,  
      em:
      ADDONS_PREMIUM, Adicione abaixo:
      ANTI_PUSH  
      Agora você pode compilar a Source.
       
       
      Configurando no servidor:
       
      Abra seu config.lua do servidor e adicione isso dentro qualquer lugar:
      -- Anti-Push useAntiPush = true antiPushItems = "2148,2152,2160,3976" antiPushDelay = 500  
       
      Navegue até o diretório 'creaturescripts' e localize o arquivo 'login.lua'.
      em resgistros de eventos adicione:
      login.lua
      registerCreatureEvent(cid, "MoveItem") registerCreatureEvent(cid, "MoveItem2")  
      Agora abra o aquivo creaturescript .xml
      <event type="moveitem" name="MoveItem" event="script" value="houseprotecao.lua"/> <event type="moveitem2" name="MoveItem2" event="script" value="moveitem2.lua"/>  
      Crie um novo arquivo lua em scripts com o nome houseprotecao.lua e adicione isso:
      function onMoveItem(moveItem, frompos, position, cid) if position.x == CONTAINER_POSITION then return true end local house = getHouseFromPos(frompos) or getHouseFromPos(position) --correção 100% if type(house) == "number" then local owner = getHouseOwner(house) if owner == 0 then return false, doPlayerSendCancel(cid, "Isso não é Possível.") end if owner ~= getPlayerGUID(cid) then local sub = getHouseAccessList(house, 0x101):explode("\n") local guest = getHouseAccessList(house, 0x100):explode("\n") local isInvited = false if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then isInvited = true end if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then isInvited = true end if not isInvited then return false, doPlayerSendCancel(cid, "Desculpe, você não está invitado.") end end end return true end  
      Crie um novo arquivo lua em scripts com o nome moveitem2.lua e adicione isso abaixo:
      local depottiles = {} --piso pra n jogar local depots = {2589} --id dos dps local group = 3 --id dos group 6 é todos. local function checkIfThrow(pos,topos) if topos.x == 0xffff then return false end local thing = getThingFromPos(pos) if isInArray(depottiles,thing.itemid) then if not isInArea(topos,{x=pos.x-1,y=pos.y-1,z=pos.z},{x=pos.x+1,y=pos.y+1, z=pos.z}) then return true end else for i = 1, #depots do if depots[i] == getTileItemById(topos,depots[i]).itemid or getTileInfo(topos).actionid == 7483 then return true end end end return false end function onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if isPlayer(cid) then local pos = getThingPos(cid) if getPlayerGroupId(cid) > group then return true end if checkIfThrow({x=pos.x,y=pos.y,z=pos.z,stackpos=0},toPos) then doPlayerSendCancel(cid,"Não jogue item ai!!") doSendMagicEffect(getThingPos(cid),CONST_ME_POFF) return false end end return true end  
      ajudei?? REP+
      CRÉDITOS:
      @L3K0T
      Fir3element
      Summ
      Wise
      GOD Wille
      Yan Lima
       
       
       
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo