jinsu Posted March 13, 2011 Posted March 13, 2011 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 Quote
0 Kràtos Posted March 13, 2011 Posted March 13, 2011 You can search at potion.java and make that potion with an sleep thread wen player is flaged. Quote
0 Xanderॐ Posted March 13, 2011 Posted March 13, 2011 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. Quote
0 Kràtos Posted March 13, 2011 Posted March 13, 2011 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. Quote
0 Xanderॐ Posted March 13, 2011 Posted March 13, 2011 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. Quote
0 Kràtos Posted March 13, 2011 Posted March 13, 2011 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. Quote
0 Xanderॐ Posted March 13, 2011 Posted March 13, 2011 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 :) Quote
0 Kràtos Posted March 13, 2011 Posted March 13, 2011 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. Quote
0 Xanderॐ Posted March 13, 2011 Posted March 13, 2011 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. Quote
0 Kràtos Posted March 13, 2011 Posted March 13, 2011 the user (i) is extended. Hf. I try to be nice but you still .... Stay cool. Quote
0 jinsu Posted March 13, 2011 Author Posted March 13, 2011 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 ^^ Quote
Question
jinsu
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.