Jump to content
  • 0

Help for a Quest that runs for 10 days


ran0120

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.04
  • Content Count:  25
  • Reputation:   0
  • Joined:  05/18/23
  • Last Seen:  

I'm trying to setup a quest wherein the player plants a seed and after 10 days, the seed will grow into an item.

 

my current script works something like this. The problem is that when I tried it on the script. Instead of adding the variable for the day of the year, it's just added next to it. (Current day of year: 200. If I put +10 to add on the variable instead of it being 210, it becomes 20010 instead.) How can I fix this?

 

yggdrasil01,194,95,0	script	Cultivated Soil	HIDDEN_NPC,{

	if ( plant_for_me == 1 ) goto plant_count;
	if ( countitem(512) > 0 ) goto plant_here;

plant_here:

	delitem 512,1;
	mes "Seed planted. Let's wait 10 days before harvesting.";
	set plant_day1,gettime(DT_DAYOFYEAR);
	set plant_for_me,1;
	close;

plant_count:

	if ( plant_day1 > plant_day+10 ) {
		getitem 607,1;
		end;
	}
		mes "This is still not ripe for the picking.";
		next;
		mes "Let's wait until it's ready for harvest.";
		close;
}
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  236
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

yggdrasil01,194,95,0	script	Cultivated Soil	HIDDEN_NPC,{
	if(CSOIL_GROWTH_DURATION == 0 && countitem(.plantItemId) < .plantItemAmt) {
		mes "You need " + .plantItemAmt + " x " + getitemname(.plantItemId) + " to use the cultivated soil.";
		close;
	}

	if(CSOIL_GROWTH_DURATION == 0) {
		delitem(.plantItemId, .plantItemAmt);
		mes "Seed planted. Let's wait " + .growthDays + " days before harvesting.";
		CSOIL_GROWTH_DURATION = gettimetick(2) + (.growthDays * 86400);
		close;
	}

	if (gettimetick(2) > CSOIL_GROWTH_DURATION) {
		getitem(.grownItemId, .grownItemAmt);
		CSOIL_GROWTH_DURATION = 0;
		end;
	}

	mes "This is still not ripe for the picking.";
	mes "Let's wait until it's ready for harvest.";
	close;

	OnInit:
		.growthDays = 10;
		
		.plantItemId = 512;
		.plantItemAmt = 1;
		
		.grownItemId = 607;
		.grownItemAmt = 1;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.04
  • Content Count:  25
  • Reputation:   0
  • Joined:  05/18/23
  • Last Seen:  

13 hours ago, Winterfox said:
yggdrasil01,194,95,0	script	Cultivated Soil	HIDDEN_NPC,{
	if(CSOIL_GROWTH_DURATION == 0 && countitem(.plantItemId) < .plantItemAmt) {
		mes "You need " + .plantItemAmt + " x " + getitemname(.plantItemId) + " to use the cultivated soil.";
		close;
	}

	if(CSOIL_GROWTH_DURATION == 0) {
		delitem(.plantItemId, .plantItemAmt);
		mes "Seed planted. Let's wait " + .growthDays + " days before harvesting.";
		CSOIL_GROWTH_DURATION = gettimetick(2) + (.growthDays * 86400);
		close;
	}

	if (gettimetick(2) > CSOIL_GROWTH_DURATION) {
		getitem(.grownItemId, .grownItemAmt);
		CSOIL_GROWTH_DURATION = 0;
		end;
	}

	mes "This is still not ripe for the picking.";
	mes "Let's wait until it's ready for harvest.";
	close;

	OnInit:
		.growthDays = 10;
		
		.plantItemId = 512;
		.plantItemAmt = 1;
		
		.grownItemId = 607;
		.grownItemAmt = 1;
}

 

Exactly what I'm looking for. Thank for this.

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