Jump to content

Question

Posted

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!

8 answers to this question

Recommended Posts

  • 0
Posted


- 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

  • 0
Posted

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

  • 0
Posted

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;
}
  • 0
Posted
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

  • 0
Posted

 

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 :(

  • 0
Posted
-	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!

  • 0
Posted
-	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?

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