Jump to content
  • 0

[Request] Teleport for a time


heopas

Question

8 answers to this question

Recommended Posts

  • 0

Hmm.. this is just a wild imagination on how to do it..

 

When the player gets ported, it also gets a buff.

When the buff time is over, it will give the effect "Return".

 

But then again, how do you make a buff execute on the last second, and how do you make a GK buff you at the same time you enter the "Teleport" button?!

Link to comment
Share on other sites

  • 0

When a player teleport, get 2 values on a table on DB, one origin city, second status of return (cuz you want to do that with every teleport? or with ones on them not all teleport?)...

 

A treat (in core) activate a timeout of "x time" and when get zero, invoque "recall player" like GM got into their menu into that player in return to origin city...

 

Any concret idea of how to do that pfff... it's just an idea not a codding solution :S...

 

How to make a player recall? well you can create a npc in every town that do that request over that player...

Link to comment
Share on other sites

  • 0

In L2TeleporterInstance, or your own instance:

 

1. add special container for those players, for example:

 

private List<L2PcInstance> _players = new FastList<L2PcInstance>();

 

2. create boolean to check conditions of the party (like members level, if they are close to the GK, if party != null, members count and so on, sample:)

 

/**

* Check if party may enter.

* @param player

* @return

*/

private boolean checkConditions(L2PcInstance player)

{

L2Party party = player.getParty();

 

if (party == null)

{

player.sendPacket(new ExShowScreenMessage("You need party with at least 5 members to enter!", 5000));

return false;

}

if (party.getLeader() != player)

{

player.sendPacket(new ExShowScreenMessage("You are not party leader!", 5000));

return false;

}

if (party.getMemberCount() < 2)

{

player.sendPacket(new ExShowScreenMessage("You need party with at least 5 members to enter!", 5000));

return false;

}

for (L2PcInstance partyMember : party.getPartyMembers())

{

if (partyMember.getLevel() < 82)

{

ExShowScreenMessage msg = new ExShowScreenMessage("Each party member should be level 82 at least!", 5000);

party.broadcastToPartyMembers(msg);

return false;

}

if (!Util.checkIfInRange(500, player, partyMember, true))

{

ExShowScreenMessage msg = new ExShowScreenMessage("Each party member should be close to the leader!", 5000);

party.broadcastToPartyMembers(msg);

return false;

}

}

return true;

}

 

3. create new bypass for this kind of teleport, for example tele_party

 

Inside of this bypass, use already created boolean:

 

if (checkConditions)

  //iterate over party members, to tele them one by one

  // and add them to the _players aswell

 

4. Create new inner class for new task, which will tele players back after certain time.

 

private class ScheduleBackTask implements Runnable

{

public ScheduleEnterTask()

{

// Nothing

}

 

@Override

public void run()

{

                      //Iterate over _players container, to tele them back

                      _players.clear();

}

}

 

5. Again inside bypass under teleporting players, use this, to run task:

 

ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleBackTask(), 300000);

 

And put there time in milisec, after this time they will be teleportedback

 


 

I could make some mistakes, i was to lazy to check it with eclipse, but will be ok.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • This is my first and last topic created on a Lineage Forum, because if there's one thing that causes headaches for a lot of people, it's the critical error, that's why I decided to share it...   I'm creating a server again and before starting configurations I started collecting dozens of customs, without realizing my system folder had 950MB of files, so I started to enter the game, every 1 to 2 hours my client was reaching the maximum limit of virtual memory of the game due to the absurd amount of customs inside the system folder, reaching the maximum limit of 2047MB virtual ram, automatically we get critical, regardless of the error that appears on your screen, "THE WORDS ARE IRRELEVANT, unless it is a critical error before the ram memory limit reaches its limit", if you are seeing "2047 MB", it means that the game's virtual memory has reached its limit, and this memory is not configurable due to the game being created on 32-bit architecture, so I significantly reduced the amount of customs within the system from 950MB to 625MB, so my client started to reach the maximum memory limit every 10 to 12h, a huge progress, but my goal was at least 24h before reaching the virtual memory limit (playing frantically), so I reduced the system's custom files from 625MB to 267MB, the result was a first virtual memory limit critical error appearing after 41h.   My client is H5, the only types of customs I added to the game were focused only on equipment, one of the main causes were these skins and cloaks, they consume a huge amount of MB's within the "system", the problem is not adding customs to the client, the problem is adapting a custom and adding it inside the system folder, the system folder was not created with the intention of storing a huge amount of files.   Adding customs to the system folder means significantly reducing the time your client can remain open before reaching the virtual ram limit and make no mistake, there are hundreds of different critical errors with a small summary of the cause of the error, but if the critical table shows 2047MB of RAM, the problem is only 1. Example: I can see 3, 5, 9 critical error with different messages, but if this table is showing 2047MB ram, the reason was the virtual memory limit, an important detail is that this 2047MB ram is not a "fixed message or information from your computer", this 2047MB only appear when the cause is the virtual ram limit, it means that when you get a critical error with random numbers of ram memory appearing, such as 358MB ram, 715MB ram, it means that the cause of this error has no connection with ram virtual memory.
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products  https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...