viewing paste Ticket Refiner v1.1 | Athena

Posted on the | Last edited on
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 67 68 69 70 71 72 73 74 75 76
//Skorm 12-9-2016 v1.1
//Script is the reverse of a ticket refiner and converts refined items into tickets.
prontera,184,177,5  script  Ticket Trader   851,{
    disable_items;
    mes "[^FF0000Ticket Trader^000000]";
    mes "I trade weapons and armours with specific refines for ^0000FFRefine Tickets^000000.";
    next;
    mes "[^FF0000Ticket Trader^000000]";
    mes "Which equipment would you like me to convert into a ^0000FFRefine Ticket^000000?";
    while(set(.@a,.@a+1)<=.e_len) {
        if( getequipid(.@a)>-1 && compare(.allow_list$,","+getequipid(.@a)+",") )
            set .@menu$, .@menu$+.eqp$[.@a-1]+"- [^0000FF"+getitemname(getequipid(.@a))+"^000000]:";
        else {
            set .@menu$, .@menu$+":";
            .@len++;
        }
    }
    
    next;
    
    if( .@len >= .e_len ) {
        mes "[^FF0000Ticket Trader^000000]";
        mes "It doesn't look like anything you have equipped can be converted sorry.";
        close;
    }
    
    select(.@menu$);
    set .@eq_loc, @menu;
    set .@eq_itm, getequipid(.@eq_loc);
    set .@eg_rfn, getequiprefinerycnt(.@eq_loc);
    if( .@eq_itm < 0 ) {
        mes "[^FF0000Ticket Trader^000000]";
        mes "Hmm, I don't think you have anything equipped there.";
        close;
    }
    if( .@eg_rfn < .uprange || .@eg_rfn > .uprange[1] ) {
        mes "[^FF0000Ticket Trader^000000]";
        mes "Sorry but I only convert items refined between +"+.uprange+" and +"+.uprange[1]+".";
        close;
    }
    
    .@ticket = getiteminfo(.@eq_itm,2) == 5 ? .weap_t_list[.@eg_rfn] : .armo_t_list[.@eg_rfn];
    
    mes "[^FF0000Ticket Trader^000000]";
    mes "^adb4be"+getitemname(.@eq_itm)+" will be changed into ^0000FF"+getitemname(.@ticket)+"^000000.";
    mes "Are you sure?";
    next;
    if( select("No:Yes") == 1 ) {
        mes "[^FF0000Ticket Trader^000000]";
        mes "Oh!- Well that was a close one then.";
        close;
    }
    
    if( getequipid(.@eq_loc) != .@eq_itm || .@eg_rfn != getequiprefinerycnt(.@eq_loc) ) {
        mes "[^FF0000Ticket Trader^000000]";
        mes "Nobody likes a cheater!";
        close;
    }
    
    delequip(.@eq_loc);
    getitem(.@ticket,1);
    enable_items;
    
    mes "[^FF0000Ticket Trader^000000]";
    mes "Have a nice day!";
    close;
    
    OnInit:
        setarray .eqp$  ,   "Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment",
                            "Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear";
        setarray .uprange, 6, 11;
        setarray .armo_t_list[.uprange],6235,6234,6233,6232,6239;
        setarray .weap_t_list[.uprange],6231,6230,6229,6228,6238;
        .allow_list$ = ",1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,2302,2304,2306,2308,2310,2311,2313,2315,2317,2318,2319,";
        .e_len = getarraysize(.eqp$);
}
Viewed 1666 times, submitted by Skorm.