viewing paste F_ItemOfChoice 1.11 | 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
 
 
// F_ItemOfChoice( <itemid>,<itemid>.... );
// F_ItemOfChoice( 512,513,614 );
// F_ItemOfChoice( 607,608 );
 
function    script  F_ItemOfChoice  {
    .@argcount = getargcount();
    
    for ( .@i = 0; .@i < .@argcount; .@i++ )
        .@menu$ = .@menu$ + getitemname( getarg( .@i,0 ) ) + ":";
        
    mes "Pick an item that you want.";
    .@i = select( .@menu$ ) - 1;
    .@itemid = getarg( .@i,0 );
    
    if ( .@itemid ) {
    
        if ( !checkweight( .@itemid,1 ) ) {
            dispbottom "Overweight.";
        }
        else {
            getitem .@itemid,1;
            
            switch ( .@itemid ) {
                default: break;
                case 607: getitem 607,1; break;     // purchase YGG and get another 1 YGG for free
                case 512: getitem 607,20; break;    // purchase Apple and get another 20 YGG for free
            }
        }
        
    }
    return;
}
Viewed 1106 times, submitted by Emistry.