function script Fishing_Box_Load { set .@Fishing_Box_Name$,"[ ^00557f"+strcharinfo(0)+" Fish Box^000000 ]"; query_sql "SELECT `item_id`, `item_count` FROM `fishing_system` WHERE `char_id` = " + getcharid(0), .@tempItemID, .@tempItemcount; mes .@Fishing_Box_Name$; mes "Box Level: [ ^ff0000" + FishingBoxLevel + "^000000 ]"; mes "Box Item Limit: [ ^005500" + ( $@FishingBoxLimit + FishingBoxLevel ) + "^000000 ]"; //cutin $FishBoxCutin1$,3; next; callfunc( "Fishing_Box_Load_Process", 0, .@tempItemID, .@tempItemcount, .@select ); if ( .@select != 255 ) { mes .@Fishing_Box_Name$; mes "Get your [ ^55557f" + getitemname( .@tempItemID[ .@select - 1 ] ) + "^000000 ] ?"; mes "Item Count: [ ^00aa7f" + .@tempItemcount[ .@select - 1 ] + "^000000 ]"; mes "^ff0000 --- !! WARNING !! ---^000000"; mes "Wait for the process to load!"; mes "^ff0000Do not log out at the moment.^000000"; //cutin $@FishBoxCutin2$,3; next; input .@count; if ( .@count > 0 && .@count <= .@tempItemcount[ .@select - 1 ] ) { query_sql "UPDATE `fishing_system` SET `item_count` = " + ( .@tempItemcount[ .@select - 1 ] - .@count ) + " WHERE `char_id` = " + getcharid(0) + " AND `item_id` = " + .@tempItemID[ .@select - 1 ]; getitem .@tempItemID[ .@select - 1 ], .@count ; if ( ( .@tempItemcount[ .@select - 1 ] - .@count ) == 0 ) query_sql "DELETE FROM `fishing_system` WHERE `fishing_system`.`char_id` = " + getcharid(0) + " AND `fishing_system`.`item_id` = " + .@tempItemID[ .@select - 1 ] ; } else { mes .@Fishing_Box_Name$; mes "Fishing Box Loaded!"; cutin "",255; close; } } return; }