viewing paste Unknown #16026 | 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
-   script  del_cards   -1,{
    
    OnInit:
        setarray .@table_name$[0],
            "inventory",
            "cart_inventory",
            "storage",
            "guild_storage",
            "mail",
            "auction";
            
        // Card constants or IDs to delete
        setarray .@card_id[0],
            Sealed_TurtleG_Card,
            SLD_Lord_Of_Death_Card;
                
            
        // Loop through all tables to clear
        for (.@i = 0; .@i < getarraysize(.@table_name$); .@i++) {   
            // Loop through all cards to delete
            for (.@j = 0; .@j < getarraysize(.@card_id); .@j++) {
                // Delete card from table
                query_sql "DELETE FROM `"+ .@table_name$[.@i] +"` WHERE `nameid` = '"+ .@card_id[.@j] +"'";
                
                // Remove compounded cards
                query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card0` = '0' WHERE `card0` = '"+ .@card_id[.@j] +"'";
                query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card1` = '0' WHERE `card1` = '"+ .@card_id[.@j] +"'";
                query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card2` = '0' WHERE `card2` = '"+ .@card_id[.@j] +"'";
                query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card3` = '0' WHERE `card3` = '"+ .@card_id[.@j] +"'";
            }
        }
        
        // Confirm completion
        announce "Restricted cards have been removed from the server.", bc_all;
        end;
 
}
 
Viewed 673 times, submitted by karazu.