viewing paste Unknown #16039 | 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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
prontera,123,81,5   script  Xmas Trader 116,{
    set .@name$,"[^FF0000Libby^000000]";
    mes .@name$;
    mes "Hello!";
    mes "Can you fetch us some ingredients";
    mes "we need for my Christmas recipe?";
    mes "We'll be glad to exchange them ";
    mes "with a Xmas gift!";
    next;
    mes .@name$;
    mes "Me and Ana Lucia will give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each ingredient";
    mes "you give us.";
    mes "You can trade those points with Ana Luciafor a Xmas Gift later on.";
    next;
    mes .@name$;
    mes "How does that sound?";
 
    next;
    switch( select("Exchange ^0055FFCandy^000000","Exchange ^0055FFCandy Cane^000000","Exchange ^0055FFWell-baked Cookie^000000") ) {
 
        case 1:
            mes .@name$;
            mes "How many Candy will you exchange?";
            input .@num;
            next;
            if( .@num <= 0 || countitem(529) < .@num ) {
                mes .@name$;
                mes "Sorry, you don't have enough Candy!";
                close;
            }
            if( select("Proceed:Nevermind") -1 ) {
                mes .@name$;
                mes "Goodbye!";
                close;
            }
            set #Xmas_Points, #Xmas_Points + 5;
            dispbottom "Gained: " +(.@num)+ " Xmas Points. Total: " +#Xmas_Points+" Xmas Points.";
            delitem 529,.@num;
 
            break;
            
        case 2:
            mes .@name$;
            mes "How many Candy Cane will you exchange?";
            input .@num;
            next;
            if( .@num <= 0 || countitem(530) < .@num ) {
                mes .@name$;
                mes "Sorry, you don't have enough Candy Cane!";
                close;
            }
            if( select("Proceed:Nevermind") -1 ) {
                mes .@name$;
                mes "Goodbye!";
                close;
            }
            set #Xmas_Points, #Xmas_Points + 5;
            dispbottom "Gained: " +(.@num)+ " Xmas Points. Total: " +#Xmas_Points+" Xmas Points.";
            delitem 530,.@num;
 
            break;
 
    
 
        case 3:
            mes .@name$;
            mes "How many Well-baked Cookie will you exchange?";
            input .@num;
            next;
            if( .@num <= 0 || countitem(538) < .@num ) {
                mes .@name$;
                mes "Sorry, you don't have enough Well-baked Cookie!";
                close;
            }
            if( select("Proceed:Nevermind") -1 ) {
                mes .@name$;
                mes "Goodbye!";
                close;
            }
            set #Xmas_Points, #Xmas_Points + 5;
            dispbottom "Gained: " +(.@num)+ " Xmas Points. Total: " +#Xmas_Points+" Xmas Points.";
            delitem 538,.@num;
 
    }
 
    close;
 
}
 
 
 
 
 
 
 
 
 
 
 
================================================================================
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//===== rAthena Script =======================================
//= Card Trader
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1 
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Exchange cards for points.
//============================================================
 
prontera,123,83,6   script  Xmas Trader Shop    90,{
    mes "[Card Trader]";
    mes "Hi, "+strcharinfo(0)+"!";
    mes "What can I do for you?";
    next;
    switch(select(" > Point shop (^0055FF"+getd(.XPoints$)+"^000000): > Leave")) {
    case 1:
        mes "[Card Trader]";
        mes "You have ^0055FF"+getd(.XPoints$)+"^000000 Point"+((getd(.XPoints$) == 1)?".":"s.");
        callshop "xmas_shop",1;
        npcshopattach "xmas_shop";
        end;
    case 2:
        mes "[Card Trader]";
        mes "*yawn*";
        mes "See you later!";
        emotion e_yawn;
        close;      
    }
OnBuyItem:
    for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1)
        for(set .@j,0; .@j <getarraysize(.Shop); set .@j,.@j+2)
            if (@bought_nameid[.@i] == .Shop[.@j]) {
                set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
                break;
            }
    if (.@cost > getd(.XPoints$)) {
        mes "[Card Trader]";
        mes "You don't have enough Points.";
        emotion e_omg;
    }
    else {
        mes "Items purchased:";
        mes "-----------------------------------";
        for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1) {
            getitem @bought_nameid[.@i], @bought_quantity[.@i];
            mes "  ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
        }
        mes " ";
        mes "---------- Total: ^0055FF"+.@cost+" pt.^000000 -------";
        setd .XPoints$, getd(.XPoints$)-.@cost;
        emotion e_cash;
    }
    deletearray @bought_nameid[0], getarraysize(@bought_nameid);
    deletearray @bought_quantity[0], getarraysize(@bought_quantity);
    close;
 
OnInit:
    set .Level,0;          // Minimum monster level to trade corresponding cards.
    set .XPoints$,"#Xmas_Points";   // Variable to store points.
    setarray .Shop[0],      // Shop items: <ID>,<point cost>
    12355,15;
    setarray .XPoints[0],1,5;   // Points per <normal card>,<MVP card>
    
    npcshopdelitem "xmas_shop",909;
    for(set .@i,0; .@i < getarraysize(.Shop); set .@i,.@i+2)
        npcshopadditem "xmas_shop",.Shop[.@i],.Shop[.@i+1];
    end;
}
-   shop    xmas_shop   -1,909:-1
Viewed 645 times, submitted by Guest.