Jump to content
  • 0

Apple Tree


Guih

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

Hello everyone, I'd like to have an NPC where I could collect about 20 Apples per day and only one time independent of the person who collected. Is that possible?

 

Thanks in advance!

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  


- script apple_tree -1,{

.@i = atoi( strnpcinfo(2) );

mes "[ ^0000FFApple Giver^000000 ]";

if ( getd( ".apple_tree_"+.@i ) ) {

mes "Look someone was already here and got all my apples...";

}

else {

mes "Whoa! It must be your lucky day here are some yummy apples for you!";

setd( ".apple_tree_"+.@i ),1;

}

close;

OnClock0000:

setd( ".apple_tree_"+strnpcinfo(2) ),0;

end;

}

prontera,1,1,4 duplicate(apple_tree) Apple Tree#01 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#02 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#03 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#04 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#05 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#06 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#07 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#08 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#09 111

prontera,1,1,4 duplicate(apple_tree) Apple Tree#10 111

Link to comment
Share on other sites

  • 0

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

You can make a permanent global variable when the player "takes" the apples, a variable like this  "$APPLES".

And you can reset the valor every day using that :

OnClock<hour><minute>:

It's only a thought  /no1

Link to comment
Share on other sites

  • 0

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

Hello everyone, I'd like to have an NPC where I could collect about 20 Apples per day and only one time independent of the person who collected. Is that possible?

 

Thanks in advance!

prontera,100,100,5	script	Apple Giver	100,{
	if( !.apples ) {
		.apples++;
		mes "[ ^0000FFApple Giver^000000 ]";
		mes "Whoa! It must be your lucky day here are some yummy apples for you!";
		getitem 501, 20;
	} else {
		mes "[ ^0000FFApple Giver^000000 ]";
		mes "Look someone was already here and got all my apples...";
	}
	close;

OnClock0000:
	.apples = 0;
}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

Okay, that worked, thanks Skorm!

 

But I need to duplicate it to a lot of maps, and with this script of yours I can't use the NPC on the other map if I've used it already... How can I make it usable per map?

 

Thanks ;D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   189
  • Joined:  11/27/11
  • Last Seen:  

geffen,100,100,5    duplicate(Apple Giver)    Apple Giver#2    100

will work without problem

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

 

geffen,100,100,5    duplicate(Apple Giver)    Apple Giver#2    100

will work without problem

 

 

I tried it, but it didn't work =/ It seems that the duplicates also get the variable of the main NPC, so I can't get the apples in the duplicates :(

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

-	script	apple_tree	-1,{
	.@i = atoi( strnpcinfo(2) );
	
	mes "[ ^0000FFApple Giver^000000 ]";
	if ( getd( ".apple_tree_"+.@i ) ) {
		mes "Look someone was already here and got all my apples...";
	}
	else {
		mes "Whoa! It must be your lucky day here are some yummy apples for you!";
		setd( ".apple_tree_"+.@i ),1;
	}	
	close;
	
	OnClock0000:
		setd( ".apple_tree_"+strnpcinfo(2) ),0;
		end;
}

prontera,1,1,4	duplicate(apple_tree)	Apple Tree#01	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#02	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#03	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#04	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#05	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#06	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#07	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#08	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#09	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#10	111

 

Thank you Emistry, it worked perfectly!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

-	script	apple_tree	-1,{
	.@i = atoi( strnpcinfo(2) );
	
	mes "[ ^0000FFApple Giver^000000 ]";
	if ( getd( ".apple_tree_"+.@i ) ) {
		mes "Look someone was already here and got all my apples...";
	}
	else {
		mes "Whoa! It must be your lucky day here are some yummy apples for you!";
		setd( ".apple_tree_"+.@i ),1;
	}	
	close;
	
	OnClock0000:
		setd( ".apple_tree_"+strnpcinfo(2) ),0;
		end;
}

prontera,1,1,4	duplicate(apple_tree)	Apple Tree#01	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#02	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#03	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#04	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#05	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#06	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#07	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#08	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#09	111
prontera,1,1,4	duplicate(apple_tree)	Apple Tree#10	111

 

 

Uhm, possible to add timestamp? name of char | job class | date and time

i know this one is through sql VERSION :D

 

can you please add.

.item = 5; quantity of apples?

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