Ir para conteúdo

Featured Replies

Postado

alguem pode me dizer onde modifico no game.cpp pra puxa a distancia com delay de 2 sec no meu ta 0 uso source 0.4 do Fir3element

 

se poder edita pra mim agradeço... REP+

http://www.4shared.com/file/ydajrJSwba/game.html?

 

GAME.CPP PARTE DO MOVINGCREATURE

Spoiler

    if(Creature* movingCreature = thing->getCreature())
    {
        uint32_t delay = g_config.getNumber(ConfigManager::PUSH_CREATURE_DELAY);
        if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 0
            && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
        {
            SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::playerMoveCreature, this,
                player->getID(), movingCreature->getID(), movingCreature->getPosition(), toCylinder->getPosition()));
            player->setNextActionTask(task);
        }
        else
            playerMoveCreature(playerId, movingCreature->getID(), movingCreature->getPosition(), toCylinder->getPosition());
    }
    else if(thing->getItem())
        playerMoveItem(playerId, fromPos, spriteId, fromStackpos, toPos, count);

    return true;
}

bool Game::playerMoveCreature(uint32_t playerId, uint32_t movingCreatureId,
    const Position& movingCreaturePos, const Position& toPos)
{
    Player* player = getPlayerByID(playerId);
    if(!player || player->isRemoved() || player->hasFlag(PlayerFlag_CannotMoveCreatures))
        return false;

    if(!player->canDoAction())
    {
        uint32_t delay = player->getNextActionTime();
        SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::playerMoveCreature,
            this, playerId, movingCreatureId, movingCreaturePos, toPos));

        player->setNextActionTask(task);
        return false;
    }

    Creature* movingCreature = getCreatureByID(movingCreatureId);
    if(!movingCreature || movingCreature->isRemoved() || movingCreature->getNoMove())
        return false;

    player->setNextActionTask(NULL);
    if(!Position::areInRange<1,1,0>(movingCreaturePos, player->getPosition()) && !player->hasCustomFlag(PlayerCustomFlag_CanMoveFromFar))
    {
        //need to walk to the creature first before moving it
        std::list<Direction> listDir;
        if(getPathToEx(player, movingCreaturePos, listDir, 0, 1, true, true))
        {
            Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
                this, player->getID(), listDir)));
            SchedulerTask* task = createSchedulerTask(player->getStepDuration(),
                boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos));

            player->setNextWalkActionTask(task);
            return true;
        }

 

Editado por guizerah1995 (veja o histórico de edições)

  • Respostas 10
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
13 horas atrás, guizerah1995 disse:

alguem pode me dizer onde modifico no game.cpp pra puxa a distancia com delay de 2 sec no meu ta 0 uso source 0.4 do Fir3element

 

se poder edita pra mim agradeço... REP+

http://www.4shared.com/file/ydajrJSwba/game.html?

 

Não tenho como baixar o arquivo, mas...

game.cpp, procurar por:

SchedulerTask* task = createSchedulerTask(std::max((int32_t)SCHEDULER_MINTICKS, player->getStepDuration()),
    boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, false));

Alterar para:

SchedulerTask* task = createSchedulerTask(std::max((int32_t)SCHEDULER_MINTICKS, player->getStepDuration()),
    boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, true));

(Alterar apenas o false para true no final da segunda linha.)

asdukeeh.jpg

Postado
  • Autor
20 horas atrás, DukeeH disse:

Não tenho como baixar o arquivo, mas...

game.cpp, procurar por:


SchedulerTask* task = createSchedulerTask(std::max((int32_t)SCHEDULER_MINTICKS, player->getStepDuration()),
    boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, false));

Alterar para:


SchedulerTask* task = createSchedulerTask(std::max((int32_t)SCHEDULER_MINTICKS, player->getStepDuration()),
    boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, true));

(Alterar apenas o false para true no final da segunda linha.)

n tem essa parte no game.cpp eu tentei por true + deu erro na hr de compilar :/ depos do toPos,... olha como ta no meu game.cpp

 

Spoiler

    if(Creature* movingCreature = thing->getCreature())
    {
        uint32_t delay = g_config.getNumber(ConfigManager::PUSH_CREATURE_DELAY);
        if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 0
            && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
        {
            SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::playerMoveCreature, this,
                player->getID(), movingCreature->getID(), movingCreature->getPosition(), toCylinder->getPosition()));
            player->setNextActionTask(task);
        }
        else
            playerMoveCreature(playerId, movingCreature->getID(), movingCreature->getPosition(), toCylinder->getPosition());
    }
    else if(thing->getItem())
        playerMoveItem(playerId, fromPos, spriteId, fromStackpos, toPos, count);

    return true;
}

bool Game::playerMoveCreature(uint32_t playerId, uint32_t movingCreatureId,
    const Position& movingCreaturePos, const Position& toPos)
{
    Player* player = getPlayerByID(playerId);
    if(!player || player->isRemoved() || player->hasFlag(PlayerFlag_CannotMoveCreatures))
        return false;

    if(!player->canDoAction())
    {
        uint32_t delay = player->getNextActionTime();
        SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::playerMoveCreature,
            this, playerId, movingCreatureId, movingCreaturePos, toPos));

        player->setNextActionTask(task);
        return false;
    }

    Creature* movingCreature = getCreatureByID(movingCreatureId);
    if(!movingCreature || movingCreature->isRemoved() || movingCreature->getNoMove())
        return false;

    player->setNextActionTask(NULL);
    if(!Position::areInRange<1,1,0>(movingCreaturePos, player->getPosition()) && !player->hasCustomFlag(PlayerCustomFlag_CanMoveFromFar))
    {
        //need to walk to the creature first before moving it
        std::list<Direction> listDir;
        if(getPathToEx(player, movingCreaturePos, listDir, 0, 1, true, true))
        {
            Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
                this, player->getID(), listDir)));
            SchedulerTask* task = createSchedulerTask(player->getStepDuration(),
                boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos));

            player->setNextWalkActionTask(task);
            return true;
        }

 

Postado
43 minutos atrás, guizerah1995 disse:

n tem essa parte no game.cpp eu tentei por true + deu erro na hr de compilar :/ depos do toPos,... olha como ta no meu game.cpp

 

Hmm, minhas sources são diferentes.

Faz o seguinte:

if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 0
			&& !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
		{

Alterar para:

if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 2000
			&& !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
		{

(isso são 2 segundos, alterar para 1000 caso queira 1)

asdukeeh.jpg

Postado
  • Autor
48 minutos atrás, DukeeH disse:

Hmm, minhas sources são diferentes.

Faz o seguinte:


if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 0
			&& !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
		{

Alterar para:


if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 2000
			&& !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
		{

(isso são 2 segundos, alterar para 1000 caso queira 1)

infelizmente n funciono e tmb push de perto e de longe fico 0 sec ja tinha tentado bota 1000 + tentei dnv só pra ver :/

Editado por guizerah1995 (veja o histórico de edições)

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.6k

Informação Importante

Confirmação de Termo