Jump to content
  • 0

Help L2J Passive Skill (Create)


VideoCopilot
 Share

Question

Hello i was about to make a code that check if a duelist come close to you to do something like reduce his speed or whatever

and i saw the codes and there is no such a file to do live check if player come close to you and i end up with passive skill

but still i cant understand how Passive skills work

So to make a new passive in Freya and make a check  if player class is X or generaly a check and make the passive work 

how this should be?

 

Thanks in advance

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

You can play with knownlist and check the classId. Make something like a global thread that it will check it every 1 seconds for example. It will read some objects(L2PcInstance) , so I don't think it will be heavy for the server.

 

for(L2PcInstance p : L2World.getBlabla.getPlayers()

{

   if(p==null) continue;

   for(L2PcInstance near : p.getKnownList().blabla.get(L2PcInstance.class),100)

        {

               if(near==null) continue;

                if(near classId == gladiator class id)

                            //slow him

        }

}

Edited by etniafamily
Link to comment
Share on other sites

  • 0

You can play with knownlist and check the classId. Make something like a global thread that it will check it every 1 seconds for example. It will read some objects(L2PcInstance) , so I don't think it will be heavy for the server.

 

for(L2PcInstance p : L2World.getBlabla.getPlayers()

{

}

You mean threadpool ? every 1 seconds? ye somehow is heavy :/ any chance to do this with passive skill? that affect area

or knownlist does not require threadpool :? 

 

Ps. i got it something like for (final L2Character obj : activeChar.getKnownList().getKnownCharactersInRadius(500()))

 

but where should i add this line i mean in which file to do the check?

Edited by VideoCopilot
Link to comment
Share on other sites

  • 0

It's not.

Thanks for answers btw, for (final L2Character obj : activeChar.getKnownList().getKnownCharactersInRadius(skill.getSkillRadius()))

this where should i add a line like this? to do the check up and inside and if (if player.getClass() == bla bla )

Link to comment
Share on other sites

  • 0

Thanks for answers btw, for (final L2Character obj : activeChar.getKnownList().getKnownCharactersInRadius(skill.getSkillRadius()))

this where should i add a line like this? to do the check up and inside and if (if player.getClass() == bla bla )

 

Main structure:

 

for(L2PcInstance p : L2World.getBlabla.getPlayers()

{

   if(p==null) continue;

   for(L2PcInstance near : p.getKnownList().blabla.get(L2PcInstance.class),100)

        {

               if(near==null) continue;

                if(near classId == gladiator class id)

                            //slow him

        }

}

Link to comment
Share on other sites

  • 0

Main structure:

 

for(L2PcInstance p : L2World.getBlabla.getPlayers()

{

   if(p==null) continue;

   for(L2PcInstance near : p.getKnownList().blabla.get(L2PcInstance.class),100)

        {

               if(near==null) continue;

                if(near classId == gladiator class id)

                            //slow him

        }

}

Yes i made the code already what i want to do the point is in which file i add it  in L2PcInstance but where? in which class?

Link to comment
Share on other sites

  • 0

Yes i made the code already what i want to do the point is in which file i add it  in L2PcInstance but where? in which class?

 

You want to start this thread when the gameserver starts actually , so create a new class with SingletonHolder_ to create only 1 object(see an example if you didn't understand) and just put MyClass.getInstance() on Gameserver.java ,  the constructor of the class will just start the Thread.

Edited by etniafamily
Link to comment
Share on other sites

  • 0

You want to start this thread when the gameserver starts actually , so create a new class with SingletonHolder_ to create only 1 object(see an example if you didn't understand) and just put MyClass.getInstance() on Gameserver.java ,  the constructor of the class will just start the Thread.

public class CheckCouple
{
 
public static CheckCouple getInstance()
{
return SingletonHolder._instance;
}
 
public CheckCouple()
{
 
}
 
@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
protected static final CheckCouple _instance = new CheckCouple();
}
}
 
 
Something like this? and add it on gameserver so inside 
 
public CheckCouple()
{
 
}
 
you add the check and it worke ach time a player with class enter inside the region arround you for knowncharacter u put ?
Link to comment
Share on other sites

  • 0

yea something like that

 

 
public CheckCouple()
{
   ThreadPoolmanager.getInstance().blabla.schedule()
}
 
 
Edited by etniafamily
Link to comment
Share on other sites

  • 0

 

yea something like that

 

 
public CheckCouple()
{
   ThreadPoolmanager.getInstance().blabla.schedule()
}
 
 

 

is there any way to add me on skype cause i messed up now with threadpool -.- ? if you can i really appreciate skype: unst0ppabl32

Link to comment
Share on other sites

  • 0

on the other hand, a ScheduledFeature task wouldn't be heavy at all if coded properly

Well added scheduleGeneralAtFixedRate(new Runnable  for KnownPlayersInRadius

and it works fine but i really dont know if it affect a lot the fact that it check every 0.5 seconds

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Posts

    • Hello add me on discord i have 2 mages for sale 78 lvl's nobless with original email. I have gear also so we can equip it for fair price. Discord : drey#9737
    • This post originally appeared on MmoGah.   With each update, Final Fantasy XIV is receiving some amazing new content and Minions. There are new locations and new functionalities that developers put up in patch 6.2 Endwalker for Minion collectors and players who are interested in getting them. Here we have a guide about where and how to get them.   Minions in FFXIV In case you are new to the game and unsure about the Minions, we will discuss it first. Minions are referred to as pets and don't have any function in the gameplay. Some Minions respond to some emotes and only stick to their owners.   To summon the Minions, you can open your Minion Guide found under Character in the main menu or drag the icon and set it on one of your hotbars. When you want that Minion out on your side, you can press or click it like an ability.   You need to know that you can't call multiple Minions at a time. When you summon another Minion while you already have one, the former one will disappear.   Wind-up Scarmiglione in FFXIV The first one we have here in our Guide is the Scarmiglione, which you can obtain through the Fell Court of Troia dungeon and only drops from the final chest. It is a rare drop in comparison to most other Minions.   On the other hand, if you are not in the mood to do some RNG (Random Number Generator) game, you can get this Minion from the Market Board (MB) to make things easier when you have enough Gil. If you can't afford it, you can buy safe and cheap Gil in FFXIV at MmoGah with fast delivery, then purchase the Minions you want from the MB.   Wind-up Erichthonios in FFXIV Next up in our Guide is Erichthonios from Abyssos: The Eighth Circle, or Abyssos: The Eighth Circle (Savage), a level 90 raid introduced in patch 6.2 with Endwalker. This Minion is Unsellable Market Prohibited, so you can only acquire it from the raid. There is no shortcut. Pterosquirrel in FFXIV   Another new Minion included in Patch 6.2 is Pterosquirrel. There are two ways to get this Minion. One is to spend 400 Faux Leaves to exchange with the Faux Commander, which you can find in Idyllshire at X:5.7 Y:6.1.   You can earn Faux Leaves by playing the Faux Hollows Unreal Trials once a week, so using this way will take some time to get the Minion.   Another way to get the Minion is by purchasing it from the MB. Since it is tradeable, you can sell it, too, if you want to make some Gil in FFXIV.   This Minion is adorable. When you use the pat emote, it will jump and fly. When you use the handover emote, it will feed from your hand and can stand on your shoulder when you use the emote beckon.   Felicitous Fuzzball in FFXIV Another Minion in FFXIV Patch 6.2 is Felicitous Fuzzball. It is a Minion from your Island Sanctuary. You can use 4k Seafarer's Cowries to exchange it, but if you haven't done with your Island yet, do not exchange it. You need those blue currencies to upgrade your Island first, then exchange Minions, Glamours, or any other things they offer.   This Minion is untradeable, so you have to earn it by yourself.   Clockwork Cerulean Chaser and Clockwork Crimson Chaser in FFXIV Lastly, we have two Minions from the PvP series. You have to be at level 15 and Level 16 in the PvP series to get them, and these are time sensitive, meaning you can only get them during PvP series 2, which is before patch 6.3.   If you want them, starting grinding your Crystalline ranks before patch 6.2 ends is a good idea.   Well, that's all to the Minions in FFXIV Patch 6.2. If you want to have new cute buddies while traveling the world of Eorzea, make sure to check this Guide.   Thank you for reading, and enjoy playing Final Fantasy XIV.
    • hi, how to disable some sites? i need only two.. but i obtain java.lang.NullPointerException when delete from votesystem.xml  
    • A new time is coming, and with it, a new challenge!   Let's relive one of the best chronicles of Lineage 2, Chronicle 4: Scions of Destiny.   Our Grand Opening will be October 1st at 6:00 pm.   For more information visit: https://l2free.org      
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock