Jump to content
  • 0

How to add NPC quest delay?


chevansea

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  05/29/12
  • Last Seen:  

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

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • -1

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  05/22/18
  • Last Seen:  

Please help. Post more scripts.

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  113
  • Reputation:   5
  • Joined:  06/06/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   10
  • Joined:  05/14/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  113
  • Reputation:   5
  • Joined:  06/06/12
  • Last Seen:  

oh my bad, i wasnt paying attention on my coding, i got it wrong coded.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   10
  • Joined:  05/14/12
  • Last Seen:  

It happens when you're not paying attention /meh

(Hence why I edit my posts so much lol)

Edited by Joey
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  113
  • Reputation:   5
  • Joined:  06/06/12
  • Last Seen:  

hehe :P

I was doing my website while coding that xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   10
  • Joined:  05/14/12
  • Last Seen:  

Rofl, not a good thing to do while writing code xD

I'm a hypocrite. I watch movies, chat, and play games while I code. LOL

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  113
  • Reputation:   5
  • Joined:  06/06/12
  • Last Seen:  

bare with me, the last time I modified npc codes was like a year ago xD

I got addicted to league of legends while doing websites Lol.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  113
  • Reputation:   5
  • Joined:  06/06/12
  • Last Seen:  

oh world of warcraft and MW3 also. xD

Edited by en_dev
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  05/29/12
  • Last Seen:  

thanks everybody who replied at here :)

thank you so much :3 !

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