Jump to content
  • 0
jayriku12

Heal Delay

Question

How can i make the NPC have a delay when players get hp and/or sp?

 

 

//===== eAthena Script =======================================

//= Healer Script (/w payments)
//===== By: ==================================================
//= Yor & abunch of other people
//===== Current Version: =====================================
//= 1.3
//===== Compatible With: =====================================
//= Any Athena Version
//===== Description: =========================================
//= NPC heals/regenerates people against zenys
//===== Additional Comments: =================================
//= alternative dog with payment.
//= each HP need 1 zeny
//= each SP need (baselevel / 5) zenys
//= calculation is done at start of the script
//= Added Duplicates And Correct payon Loc [Darkchild]
//= Some modifications. Added NPC locations. [massdriller]
//= Removed Duplicates [silent]
//============================================================
 
- script ::Healer2 -1,{
set @tempHp, MaxHp-Hp;
set @tempSpReal, MaxSp-Sp;
set @tempSp, ((MaxSp-Sp) * BaseLevel) / 5;
if (@tempHp > 0) goto WOUNDED;
if (@tempSpReal > 0) goto ONLY_REGENERATION;
 
mes "[Healer]";
mes "Oh?";
mes "You do not look like a person in pain.";
close;
 
WOUNDED:
if (@tempSp > 0) goto WITH_REGENERATION;
mes "[Healer]";
mes "Oh dear, you look really hurt,";
mes "I can cure you for: "[email protected]+" z)";
mes "Do you want me to cure you?";
next;
menu "Healings ("[email protected]+"z)",HEALINGS,"No, thanks",CANCEL;
 
WITH_REGENERATION:
mes "[Healer]";
mes "Do you want only your HP to be healed? ("[email protected]+" z)";
mes "Do you want only your SP to be healed? ("[email protected]+" z)?";
mes "Or Would you like both? ("+(@[email protected])+" z)";
next;
menu "Only HP ("[email protected]+"z)",HEALINGS,"Only SP ("[email protected]+"z)",REGENERATION,"Both HP & SP ("+(@[email protected])+"z)",HEALINGS_AND_REGEN,"Nothing, thanks",CANCEL;
 
ONLY_REGENERATION:
mes "[Healer]";
mes "So, you only want your SP to heal? ("[email protected]+" z)";
mes "I need to make a living...";
next;
menu "Regeneration ("[email protected]+"z)",REGENERATION,"No, thanks",CANCEL;
 
HEALINGS:
if (Zeny < @tempHp) goto NO_ZENYS;
heal @tempHp,0;
goto FIN;
 
REGENERATION:
if (Zeny < @tempSp) goto NO_ZENYS;
heal 0,@tempSpReal;
goto FIN;
 
HEALINGS_AND_REGEN:
if (Zeny < (@[email protected])) goto NO_ZENYS;
set Zeny, Zeny-(@[email protected]);
heal @tempHp,@tempSpReal;
goto FIN;
 
NO_ZENYS:
mes "[Healer]";
mes "Oh dear, you don't look like you have enough zeny.";
mes "Sorry, i can't help you.";
close;
 
FIN:
mes "[Healer]";
mes "You are Completely Healed.";
close;
 
CANCEL:
mes "[Healer]";
mes "Allright. Please come again if you need anything.";
close;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

There is no need to use that Variable for getting character HP & SP, you should use a NPC scope variable. ([email protected])

The script command Sleep2 (milliseconds) should allow the healer to delay healing for a certain time frame.

Link to comment
Share on other sites

What question do I have to use to replace this one?

prontera,100,100,4    script    Healer    100,{



    set [email protected], 5 * 60;    // delay (seconds).



    set [email protected], gettimetick ( 2 ) - delay;

    set [email protected], [email protected] - [email protected];

    if ( [email protected] < [email protected] )

        mes "You have to wait "+ [email protected] +" seconds before heal again";

    else

    {

        if ( HP + SP == MaxHP + MaxSP )

            mes "You do not look like a person in pain.";

        else

        {

            while ( [email protected] < 3 )

            {

                set [email protected], MaxHP - HP;

                set [email protected], ((MaxSP - SP) * BaseLevel) / 5;

                set [email protected], [email protected] + [email protected];

                if ( [email protected] > 0 )

                    mes "Heal price: ^ff0000"+ [email protected] +"^000000 z";

                if ( [email protected] > 0 )

                    mes "SP Restoration price: ^0000ff"+ [email protected] +"^000000 z";

                if ( [email protected] > [email protected] || [email protected] > [email protected] )

                    mes "Both: ^00ff00"+ [email protected] +"^000000 z";

                next ;

                set [email protected], select ( ( ([email protected] > 0) ? ( ([email protected] & 1) ? "^00ff00" : "^ff0000")Heal" ? "" ) +":"+ ( ([email protected] > 0) ? ( ([email protected] & 2) ? "^00ff00" : "^ff0000")SP Restoration" ? "" ):Heal ("+ ( (zeny < [email protected])?"^ff0000":"^0000ff") + [email protected] +" zeny):Exit");

                set [email protected], [email protected] | [email protected];

                set [email protected], (([email protected] & 1) * [email protected]) + (([email protected]&2) * [email protected]);

            }

            if ( [email protected] == 3 )

            {

                if ( zeny < [email protected] )

                    mes "You don't have enough zeny";

                else

                {

                    percentheal 100 * ([email protected] & 1), 100 * ([email protected] & 2);

                    set zeny, zeny - [email protected];

                    set delay, gettimetick ( 2 );

                }

            }

        }

    }

    close ;

    

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.