Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''otx2''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 2 registros

  1. Scripting NPC não responde

    Olá comunidade, tenho um problema "um pouco grave a ser resolvido", meus npcs que estão abaixo do quarto andar não me respondem, mesmo usando a lib original do otx2 eu percebi que npcs sumonados e/ou npcs abaixo do quarto andar nao respondem. eu ja tentei de tudo mas n consigo. alguem tem ideia do que poderia ser? eu uso otx2 original baixei recentemente do github, e esse problema é persistente. pensei em alguma função do npc.lua ja testei com xml. lua. tudo e nada deu. o problema ta na configuração do proprio otx2.
  2. getCreaturePathTo

    Para TFS 0.4/0.3.6 e OTX2 Em luascript.h depois de: static int32_t luaGetCreatureName(lua_State* L); Adicionar: static int32_t luaGetCreaturePathTo(lua_State* L); Em luascript.cpp depois de: //getCreatureName(cid) lua_register(m_luaState, "getCreatureName", LuaInterface::luaGetCreatureName); Adicionar: //getCreaturePathTo(cid, pos, maxSearchDist) lua_register(m_luaState, "getCreaturePathTo", LuaInterface::luaGetCreaturePathTo); Depois de: int32_t LuaInterface::luaGetCreatureName(lua_State* L) { //getCreatureName(cid) ScriptEnviroment* env = getEnv(); if(Creature* creature = env->getCreatureByUID(popNumber(L))) lua_pushstring(L, creature->getName().c_str()); else { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); } return 1; } Adicionar: int32_t LuaInterface::luaGetCreaturePathTo(lua_State* L) { //getCreaturePathTo(cid, pos, maxSearchDist) ScriptEnviroment* env = getEnv(); int32_t maxSearchDist = popNumber(L); PositionEx position; popPosition(L, position); Creature* creature = env->getCreatureByUID(popNumber(L)); if (!creature) { lua_pushnil(L); return 1; } std::list<Direction> dirList; lua_newtable(L); if (g_game.getPathTo(creature, position, dirList, maxSearchDist)) { std::list<Direction>::const_iterator it = dirList.begin(); for (int32_t index = 1; it != dirList.end(); ++it, ++index) { lua_pushnumber(L, index); lua_pushnumber(L, (*it)); pushTable(L); } } else { lua_pushboolean(L, false); } return 1; } E sejam felizes! getCreaturePathTo(cid, position, maxSearchDist) retornará uma tabela com as direções que o jogador deve seguir para chegar no ponto position. Não contem posições que ele deve passar por.
×