Page 1 of 1

L2Skill.java help :)

Posted: Sun Feb 26, 2012 4:58 pm
by cursing
when i try put a freya code i get those 2 errors

- sourcePlayer cannot be resolved

- obj cannot be resolved to a variable

The code im tryning to install is for one event engine made by rizel and i got the premium files that was for freya and im tryning to use them on H5 , so far only here i got problem and its the last part to finish the installing all the code.

Code: Select all

Index: java/com/l2jserver/gameserver/model/L2Skill.java===================================================================--- java/com/l2jserver/gameserver/model/L2Skill.java    (revision 4622)+++ java/com/l2jserver/gameserver/model/L2Skill.java    (working copy)@@ -21,6 +21,8 @@ import java.util.StringTokenizer; import java.util.logging.Logger; +import net.phoenixengine.PhoenixInterface;+ import javolution.util.FastList; import javolution.util.FastMap; @@ -1558,6 +1560,19 @@                            if (onlyFirst)                                return new L2Character[] { obj };                            +                           if(activeChar instanceof L2PcInstance)+                               +                           if(obj instanceof L2PcInstance) +                               if(PhoenixInterface.isParticipating(sourcePlayer.getObjectId()) && PhoenixInterface.isParticipating(obj.getObjectId())) +                                   if(PhoenixInterface.areTeammates(obj.getObjectId(), sourcePlayer.getObjectId())) +                                       continue; +                            +                           if(activeChar instanceof L2PcInstance)  +                            if(obj instanceof L2Summon) +                                if(PhoenixInterface.isParticipating(sourcePlayer.getObjectId()) && PhoenixInterface.isParticipating(((L2Summon)obj).getOwner().getObjectId())) +                                    if(PhoenixInterface.areTeammates(((L2Summon)obj).getOwner().getObjectId(), sourcePlayer.getObjectId())) +                                        continue;+                                                       targetList.add(obj);                        }                    }

Re: L2Skill.java help :)

Posted: Mon Feb 27, 2012 7:00 pm
by theone
Obvioulsly if you're applying custom stuff to your core, there could be code that breaks ;)
What do you mean about "premium package"? That's some dp/core patch you bought?
If it's the case, I suggest talking to the person who sold you the patch to get it to work correctly.
Little hint:
If your patch doesnt apply correctly (probably because you're not using the same revision as was used when making the patch), you can always copy the lines manually ;)

Re: L2Skill.java help :)

Posted: Sun Mar 04, 2012 1:18 pm
by cursing
yeap , I'm tryning to put the patch manually but the only part i have problem is there :/ also the person who sold me this , he dont give us suppost anymore :/

Re: L2Skill.java help :)

Posted: Sun Mar 04, 2012 1:46 pm
by Zoey76
That code won't work in our L2Skill code since we removed targets from core to datapack.

I believe that is used to avoid team mates cause damage with offensive skills in some sort of event.

Anyway the code is duplicated and probably not optimized.
For our sources, datapack/handlers/targethandlers/

Code: Select all

+   if ((target instanceof L2Playable) &&  PhoenixInterface.isParticipating(activeChar.getObjectId()) && PhoenixInterface.isParticipating(target.getObjectId()) && PhoenixInterface.areTeammates(target.getObjectId(), activeChar.getObjectId()))+   {+       continue;+   }
Use L2Playable for both summons and players and avoid duplicate checks.
Avoid nested ifs.
If you have event source, areTeammates(int, int) should be enough check, if they are not event participants, of course they aren't team mates.

That's about it, remember we don't give support for customs or other sources, if you have doubts or you want support about a feature visit the creator's forums/web.

Re: L2Skill.java help :)

Posted: Sun Mar 04, 2012 1:53 pm
by Zoey76
Previous post is for High Five, for Freya:
In L2Skill go to getTargetList(L2Character activeChar, boolean onlyFirst, L2Character target) and add this code manually for most of the target types or one time at the beginning of the method after adding null checks.

Code: Select all

                if ((target instanceof L2Playable) &&  PhoenixInterface.isParticipating(activeChar.getObjectId()) && PhoenixInterface.isParticipating(target.getObjectId()) && PhoenixInterface.areTeammates(target.getObjectId(), activeChar.getObjectId()))                {                    continue;                }