Jump to content
  • 0

[HELP] Mana-Potion behaviour in PVP


Question

Posted

Hi guys,

 

i edited the Mana-Drugs a bit so they work like healing potions.. just for mana..

 

now i wanted to implement some other feature ....

 

 

if a player is not flagged .. reuse 15 seconds of the potion

if a player is flagged... reuse 30 seconfs of the potion

 

any chance that you can help me with that ?

 

greets

Jinsu

 

//EDIT

 

Sry i forgot ... Client is the Freya Chronicle

 

 

And if you can tell me how to change Triggers and Toggles so they dont overbuff... i would be rly thankful

11 answers to this question

Recommended Posts

  • 0
Posted

You can search at potion.java and make that potion with an sleep thread wen player is flaged.

 

 

 

Never sleep a thread that is used by multiple tasks it will hog the threadpool.

 

 

public boolean isSkillDisabled(int reuseHashcode)

{

if (isAllSkillsDisabled())

return true;

 

if (_disabledSkills == null)

return false;

 

final Long timeStamp = _disabledSkills.get(Integer.valueOf(reuseHashcode));

if (timeStamp == null)

return false;

 

if (timeStamp < System.currentTimeMillis())

{

_disabledSkills.remove(Integer.valueOf(reuseHashcode));

return false;

}

 

return true;

}

 

The potion has a skill on the back working with it and the skill has a timestamp of usage compare it with the reuse delay /2 to get the remaining time and direct the flow of the function.

  • 0
Posted

Never sleep a thread that is used by multiple tasks it will hog the threadpool.

 

 

public boolean isSkillDisabled(int reuseHashcode)

{

if (isAllSkillsDisabled())

return true;

 

if (_disabledSkills == null)

return false;

 

final Long timeStamp = _disabledSkills.get(Integer.valueOf(reuseHashcode));

if (timeStamp == null)

return false;

 

if (timeStamp < System.currentTimeMillis())

{

_disabledSkills.remove(Integer.valueOf(reuseHashcode));

return false;

}

 

return true;

}

 

The potion has a skill on the back working with it and the skill has a timestamp of usage compare it with the reuse delay /2 to get the remaining time and direct the flow of the function.

 

You can make it even from xml... with a type.

 

There are different methods that you can use. if any error occurs on the skill can be disabled or enabled...easly... if you mean that.

  • 0
Posted

I mean that if you sleep a thread, and the thread pool alocates a pool of 10 - 20 threads for skill usages, then after some pot usages the pool will get out of resources and the server will stop responding to skill usages. And you cant do it with xml, since there is no check in the core for flagged ppl. You have to edit the core for it.

  • 0
Posted

I mean that if you sleep a thread, and the thread pool alocates a pool of 10 - 20 threads for skill usages, then after some pot usages the pool will get out of resources and the server will stop responding to skill usages.

 

Well he ask for an custom edit and he have to think. There are many methods as i said... from potion.java from character.java from l2pcinstance.java you can edit and do it in many ways and try different methods and choices.

 

If you think!!!

 

And you cant do it with xml, since there is no check in the core for flagged ppl. You have to edit the core for it.

 

Whats the problem with that... cant be done? ^^

 

If you have something to tell or help get in the point and reply... quoting my words dint help the poster but your e-post aka e-penis bigger.

 

 

 

 

 

 

  • 0
Posted

Once again, you cant Thread.sleep() in a poolable resource cause the number of threads are limmited. If you wanna use xml, you need to also specify if "xx" attribute is present in xml, then check the flag status of the player and get the reuse according to his flag. So thread.sleep is not an alternative method to do it, cause it will freaking crash the server, get it ?

 

 

The only reason i posted, is to show you how wrong you always are :)

 

  • 0
Posted

Once again, you cant Thread.sleep() in a poolable resource cause the number of threads are limmited. If you wanna use xml, you need to also specify if "xx" attribute is present in xml, then check the flag status of the player and get the reuse according to his flag. So thread.sleep is not an alternative method to do it, cause it will freaking crash the server, get it ?

 

 

The only reason i posted, is to show you how wrong you always are :)

 

 

 

the user is extended to reply by the stupidity detected on the board.

 

Hf.

  • 0
Posted

 

the user is extended to reply by the stupidity detected on the board.

 

Hf.

 

Its "expected", not extended. And dont go off-topic, i just told you that your "solution" will crash the server. Stay cool.

  • 0
Posted

Thanks for the answers so far...

Well he ask for an custom edit and he have to think. There are many methods as i said... from potion.java from character.java from l2pcinstance.java you can edit and do it in many ways and try different methods and choices.

 

If you think!!!

 

I thought that there are many ways to do that ... if i would have any clue about how to make it .. i would have done it already...  Well ... im kinda new to this stuff and i would he happy if you can show me how to do that ..

 

quoting my words dint help the poster but your e-post aka e-penis bigger.

 

Im sorry that i quoted you .. but a bigger e-penis is always great ^^

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2Elixir – Patch 4 Is Live!   We’re working non-stop, day and night, to deliver the best possible quality and bring back what made L2Elixir special. This project is built with passion, not shortcuts — for the old-school players who remember, and the new ones who want to experience it properly. Thank you for being part of the journey. Together, we’re making L2Elixir great again ❤️ The legends never fade.    ⚙️ General Enabled Class Change service (same class type only) ALT + B → Services → Character Development Enabled Shift + Click on Treasure Chests Players can now identify real chests (Adena, scroll drops) and use Key / Unlock Event deaths now cancel only debuffs, All self buffs are preserved, fixes issues with Root and similar effects Bladedancer class can now log in even when Max Clients (2) is reached. Since an active Bladedancer is not available for every damage dealer and some players tried to abuse this via VPN or a second PC, this feature was added to keep things fair. protections applies, requires testing!    🎒 Items Crystallizing enchanted items now gives the correct increased crystal amount (retail-like behavior) Removed Agathion Seal Bracelet: Rudolph from Santa rewards (Gracia Final item) Added Dualsword Craft Stamp into Milestone Exchange list    🧙 Skills Fixed Banish Undead lethal chance Hot Springs Malaria and similar effects now level up faster while being attacked
    • thats new SEO level tricks you know nothing of noob - bottom line: exposed.
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away!   @Atom @Celestine
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away! @Celestine @Atom
  • 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