Пример #1
0
            } else {
                $mapstring .= "<img src='images/" . $floor . ".gif'>";
            }
        }
        $mapstring .= "<br>";
    }
    $reportintro .= "|";
    if ($reportmap != "") {
        $reportinitiative .= "|";
        $reporttext .= "|";
    }
    $reportmap .= $mapstring . "|";
}
$reportinitiative .= "|";
$reporttext .= "|";
giveLoot();
$reportintro = addslashes($reportintro);
$reportinitiative = addslashes($reportinitiative);
$reportmap = addslashes($reportmap);
$reporttext = addslashes($reporttext);
echo "<span style='color:yellow;'>";
print_r($totalloot);
echo "</span>";
$conn = mysqli_connect("ucfsh.ucfilespace.uc.edu", "piattjd", "curtis1", "piattjd");
//mysqli_query($conn, "DELETE FROM Party WHERE partyid = '$hero[party]'");
foreach ($partyfighters as $hero) {
    mysqli_query($conn, "INSERT INTO Reports (heroid, timestamp, dungeon, reportintro, reportinitiative, reportmap, reporttext) VALUES ('{$hero['id']}', '{$cd}', '{$dungeonname}', '{$reportintro}', '{$reportinitiative}', '{$reportmap}', '{$reporttext}')") or die(mysqli_error($conn));
    if ($hero['dungeonlevel'] <= $dungeonlevel) {
        mysqli_query($conn, "UPDATE Hero SET dungeonlevel = '{$dungeonlevel}' + 1 WHERE id = '{$hero['id']}'");
        //mysqli_query($conn, "UPDATE Hero SET cd = '$cd' WHERE id = '$hero[id]'");
        //mysqli_query($conn, "UPDATE Hero SET party = '0' WHERE id = '$hero[id]'");
Пример #2
0
function checkForLootDrop($monster, &$charData)
{
    $isElite = isset($monster->elite);
    $chanceInSix = rand(1, 6);
    $output = "";
    // 5,6:	Loot
    if ($chanceInSix > 4) {
        $output = giveLoot($monster, $charData);
    } else {
        if ($chanceInSix > 1) {
            $output = giveGold($monster, $charData);
        } else {
            $output = "You find nothing of note on the {$monster->name}. ";
        }
    }
    return $output;
}