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
2 minutes ago, arm4729 said:

hey you just said some posts earlier you help him but you don't get dmg , show what you modified ?

theres an else

{

hitTarget(target, weapon, damage);

}

 

i // the HitTarget, the method is weird i tried to modify and see where it calls the window but nothing i saw

  • 0
Posted (edited)

now im pretty sure that victims target is set to attacker from client side 90% ... maybe someone more experienced will bring us to light ? 

Edited by arm4729
  • 0
Posted
8 minutes ago, arm4729 said:

now im pretty sure that victims target is set to attacker from client side 90% ... maybe someone more experienced will bring us to light ? 

Or we can disable the packet call onHit but  which packet is? What bugs might be accured?

  • 0
Posted

        if(target.getTarget() == null)
            target.sendMessage("no target");
        if(target.getTarget() != null)
            target.sendMessage("has target");

               somevoid();

        if(target.getTarget() == null)
            target.sendMessage("no target");
        if(target.getTarget() != null)
            target.sendMessage("has target");

 

i added this to almost every parts of the attack method and i get msg no target everytime until the first attack is done , maybe you can try check where you get has target msg and there might be the part where target is set..

  • 0
Posted (edited)

When Invisible character attacks Visible. Visible character receives - null target. I assume to get what i want i need to do same but after simple physical attack, where is this check? But if you do this - after each attack your target will be canceled :D is it possible to not cancel it if my target not null?

Edited by FeeLings
  • 0
Posted (edited)

on the setTarget method, you can debug it this way:

filter by owner name, sor for example, if my character name is "mxc"

you make something like this:


 

if(getName().equals("mxc") && getTarget()==null){
Thread.dumpStack();
}


With this, you will get a stacktrace with initial location from where your target is beeing set. Debug it till u find the correct place, and simply edit the initial action.

For example.

On an source I have, I made this:

L2Character::callSkill(L2Skill skill, L2Object[] targets

 

if (GabConfig.ALLOW_AUTO_TARGET_WHEN_HIT && target.isPlayer() && (target.getActingPlayer().getTarget() == null) && !skill.hasEffectType(L2EffectType.REMOVE_TARGET)) {
    target.getActingPlayer().setTarget(this);
}

Edited by HyperBlown
  • 0
Posted (edited)
1 hour ago, HyperBlown said:

on the setTarget method, you can debug it this way:

filter by owner name, sor for example, if my character name is "mxc"

you make something like this:


 

if(getName().equals("mxc") && getTarget()==null){
Thread.dumpStack();
}


With this, you will get a stacktrace with initial location from where your target is beeing set. Debug it till u find the correct place, and simply edit the initial action.

For example.

On an source I have, I made this:

L2Character::callSkill(L2Skill skill, L2Object[] targets

 

if (GabConfig.ALLOW_AUTO_TARGET_WHEN_HIT && target.isPlayer() && (target.getActingPlayer().getTarget() == null) && !skill.hasEffectType(L2EffectType.REMOVE_TARGET)) {
    target.getActingPlayer().setTarget(this);
}

since when a gm char is invisible and does the attack and dont register target's target list; i just disabled the broadcast to see if its possible to target thru doattack https://prnt.sc/pRVDLOnhi_ne

 

does the job but needs a workaround on broadcasting

 

*edit: i didnt read ur entire post 😄 so u already made it xd
ezgif-1-32c6bfc864.gif

Edited by aLzhite
  • 0
Posted

For me since it's l2jmobius it's not solved yet .. and I have stop search this .. bcs I don't wanna break target system.

 

Xd

  • 0
Posted

hey im pretty sure pack doesen't matter here  but im not 100% thats why i bumped the topic... 

it might be something like enchanting system , when you fail a scroll you get system msg failed , and it also close the enchant item select window ...if you remove the systemmsg failed enchant , you will not get the failed enchant text , but also the enchant item selection window will not close ..

maybe when you get attacked and you don't have a target it just puts the target from client side.

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

    • Only 3 days left and we'll start with some events, you can check our Discord for more info!
    • Tired of frantically switching between windows trying to find that specific Warlock who should be casting saves? Forgot which server you left your Warsmith on? This mod solves these problems! What it does: Turns the boring window title into an information panel: Server Name - Character Name [Class] Real-life examples: - ServerName - HardcoreFarm [Spoilerr] (who's been spoiling for 3 months already) - ServerName - ClericHelper [Buffer] (eternal buffer on standby) - ServerName - MainChar [Gladiator] (main character who's always AFK) Why you need this: For multiboxers - to avoid confusing where the DD is and where the healer is For the forgetful - if your memory is like a goldfish For streamers - viewers immediately see who's on screen For adults - when playing at work and need to quickly hide the window DLL only - no Interface files needed Installation (more complicated than making tea): 1. Download the DLL 2. Drop it into the System folder 3. Launch the client 4. Be amazed how you lived without this before! Purchase Conditions: Price: 100$ Payment Method: USDT. How to Buy: Contact me on Telegram: @kiselevwv for a quick response. I will answer all your questions and provide additional information if needed. I guarantee functionality at the moment of sale and prompt assistance with setup after purchase.
    • I agree, l2damage crap to compare to l2java which was the father of pvp servers and till this days people playing there for good time.
    • 📝 Registration — Account Registration Creating a new player account. Usually includes: login password password confirmation email Result: a new record is created in the accounts table (loginserver). 🔑 Change Password — Password Change The player changes the password knowing the current one. Required: current password new password new password confirmation Result: the password field is updated in the accounts table. ♻️ Password Recovery — Password Reset If the player forgot the password. Implementation only via email: the player enters their login, email the system sends an email with a link or code the player opens the link / enters the code sets a new password Result: the password is updated in the accounts table.   All fields are validated (required, format, length, uniqueness, security checks).   Price: 80$   and i can rewrite script for PTS server.   Contacts:   Telegram Discord
  • 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..