Postado Junho 22, 2016 8 anos tem que ser feito pelar sources em c++ bool InstantSpell::SearchPlayer(const InstantSpell*, Creature* creature, const std::string& param) { //a. From 1 to 4 sq's [Person] is standing next to you. //b. From 5 to 100 sq's [Person] is to the south, north, east, west. //c. From 101 to 274 sq's [Person] is far to the south, north, east, west. //d. From 275 to infinite sq's [Person] is very far to the south, north, east, west. //e. South-west, s-e, n-w, n-e (corner coordinates): this phrase appears if the player you're looking for has moved five squares in any direction from the south, north, east or west. //f. Lower level to the (direction): this phrase applies if the person you're looking for is from 1-25 squares up/down the actual floor you're in. //g. Higher level to the (direction): this phrase applies if the person you're looking for is from 1-25 squares up/down the actual floor you're in. Player* player = creature->getPlayer(); if (!player) { return false; } enum distance_t { DISTANCE_BESIDE, DISTANCE_CLOSE, DISTANCE_FAR, DISTANCE_VERYFAR, }; enum direction_t { DIR_N, DIR_S, DIR_E, DIR_W, DIR_NE, DIR_NW, DIR_SE, DIR_SW, }; enum level_t { LEVEL_HIGHER, LEVEL_LOWER, LEVEL_SAME, }; Player* playerExiva = g_game.getPlayerByName(param); if (!playerExiva) { return false; } if (playerExiva->isAccessPlayer() && !player->isAccessPlayer()) { player->sendCancelMessage(RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE); g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF); return false; } const Position& lookPos = player->getPosition(); const Position& searchPos = playerExiva->getPosition(); int32_t dx = Position::getOffsetX(lookPos, searchPos); int32_t dy = Position::getOffsetY(lookPos, searchPos); int32_t dz = Position::getOffsetZ(lookPos, searchPos); distance_t distance; direction_t direction; level_t level; //getting floor if (dz > 0) { level = LEVEL_HIGHER; } else if (dz < 0) { level = LEVEL_LOWER; } else { level = LEVEL_SAME; } //getting distance if (std::abs(dx) < 4 && std::abs(dy) < 4) { distance = DISTANCE_BESIDE; } else { int32_t distance2 = dx * dx + dy * dy; if (distance2 < 10000) { distance = DISTANCE_CLOSE; } else if (distance2 < 75076) { distance = DISTANCE_FAR; } else { distance = DISTANCE_VERYFAR; } } //getting direction float tan; if (dx != 0) { tan = static_cast<float>(dy) / dx; } else { tan = 10.; } if (std::abs(tan) < 0.4142) { if (dx > 0) { direction = DIR_W; } else { direction = DIR_E; } } else if (std::abs(tan) < 2.4142) { if (tan > 0) { if (dy > 0) { direction = DIR_NW; } else { direction = DIR_SE; } } else { if (dx > 0) { direction = DIR_SW; } else { direction = DIR_NE; } } } else { if (dy > 0) { direction = DIR_N; } else { direction = DIR_S; } } std::ostringstream ss; ss << playerExiva->getName(); if (distance == DISTANCE_BESIDE) { if (level == LEVEL_SAME) { ss << " is standing next to you."; } else if (level == LEVEL_HIGHER) { ss << " is above you."; } else if (level == LEVEL_LOWER) { ss << " is below you."; } } else { switch (distance) { case DISTANCE_CLOSE: if (level == LEVEL_SAME) { ss << " is to the "; } else if (level == LEVEL_HIGHER) { ss << " is on a higher level to the "; } else if (level == LEVEL_LOWER) { ss << " is on a lower level to the "; } break; case DISTANCE_FAR: ss << " is far to the "; break; case DISTANCE_VERYFAR: ss << " is very far to the "; break; default: break; } switch (direction) { case DIR_N: ss << "north."; break; case DIR_S: ss << "south."; break; case DIR_E: ss << "east."; break; case DIR_W: ss << "west."; break; case DIR_NE: ss << "north-east."; break; case DIR_NW: ss << "north-west."; break; case DIR_SE: ss << "south-east."; break; case DIR_SW: ss << "south-west."; break; } } player->sendTextMessage(MESSAGE_INFO_DESCR, ss.str()); g_game.addMagicEffect(player->getPosition(), CONST_ME_MAGIC_BLUE); return true; } obs: n sei mexer em c++, mas tem que editar essa função e compilar seu distro de novo [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 22, 2016 8 anos Eu ri da ideia desse cara kk Mano, lembra de colocar exaust nisso, pois senão o cara que ficar usando o ant exiva toda hora ira utilizar igual utevo lux e ngm ira achalo no server. Vodkart acredito que tenha como criar uma tabela no banco de dados na parte players, e quando na tabela fica 1 e o outro player tenta exivar, o exiva procura nessa tabela e se tiver 1 da a msg dizendo que não pode exivar e da as nuvens, e etc kkkk e quando no banco tiver 0 o exiva funciona normalmente. no scrip ele ira ler essa tabela, se tiver 1 não pode ser encontrado o player, se tiver 0 o player é achado. e na spells Exana exiva, ira adicionar temporariamente +1 na tabela(2min) e depois ira remover pra 0
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.