mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-18 17:42:09 +00:00
properties with missing stat1 and multiple stats item description done for unique items
This commit is contained in:
228
genDocs.php
228
genDocs.php
@@ -207,8 +207,8 @@ if ($cmd == "genDocCube") {
|
||||
$htmlFinal = '';
|
||||
$htmlFinal .= $htmltop;
|
||||
|
||||
// echo $htmltop;
|
||||
// ob_flush();
|
||||
echo $htmltop;
|
||||
ob_flush();
|
||||
|
||||
$table = <<<EOT
|
||||
<table border=1 class="cubetable">
|
||||
@@ -229,9 +229,9 @@ if ($cmd == "genDocCube") {
|
||||
</thead>
|
||||
<tbody>
|
||||
EOT;
|
||||
//echo $table;
|
||||
echo $table;
|
||||
$htmlFinal .= $table;
|
||||
//ob_flush();
|
||||
ob_flush();
|
||||
$i_params = [
|
||||
"any" => "Any Item",
|
||||
"low" => "Low Quality",
|
||||
@@ -265,9 +265,12 @@ EOT;
|
||||
];
|
||||
|
||||
// get all cube rows
|
||||
$sql = "SELECT * FROM cubemain WHERE enabled=1";
|
||||
// changed enabled=1 to enabled > 0 for CubeOps.dll users
|
||||
|
||||
$sql = "SELECT * FROM cubemain WHERE enabled > 0";
|
||||
$res = PDO_FetchAll($sql);
|
||||
|
||||
|
||||
// process each cube row here
|
||||
foreach ($res as $r) {
|
||||
$desc = str_replace('+', '<br>+<br>', $r['description']);
|
||||
@@ -496,7 +499,7 @@ EOT;
|
||||
|
||||
for ($i = 1; $i <= 7; $i++) {
|
||||
|
||||
$htmlRow .= "<td class='input$i'>";
|
||||
$htmlRow .= "<td class='_input$i'>"; // replace _input with input to get grey td bg colors back
|
||||
if (!empty($output["input $i"]["img"])) {
|
||||
$htmlRow .= "<img src='img/items/{$output["input $i"]["img"]}'><br>";
|
||||
if (str_contains($output["input $i"][0], "ÿc")) {
|
||||
@@ -526,7 +529,7 @@ EOT;
|
||||
}
|
||||
|
||||
|
||||
$htmlRow .= "<td class='output1'>";
|
||||
$htmlRow .= "<td class='_output1'>"; // change _output to output
|
||||
if (!empty($output["output"]["img"])) {
|
||||
$htmlRow .= "<img src='img/items/{$output["output"]["img"]}'><br>";
|
||||
if (str_contains($output["output"][0], "ÿc")) {
|
||||
@@ -576,7 +579,7 @@ EOT;
|
||||
}
|
||||
$htmlRow .= "</td>";
|
||||
|
||||
$htmlRow .= "<td class='output2'>";
|
||||
$htmlRow .= "<td class='_output2'>"; // change _output2 to output
|
||||
if (!empty($output["output b"]["img"])) {
|
||||
$htmlRow .= "<img src='img/items/{$output["output b"]["img"]}'><br>";
|
||||
if (str_contains($output["output b"][0], "ÿc")) {
|
||||
@@ -609,7 +612,7 @@ EOT;
|
||||
}
|
||||
$htmlRow .= "</td>";
|
||||
|
||||
$htmlRow .= "<td class='output3'>";
|
||||
$htmlRow .= "<td class='_output3'>"; // change _output3 to normal
|
||||
if (!empty($output["output c"]["img"])) {
|
||||
$htmlRow .= "<img src='img/items/{$output["output c"]["img"]}'><br>";
|
||||
if (str_contains($output["output c"][0], "ÿc")) {
|
||||
@@ -643,19 +646,21 @@ EOT;
|
||||
$htmlRow .= "</td>";
|
||||
$htmlRow .= "</tr>";
|
||||
|
||||
// echo $htmlRow;
|
||||
// ob_flush();
|
||||
echo $htmlRow;
|
||||
ob_flush();
|
||||
|
||||
$htmlFinal .= $htmlRow;
|
||||
// ob_flush();
|
||||
ob_flush();
|
||||
unset($output);
|
||||
}// end each row loop
|
||||
|
||||
$tableBottom = '</tbody><table>';
|
||||
//echo $tableBottom;
|
||||
//echo $htmlbottom;
|
||||
//ob_flush();
|
||||
echo $tableBottom;
|
||||
echo $htmlbottom;
|
||||
ob_flush();
|
||||
$htmlFinal .= $tableBottom . $htmlbottom;
|
||||
|
||||
// echo $htmlFinal;
|
||||
|
||||
// save file and redirect to it
|
||||
file_put_contents("$dir/cubemain.html", $htmlFinal);
|
||||
@@ -1232,7 +1237,7 @@ if ($cmd == 'genDocArmor') {
|
||||
$tableTop = <<<EOT
|
||||
<style>
|
||||
body { font-family: Tahoma,Arial,Sans-Serif}
|
||||
table { font-family: ExocetHeavy;}
|
||||
table { font-family: ;}
|
||||
</style>
|
||||
<table border=1 class="mtable">
|
||||
<thead>
|
||||
@@ -1244,7 +1249,6 @@ if ($cmd == 'genDocArmor') {
|
||||
<th>Min AC</th>
|
||||
<th>Max AC</th>
|
||||
<th>Block Chance</th>
|
||||
<th>Set/Unique Exceptional & Elite</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -1263,10 +1267,15 @@ EOT;
|
||||
} else {
|
||||
$indestructable = "No";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$imgUnique = (!empty($r['uniqueinvfile'])) ? "{$strings[$r['ultracode']]}<br><img src='img/items/{$r['uniqueinvfile']}.png'>" : "";
|
||||
$imgSet = (!empty($r['setinvfile'])) ? "{$strings[$r['ubercode']]}<br><img src='img/items/{$r['setinvfile']}.png'>" : "";
|
||||
|
||||
|
||||
$imgUnique = (!empty($r['uniqueinvfile'])) ? "<br><img src='img/items/{$r['uniqueinvfile']}.png'>" : "";
|
||||
$imgSet = (!empty($r['setinvfile'])) ? "<br><img src='img/items/{$r['setinvfile']}.png'>" : "";
|
||||
|
||||
|
||||
if (!empty($r['auto prefix'])) {
|
||||
$sql = "SELECT * FROM automagic WHERE `group` = ?";
|
||||
$ret = PDO_FetchRow($sql, [$r['auto prefix']]);
|
||||
@@ -1307,27 +1316,29 @@ EOT;
|
||||
|
||||
$tr .= <<<EOT
|
||||
<tr>
|
||||
<td>
|
||||
<td style="text-align: left;">
|
||||
<ul>
|
||||
<li class="white h1">$name</li>
|
||||
<li class=""><img src="img/items/{$r['invfile']}.png"</li>
|
||||
<li class="blue">Defense: <span class="white">[{$r['minac']} - {$r['maxac']}]</span></li>
|
||||
<li class="blue">Weight: <span class="blue">{$r['speed']}</span></li>
|
||||
<li class="blue">Level: <span class="white">{$r['level']}</span></li>
|
||||
<li class="blue">Required Level: <span class="white">{$r['levelreq']}</span></li>
|
||||
<li class="blue">Required Strength: <span class="white">{$r['reqstr']}</span></li>
|
||||
<li class="blue">Indestructable: <span class="gold">$indestructable</span></li>
|
||||
<li class="blue">Durability: <span class="gold">{$r['durability']}</span></li>
|
||||
<li class="blue">Cost: <span class="gold">{$r['cost']}</span></li>
|
||||
<li class=""><img src="img/items/{$r['invfile']}.png">$imgC</li>
|
||||
<li class="white">Defense: <span class="blue">[{$r['minac']} - {$r['maxac']}]</span></li>
|
||||
<li class="white">Weight: <span class="blue">{$r['speed']}</span></li>
|
||||
<li class="white">Level: <span class="blue">{$r['level']}</span></li>
|
||||
<li class="white">Required Level: <span class="blue">{$r['levelreq']}</span></li>
|
||||
<li class="white">Required Strength: <span class="blue">{$r['reqstr']}</span></li>
|
||||
<li class="white">Indestructable: <span class="blue">$indestructable</span></li>
|
||||
<li class="white">Durability: <span class="blue">{$r['durability']}</span></li>
|
||||
<li class="gold">Cost: <span class="white">{$r['cost']}</span></li>
|
||||
|
||||
<li class="blue">Normal:
|
||||
<li class="white">Normal:
|
||||
<spap class="white">{$strings[$r['normcode']]}</span>
|
||||
</li>
|
||||
<li class="blue">Exceptional:
|
||||
<li class="blue">Exceptional:<br>
|
||||
<span class="white">{$strings[$r['ubercode']]}</span>
|
||||
$imgSet
|
||||
</li>
|
||||
<li class="blue">Elite:
|
||||
<li class="blue">Elite:<br>
|
||||
<span class="white">{$strings[$r['ultracode']]}</span>
|
||||
$imgUnique
|
||||
</li>
|
||||
<li class="blue">Sockets: <span class="white">{$r['gemsockets']}</span></li>
|
||||
<li class="blue" style="margin-top: 30px;">$autoprefix<span class="white">{$props[0]}</span></li>
|
||||
@@ -1346,10 +1357,6 @@ EOT;
|
||||
<td>Min AC: <br> {$r['minac']}</td>
|
||||
<td>Max AC: <br> {$r['maxac']}</td>
|
||||
<td>Block: <br> {$r['block']}</td>
|
||||
<td style="width: 100px;">
|
||||
<li>$imgUnique <br> $imgUnique</li>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
EOT;
|
||||
@@ -1359,9 +1366,150 @@ EOT;
|
||||
|
||||
$htmlFinal = $htmltop . $tableTop . $tr . $tableBottom . $htmlbottom;
|
||||
|
||||
// ob_flush();
|
||||
// echo $htmlFinal;
|
||||
ob_flush();
|
||||
echo $htmlFinal;
|
||||
|
||||
file_put_contents("$dir/armor.html", $htmlFinal);
|
||||
header("Location: docs/{$_SESSION['modname']}/armor.html");
|
||||
//file_put_contents("$dir/armor.html", $htmlFinal);
|
||||
//header("Location: docs/{$_SESSION['modname']}/armor.html");
|
||||
}
|
||||
|
||||
if ($cmd == 'genDocWeapons') {
|
||||
|
||||
$tableTop = <<<EOT
|
||||
<style>
|
||||
body { font-family: Tahoma,Arial,Sans-Serif}
|
||||
table { font-family: ;}
|
||||
</style>
|
||||
<table border=1 class="mtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Lvl</th>
|
||||
<th>Required Lvl</th>
|
||||
<th>Required Str</th>
|
||||
<th>Min AC</th>
|
||||
<th>Max AC</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
EOT;
|
||||
$tableBottom = '</tbody> </table>';
|
||||
|
||||
$sql = "SELECT * FROM weapons WHERE spawnable=1 AND namestr != ''";
|
||||
$res = PDO_FetchAll($sql);
|
||||
|
||||
foreach ($res as $r) {
|
||||
|
||||
$name = (!empty($strings[$r['namestr']])) ? $strings[$r['namestr']] : $r['name'];
|
||||
|
||||
if ($r['indestructible'] == '1') {
|
||||
$indestructable = "Yes";
|
||||
} else {
|
||||
$indestructable = "No";
|
||||
}
|
||||
|
||||
|
||||
$imgUnique = (!empty($r['uniqueinvfile'])) ? "<br><img src='img/items/{$r['uniqueinvfile']}.png'>" : "";
|
||||
$imgSet = (!empty($r['setinvfile'])) ? "<br><img src='img/items/{$r['setinvfile']}.png'>" : "";
|
||||
|
||||
if (!empty($r['auto prefix'])) {
|
||||
$sql = "SELECT * FROM automagic WHERE `group` = ?";
|
||||
$ret = PDO_FetchRow($sql, [$r['auto prefix']]);
|
||||
|
||||
// ddump($isc[$ret['mod1code']]);
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
if ($ret["mod{$i}code"] != '') {
|
||||
|
||||
// ddump($isc[$ret["mod{$i}code"]]['string1']);
|
||||
$params = [
|
||||
"string1" => $isc[$ret["mod{$i}code"]]["string1"],
|
||||
"string2" => $isc[$ret["mod{$i}code"]]["string2"],
|
||||
"gstring1" => $isc[$ret["mod{$i}code"]]["gstring"],
|
||||
"gstring2" => $isc[$ret["mod{$i}code"]]["gstring2"],
|
||||
"descfunc" => $isc[$ret["mod{$i}code"]]["descfunc"],
|
||||
"descval" => $isc[$ret["mod{$i}code"]]["descval"],
|
||||
"dgrp" => $isc[$ret["mod{$i}code"]]["dgrp"],
|
||||
"dgrpfunc" => $isc[$ret["mod{$i}code"]]["dgrpfunc"],
|
||||
"dgrpval" => $isc[$ret["mod{$i}code"]]["dgrpval"],
|
||||
"prop" => $isc[$ret["mod{$i}code"]]["prop"]
|
||||
];
|
||||
$params["par"] = $ret["mod{$i}param"];
|
||||
$params["min"] = $ret["mod{$i}min"];
|
||||
$params["max"] = $ret["mod{$i}max"];
|
||||
|
||||
$props[$i] = $idesc->getDesc($params);
|
||||
}
|
||||
}
|
||||
|
||||
// dump($props);
|
||||
$autoprefix = "Automagic/Auto prefix Mods";
|
||||
}
|
||||
|
||||
$strbonus = (!empty($r['StrBonus'])) ? "Strength Bonus: <span class='white'>{$r['StrBonus']}" : "";
|
||||
|
||||
if (empty($r['mindmg']) OR empty($r['maxdmg'])){
|
||||
$mindmg = $r['2handmindam'];
|
||||
$maxdmg = $r['2handmaxdam'];
|
||||
} else {
|
||||
$mindmg = $r['mindmg'];
|
||||
$maxdmg = $r['maxdmg'];
|
||||
}
|
||||
|
||||
$tr .= <<<EOT
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<ul>
|
||||
<li class="white h1">$name</li>
|
||||
<li class=""><img src="img/items/{$r['invfile']}.png"></li>
|
||||
<li class="white">Damage: <span class="blue">[$mindmg - $maxdmg]</span></li>
|
||||
<li class="white">Weight: <span class="blue">{$r['speed']}</span></li>
|
||||
<li class="white">Level: <span class="blue">{$r['level']}</span></li>
|
||||
<li class="white">Required Level: <span class="blue">{$r['levelreq']}</span></li>
|
||||
<li class="white">Required Strength: <span class="blue">{$r['reqstr']}</span></li>
|
||||
<li class="white">Indestructable: <span class="blue">$indestructable</span></li>
|
||||
<li class="white">Durability: <span class="blue">{$r['durability']}</span></li>
|
||||
<li class="gold">Cost: <span class="white">{$r['cost']}</span></li>
|
||||
|
||||
<li class="blue">Normal:
|
||||
<spap class="white">{$strings[$r['normcode']]}</span>
|
||||
</li>
|
||||
<li class="blue">Exceptional:
|
||||
<span class="white">{$strings[$r['ubercode']]}</span>
|
||||
$imgSet
|
||||
</li>
|
||||
<li class="blue">Elite:
|
||||
<span class="white">{$strings[$r['ultracode']]}</span>
|
||||
$imgUnique
|
||||
</li>
|
||||
<li class="blue">Sockets: <span class="white">{$r['gemsockets']}</span></li>
|
||||
<li class="blue" style="margin-top: 30px;">$autoprefix<span class="white">{$props[0]}</span></li>
|
||||
<li class="blue"><span class="white">{$props[1]}</span></li>
|
||||
<li class="blue" style="margin-bottom: 30px;"><span class="white">{$props[2]}</span></li>
|
||||
<li class="blue">$strbonus</li>
|
||||
<li class="blue">$block</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</td>
|
||||
<td>Level: <br> {$r['level']}</td>
|
||||
<td>Level Required: <br> {$r['levelreq']}</td>
|
||||
<td>Requird Strength: <br> {$r['reqstr']}</td>
|
||||
<td>Min Dmg: <br> {$mindmg}</td>
|
||||
<td>Max Dmg: <br> {$maxdmg}</td>
|
||||
</tr>
|
||||
|
||||
EOT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$htmlFinal = $htmltop . $tableTop . $tr . $tableBottom . $htmlbottom;
|
||||
|
||||
ob_flush();
|
||||
echo $htmlFinal;
|
||||
|
||||
file_put_contents("$dir/weapons.html", $htmlFinal);
|
||||
header("Location: docs/{$_SESSION['modname']}/weapons.html");
|
||||
}
|
Reference in New Issue
Block a user