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

    • Where's the proof? I can tell you're a scammer.
    • Where was I called a scammer? Is there any proof, etc.? There are a lot of reviews about our store online, etc. https://zhyk.org/forum/showthread.php?t=1108673
    • U was reported as scammer in your previos topic why u create new topic?
    • 🔍 Inventory 1.0 is a next-generation inventory system that stands out with its special minimal clothing system. Carefully designed and prepared according to the highest standards of your server, it not only enhances your gaming experience but also contributes to your server's infrastructure. ⚙️ Supported: QB-CORE Features: ✅ Instant Delivery: All products you purchase will be instantly assigned to your account as soon as your payment is completed. ✅ Clothing System: With the special animated clothing configurations in your inventory, you will be able to change outfits with ease. Experience a unique roleplaying experience with high-quality animations and customizable clothing options. ✅ Minimalist Inventory System: This inventory system, with its visuals, animations, and mechanics, offers maximum efficiency without overwhelming your screen and limiting your roleplaying experience. It’s designed to be user-friendly while enhancing your roleplaying experience. ✅ Continuous Updates: The content in the inventory is regularly updated with innovative features added. New animations, additional clothing options, and cutting-edge features ensure a fresh and dynamic experience. ✅ Easy Setup and Compatibility: Compatible with QB-CORE, this system is easy to install and optimized for quick integration into your server. It works seamlessly with a simple drag-and-drop method. ✅ Performance Optimization: The system is optimized to avoid low FPS and performance drops. All features of the inventory run smoothly without affecting your server’s performance. ✅ Multilingual Support: With support for different languages, you can cater to an international player base and build a larger community on your server. ✅ Flexible Customization Options: You can fully customize the inventory according to your needs and server rules. Choose between different outfits and animations to create a unique gaming experience. ✅ Comprehensive Help and Support: With 24/7 support, you can quickly resolve any issues you encounter. Our technical support and user guides are always here to assist you. Shop Now! Take your game to the next level with Inventory 1.0  and enjoy its unique features. Get ready to make a real difference in your roleplaying experience!   --------------------------TEBEX: https://matza.tebex.io/package/7174862 --------------------------
  • 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