Jump to content
  • 0

Prevent Npc's Heading Being Adjusted To Player's Heading.


Question

Posted (edited)

I don't know but it might client side(but i think it can be changed from server side since client shows server's values, right? :P). I was wondering, is there any way to prevent NPCs change their heading according to player's? When a player speaks to an NPC, this NPC change its face to the player so player and NPC can have their "conversation. I know that this is taking place to some templates only, but i think it can be changed from server (enlighten me).

 

EDIT: L2jserver high five.

Edited by Solomun

Recommended Posts

  • 0
Posted (edited)

MoveToPawn is the key, it makes character go to npc and when it is close, run function that turns npc around. You cannot drop that packet, because it would be impossible to come near Npcs. To fix this problem you need to dig into Engine.dll and drop  ?AdjustPawnLocation@UGameEngine@@QAEXPAVAPawn@@ABVFVector@@@Z calls.

 

egjE0iD.png

Edited by vampir
  • 0
Posted

First of all, NPC heading never changes, its just an effect only the player who target can see.

 

Its a ServerPacket, I don't really remember its name but you will find it if you look at methods onAction L2NPC and friends

  • 0
Posted

First of all, NPC heading never changes, its just an effect only the player who target can see.

 

Its a ServerPacket, I don't really remember its name but you will find it if you look at methods onAction L2NPC and friends

I have searched already there. However, since NPC heading is never changed and this happens only to specific NPCs, it can be client side, right? 

  • 0
Posted

I tried this, but it ain't working..

 

MoveToPawn.java

 

 

.

.

.

@Override
protected final void writeImpl()
{
  if (target instanceof L2Npc)
  {
   L2Npc npc = (L2Npc) target;
   if (npc.getId() == 37004) //My custom NPC id
   {

    return;
   }
  }
  writeC(0x72);
 
  writeD(_charObjId);
  writeD(_targetId);
  writeD(_distance);

.

.

.

 

 

 

In case it plays any role (i doubt it), i forget to mention that i am working on L2jserver High Five.

  • 0
Posted

My answer is the only good answer. L2J didn't have that behavior for a very long time, from IL to latest, I'm the one who reported it.

 

http://www.l2jserver.com/forum/viewtopic.php?f=90&t=23583

 

And how exactly id differs from mine? You repeated the same thing only adding the severpacket's name

  • 0
Posted

And how exactly id differs from mine? You repeated the same thing only adding the severpacket's name

 

Mate, stop the ego bullshit, I could even say "I gave the answer back in 2011, you only repeat what I say in 2011" if we go on that way.

 

Grow up, one day. I hope.

 

By "my answer is the only good answer", I meant there is no other possibility. If you feel buttfuck, that's only your problem.

  • 0
Posted (edited)

Mate, stop the ego bullshit, I could even say "I gave the answer back in 2011, you only repeat what I say in 2011" if we go on that way.

 

Grow up, one day. I hope.

 

By "my answer is the only good answer", I meant there is no other possibility. If you feel buttfuck, that's only your problem.

Huh man, dont waste time on that retard, simply ignore him, dont read his trash ...

Edited by LightFusion
  • 0
Posted

Mate, stop the ego bullshit, I could even say "I gave the answer back in 2011, you only repeat what I say in 2011" if we go on that way.

 

Grow up, one day. I hope.

 

By "my answer is the only good answer", I meant there is no other possibility. If you feel buttfuck, that's only your problem.

 

whose buttfuck me or you? I didn't said it to offend you if thats what you believe. I just said that the solution was already given but you repeated it in a way that you proposed something different whereas you could simply agree and include the serverpacket name.

 

No hard feelings whatsoever, look at the post bellow you, you now have a new girlfriend pet.

  • 0
Posted (edited)

data\scripts\handlers\actionhandlers\L2NpcAction.java

 

I have done this, but NPC is turning even if the packet is not being sent.

 

 

 

// Turn NPC to the player.
     if (npc.getId() != 37004) //NPC id i want to prevent from turning
     {
      activeChar.sendPacket(new MoveToPawn(activeChar, npc, 100));
     }

 

 

 

In case u didnt mean this Tryskell, could you explain it better, of what should i do in order to fix it?

 

EDIT:

 

On the same file (l2npcaction) some lines below, i added this IF statement:

 

 

else
      {
       if (npc.getId() != 37004)
       {
        npc.showChatWindow(activeChar);
       }
      }

 

 

 

Now, as it is natural, when i talk to the NPC it doesnt open its HTML, but in addition, it doesnt turning either...which means, i ve no idea how to continue :( Of course i checked showChatWindow method, but nothing related to position or something...

Edited by Solomun
  • 0
Posted

Verify with L2PHX if you end getting the packet or no. The rotation effect is only due to this packet call (at least up to Hi5). Maybe L2J got it in 2 different places, so if you drop it somewhere it still calls it from another location.

  • 0
Posted

The only classes that call-use MoveToPawn packet is L2NpcAction in datapack (I have tried to prevent it) and 2 times in L2AbstractAI which is (with my poor knowledge) using it in order to make the L2PcInstance player move close to npc if he targets it from range. For example i am at giran maximillian and target the gatekeeper, my char walks to the GK and then L2NpcAction is taking effect...

 

P.S: I hope i was clear...posting from phone :)

  • 0
Posted

he gave you the "only correct answer"

 

still bumping? kappa

Since my problem ain't solved why shouldn't i bump? I tried what Tryskell said, or at least what i understood from what Tryskell said but it did not work, so...

Guest
This topic is now closed to further replies.


×
×
  • Create New...