Guih Posted July 28, 2015 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 40 Reputation: 0 Joined: 11/25/12 Last Seen: January 10, 2016 Share Posted July 28, 2015 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! Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted July 29, 2015 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Thursday at 04:49 PM Share Posted July 29, 2015 - 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 Quote Link to comment Share on other sites More sharing options...
0 Waken Posted July 28, 2015 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 65 Reputation: 7 Joined: 06/06/12 Last Seen: April 8 Share Posted July 28, 2015 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 Quote Link to comment Share on other sites More sharing options...
0 Skorm Posted July 28, 2015 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted July 28, 2015 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; } Quote Link to comment Share on other sites More sharing options...
0 Guih Posted July 28, 2015 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 40 Reputation: 0 Joined: 11/25/12 Last Seen: January 10, 2016 Author Share Posted July 28, 2015 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 Quote Link to comment Share on other sites More sharing options...
0 Vykimo Posted July 29, 2015 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 236 Reputation: 189 Joined: 11/27/11 Last Seen: August 4, 2024 Share Posted July 29, 2015 geffen,100,100,5 duplicate(Apple Giver) Apple Giver#2 100 will work without problem Quote Link to comment Share on other sites More sharing options...
0 Guih Posted July 29, 2015 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 40 Reputation: 0 Joined: 11/25/12 Last Seen: January 10, 2016 Author Share Posted July 29, 2015 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 Quote Link to comment Share on other sites More sharing options...
0 Guih Posted July 29, 2015 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 40 Reputation: 0 Joined: 11/25/12 Last Seen: January 10, 2016 Author Share Posted July 29, 2015 - 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! Quote Link to comment Share on other sites More sharing options...
0 Azeroth Posted November 21, 2015 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 383 Reputation: 121 Joined: 03/31/12 Last Seen: January 29, 2023 Share Posted November 21, 2015 - 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 can you please add. .item = 5; quantity of apples? Quote Link to comment Share on other sites More sharing options...
Question
Guih
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.