Jump to content
  • 0

How to add NPC quest delay?


Question

Posted

Hi!

i want to ask about how to give npc's delay aftar i was finished his quest?

hm.. for example.

i already finished quest A from NPC X, and i want to take the quest again, but i must waiting 3hours to take the quest again.

Thanks before. and sorry for my english T_T

11 answers to this question

Recommended Posts

Posted (edited)

This will give you idea.

if(.takeQuest == 0){
mes "Take Quest?";
.takeQuest == 1;
addtimer 10800000, strnpcinfo(3)+"::On3Hours";
end;
}
else{
mes "Sorry, you have to wait 3hrs to take the quest again";
end;
}
On3Hours:
.takeQuest, 1;
end;

Edited by en_dev
Posted (edited)

You can use this:

// By: Joey
prontera,155,155,3 script Timer 66,{
if(questdelay < gettimetick(2)){ // Check timer, if over it will allow you to continue.
mes "You are able to do the quest again. Congratulations.";
close;
}
set questdelay,gettimetick(2)+10800; // Sets timer.
if(questdelay > gettimetick(2)){ // Checks timer, if active it will block you from doing the quest.
set .@delayremaining,(((questdelay-gettimetick(2))+1)/60);
mes "Please wait "+.@delayremaining+" minutes longer.";
close;
}
}

It will work even if the player logs out. (Permanant character variable.)

If you wish to make it temporary, where logging out will remove the timer, add an @ sign infront of each "questdelay" variable.

Here's one that's set to the account:

// By: Joey
prontera,155,155,3 script Timer 66,{
if(#questdelay < gettimetick(2)){ // Check timer, if over it will allow you to continue.
mes "You are able to do the quest again. Congratulations.";
close;
}
set #questdelay,gettimetick(2)+10800; // Sets Timer.
if(#questdelay > gettimetick(2)){ // Checks timer, if active it will block you from doing the quest.
set .@delayremaining,(((#questdelay-gettimetick(2))+1)/60);
mes "Please wait "+.@delayremaining+" minutes longer.";
close;
}
}

This will give you idea.

if(.takeQuest == 0){
mes "Take Quest?";
.takeQuest == 1;
addtimer 10800000, strnpcinfo(3)+"::On3Hours";
end;
}
else{
mes "Sorry, you have to wait 3hrs to take the quest again";
end;
}
On3Hours:
.takeQuest, 1;
end;

If you wish to be able to do the quest after the timer triggers, you'd need to set .takeQuest to 0 at the end of the timer.

Change:

.takeQuest, 1;

To:

set .takeQuest, 0;

Edited by Joey
Posted

Anyways,I always use gettimetick,like you can see in my released iRO Daily Quests

<npc header>,{
if(gettimetick(2) - CooldownQuest < (60 * 60 * 24)) {
mes "[ NPC NAME ]";
mes "Sorry you have to wait 24 Hours until you can do the Quest again!";
close;
}
mes "[ NPC NAME ]";
mes "Hey,now you have to wait 24 Hours until you can talk to me again!";
set CooldownQuest,gettimetick(2);
close;
}

The 60*60*24 defines the time,which you have to wait until you can talk to the NPC again. That means 60 seconds multipled with 60 for getting 1 Hour and this * 24 , which means that you have to wait 24 Hours. So you just have to edit the 24 to the Hour time,which you want it to change to.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...