Skip to content

Character Auto Attacks Npc

Featured Replies

Hello, i have problem with my buffer, when I target it and click character auto attacks it, how to fix this problem?

Solved by Nightw0lf

the buffer works as it could?,whats the type of it?If its L2Monster then there is the problem,check it.

Edited by Lineage 2 Ramon

  • Author

the buffer works as it could?,whats the type of it?If its L2Monster then there is the problem,check it.

Buffer works perfectly, it's instanced buffer, type - L2Buffer

  • Author

hmm,try to change the id of the npc,the template or w\e

I've tried this, but nothing...

The problem occur only on this npc or you can attack any npc ?

  • Author

The problem occur only on this npc or you can attack any npc ?

Only for this...   IMO problem is in instance code, here: 

 

 @Override
    public void onAction(L2PcInstance player)
    {
      if (this != player.getTarget()) {
         player.setTarget(this);
         player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
         player.sendPacket(new ValidateLocation(this));
      }
      else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false)) {
         player.setCurrentFolkNPC(this);
         showMessageWindow(player);
         player.sendPacket(ActionFailed.STATIC_PACKET);
      }
      else {
         player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
         player.sendPacket(ActionFailed.STATIC_PACKET);
      }
    }

Edited by Meikis

  • Solution

delete this player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);

change the whole action from some other npc should be the best choice

Edited by Nightw0lf

lol :troll:

 

Why so much (useless) checks .. Intention attack, huehue.. Anyway, take a look at any other instance and c/p it if you are not sure what should you put :)

  • Author

lol :troll:

 

Why so much (useless) checks .. Intention attack, huehue.. Anyway, take a look at any other instance and c/p it if you are not sure what should you put :)

 

What you mean saying useless checkS, if something is useless it is only - intention check

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.