function mountaccessories_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "boughtmount":
        case "soldmount":
            $accs = get_player_acc_list();
            $hadaccessories = count($accs);
            if ($hadaccessories != 0) {
                output("Merick merrily strips off the accessories adorning your previous mount, and tosses them into a pile in the corner.  \"Ye'll nae be needin' these any more, I dare wager!\"`n`nYou contemplate asking him for the accessories back, or perhaps some money for them - but the slightly manic look in Merick's eye, and the sharpened pitchfork slung across his back, give you second thoughts.`n");
            }
            strip_accessories();
            addnav("Browse Mount Accessories", "runmodule.php?module=mountaccessories&op=browse");
            if ($session['user']['hashorse'] == 0) {
                blocknav("runmodule.php?module=mountaccessories&op=browse");
            }
            break;
        case "newday":
            apply_all_accessories();
            break;
        case "superuser":
            addnav("Edit Mount Accessories", "runmodule.php?module=mountaccessories&op=editdefaultaccessories");
            break;
        case "stables-nav":
            if ($session['user']['hashorse'] > 0) {
                addnav("Browse Mount Accessories", "runmodule.php?module=mountaccessories&op=browse");
            }
            break;
        case "charstats":
            if ($session['user']['hashorse'] > 0) {
                $rawaccs = get_player_acc_list();
                $display = "";
                $number = 0;
                foreach ($rawaccs as $acc => $details) {
                    $number++;
                    $display .= $details['displayname'];
                    $display .= "<br>";
                }
                $stat = "Mount Accessories";
                if ($number == 0) {
                    $display = "None";
                }
                setcharstat("Equipment Info", $stat, $display);
            }
            break;
    }
    return $args;
}
function strip_accessories()
{
    global $session;
    $accs = get_player_acc_list($userid);
    foreach ($accs as $acc => $details) {
        strip_buff($acc);
        modulehook("mountaccessories_strip_accessories", $acc);
    }
    $blank = array();
    set_module_pref("accessories", serialize($blank), "mountaccessories");
}