Jump to content
  • 0

Player gotta wait after 10 mins before finish item is made by the NPC?


Currently

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

For example, player x got 1 jellopy, 1 clover, 1 fabre. when he turn them to the NPC. the NPC will make the player come back after 10 mins to be able to get the finished product. any takers? pretty please? I really got no idea how to make it like that.. 

Link to comment
Share on other sites

13 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   8
  • Joined:  12/27/11
  • Last Seen:  

Im not sure if this will work. I did not test but this my idea of how this script is done. 

 

if (.@product == 0) {

	mes "I need you to gather some items";
	mes "enter any items here";
	next;
	
	if (countitem("Jellopy") < 1) goto miss;
	if (countitem("Clover") < 1) goto miss;
	if (countitem("Fluff") < 1) goto miss;
	
	delitem "Jellopy",1;
	delitem "Clover",1;
	delitem "Fluff",1;
	
	mes "I see that you have all the items required!";
	next;
	mes "Please wait for at least 10 minutes in order for me to finish this item.";
	set .@product,1;
	initnpctimer;
	close;
	
miss:

	mes "Sorry, you dont have all the items required.";
	close;

}	
	
if (.@product == 1) {

	mes "Please come after a few minutes";
	close;
	
OnTime 600000:
	
	mes "Here is your item!";
	getitem "Item",1;
	set .@product,0;
	close;
	
	
	
Edited by arzzzae
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  331
  • Reputation:   63
  • Joined:  11/29/11
  • Last Seen:  

@arzzzae

Updated the Script

if (product == 0) {
 
	mes "I need you to gather some items";
	mes "enter any items here";
	next;
	
	if (countitem("Jellopy") < 1) goto miss;
	if (countitem("Clover") < 1) goto miss;
	if (countitem("Fluff") < 1) goto miss;
	
	delitem "Jellopy",1;
	delitem "Clover",1;
	delitem "Fluff",1;
	
	mes "I see that you have all the items required!";
	next;
	mes "Please wait for at least 10 minutes in order for me to finish this item.";
	addtimer 600000,strnpcinfo(0)+"::OnEnd";
	set product,gettimetick(2)+600;
	close;

miss:
	mes "Sorry, you dont have all the items required.";
	close;
 
}
else if (product >= gettimetick(2)){
OnEnd:
	mes "Here's You Item";
	getitem 502,1;
	set product,0;
	close;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  


new_1-1,161,112,4    script    Crafter    82,{
set @npc$,"[Craft]";
    mes @npc$;
    if (#product == 0) {
    mes "Do you want to cook ( 50 All Stats Food )?";
    mes "Get me 10 Meat, 10 Honey, 10 Mastela Fruit.";
    next;
    
    if (countitem(517) < 10) goto miss;
    if (countitem(518) < 10) goto miss;
    if (countitem(522) < 10) goto miss;
    
    delitem 517,10;
    delitem 518,10;
    delitem 522,10;
    mes @npc$;
    mes "I see that you have all the items required!";
    next;
    mes @npc$;
    mes "Please wait for at least 10 minutes in order for me to finish this item.";
    addtimer 600000,strnpcinfo(0)+"::OnEnd";
    set #product,gettimetick(2)+600;
    close;
miss:
    mes @npc$;
    mes "Sorry, you dont have all the items required.";
    close;
}
else if (#product >= gettimetick(2)){
OnEnd:
    mes @npc$;
    mes "Here's You Item";
    getitem 14607,1;
    set #product,0;
    close;
}
}

 

I have it like this. But, it doesn't even wait for 10 minutes. When I talk to the NPC again, it just go straight to "Here's your item".

Edited by Capuche
Change Quote to Code
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

new_1-1,161,112,4    script    Crafter    82,{

set @npc$,"[Craft]";

if(gettimetick(0)>=#product){

mes @npc$;

mes "Oh! -Sorry I almost forgot- Here's Your Item!";

getitem 14607,1;

set #product,0;

close;

}

if(#product>=gettimetick(0)){

mes @npc$;

mes "Hold on a second. I'm still making it!";

close;

}

if (#product == 0) {

mes @npc$;

mes "Do you want to cook ( 50 All Stats Food )?";

mes "Get me 10 Meat, 10 Honey, 10 Mastela Fruit.";

next;

if (countitem(517) < 10) goto miss;

if (countitem(518) < 10) goto miss;

if (countitem(522) < 10) goto miss;

delitem 517,10;

delitem 518,10;

delitem 522,10;

mes @npc$;

mes "I see that you have all the items required!";

next;

mes @npc$;

mes "Please wait for at least 10 minutes in order for me to finish this item.";

set #product,gettimetick(0)+600000;

close;

miss:

mes @npc$;

mes "Sorry, you dont have all the items required.";

close;

}

}

Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

new_1-1,161,112,4    script    Crafter    82,{
 
set @npc$,"[Craft]";
 
	if(gettimetick(0)>=#product){
		mes @npc$;
		mes "Oh! -Sorry I almost forgot- Here's Your Item!";
		getitem 14607,1;
		set #product,0;
		close;
	}
	if(#product>=gettimetick(0)){
		mes @npc$;
		mes "Hold on a second. I'm still making it!";
		close;
	}
	if (#product == 0) {
		mes @npc$;
		mes "Do you want to cook ( 50 All Stats Food )?";
		mes "Get me 10 Meat, 10 Honey, 10 Mastela Fruit.";
		next;

		if (countitem(517) < 10) goto miss;
		if (countitem(518) < 10) goto miss;
		if (countitem(522) < 10) goto miss;

		delitem 517,10;
		delitem 518,10;
		delitem 522,10;
		mes @npc$;
		mes "I see that you have all the items required!";
		next;
		mes @npc$;
		mes "Please wait for at least 10 minutes in order for me to finish this item.";
		set #product,gettimetick(0)+600000;
		close;

	miss:
		mes @npc$;
		mes "Sorry, you dont have all the items required.";
		close;
	}
}

 

sir how to make multiple selection with many cooking ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

sir how to make multiple selection with many cooking ?

I think another variable (or an array with as many components as you want) would do the job.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

new_1-1,161,112,4    script    Crafter    82,{
 
set @npc$,"[Craft]";
 
	if(gettimetick(0)>=#product){
		mes @npc$;
		mes "Oh! -Sorry I almost forgot- Here's Your Item!";
		getitem 14607,1;
		set #product,0;
		close;
	}
	if(#product>=gettimetick(0)){
		mes @npc$;
		mes "Hold on a second. I'm still making it!";
		close;
	}
	if (#product == 0) {
		mes @npc$;
		mes "Do you want to cook ( 50 All Stats Food )?";
		mes "Get me 10 Meat, 10 Honey, 10 Mastela Fruit.";
		next;

		if (countitem(517) < 10) goto miss;
		if (countitem(518) < 10) goto miss;
		if (countitem(522) < 10) goto miss;

		delitem 517,10;
		delitem 518,10;
		delitem 522,10;
		mes @npc$;
		mes "I see that you have all the items required!";
		next;
		mes @npc$;
		mes "Please wait for at least 10 minutes in order for me to finish this item.";
		set #product,gettimetick(0)+600000;
		close;

	miss:
		mes @npc$;
		mes "Sorry, you dont have all the items required.";
		close;
	}
}

 

Everytime I talk to the NPC. it just gives me the item without doing the quest.. 

 

I tried this with other accounts too, same result.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Everytime I talk to the NPC. it just gives me the item without doing the quest..

I tried this with other accounts too, same result.

Oh lol change
if(gettimetick(0)>=#product){
to
if(gettimetick(0)>=#product&product>0){

sir how to make multiple selection with many cooking ?

I'm not really sure what you mean. Edited by Skorm
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   54
  • Joined:  12/23/12
  • Last Seen:  

Why not use the quest system with a timer quest of 10 mins, then use if(checkquest(0000,PLAYTIME)==2).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

For example, player x got 1 jellopy, 1 clover, 1 fabre.

 

a live Fabre 2iqLPAj.gif or dead Fabre?


/gg

// count ingredients
// take ingredients
progressbar "FFFF00",600;     // 600 seconds = 10 minutes

// give product
 

Or a more serious example:

prontera,155,180,0	script	cook_for_10_min	910,{
	mes "[Oven]";
	if (fabre_finish_cooking == 0) {
		// first time (no quest in progress)
		mes "Bring me 1 jellopy, 1 clover, 1 fabre card.";
		next;
		if (countitem(909)<1 || countitem(705)<1 || countitem(4002)<1) {
			select("I don't have all the items yet");
			mes "[Oven]";
			mes "Well, get going and bring me those items!";
		} else if (prompt("Here you go.  **give items to oven**:Cancel, keep items")!=1) {
			mes "[Oven]";
			mes "Fine! Keep your items!";
		} else {
			mes "[Oven]";
			if (countitem(909)<1 || countitem(705)<1 || countitem(4002)<1) {
				mes "You don't have all the ingredients.";
			} else {
				delitem 909,1; // Jellopy
				delitem 705,1; // Clover
				delitem 4002,1; // Fabre Card
				set fabre_finish_cooking, gettimetick(2) + 600; // 10 minutes from now
				mes "Now I will cook your Fabre.";
				mes "Come back in 10 minutes...";
			}
		}
	} else if (gettimetick(2) < fabre_finish_cooking) {
		// quest IN PROGRESS (wait 10 mins)
		mes "Your Fabre is still cooking.";
		mes "Come back in "+ Time2Str(fabre_finish_cooking) +" ...";
	} else if (gettimetick(2) >= fabre_finish_cooking) {
		// FINISH quest
		if (checkweight(5785,1) == 0) {
			mes "You are overweight or carrying too many items.";
		} else {
			mes "**ding**";
			getitem 5785,1; // Green_Bunny_Hairband
			set fabre_finish_cooking,0;
			mes "All done, here is your cake/pie!!";
		}
	}
	close;
}
Edited by Brian
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

For example, player x got 1 jellopy, 1 clover, 1 fabre.

 

a live Fabre 2iqLPAj.gif or dead Fabre?


/gg

// count ingredients
// take ingredients
progressbar "FFFF00",600;     // 600 seconds = 10 minutes

// give product
 

Or a more serious example:

prontera,155,180,0	script	cook_for_10_min	910,{
	mes "[Oven]";
	if (fabre_finish_cooking == 0) {
		// first time (no quest in progress)
		mes "Bring me 1 jellopy, 1 clover, 1 fabre card.";
		next;
		if (countitem(909)<1 || countitem(705)<1 || countitem(4002)<1) {
			select("I don't have all the items yet");
			mes "[Oven]";
			mes "Well, get going and bring me those items!";
		} else if (prompt("Here you go.  **give items to oven**:Cancel, keep items")!=1) {
			mes "[Oven]";
			mes "Fine! Keep your items!";
		} else {
			mes "[Oven]";
			if (countitem(909)<1 || countitem(705)<1 || countitem(4002)<1) {
				mes "You don't have all the ingredients.";
			} else {
				delitem 909,1; // Jellopy
				delitem 705,1; // Clover
				delitem 4002,1; // Fabre Card
				set fabre_finish_cooking, gettimetick(2) + 600; // 10 minutes from now
				mes "Now I will cook your Fabre.";
				mes "Come back in 10 minutes...";
			}
		}
	} else if (gettimetick(2) < fabre_finish_cooking) {
		// quest IN PROGRESS (wait 10 mins)
		mes "Your Fabre is still cooking.";
		mes "Come back in "+ Time2Str(fabre_finish_cooking) +" ...";
	} else if (gettimetick(2) >= fabre_finish_cooking) {
		// FINISH quest
		if (checkweight(5785,1) == 0) {
			mes "You are overweight or carrying too many items.";
		} else {
			mes "**ding**";
			getitem 5785,1; // Green_Bunny_Hairband
			set fabre_finish_cooking,0;
			mes "All done, here is your cake/pie!!";
		}
	}
	close;
}

:o is a good idea I didn't even thing of adding a progress bar to timed npc events... Hmm, would that show up for all characters or just the invoked char, and does it show up above the players head or the npc's head?
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

:o is a good idea I didn't even thing of adding a progress bar to timed npc events... Hmm, would that show up for all characters or just the invoked char, and does it show up above the players head or the npc's head?

I wouldn't use a progress bar. Ever. At least for more than 5 seconds.

 

This command works almost like 'sleep2', but displays a progress bar above the head of the currently attached character (like cast bar). Once the given amount of  seconds passes, the script resumes. If the character moves while the progress bar progresses, it is aborted and the script ends. The color format is in RGB  (0xRRGGBB). The color is currently ignored by the client and appears always green.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Lol perhaps that's why I haven't. I tend to forget things, but wouldn't it be something if we had this for npc timers... I guess we could use waiting room with like a batch loading bar ( [||||||||| ] ) LOL, just a thought.

But really what I was thinking about- would be instance based loading bars... Shown above the invoked npc only to the attached character. /slur

Edited by Skorm
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...