AndrossiS Posted November 30, 2012 Posted November 30, 2012 Greetings! I'm requesting a healer that'd act as usual, unless the player was level 70 or above. In the event the player is level 70 or above, it'd only do a 100% HP and SP every 5 minutes. If the player is below level 70, it'd be just a regular healer. Thanks in advance. Quote
Omnipotent Posted December 1, 2012 Posted December 1, 2012 prontera,100,100,4 Healer 100,{ if ( BaseLevel < 70 || set ( .@t, gettimetick ( 2 ) - heal_delay ) >= (5 * 60) ) { percentheal 100, 100; if ( BaseLevel >= 70 ) set heal_delay, gettimetick ( 2 ); } else { set .@m, .@t / 60; set .@s, .@t % 60; dispbottom "Please wait for "+ .@m +" min(s) "+ .@s ? .@s +" seconds" : ""; } end ; } Quote
AndrossiS Posted December 1, 2012 Author Posted December 1, 2012 (edited) I tried this, but for some reason it does not work. Yes, I did relocate the NPC. Thanks for your hardwork regardless. edit: Ah, I added "script" between the name and the position and now it works. But it doesn't display a chatbox or anything, just says "X seconds." in the regular chat. X being the time since you last used the NPC. Edited December 1, 2012 by AndrossiS Quote
Omnipotent Posted December 1, 2012 Posted December 1, 2012 Forget 1 line. prontera,100,100,4 script Healer 100,{ if ( BaseLevel < 70 || set ( .@t, gettimetick ( 2 ) - heal_delay ) >= (5 * 60) ) { percentheal 100, 100; if ( BaseLevel >= 70 ) set heal_delay, gettimetick ( 2 ); } else { set .@t, (5 * 60) - .@t; set .@m, .@t / 60; set .@s, .@t % 60; dispbottom "Please wait for "+ .@m +" min(s) "+ .@s ? .@s +" seconds" : ""; } end ; } 1 Quote
AndrossiS Posted December 1, 2012 Author Posted December 1, 2012 (edited) Hello and thank you for all your help. The NPC now counts down, but only 60 and downwards. If there's longer than 60 seconds left, it'll just keep looking 60 seconds each minute. Edited December 1, 2012 by AndrossiS Quote
GmOcean Posted December 1, 2012 Posted December 1, 2012 Hmm, i never would have though of using ' set ' in an ( if ) statement.. didn't think the system could proccess that lol. *Keeps an eye on you* I'm looking forward to seeing other things you'll do lol. @AndrossiS - I really don't see any problem with the script... Quote
AndrossiS Posted December 1, 2012 Author Posted December 1, 2012 It's not a problem per see. The NPC works wonderfully, if not for the timer. Instead of saying 300 seconds left, it says 60 seconds left, and just does it 5 times. So players are a bit confused "wait, it said 60 seconds 60 seconds ago! and now it says it again!". But other than that, great job and I'm very thankful. Quote
Ryokem Posted December 1, 2012 Posted December 1, 2012 Hello and thank you for all your help. The NPC now counts down, but only 60 and downwards. If there's longer than 60 seconds left, it'll just keep looking 60 seconds each minute. Yeah, you have to put some brackets. dispbottom "Please wait for "+ .@m +" min(s) "+ ( (.@s) ? .@s +" seconds" : ""); Hmm, i never would have though of using ' set ' in an ( if ) statement.. didn't think the system could proccess that lol. *Keeps an eye on you* I'm looking forward to seeing other things you'll do lol. Do not forget that all commands are monitored by a source function, and regardless from what they do, they always have some values as return, most of them are booleans (true, false), another good part is integers or float/double (not in e/rAthena case as those kind of variables are not really implemented). Quote
AndrossiS Posted December 1, 2012 Author Posted December 1, 2012 Works perfectly, thanks for all the help, everyone. Quote
GmOcean Posted December 1, 2012 Posted December 1, 2012 @Ryokem - Ahh, I see. That does make a bit more sense. I should have known this was possible since I can already retrieve information in an IF statement, it'd only make sense that the setting information would also be possible, since I can use: ' if( select) ' and the such. Quote
Tio Akima Posted December 1, 2012 Posted December 1, 2012 sorry, this healer also works on eAthena? Quote
Euphy Posted December 1, 2012 Posted December 1, 2012 sorry, this healer also works on eAthena? Yes. Quote
Question
AndrossiS
Greetings!
I'm requesting a healer that'd act as usual, unless the player was level 70 or above. In the event the player is level 70 or above, it'd only do a 100% HP and SP every 5 minutes. If the player is below level 70, it'd be just a regular healer.
Thanks in advance.
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.