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

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Okay I respect that but why is your other account banned?   I don't think this happened just because you delayed somebodys work even in 2012
    • Do You understand the fact, I won't scam anyone? Can You grasp such idea?  Second of all, if a random restaurant on Google Maps has 599 positive reviews and few negative ones with 4,8* score, do You ask Google to block it's profile and burn the place down? No? Then why the fuck You are crying about my random delays? If someone can't get a CUSTOM DESIGN on time, I refund. I'm not 16  y.o. anymore. I don't make living out of this L2 bullshit. Never did. Since 2012 I've made shit tons of projects. How many delays did I have? 12? 15? Out of hundrets of projects. Calm Your tits please. If I would actually take 4k euro and NOT deliver and NOT refund - admins can ban me. So don't compare me to Simple. And just so You know, Celestine sent me customers, so it's not like I've worked with him on his account all the time. That's another thing You won't understand. I won't waste anymore time on You and any other cunt who never was my customer but is bitching just because he has nothing better to do in his life. You don't like my work? Hove along, I don't give a shit. 
    • So he's like unsimple you would say? Cherry picking who's getting scammed.   Deliver 5 projects, don't deliver/delay the other 2 projects. Of course he won't scam you because he know what's gonna happen after since he's dealing with the admin himself.
    • I've worked with Ave a lot lately on designs and other projects. He has always delivered as quickly as possible sometimes within a week, maybe two. Personally, I’m patient, so I’ve never had an issue with the wait. I’m not trying to defend him blindly, but I genuinely don’t believe he would mess someone over for €60 €100. Sometimes he's inactive, likely due to real life responsibilities, but I don't judge everyone has their own situations. I understand that some people are impatient and want their orders completed quickly, but considering the quality of his work, I have no problem waiting. Of course, people react differently to delays, and that’s fair. But in my experience, I can't call him a scammer he's always delivered what I ordered.
  • Topics

×
×
  • Create New...