mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 12:36:03 +00:00
latest.
This commit is contained in:
parent
ab78848845
commit
caf675cff5
95
genDocs.php
95
genDocs.php
@ -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,7 +297,7 @@ 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, ',')) {
|
||||
@ -371,7 +377,10 @@ 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]];
|
||||
//}
|
||||
@ -388,7 +397,6 @@ EOT;
|
||||
//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]);
|
||||
@ -422,6 +430,57 @@ EOT;
|
||||
$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);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -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"]) {
|
||||
|
@ -150,10 +150,12 @@ class D2ItemDesc {
|
||||
* @var
|
||||
*/
|
||||
public $skilltabsDesc;
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
public $skilltabsDescClean;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
@ -187,6 +189,7 @@ class D2ItemDesc {
|
||||
'19' => 'StrSklTabItem20',
|
||||
'20' => 'StrSklTabItem21'
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
@ -299,7 +302,6 @@ class D2ItemDesc {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $params
|
||||
* @return false|string
|
||||
@ -308,7 +310,7 @@ class D2ItemDesc {
|
||||
if (empty($params))
|
||||
return false;
|
||||
|
||||
//ddump($params);
|
||||
//var_dump($params);
|
||||
|
||||
$s1 = $params['string1'];
|
||||
$s2 = $params['string2'];
|
||||
@ -324,10 +326,46 @@ class D2ItemDesc {
|
||||
// $params['descval'] = $params['dgrpval'];
|
||||
// }
|
||||
|
||||
$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>",
|
||||
"noe" => "<span style='color: #ccc;'>Not Ethereal<span>",
|
||||
"nos" => "No Socket (for input)",
|
||||
"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",
|
||||
"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",
|
||||
"uns" => "Unsocket Item(destroys gems)",
|
||||
"rem" => "Unsocket Item(removes gems)",
|
||||
"reg" => "Regenerate? Seems to reroll the item",
|
||||
"mod" => "Transfers properties from input1 to output item.",
|
||||
"levelreq" => "To level requirements"
|
||||
];
|
||||
|
||||
if (empty($s1)) {
|
||||
if (empty($s1)) {
|
||||
if (array_key_exists($prop, $i_params)) {
|
||||
$this->str = "$min " . $i_params[$prop];
|
||||
} else {
|
||||
$this->str = $prop;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($par)) {
|
||||
$v = $min;
|
||||
@ -339,7 +377,7 @@ class D2ItemDesc {
|
||||
$max = '';
|
||||
}
|
||||
|
||||
if (empty($this->skilltabsDesc)){
|
||||
if (empty($this->skilltabsDesc)) {
|
||||
|
||||
foreach ($this->skilltabs as $s) {
|
||||
$sql = "SELECT String FROM strings WHERE Key=?";
|
||||
|
Loading…
Reference in New Issue
Block a user