# DOSHOP.INC
#
# actually plays a visit to a store
?>
include $DOCUMENT_ROOT."/functions.php"; ?>
$report = "-=".GiveDate($turn, "precise")."=-
";
$cost = 0;
if ($action == 2) {
$weapon = $param;
$charitemsW[$param]++;
$cost = $cost + $param2;
$addreport = "Bought : ".$Tweapon[$weapon]." for ".$cost."
";
}
if ($action == 3) {
switch ($Tatype[$param]) {
case "1" : $armor = $param; break;
case "2" : $shield = $param; break;
case "3" : $armorplus = $param; break;
case "4" : $shieldplus = $param; break;
}
$charitemsA[$param]++;
$addreport = "Bought : ".$Tarmor[$armor]." for ".$cost."
";
$cost = $cost + $param2;
}
if ($action == 4) {
$charitemsF[$param]++;
$cost = $cost + $param2;
$addreport = "Bought : ".$Tfood[$param]." for ".$cost."
";
}
if ($action == 7) {
$charitemsO[$param]++;
$cost = $cost + $param2;
$addreport = "Bought : ".$Tobject[$param]." for ".$cost."
";
}
if ($totalgold < $cost) {
echoA("Not enough money !
");
} else {
$reportstory = $report.$addreport;
include Inc("dogold.inc");
RecrunchEquipment();
$result = mysql_query("UPDATE Characters SET Equipment='$equipment' WHERE Id=$id");
$result = mysql_query("UPDATE Characters SET Weapon='$weapon' WHERE Id=$id");
$result = mysql_query("UPDATE Characters SET Armor='$armor' WHERE Id=$id");
$result = mysql_query("UPDATE Characters SET Shield='$shield' WHERE Id=$id");
$result = mysql_query("UPDATE Characters SET ArmorPlus='$armorplus' WHERE Id=$id");
$result = mysql_query("UPDATE Characters SET ShieldPlus='$shieldplus' WHERE Id=$id");
}
?>