Jump to content
  • 0

auto target the player when it attacks me


Question

Posted

When a Player attack me, the Character auto target it.
Can it be disabled so it doesn't auto target it?

What i want is it to work like with skills. When you use skills you don't auto target player, but if it is default physical attack you do.

Is it a way to change it?

Recommended Posts

  • 0
Posted
41 minutes ago, Amenadiel said:

if is java it should be either l2character or L2AttackableAI not sure if its l2off then its via the extender 

its java aCis

 

What exactly i need to change or add?

I tried to make some changes with setTarget but it doesn't work.

 

  • 0
Posted

I m interested also for this .. any idea ? I m looking for l2jmobius..

 

Any idea where exactly search?  It's possible to be this by client side ?

  • 0
Posted (edited)

I'm not sure i did understand what you want to do , but i guess when you use a skill on a player and that player has no target , you want that player who is attacked to get and set the target to the player who is attacking him?

 

search in creature for    private void beginCast(L2Skill skill, boolean simultaneously, Creature target, WorldObject[] targets)

----

----

if (this instanceof Playable)
        {
            // Send a system message USE_S1 to the L2Character
            if (this instanceof Player && skill.getId() != 1312)
            {
                SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.USE_S1);
                sm.addSkillName(skill);
                sendPacket(sm);
            }

   +        if(this instanceof Player && this.getActingPlayer().getTarget() instanceof Player && this.getActingPlayer().getTarget().getActingPlayer().getTarget() == null)

     +              this.getActingPlayer().getTarget().getActingPlayer().setTarget(this);

 

you can also set some checks if classid = cardinal  or same party to not set target

 

Edited by arm4729
  • 0
Posted
3 hours ago, arm4729 said:

I'm not sure i did understand what you want to do , but i guess when you use a skill on a player and that player has no target , you want that player who is attacked to get and set the target to the player who is attacking him?

 

search in creature for    private void beginCast(L2Skill skill, boolean simultaneously, Creature target, WorldObject[] targets)

----

----

if (this instanceof Playable)
        {
            // Send a system message USE_S1 to the L2Character
            if (this instanceof Player && skill.getId() != 1312)
            {
                SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.USE_S1);
                sm.addSkillName(skill);
                sendPacket(sm);
            }

   +        if(this instanceof Player && this.getActingPlayer().getTarget() instanceof Player && this.getActingPlayer().getTarget().getActingPlayer().getTarget() == null)

     +              this.getActingPlayer().getTarget().getActingPlayer().setTarget(this);

 

you can also set some checks if classid = cardinal  or same party to not set target

 

No .. he say like skills 

 

Currently when attacker attack at target .. target with target null .. he target attacker ... and we ask both the same .. 

 

Don't auto target attacker if target is null and if target the attacker don't remove the target each time that attacker attack ...

 

Complicated example I know xd

L2pride have such method but I can't adapt it for l2jmobius 

  • 0
Posted

i helped gsl the method is on l2character but we need a way to set that to get a return or something , cause if you edit it , it works but the player makes no damage

  • 0
Posted
6 hours ago, Amenadiel said:

i helped gsl the method is on l2character but we need a way to set that to get a return or something , cause if you edit it , it works but the player makes no damage

i dont really understand what you want maybe you can make a video , or show the files in wich "works" but nomake dmg

  • 0
Posted

Just the point is to remove auto target when attacker do auto attack and if target set target the attacker the next attack of attacker don't remove the target

It's funny complicated 

  • 0
Posted
4 hours ago, arm4729 said:

i dont really understand what you want maybe you can make a video , or show the files in wich "works" but nomake dmg

Check Creature.java onHitTarget, you will understand what it does

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hello everyone, I am looking to purchase a Premium Lineage 2 High Five server pack. My main requirements are: Stability & Quality (Most Important): The pack must be highly stable with no system errors or major bugs. Custom Features: It must include ready-to-use custom features such as a fully functional Community Board, custom NPC Buffers, and Custom Item Sellers (GM Shops), etc. Complete Files: It is absolutely necessary that the full source code (src) and complete Geodata are included. If you are selling a pack that meets these criteria, please send me a PM or leave a reply with the following information: Brief details and key features of the pack Price Test server availability (I would like to test it before buying) Thank you!
    • L2jmobiusDevClon — Classic Interlude p110 Emulator L2jmobiusDevClon is actively developing a Lineage 2 Classic Interlude p110 emulator. Development is done in free time with a strong focus on: • Stability • Authentic Classic mechanics • Clean and optimized architecture The project is based on the L2jMobius source and is continuously evolving and improving. System Requirements: • Java 25 • MariaDB 12.0 • Client p110 Current Revision: 3.0 Development Status: Active Distribution: Free Official Website: https://www.l2jmobiusdevclon.pp.ua Discord Server: https://discord.gg/23a9S8g4Bn Contact: Telegram — @L2jmobiusDevClon Also available via private messages Project Goals: ✔ Improved stability ✔ Maximum Classic accuracy ✔ Core optimization We are currently looking for: • Testers • Server administrators Suggestions, bug reports, and ideas are always welcome. Contact us via: ✔ Discord ✔ Telegram ✔ Private Messages
    • i guess loading only the effects that are needed it will maybe work, like removing from reshade shader folder the ones that are not needed, depends on the pc also i guess, also limithing the game at 30fps can be better maybe
    • Up   SELL CHARACTERS L2 REBORN FRANZ x1     destroyer 74 lvl naked - 120 euro sws 71 lvl naked - 120 euro pp 66 skills - 120 euro se 64 lvl - 90 euro   Characters are legit with mail   i can wtt the characters for adena server franz   sell adena franz 250kk stock     add discord topeseller4081  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..