prontera,155,171,5 script Sample#quest 757,{
.@category = select(
"Category 1",
"Category 2",
"Category 3"
);
.@quest_size = getd( ".quest_id_"+.@category+"_size" );
copyarray .@quest_id,getd( ".quest_id_"+.@category ),.@quest_size;
for ( .@i = 0; .@i < .@quest_size; .@i++ ) {
if ( questprogress( .@quest_id[.@i] ) != 2 ) {
.@menu$ = .@menu$ + "Level "+( .@i+1 )+" - "+.@quest_id[.@i];
.@avail_quest_count++;
}
.@menu$ = .@menu$ + ":";
}
if ( !.@avail_quest_count ) {
mes "All quest finished.";
close;
}
.@i = select( .@menu$ ) - 1;
mes "Selected Quest Category "+.@category+" - 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,
60101,
60102,
60103;
.quest_id_1_size = getarraysize( .quest_id_1 );
setarray .quest_id_2,
60104,
60105,
60106;
.quest_id_2_size = getarraysize( .quest_id_2 );
setarray .quest_id_3,
60107,
60108,
60109;
.quest_id_3_size = getarraysize( .quest_id_3 );
end;
}