Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

galera queria adaptar essa função

int32_t LuaScriptInterface::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;
}

eu queria que quando essa função foce usada em um montros essa linha:

 

lua_pushstring(L, creature->getName().c_str());

 

foce substituída por: 

 

lua_pushstring(L, monster->nomereal.c_str());

 

 

 

 

  • Respostas 5
  • Visualizações 516
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • alguem pode me ajuda com uma dll que faça meu client rodar com sprites extendidas...

Postado
  • Autor

sim mano olha tem uma função abaixo que usar ela 

 

ScriptEnviroment* env = getEnv();
if(Monster* monster = env->getCreatureByUID(popNumber(L))->getMonster())
lua_pushstring(L, monster->realname.c_str());
else
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
}


return 1;
}
Postado

Tenta, não manjo de C++, mas vai que funciona:
 

int32_t LuaScriptInterface::luaGetCreatureName(lua_State* L)
{
    //getCreatureName(cid)
    ScriptEnviroment* env = getEnv();
    if(Creature* creature = env->getCreatureByUID(popNumber(L)))
        if(Monster* monster = env->getCreatureByUID(popNumber(L))->getMonster())
            lua_pushstring(L, monster->realname.c_str());
        else
        {
            lua_pushstring(L, creature->getName().c_str());
        }
    else
    {
        errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
        lua_pushboolean(L, false);
    }
    
    
    return 1;
}
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

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