[HELP] Set in front of player

Hi !

After many researches on the web and on trinity forum, I couldn’t find a good answer.

I would like my NPC turns aside to the player, I know how, many ways :

me->SetUInt64Value(UNIT_FIELD_TARGET, player->GetGUID());

creature->SetFacingToObject(player);
creature->SetInFront(player);

But I don’t know how to select the player to allow the movement.

Moreover, I would know how disable combat movements with C++ command.

If you need more informations about that. I hope I’ve been clear.

Thanks !

Actually, we’d need to know what type of script you script, e.g. if you want to select the player nearest to the npc or a player coming with a quest, etc.

Hi !

I solved my problem :

I use :

if (Player* pPlayer = me->FindNearestPlayer(10.0f, true))
me->SetFacingToObject(pPlayer);

It works perfectly ^^