Page 1 of 1

Players can kill teamates on TvT with AoE skills.

Posted: Sun Jan 15, 2012 2:12 pm
by JMD
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 5123:
L2JDP Revision 8628:

Im using stable and i get a lot of complaints about this. I dont want to enable the notargetteamates because it will ruin parties and stuff, is there any other way to fix it?

Re: Players can kill teamates on TvT with AoE skills.

Posted: Sun Feb 05, 2012 4:05 pm
by Starter
Ofc and I think there is already a topic about it but I dont remember now.. 5 months ago or so when I was active the last time.^^

Re: Players can kill teamates on TvT with AoE skills.

Posted: Mon Feb 06, 2012 1:14 am
by theone
This is a very old problem, which had been solved a long time ago (2+ years).
I'm surprised that it has come back... it's not a very hard thing to solve.
Lets wait for Zoey to finish comitting his skills engine rework and then we can fix this thing. Please bump this thread if there's no update within a few weeks (just so I dont forget to look into this ;) )

Re: Players can kill teamates on TvT with AoE skills.

Posted: Sun Feb 12, 2012 10:54 am
by HorridoJoho
Fast way to just get the thing done in stable
  • com.l2jserver.gameserver.model.L2Skill
    • public final L2Object[] getTargetList(L2Character, boolean, L2Character) - don't return the target list from target type handler directly, check for (SKILL_IS_OFFENSIVE & (ACTIVE_CHAR_TVT_TEAM == TARGET_ARRAY_TVT_TEAM) to recreate the array without the tvt team mates


Fast way to just get the thing done in unstable
  • com.l2jserver.gameserver.model.skills.L2Skill.java
    • public final L2Object[] getTargetList(L2Character, boolean, L2Character) - don't return the target list from target type handler directly, check for (SKILL_IS_OFFENSIVE & (ACTIVE_CHAR_TVT_TEAM == TARGET_ARRAY_TVT_TEAM) to recreate the array without the tvt team mates


Recreate or setting null
If the code which calls getTargetList is ok with null elements within the array(didn't checked that) it would be as easy as:

Code: Select all

 L2Object[] targetList = handler.getTargetList(this, activeChar, onlyFirst, target);if (activeChar is participant in tvt && skill is offensive){    for (int i = 0;i < targetList.length;++ i)    {        if (tagetList[i] is in activeChar team)            targetList[i] = null;    }} 
But if the code which calls getTargetList musn't have nulls in the target list:

Code: Select all

 L2Object[] targetList = handler.getTargetList(this, activeChar, onlyFirst, target);if (activeChar is participant in tvt && skill is offensive){    ListToHoldNewTargets newTargetList = ....;    for (int i = 0;i < targetList.length;++ i)    {        if (tagetList[i] is not in activeChar team)            newTargetList.add(targetList[i]);    }    return newTargetList.toArray();} 
This is in no way the best practice to get that done it's more like "just get that damn thing running no matter how"
I think the best would be to notify the TvT event itself with a target list for a skill and filter it there. But for a fast test to stop all offensive skills on team mates in TvT it is sufficient.