mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-18 01:22:08 +00:00
item parsing not yet working fully
This commit is contained in:
@@ -134,6 +134,8 @@ class D2Item {
|
||||
$class_specific = bindec($b->readr(11));
|
||||
}
|
||||
|
||||
|
||||
//var_dump($b->getOffset());
|
||||
|
||||
//
|
||||
{
|
||||
@@ -178,19 +180,29 @@ class D2Item {
|
||||
case D2ItemQuality::MAGIC:
|
||||
// read 11 bits, prefix.
|
||||
// if no prefix, then next 11 bits will be suffix
|
||||
$this->iData['$magic_prefix'] = bindec($b->readr(11));
|
||||
$this->iData['magic_prefix'] = bindec($b->readr(11));
|
||||
$this->iData['magic_suffix'] = bindec($b->readr(11));
|
||||
break;
|
||||
case D2ItemQuality::SET:
|
||||
// Set items have a 12-bit field containing the ID of the set. (Not the set member, but the whole set.) The set member is identified by cross-referencing the item type with the set ID. Also note that set items have an extra field following the item-specific data.
|
||||
// Set identifier; i.e., all items which are part of the set will have the same value in this field.
|
||||
$set_item = bindec($b->readr(12));
|
||||
//var_dump($b->getOffset());
|
||||
$setid = bindec($b->readr(12));
|
||||
//var_dump($setid);
|
||||
$sql = "SELECT ROWID,* from sets WHERE ROWID=$setid";
|
||||
$res = PDO_FetchRow($sql);
|
||||
|
||||
//ddump($res);
|
||||
|
||||
$this->iData["setname"] = $res;
|
||||
|
||||
break;
|
||||
case D2ItemQuality::RARE:
|
||||
$this->iData['iquality'] = "Rare";
|
||||
break;
|
||||
case D2ItemQuality::UNIQUE:
|
||||
$this->iData['iquality'] = "Unique";
|
||||
//Unique items have an additional 12 bit field, which in most cases is the unique item ID. The few exceptions are certain quest items (e.g., the Horadric Malus).
|
||||
$uni_item = bindec($b->readr(12));
|
||||
break;
|
||||
case D2ItemQuality::CRAFTED:
|
||||
$this->iData['iquality'] = "Crafted";
|
||||
@@ -304,7 +316,9 @@ class D2Item {
|
||||
$sql = "SELECT * from weapons WHERE code = '{$this->iData['code']}'";
|
||||
$res = PDO_FetchRow($sql);
|
||||
}
|
||||
//$this->iData['txt'] = ($res);
|
||||
|
||||
// set txt data array
|
||||
$this->iData['txt'] = ($res);
|
||||
|
||||
$sql = "
|
||||
SELECT code, namestr
|
||||
|
Reference in New Issue
Block a user