mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-12-02 21:46:03 +00:00
106 lines
3.1 KiB
PHP
106 lines
3.1 KiB
PHP
|
<?php
|
||
|
|
||
|
require_once 'D2BitReader.php';
|
||
|
|
||
|
class D2Item {
|
||
|
|
||
|
private string $_bits;
|
||
|
public $basename = ''; //name of the base item
|
||
|
public $item_name = ''; //name string
|
||
|
public $item_rank = ''; //normal/exceptional/elite
|
||
|
public $item_type = ''; //basic type: armor/weapon/misc
|
||
|
//flags
|
||
|
public $identified = 0;
|
||
|
public $sockets = 0;
|
||
|
public $ear = 0;
|
||
|
public $starter = 0;
|
||
|
public $compact = 0;
|
||
|
public $ethereal;
|
||
|
public $personalized;
|
||
|
public $runeword;
|
||
|
public $version;
|
||
|
public $runeword_name = '';
|
||
|
public $runes_title = '';
|
||
|
//placement
|
||
|
public $location = 0;
|
||
|
public $body = 0;
|
||
|
public $col = 0;
|
||
|
public $row = 0;
|
||
|
public $container = 0;
|
||
|
public $parent;
|
||
|
public $storage;
|
||
|
public $bodypart;
|
||
|
public $invH = 0;
|
||
|
public $invW = 0;
|
||
|
public $beltrows = 1;
|
||
|
//features
|
||
|
public $item_code = ''; //3 letter code from txt
|
||
|
public $SocketsFilled = 0;
|
||
|
public $SocketsNum = 0;
|
||
|
public $socketable = false; //gem, rune, jewel
|
||
|
public $fingerprint = '';
|
||
|
public $itemlvl = 0; //item level
|
||
|
public $quality = 0;
|
||
|
public $isCharm = false;
|
||
|
public $isJewel = false;
|
||
|
public $magic_rank = 'Normal'; //normal/magic/rare/crafted/set/unique
|
||
|
public $set_id = 0; //set item id from txt
|
||
|
public $set_item = '';
|
||
|
public $set_name = 0; //set name, if it is set item,
|
||
|
public $personname = '';
|
||
|
public $questdif = -1;
|
||
|
public $gold;
|
||
|
public $GUID = '';
|
||
|
public $defense = 0;
|
||
|
public $mindam = 0;
|
||
|
public $maxdam = 0;
|
||
|
public $mindam2 = 0;
|
||
|
public $maxdam2 = 0;
|
||
|
public $mindammi = 0;
|
||
|
public $maxdammi = 0;
|
||
|
public $MaxDur = 0;
|
||
|
public $CurDur = 0;
|
||
|
public $reqlvl = 0;
|
||
|
public $reqstr = 0;
|
||
|
public $reqdex = 0;
|
||
|
public $speed = 0;
|
||
|
public $throwing = 0;
|
||
|
public $stackable = 0;
|
||
|
public $charName = ''; //ear's name
|
||
|
public $gfx; //graphic file name
|
||
|
public $baseTrans = -1; //transform indexes for colour remap base item
|
||
|
public $magicTrans = -1; //transform indexes for colour remap magic item
|
||
|
public $type; //type column from txt
|
||
|
public $spelldesc = ''; //desc for potions
|
||
|
public $ditem; //link to item properties from txt
|
||
|
//mods
|
||
|
public $dammult = 100; //damage multiply
|
||
|
public $damminadd = 0; //damage add
|
||
|
public $dammaxadd = 0; //damage add
|
||
|
public $defmult = 100; //defense multiply
|
||
|
public $defadd = 0; //defense multiply
|
||
|
public $resist = array(0, 0, 0, 0, 0, 0); //phy, mag, fire, light, cold, poison
|
||
|
public $attributes = array(0, 0, 0, 0); //str, dex, vit, ene
|
||
|
|
||
|
//arrays
|
||
|
|
||
|
//socketed items, collected in above function,
|
||
|
//because item has only data for itselt, and
|
||
|
//gems/runes/jewels are standalone
|
||
|
public $SocketItems = array();
|
||
|
public $properties = array(); //item variable properties
|
||
|
public $propids = array(); //properties ids list
|
||
|
|
||
|
|
||
|
public function __construct(string $bits){
|
||
|
if ($bit == '') return false;
|
||
|
$this->bits = $bits;
|
||
|
|
||
|
$this->parseItem();
|
||
|
}
|
||
|
|
||
|
public function parseItem(){}
|
||
|
|
||
|
|
||
|
}
|