your request kinda make me reminds of my mission board script, that were highly demanded to be convert to SQL version
anyway
/*
create table item_recipe_custom (
id smallint not null primary key auto_increment,
item_id smallint(6) unique,
value1 smallint(6) not null default '0',
amount1 smallint(6) not null default '0',
value2 smallint(6) not null default '0',
amount2 smallint(6) not null default '0',
value3 smallint(6) not null default '0',
amount3 smallint(6) not null default '0',
value4 smallint(6) not null default '0',
amount4 smallint(6) not null default '0',
value5 smallint(6) not null default '0',
amount5 smallint(6) not null default '0',
value6 smallint(6) not null default '0',
amount6 smallint(6) not null default '0',
value7 smallint(6) not null default '0',
amount7 smallint(6) not null default '0',
value8 smallint(6) not null default '0',
amount8 smallint(6) not null default '0',
value9 smallint(6) not null default '0',
amount9 smallint(6) not null default '0',
value10 smallint(6) not null default '0',
amount10 smallint(6) not null default '0'
) engine = innodb;
*/
prontera,157,175,5 script item_recipe_make 100,{
set item_recipe_custom0, 0;
set .@nb, query_sql( "select * from item_recipe_custom", .@id, .@item_id, .@v1, .@a1, .@v2, .@a2, .@v3, .@a3, .@v4, .@a4, .@v5, .@a5, .@v6, .@a6, .@v7, .@a7, .@v8, .@a8, .@v9, .@a9, .@v0, .@a0 );
if ( .@nb == -1 ) {
mes "the table is not set";
close;
}
if ( .@nb == 0 ) {
mes "current list is empty";
close;
}
mes "select an item to make";
next;
set .@menu$, getitemname( .@item_id );
for( set .@i, 1; .@i < .@nb; set .@i, .@i +1 )
set .@menu$, .@menu$ +":"+ getitemname( .@item_id[ .@i ] );
set .@s, select( .@menu$ ) -1 ;
if ( getd( "item_recipe_custom"+ ( .@id[ .@s ] / 31 ) ) & pow( 2, .@id[ .@s ] % 31 ) ) {
mes "you've learned how to make this item and used them";
close;
}
mes "to make ^ff0000"+ getitemname( .@item_id[ .@s ] );
mes "^000000you need the following items:^0000ff";
set .@i, 1;
while ( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) {
mes getd( ".@a"+ .@i +"["+ .@s +"]" ) +"x "+ getitemname( getd( ".@v"+ .@i +"["+ .@s +"]" ) );
set .@i, .@i +1;
}
next;
select "learn it";
set .@i, 1;
while ( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) {
if ( countitem( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) < getd( ".@a"+ .@i +"["+ .@s +"]" ) ) {
mes "you don't have enough "+ getitemname( getd( ".@v"+ .@i +"["+ .@s +"]" ) );
close;
}
set .@i, .@i +1;
}
set .@i, 1;
while ( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) {
delitem getd( ".@v"+ .@i +"["+ .@s +"]" ), getd( ".@a"+ .@i +"["+ .@s +"]" );
set .@i, .@i +1;
}
setd "item_recipe_custom"+( .@id[ .@s ] /31 ), getd( "item_recipe_custom"+( .@id[ .@s ] /31 ) ) | pow( 2, .@id[ .@s ] % 31 );
mes "you've learned how to make "+ getitemname( .@item_id[ .@s ] );
close;
}
pls let me spam abit
WTF and WTF the hell with me used 2 hours and 30 mins to make this simple script
I need to continue make more script at the moment to improve myself yet