This commit is contained in:
Hash Borgir 2023-08-19 17:32:13 -06:00
parent ab78848845
commit caf675cff5
2 changed files with 685 additions and 588 deletions

View File

@ -79,6 +79,12 @@ $strings = $idoc->getStrings();
$itemtypesTbl = $idoc->getItemTypesTbl();
$namestr = $idoc->getNameStr();
$query = "SELECT ROWID,* FROM magicprefix";
$mpre = PDO_FetchAll($query);
$query = "SELECT ROWID,* FROM magicsuffix";
$spre = PDO_FetchAll($query);
// htmlTop was huge, so put it into another file and just include it
require_once 'templates/htmlTop.php';
$htmlbottom = "</div></body></html>";
@ -230,32 +236,32 @@ EOT;
$i_params = [
"any" => "Any Item",
"low" => "Low Quality",
"hiq" => "Superior",
"nor" => "Normal",
"mag" => "<span class='blue'>Magic<span>",
"rar" => "<span class='yellow'>Rare<span>",
"set" => "<span class='green'>Set<span>",
"uni" => "<span class='gold'>Unique<span>",
"crf" => "<span class='orange'>Crafted<span>",
"tmp" => "<span class='orange'>Tempered<span>",
"eth" => "<span style='color: #ccc;'>Ethereal<span>",
"hiq" => "Superior Quality",
"nor" => "Normal Quality",
"mag" => "<span class='blue'>Magic<span> item",
"rar" => "<span class='yellow'>Rare<span> item",
"set" => "<span class='green'>Set<span> item",
"uni" => "<span class='gold'>Unique<span> item",
"crf" => "<span class='orange'>Crafted<span> item",
"tmp" => "<span class='orange'>Tempered<span> item",
"eth" => "<span style='color: #ccc;'>Ethereal<span>item ",
"noe" => "<span style='color: #ccc;'>Not Ethereal<span>",
"nos" => "No Socket (for input)",
"nos" => "No Socket (for input1)",
"sock" => "Sockets",
"pre" => "Prefix (ID from magicprefix.txt) - ID => (Row Number - 2)",
"suf" => "Suffix (ID from magicsuffix.txt) - ID => (Row Number - 2)",
"rep" => "Repair durability",
"rch" => "Recharge Quantity",
"rep" => "Repair item durability",
"rch" => "Recharge all of the skill charges on the Item",
"qty" => 'Quantity',
"upg" => "For inputs only, Item is upgraded.",
"bas" => "Base item",
"exc" => "Exceptional",
"eli" => "Elite",
"usetype" => "Uses base type of input1 for output",
"useitem" => "Uses item from input 1",
"useitem" => "Uses item from input1",
"uns" => "Unsocket Item(destroys gems)",
"rem" => "Unsocket Item(removes gems)",
"reg" => "Regenerate? Seems to reroll the item",
"reg" => "Reroll the item",
"mod" => "Transfers properties from input1 to output item.",
];
@ -291,8 +297,8 @@ EOT;
"input 7" => $r["input 7"],
]);
$input1_code = explode(',',$r['input 1'])[0];
$input1_code = explode(',', $r['input 1'])[0];
foreach ($input_codes as $inputNum => $value) {
if (str_contains($value, ',')) {
$input_codes[$inputNum] = explode(",", $value); // hpot,qty=3
@ -371,9 +377,12 @@ EOT;
$oarray = explode(",", $value); // hpot,qty=3
if ($oarray[0] == 'usetype' || $oarray[0] == 'useitem') {
$oarray[0] = $input1_code;
$oarray[2] = $i_params[$oarray[2]];
}
//var_dump($oarray);
//if (in_array($oarray[0], $strings)) {
$str = $strings[$oarray[0]];
$str = $strings[$oarray[0]];
//}
// "SELECT `String` FROM `strings` WHERE Key=\"{$oarray[0]}\"";
// clean str
@ -383,12 +392,11 @@ EOT;
$str = preg_replace($p, "", $str);
}
// what if we set it to input codes 1 code
//var_dump($strings[$oarray[0]]);
// var_dump($oarray[0]);
// var_dump($str);
// if empty, str == 4-letter code, so just display
if (empty($str)) {
$output_codes[$outputNum][0] = ($oarray[0]);
@ -421,7 +429,58 @@ EOT;
$e = explode("=", $mod[1]);
$output_codes[$outputNum]['code'] = $e[0];
$output_codes[$outputNum]['value'] = $e[1];
// if ($e[0] == 'pre') {
// $e[1]++;
//
// $pre = $mpre[$e[1]];
//
// for ($i = 1; $i <= 3; $i++) {
//
// $mods = array_filter([
// "mod{$i}code" => $pre["mod{$i}code"],
// "mod{$i}param" => $pre["mod{$i}param"],
// "mod{$i}min" => $pre["mod{$i}min"],
// "mod{$i}max" => $pre["mod{$i}max"],
// ]);
// }
//
// // var_dump($output['mods']);
// foreach ($mods as $k => $v) {
// $prop = ($v["mod " . $k + 1]);
// $par = ($v["mod{$k}param"]) ?? "";
// $min = ($v["mod{$k}min"]) ?? $max;
// $max = ($v["mod{$k}max"]) ?? $min;
//
// //var_dump($isc[$prop]);
//
// $pre['mods'][$k]["isc"] = $isc[$prop];
//
//
//
// $params = [
// 'string1' => $pre['mods'][$k]["isc"]['string1'],
// 'string2' => $pre['mods'][$k]["isc"]['string2'],
// 'descfunc' => $pre['mods'][$k]["isc"]['descfunc'],
// 'descval' => $pre['mods'][$k]["isc"]['descval'],
// "prop" => $prop,
// "par" => $par,
// "min" => $min,
// "max" => $max,
// // "val1" => $funcval['val1'],
// // "func1" => $funcval['func1']
// // 'item' => $return
// ];
//
// //var_dump($idesc->getDesc($params));
//
// $output['pre']['mods'][$k]["str"] = $idesc->getDesc($params);
// }
// }
}
}
@ -455,7 +514,7 @@ EOT;
$m[] = array_filter($mods);
}
$output['mods'] = array_filter($m);
//var_dump($output['mods']);
$result = [];
@ -484,12 +543,10 @@ EOT;
// 'item' => $return
];
//var_dump($idesc->getDesc($params));
$output['mods'][$k]["str"] = $idesc->getDesc($params);
}
@ -567,6 +624,8 @@ EOT;
$htmlRow .= $output["output"][1] . "<br>";
}
$htmlRow .= $i_params[$output["output"][2]] . "<br>";
for ($i = 1; $i <= 5; $i++) {
if ($output["mods"][0]["mod $i"]) {

File diff suppressed because it is too large Load Diff