viewing paste dynamic quest list npc v3 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
 
 
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;
}
Viewed 1401 times, submitted by Emistry.