Page 1 of 1

Target nearest enemy

PostPosted: Wed Dec 07, 2011 9:54 am
by flikmax
Hello all, what classes in the source code handle the possibility to target the nearest enemy (by default keyboard's settings clicking on TAB key)??

Im asking it because i've some problem fixing the following issues:
1. When you charm a pet or you got a summoned pet, if you try to target the nearest enemy near you, the pet is targetted !
2. Same thing as above if a GuildMate or a GroupMember do the same action.


I'm wondering it may depend from the client but i don't find where..

Any idea?

Re: Target nearest enemy

PostPosted: Wed Dec 07, 2011 10:51 am
by Blue
That Tab key is client side. The client will send us a TargetChange. Maybe some wrong flags/realm are sent (enemy flag?).

Re: Target nearest enemy

PostPosted: Wed Dec 07, 2011 11:48 am
by Dunnerholl
I think the solution is to recreate the charmed mob and send the correct realm then, I have the impression that this is the Daoc way.

Re: Target nearest enemy

PostPosted: Wed Dec 07, 2011 12:08 pm
by flikmax
i quote Blue for the 'tabbing' action but the reply to the client is server side, right?

the server is PvP, so it uses the PvPServerRules.cs and something about that is at line 491:
Code: Select all
public override byte GetColorHandling(GameClient client)
{
return 1;
}
That method looks like to ovveride the other one (virtual) in AbstractServerRules.cs at line 1573:
Code: Select all
public virtual byte GetColorHandling(GameClient client)
{
return 0;
}
Should it be possible to modify the value returned by the AbstractServerRules from 0 to 1 like the PvP one? Imho the overrides doesn't "override" well...

That flag (0, 1, etc..) is also inside PacketLib1xx.cs files but is commented and i dunno why:
Code: Select all
//if (GameServer.ServerRules.GetColorHandling(m_gameClient) == 1) // PvP
im confused..