Jump to content
  • 0

Daily quest infinity loop


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

Q> How to make this into a daily based quest? like every 8:00 in the morning the npc reset and when it resets it announces "you can now take the daily quest" or something like that.

prontera,153,189,5 script dksfjdsk 100,{
.@t = gettime(4);
mes "Hi, today is "+ .week$[.@t];
mes "The Daily Quest for today is ...";
mes getitemname( getd( ".req_item"+ .@t ) );
next;
mes "The Items that needed are :";
.@size = getarraysize( getd( ".req_item"+ .@t ) );
for ( .@i = 1; .@i < .@size; .@i += 2 )
mes getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) +"x "+ getitemname( getd( ".req_item"+ .@t +"["+ .@i +"]" ) );
next;
if ( select ( "I want this Item", "Just walk around" ) == 2 ) {
mes "OK, please come again";
close;
}
else if ( gettime(4) != .@t ) {
mes "I'm sorry, today is a brand new day";
close;
}
for ( .@i = 1; .@i < .@size; .@i += 2 ) {
if ( countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) ) < getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) ) {
setarray .@not_enough[.@c], getd( ".req_item"+ .@t +"["+ .@i +"]" ), getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) - countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) );
.@c += 2;
}
}
if ( .@c ) {
mes "You didn't bring enough items";
for ( .@i = 0; .@i < .@c; .@i += 2 )
mes .@not_enough[ .@i +1 ] +"x "+ getitemname( .@not_enough[ .@i ] );
close;
}
for ( .@i = 1; .@i < .@size; .@i += 2 )
delitem getd( ".req_item"+ .@t +"["+ .@i +"]" ), getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" );
getitem getd( ".req_item"+ .@t ), 1;
mes "Congratulations for getting";
mes getitemname( getd( ".req_item"+ .@t ) );
close;
OnInit:
setarray .week$, "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday";
setarray .req_item0, 501, 501,1, 502,1;
setarray .req_item1, 501, 501,10, 502,20, 503,30, 504, 40;
setarray .req_item2, 501, 501,1, 502,1;
setarray .req_item3, 501, 501,1, 502,1;
setarray .req_item4, 501, 501,1, 502,1;
setarray .req_item5, 501, 501,1, 502,1;
setarray .req_item6, 501, 501,1, 502,1;
end;
}

Edited by caspa
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

updating script on that topic post#10

prontera,153,189,5	script	dksfjdsk	100,{
.@t = gettime(4);
mes "Hi, today is "+ .week$[.@t];
mes "The Daily Quest for today is ...";
mes getitemname( getd( ".req_item"+ .@t ) );
next;
mes "The Items that needed are :";
.@size = getarraysize( getd( ".req_item"+ .@t ) );
for ( .@i = 1; .@i < .@size; .@i += 2 )
	mes getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) +"x "+ getitemname( getd( ".req_item"+ .@t +"["+ .@i +"]" ) );
next;
if ( select ( "I want this Item", "Just walk around" ) == 2 ) {
	mes "OK, please come again";
	close;
}
else if ( gettime(4) != .@t ) {
	mes "I'm sorry, today is a brand new day";
	close;
}
for ( .@i = 1; .@i < .@size; .@i += 2 ) {
	if ( countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) ) < getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) ) {
		setarray .@not_enough[.@c], getd( ".req_item"+ .@t +"["+ .@i +"]" ), getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) - countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) );
		.@c += 2;
	}
}
if ( .@c ) {
	mes "You didn't bring enough items";
	for ( .@i = 0; .@i < .@c; .@i += 2 )
		mes .@not_enough[ .@i +1 ] +"x "+ getitemname( .@not_enough[ .@i ] );
	close;
}
for ( .@i = 1; .@i < .@size; .@i += 2 )
	delitem getd( ".req_item"+ .@t +"["+ .@i +"]" ), getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" );
getitem getd( ".req_item"+ .@t ), 1;
mes "Congratulations for getting";
mes getitemname( getd( ".req_item"+ .@t ) );
close;
OnInit:
setarray .week$, "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday";
setarray .req_item0, 501, 501,1, 502,1;
setarray .req_item1, 501, 501,10, 502,20, 503,30, 504, 40;
setarray .req_item2, 501, 501,1, 502,1;
setarray .req_item3, 501, 501,1, 502,1;
setarray .req_item4, 501, 501,1, 502,1;
setarray .req_item5, 501, 501,1, 502,1;
setarray .req_item6, 501, 501,1, 502,1;
end;
}

@icabit

you should've seen the script, or read the topic

if use freeloop, entire server will hang

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  353
  • Reputation:   70
  • Joined:  07/14/12
  • Last Seen:  

im Sorry :(

im kinda new to freeloop :(

wont happen again

Edited by icabit
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

@ BUMP

@ BUMP

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

I would like to know how to make this script a daily based also.

Edited by xmaniacx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

the above script should be a daily script

oh well the configuration part might be confusing

I made it in-game configuration then

daily_quest_0.3.txt

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