Jump to content
  • 0

Healer with timer


AndrossiS

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  11/20/12
  • Last Seen:  

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.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   25
  • Joined:  11/23/11
  • Last Seen:  

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 ;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  11/20/12
  • Last Seen:  

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 by AndrossiS
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   25
  • Joined:  11/23/11
  • Last Seen:  

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 ;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  11/20/12
  • Last Seen:  

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 by AndrossiS
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  11/20/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

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).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  11/20/12
  • Last Seen:  

Works perfectly, thanks for all the help, everyone.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

@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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  191
  • Reputation:   138
  • Joined:  09/24/12
  • Last Seen:  

sorry, this healer also works on eAthena?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

sorry, this healer also works on eAthena?

Yes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...