Hi, is it possible to show how many hours,minutes and seconds left before you can take the quest again ? I set it on 24hours and I want to see how many minutes are left with countdown ...heres my npc script credits to @Emistry and added some lines from hunting mission thanks
prontera,155,181,5 script Sample 4_F_KAFRA1,{
if (#Crafting_Delay > gettimetick(2) && .Delay) {
set .@i, #Crafting_Delay-gettimetick(2);
if (.@i > 3600) set .@j$, (.@i/3600)+" hour"+(((.@i/3600) == 1)?"":"s");
else if (.@i > 60) set .@j$, (.@i/60)+" minute"+(((.@i/60) == 1)?"":"s");
else set .@j$, (.@i)+" second"+((.@i == 1)?"":"s");
mes .name$;
mes "I'm afraid you'll have to wait ^0055FF"+getd(".Delay")+"^000000 hours before taking another mission.";
close;
}
if (!quest_random) {
quest_random = rand(1,3);
mes .name$;
mes "You have been assigned with a new quest.";
next;
}
switch(quest_random) {
case 1:
setarray .@reward, 4001, 1;
setarray .@item, 512;
setarray .@amount, 100;
if (.Delay) set #Crafting_Delay, gettimetick(2)+(.Delay*3600);
break;
case 2:
setarray .@reward, 4002, 1;
setarray .@item, 501, 502, 503;
setarray .@amount, 3, 1, 2;
if (.Delay) set #Crafting_Delay, gettimetick(2)+(.Delay*3600);
break;
case 3:
setarray .@reward, 4003, 1;
setarray .@item, 512, 503;
setarray .@amount, 300, 100;
//set #crafting_quest,0;
if (.Delay) set #Crafting_Delay, gettimetick(2)+(.Delay*3600);
break;
default:
mes "invalid quest.";
close;
}
mes "Quest Requirement(s):";
.@size = getarraysize(.@item);
for (.@i = 0; .@i < .@size; .@i++) {
mes " > "+.@amount[.@i]+"x "+getitemname(.@item[.@i]);
if (countitem(.@item[.@i]) < .@amount[.@i])
.@fail++;
}
if (!.@fail) {
next;
if (select("Submit Quest", "Cancel") == 1) {
for (.@i = 0; .@i < .@size; .@i++)
delitem .@item[.@i], .@amount[.@i];
getitem .@reward[0], .@reward[1];
quest_random = 0;
}
}
close;
OnInit:
set .Delay,24; // Quest delay, in hours (0 to disable).
.name$ = "[ ^FF0000Craft Collector^000000 ]";
}
Question
Eross
Hi, is it possible to show how many hours,minutes and seconds left before you can take the quest again ? I set it on 24hours and I want to see how many minutes are left with countdown ...heres my npc script credits to @Emistry and added some lines from hunting mission thanks
Use codebox
Link to comment
Share on other sites
2 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.