");
output("`nIf you wish to delete a mount, you have to deactivate it first.");
output("If there are any owners of the mount when it is deleted, they will no longer have a mount, but they will get a FULL refund of the price of the mount at the time of deletion.");
}elseif ($op=="add"){
output("Add a mount:`n");
addnav("Mount Editor Home","mounts.php");
mountform(array());
}elseif ($op=="edit"){
addnav("Mount Editor Home","mounts.php");
$sql = "SELECT * FROM " . db_prefix("mounts") . " WHERE mountid='$id'";
$result = db_query_cached($sql, "mountdata-$id", 3600);
if (db_num_rows($result)<=0){
output("`iThis mount was not found.`i");
}else{
addnav("Mount properties", "mounts.php?op=edit&id=$id");
module_editor_navs("prefs-mounts", "mounts.php?op=edit&subop=module&id=$id&module=");
$subop=httpget("subop");
if ($subop=="module") {
$module = httpget("module");
rawoutput("");
addnav("", "mounts.php?op=save&subop=module&id=$id&module=$module");
} else {
output("Mount Editor:`n");
$row = db_fetch_assoc($result);
$row['mountbuff']=unserialize($row['mountbuff']);
mountform($row);
}
}
}
function mountform($mount){
// Let's sanitize the data
if (!isset($mount['mountname'])) $mount['mountname'] = "";
if (!isset($mount['mountid'])) $mount['mountid'] = "";
if (!isset($mount['mountdesc'])) $mount['mountdesc'] = "";
if (!isset($mount['mountcategory'])) $mount['mountcategory'] = "";
if (!isset($mount['mountlocation'])) $mount['mountlocation'] = 'all';
if (!isset($mount['mountdkcost'])) $mount['mountdkcost'] = 0;
if (!isset($mount['mountcostgems'])) $mount['mountcostgems'] = 0;
if (!isset($mount['mountcostgold'])) $mount['mountcostgold'] = 0;
if (!isset($mount['mountfeedcost'])) $mount['mountfeedcost'] = 0;
if (!isset($mount['mountforestfights'])) $mount['mountforestfights'] = 0;
if (!isset($mount['newday'])) $mount['newday'] = "";
if (!isset($mount['recharge'])) $mount['recharge'] = "";
if (!isset($mount['partrecharge'])) $mount['partrecharge'] = "";
if (!isset($mount['mountbuff'])) $mount['mountbuff'] = array();
if (!isset($mount['mountactive'])) $mount['mountactive']=0;
if (!isset($mount['mountbuff']['name']))
$mount['mountbuff']['name'] = "";
if (!isset($mount['mountbuff']['roundmsg']))
$mount['mountbuff']['roundmsg'] = "";
if (!isset($mount['mountbuff']['wearoff']))
$mount['mountbuff']['wearoff'] = "";
if (!isset($mount['mountbuff']['effectmsg']))
$mount['mountbuff']['effectmsg'] = "";
if (!isset($mount['mountbuff']['effectnodmgmsg']))
$mount['mountbuff']['effectnodmgmsg'] = "";
if (!isset($mount['mountbuff']['effectfailmsg']))
$mount['mountbuff']['effectfailmsg'] = "";
if (!isset($mount['mountbuff']['rounds']))
$mount['mountbuff']['rounds'] = 0;
if (!isset($mount['mountbuff']['atkmod']))
$mount['mountbuff']['atkmod'] = "";
if (!isset($mount['mountbuff']['defmod']))
$mount['mountbuff']['defmod'] = "";
if (!isset($mount['mountbuff']['invulnerable']))
$mount['mountbuff']['invulnerable'] = "";
if (!isset($mount['mountbuff']['regen']))
$mount['mountbuff']['regen'] = "";
if (!isset($mount['mountbuff']['minioncount']))
$mount['mountbuff']['minioncount'] = "";
if (!isset($mount['mountbuff']['minbadguydamage']))
$mount['mountbuff']['minbadguydamage'] = "";
if (!isset($mount['mountbuff']['maxbadguydamage']))
$mount['mountbuff']['maxbadguydamage'] = "";
if (!isset($mount['mountbuff']['mingoodguydamage']))
$mount['mountbuff']['mingoodguydamage'] = "";
if (!isset($mount['mountbuff']['maxgoodguydamage']))
$mount['mountbuff']['maxgoodguydamage'] = "";
if (!isset($mount['mountbuff']['lifetap']))
$mount['mountbuff']['lifetap'] = "";
if (!isset($mount['mountbuff']['damageshield']))
$mount['mountbuff']['damageshield'] = "";
if (!isset($mount['mountbuff']['badguydmgmod']))
$mount['mountbuff']['badguydmgmod'] = "";
if (!isset($mount['mountbuff']['badguyatkmod']))
$mount['mountbuff']['badguyatkmod'] = "";
if (!isset($mount['mountbuff']['badguydefmod']))
$mount['mountbuff']['badguydefmod'] = "";
rawoutput("");
}
page_footer();
?>