mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-04-27 14:55:38 +00:00
More item parsing, still not done
This commit is contained in:
parent
7b0f6e152c
commit
caa8377131
@ -340,8 +340,8 @@ class D2Item {
|
|||||||
$this->defense = $this->b->read(11);
|
$this->defense = $this->b->read(11);
|
||||||
$this->_defense = bindec(strrev($this->defense)) - 10;
|
$this->_defense = bindec(strrev($this->defense)) - 10;
|
||||||
|
|
||||||
//var_dump("Def:" . $this->defense);
|
var_dump("Def:" . $this->defense);
|
||||||
//var_dump("Def:" . $this->_defense);
|
var_dump("Def:" . $this->_defense);
|
||||||
|
|
||||||
// armors are missing a full byte here
|
// armors are missing a full byte here
|
||||||
// if we insert all 0s, it evens out, but is wrong
|
// if we insert all 0s, it evens out, but is wrong
|
||||||
@ -354,16 +354,16 @@ class D2Item {
|
|||||||
$this->maxdurability = "" . $this->b->read(8);
|
$this->maxdurability = "" . $this->b->read(8);
|
||||||
$this->_maxdurability = bindec(strrev($this->maxdurability));
|
$this->_maxdurability = bindec(strrev($this->maxdurability));
|
||||||
|
|
||||||
//var_dump("MaxDur:" . $this->maxdurability);
|
var_dump("MaxDur:" . $this->maxdurability);
|
||||||
//var_dump("MaxDur:" . $this->_maxdurability);
|
var_dump("MaxDur:" . $this->_maxdurability);
|
||||||
|
|
||||||
//Only exists if the item's max durability is greater than zero
|
//Only exists if the item's max durability is greater than zero
|
||||||
//The first 8 bits are the item's current durability. The last bit is unknown.
|
//The first 8 bits are the item's current durability. The last bit is unknown.
|
||||||
if ($this->maxdurability !== 0) {
|
if ($this->maxdurability !== 0) {
|
||||||
$this->currentdurability = $this->b->read(9);
|
$this->currentdurability = $this->b->read(9);
|
||||||
$this->_currentdurability = bindec(strrev($this->currentdurability));
|
$this->_currentdurability = bindec(strrev($this->currentdurability));
|
||||||
//var_dump("CurDur:" . $this->currentdurability);
|
var_dump("CurDur:" . $this->currentdurability);
|
||||||
//var_dump("CurDur:" . $this->_currentdurability);
|
var_dump("CurDur:" . $this->_currentdurability);
|
||||||
//$this->currentdurability_unknown_bit = $this->b->read(1);
|
//$this->currentdurability_unknown_bit = $this->b->read(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -375,16 +375,16 @@ class D2Item {
|
|||||||
$this->maxdurability = $this->b->read(8);
|
$this->maxdurability = $this->b->read(8);
|
||||||
$this->_maxdurability = bindec(strrev($this->maxdurability));
|
$this->_maxdurability = bindec(strrev($this->maxdurability));
|
||||||
|
|
||||||
//var_dump("MaxDur:" . $this->maxdurability);
|
var_dump("MaxDur:" . $this->maxdurability);
|
||||||
//var_dump("MaxDur:" . $this->_maxdurability);
|
var_dump("MaxDur:" . $this->_maxdurability);
|
||||||
|
|
||||||
//Only exists if the item's max durability is greater than zero
|
//Only exists if the item's max durability is greater than zero
|
||||||
//The first 8 bits are the item's current durability. The last bit is unknown.
|
//The first 8 bits are the item's current durability. The last bit is unknown.
|
||||||
if ($this->maxdurability !== 0) {
|
if ($this->maxdurability !== 0) {
|
||||||
$this->currentdurability = $this->b->read(9);
|
$this->currentdurability = $this->b->read(9);
|
||||||
$this->_currentdurability = bindec(strrev($this->currentdurability));
|
$this->_currentdurability = bindec(strrev($this->currentdurability));
|
||||||
//var_dump("CurDur:" . $this->currentdurability);
|
var_dump("CurDur:" . $this->currentdurability);
|
||||||
//var_dump("CurDur:" . $this->_currentdurability);
|
var_dump("CurDur:" . $this->_currentdurability);
|
||||||
//$this->currentdurability_unknown_bit = $this->b->read(1);
|
//$this->currentdurability_unknown_bit = $this->b->read(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -393,7 +393,7 @@ class D2Item {
|
|||||||
|
|
||||||
if ($this->txt['stackable'] == 1) {
|
if ($this->txt['stackable'] == 1) {
|
||||||
$this->stackable = $this->b->read(9);
|
$this->stackable = $this->b->read(9);
|
||||||
//var_dump("stackable: " . bindec(strrev($this->stackable)));
|
var_dump("stackable: " . bindec(strrev($this->stackable)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -402,8 +402,8 @@ class D2Item {
|
|||||||
$this->numsockets = $this->b->read(4);
|
$this->numsockets = $this->b->read(4);
|
||||||
$this->_numsockets = bindec(strrev($this->numsockets));
|
$this->_numsockets = bindec(strrev($this->numsockets));
|
||||||
//$this->numsockets_extra_bit = $this->b->read(1);
|
//$this->numsockets_extra_bit = $this->b->read(1);
|
||||||
//var_dump("numsock: " . $this->numsockets);
|
var_dump("numsock: " . $this->numsockets);
|
||||||
//var_dump("numsock: " . $this->_numsockets);
|
var_dump("numsock: " . $this->_numsockets);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set properties bit field, used later for reading the set property lists of the item
|
// Set properties bit field, used later for reading the set property lists of the item
|
||||||
@ -438,22 +438,39 @@ class D2Item {
|
|||||||
$property = $this->b->read(9);
|
$property = $this->b->read(9);
|
||||||
$_property = bindec(strrev($property));
|
$_property = bindec(strrev($property));
|
||||||
|
|
||||||
|
$val1;
|
||||||
|
$_val1;
|
||||||
|
$val2;
|
||||||
|
$_val2;
|
||||||
|
|
||||||
for ($i = 0; $i < 10; $i++) {
|
for ($i = 0; $i < 10; $i++) {
|
||||||
if ($isc[$_property]['Save Bits']) {
|
if ($isc[$_property]['Save Bits']) {
|
||||||
$val = $this->b->read($isc[$_property]['Save Bits']);
|
switch ($_property) {
|
||||||
$_val = bindec(strrev($val));
|
case 17:
|
||||||
|
$props[$property][] = $this->b->read($isc[$_property]['Save Bits']);
|
||||||
|
$props[$property][] = $this->b->read($isc[$_property]['Save Bits']);
|
||||||
|
break;
|
||||||
|
case 48:
|
||||||
|
$props[$property][] = $this->b->read($isc[$_property]['Save Bits']);
|
||||||
|
$props[$property][] = $this->b->read($isc[$_property]['Save Bits']);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$props[$property][] = $this->b->read($isc[$_property]['Save Bits']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
$property = $this->b->read(9);
|
$property = $this->b->read(9);
|
||||||
$_property = bindec(strrev($property));
|
$_property = bindec(strrev($property));
|
||||||
//var_dump($isc[$_property]['Stat']);
|
if ($_property == 511) {
|
||||||
//var_dump($property);
|
echo 511;
|
||||||
//var_dump($_property);
|
break;
|
||||||
//var_dump($val);
|
}
|
||||||
//var_dump($_val);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////var_dump($isc[$_property]);
|
|
||||||
|
$this->props = $props;
|
||||||
|
|
||||||
|
var_dump($this->props);
|
||||||
|
|
||||||
if ($this->simple) {
|
if ($this->simple) {
|
||||||
echo "Simple";
|
echo "Simple";
|
||||||
@ -543,6 +560,16 @@ class D2Item {
|
|||||||
$values[] = $this->setfield;
|
$values[] = $this->setfield;
|
||||||
$values[] = $this->magicammo;
|
$values[] = $this->magicammo;
|
||||||
$values[] = $this->tpot;
|
$values[] = $this->tpot;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// foreach($this->props as $k => $v){
|
||||||
|
// $values[] = $k;
|
||||||
|
// $values[] = $v[0];
|
||||||
|
// $values[] = $v[1] ?? '';
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
$values[] = "";
|
$values[] = "";
|
||||||
$values[] = "";
|
$values[] = "";
|
||||||
$values[] = "";
|
$values[] = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user