Jump to content
  • 0
xienne15

Whispering NPC: Full info inside

Question

Hello again!~

I want to request a npc that when you whisper it will do revive to the whisperer when he got apple in his/her inventory(only checks not delete if has apple)

-    script    apple    -1,{
 

Messages:
No apple whisperer: You need to have an apple in your inventory.

end;

With apple whisperer but not dead: You don't require resurrection at this moment.

end;

with apple whisperer but dead: Your Acolytes are now praying in Prontera, please wait 10 seconds for the final judgement.

sleep2:10000

#revive the "whisperer with apple but dead"

And NPC will say "You have #amount of revive left for this hour") ///maximum of 3 revive per hour


The
NPC will only revive 3x per hour, so if the player with apple used all
the revive in less than hour, the player will not be able to get
resurrected
and the npc will say "You can only be revived 3x every hour.



Every successful revive the npc will say You only have " #number of available resurrection" left.
 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

-	script	apple	-1,{

OnWhisperGlobal:

set [email protected]_id, 512; // Apple

if (countitem([email protected]_id)) {

if (Hp) {

dispbottom "You don't require resurrection at this moment.";

} else {

set [email protected], callsub(S_getrevivecount);

// if they have less than 3 revives this hour

if ([email protected] < 3) {

callsub S_setrevivecount, [email protected] +1;

dispbottom "Your Acolytes are now praying in Prontera, please wait 10 seconds for the final judgement.";

sleep2 10000;

recovery 0;

dispbottom "You have "+(3 - ([email protected]+1))+" revives left for this hour.";

} else {

dispbottom "You can only be revived 3x every hour.";

}

}

} else {

dispbottom "You need to have a "+getitemname([email protected]_id)+" in your inventory.";

}

end;

S_getrevivecount:

set [email protected]_hour, atoi(gettimestr("%y%m%d%H",9)); // YYMMDDHH

if (atoi(delchar(revive+"",8)) < [email protected]_hour)

return 0; // if their last revive was not this hour, then they have used 0 revives this hour

else

return atoi(charat(revive+"",8));

S_setrevivecount:

set revive, atoi(gettimestr("%y%m%d%H",9) + getarg(0));

return;

}

  • Upvote 2
Link to comment
Share on other sites

-	script	apple	-1,{
OnWhisperGlobal:
	set [email protected]_id, 512; // Apple
	
	if (countitem([email protected]_id)) {
		if (Hp) {
			dispbottom "You don't require resurrection at this moment.";
		} else {
			set [email protected], callsub(S_getrevivecount);
			// if they have less than 3 revives this hour
			if ([email protected] < 3) {
				callsub S_setrevivecount, [email protected] +1;
				dispbottom "Your Acolytes are now praying in Prontera, please wait 10 seconds for the final judgement.";
				sleep2 10000;
				recovery 0;
				dispbottom "You have "+(3 - ([email protected]+1))+" revives left for this hour.";
			} else {
				dispbottom "You can only be revived 3x every hour.";
			}
		}
	} else {
		dispbottom "You need to have a "+getitemname([email protected]_id)+" in your inventory.";
	}
	end;


S_getrevivecount:
	set [email protected]_hour, atoi(gettimestr("%y%m%d%H",9)); // YYMMDDHH
	if (atoi(delchar(revive+"",8)) < [email protected]_hour)
		return 0; // if their last revive was not this hour, then they have used 0 revives this hour
	else
		return atoi(charat(revive+"",8));
S_setrevivecount:
	set revive, atoi(gettimestr("%y%m%d%H",9) + getarg(0));
	return;
}

Thanks~ but i am having error on line 15 saying

 

parse_line: need ';'

 

line 15:

				recovery 0;

it says

recovery '0';

Link to comment
Share on other sites

recovery is update since r17321

a trick to replace this one

-     recovery 0;
+     getmapxy [email protected]$, [email protected], [email protected], 0;
+     warp [email protected]$, [email protected], [email protected];
+     percentheal 100,100;
  • Upvote 1
Link to comment
Share on other sites

Thanks~

 

Can i add something? like when i whisper the npc it will say

dispbottom "Do you want to be revive?";

whisper "YES" =

recovery 0;

whisper "NO" =

dispbottom "Take care~.";
end;
Edited by xienne15
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.