Page 1 of 2

Disable /target on GM.

Posted: Fri Sep 18, 2009 11:07 am
by Notorious
I need some directions to where in the code the player-command "/target" is handled. I'd like to make it impossible to /target a GM.
You should be able to click-target him, but not use /target.

Thanks for input!

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 11:25 am
by Bloodshed
good idea :)

maybe there is something like that in skilleffect for Hide skill

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 12:19 pm
by _DS_
Try to sniff packets first, and you will see.

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 12:21 pm
by Notorious
Yah, something can be found...

This might work, but where do I put it? :)
Don't even know what file to start messing with, lol!

if (target.getTarget().isGM()) target.setTarget(null);

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 12:23 pm
by _DS_
This will make clicking impossible too.

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 12:25 pm
by Notorious
_DS_ wrote:This will make clicking impossible too.
Until a better solution is found, I can live with that! :)
But, where do I put it? :)

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 12:26 pm
by Notorious
Maybe I could make it configurable, so it's only when I need it it's active.

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 1:12 pm
by Notorious
Notorious wrote:
_DS_ wrote:This will make clicking impossible too.
Until a better solution is found, I can live with that! :)
But, where do I put it? :)
On second thought, disabling it altogether is not an option! :(

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 1:15 pm
by Notorious
But where in the code is the /target handled?
I mean, must be somewhere where it reads commands like that... like /invite or /allyinfo and /target
And then processes those commands.

The /target I think must check if the target is inside the radius, and then put the target active.
Or is there no difference between clicking on a target and writing the command in the chatbox?

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 2:06 pm
by JIV
its handled by client, it has own knownlist and /target search for name player or npc and then send action packet with proper objid. so your answer is net.sf.l2j.gameserver.network.clientpackets.Action

Re: Disable /target on GM.

Posted: Fri Sep 18, 2009 11:54 pm
by Notorious
Thanks, I will look into it, but at first glance it doesn't seem like it differs between a click-target and a /target, so don't know how to make it only accept click-target...
But I will try! :)

Thanks again!

Re: Disable /target on GM.

Posted: Mon Sep 21, 2009 9:47 am
by Notorious
I think I've found a fix I can live with! :)

Will test it on live, then post it here if it works out like I hope! :)

Re: Disable /target on GM.

Posted: Mon Sep 21, 2009 12:13 pm
by tropheo
Try to put one space " " before GM name

Re: Disable /target on GM.

Posted: Tue Sep 22, 2009 1:56 am
by tropheo
If you put one space before GM name they can't be target I tested it. ;)

Re: Disable /target on GM.

Posted: Tue Sep 22, 2009 7:01 am
by Notorious
Hehehe.... yes, that's a solution that will probably work too, if it's like you say it is...

My solution is to limit the distance, so you can only target a GM if you stand close enough, like as close as you have to be to be able to shop! :)