viewing paste Wishing Well | 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
 
 
/*
 
 
CREATE TABLE IF NOT EXISTS `wishing_well` (
    `id` int(10) unsigned NOT NULL auto_increment,
    `time` datetime NOT NULL default '0000-00-00 00:00:00',
    `char_id` int(11) NOT NULL default '0',
    `zeny` int(11) NOT NULL default '0',
    `nameid` int(11) unsigned NOT NULL default '0',
    `amount` int(11) unsigned NOT NULL default '0',
    PRIMARY KEY  (`id`)
) ENGINE=MyISAM; 
 
 
*/
 
prontera,155,171,5  script  Wishing Well    757,{
mes "Throw zeny.";
input .@zeny,0,Zeny;
if( .@zeny ){
    mes "What item you wish ?";
    do{
        input .@itemid,0,32767;
        if( !.@itemid ) close;
    }while( getitemname( .@itemid ) == "null" );
    mes "Amount ?";
    input .@amount,0,30000;
    if( .@amount ){
        set Zeny,Zeny - .@zeny;
        mes "Zeny : "+.@zeny;
        mes "Wished "+.@amount+" x "+getitemname( .@itemid );
        if( select( "Confirm","Cancel" ) == 1 ){
            mes "You've wish to get "+getitemname( .@itemid );
            query_sql( "INSERT INTO `wishing_well` ( `time`,`char_id`,`zeny`,`nameid`,`amount` ) VALUES ( NOW(),"+getcharid(0)+","+.@zeny+","+.@itemid+","+.@amount+" )" );
        }
    }
}
close;
}
 
Viewed 1240 times, submitted by Emistry.