L2Skill.java help :)

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
cursing
Posts: 51
Joined: Wed Feb 24, 2010 1:09 pm

L2Skill.java help :)

Post 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);                        }                    }
User avatar
theone
Posts: 1384
Joined: Tue Aug 12, 2008 2:28 am
Location: Quebec, Canada

Re: L2Skill.java help :)

Post 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 ;)
Image
cursing
Posts: 51
Joined: Wed Feb 24, 2010 1:09 pm

Re: L2Skill.java help :)

Post 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 :/
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: L2Skill.java help :)

Post 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.
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: L2Skill.java help :)

Post 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;                }
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
Post Reply