prontera,155,181,5 script Sample#quest 757,{
.@category = select(
"Category 1",
"Category 2",
"Category 3"
) - 1;
.@quest_size = getd( ".quest_id_"+.@category+"_size" );
copyarray .@quest,getd( ".quest_id_"+.@category ),.@quest_size;
for ( .@i = 0; .@i < .@quest_size; .@i++ ) {
if ( questprogress( .@quest_id[.@i] ) != 2 ) {
.@menu$ = .@menu$ + "Level - "+.@quest_id[.@i];
.@avail_quest_count++;
}
.@menu$ = .@menu$ + ":";
}
if ( .@avail_quest_count >= .@quest_size ) {
mes "All quest finished.";
close;
}
.@i = select( .@menu$ ) - 1;
mes "Selected Quest Category "+( .@category+1 )+" - Level "+( .@i+1 )+" - "+.@quest_id[.@i];
if ( .@i > 0 ) {
if ( questprogress( .@quest_id[.@i-1] ) != 2 ) {
mes "You cant take this quest because you haven't finish the previous quests.";
close;
}
}
if ( questprogress( .@quest_id[.@i] ) == 1 ) {
mes "You've already taken this quest but not yet complete.";
}
else {
mes "quest assigned.";
setquest .@quest_id[.@i];
}
close;
OnInit:
setarray .quest_id_1,
1000,
2000,
3000;
.quest_id_1_size = getarraysize( .quest_id_1 );
setarray .quest_id_2,
1000,
2000,
3000;
.quest_id_2_size = getarraysize( .quest_id_2 );
setarray .quest_id_3,
1000,
2000,
3000;
.quest_id_3_size = getarraysize( .quest_id_3 );
end;
}