diff --git a/filterProperties.txt b/filterProperties.txt index b24c7e0..e3dc4b7 100755 --- a/filterProperties.txt +++ b/filterProperties.txt @@ -128,4 +128,6 @@ magharv showkills iforge killcounter -soulcounter \ No newline at end of file +soulcounter +skill-rand +aura-rand \ No newline at end of file diff --git a/ironman-dev.sqbpro b/ironman-dev.sqbpro new file mode 100644 index 0000000..8250ffc --- /dev/null +++ b/ironman-dev.sqbpro @@ -0,0 +1,94 @@ +WITH cte_item_codes(code,flippyfile) AS ( +SELECT code,flippyfile from armor WHERE code != '' +UNION +SELECT code,flippyfile from misc WHERE code != '' +UNION +SELECT code,flippyfile from weapons WHERE code != '' +UNION +SELECT normcode,flippyfile from armor WHERE code != '' +UNION +SELECT normcode,flippyfile from weapons WHERE code != '' +UNION +SELECT ubercode,flippyfile from armor WHERE code != '' +UNION +SELECT ubercode,flippyfile from weapons WHERE code != '' +UNION +SELECT ultracode,flippyfile from armor WHERE code != '' +UNION +SELECT ultracode,flippyfile from weapons WHERE code != '' +) + +--SELECT u.code,c.flippyfile +--FROM uniqueitems as u +--JOIN cte_item_codes as c +--ON u.code = c.code + +SELECT s.item,c.flippyfile +FROM setitems as s +JOIN cte_item_codes as c +ON s.item = c.code +WHERE s.item != '' AND c.code != ''select count(*) from setitemsWITH cte_item_codes(code,flippyfile) AS ( +SELECT code,flippyfile from armor WHERE code != '' +UNION +SELECT code,flippyfile from misc WHERE code != '' +UNION +SELECT code,flippyfile from weapons WHERE code != '' +UNION +SELECT normcode,flippyfile from armor WHERE code != '' +UNION +SELECT normcode,flippyfile from weapons WHERE code != '' +UNION +SELECT ubercode,flippyfile from armor WHERE code != '' +UNION +SELECT ubercode,flippyfile from weapons WHERE code != '' +UNION +SELECT ultracode,flippyfile from armor WHERE code != '' +UNION +SELECT ultracode,flippyfile from weapons WHERE code != '' +) + +SELECT u.code,c.flippyfile +FROM uniqueitems as u +JOIN cte_item_codes as c +ON u.code = c.code + +--SELECT s.item,c.flippyfile +--FROM setitems as s +--JOIN cte_item_codes as c +--ON s.item = c.code + +WHERE +u.code <> '' +AND c.code <> '';WITH cte_item_codes(code,flippyfile) AS ( +SELECT code,flippyfile from armor +UNION +SELECT code,flippyfile from misc +UNION +SELECT code,flippyfile from weapons +UNION +SELECT normcode,flippyfile from armor +UNION +SELECT normcode,flippyfile from weapons +UNION +SELECT ubercode,flippyfile from armor +UNION +SELECT ubercode,flippyfile from weapons +UNION +SELECT ultracode,flippyfile from armor +UNION +SELECT ultracode,flippyfile from weapons +) + +select * from cte_item_codesSELECT a.flippyfile, m.flippyfile, w.flippyfile + FROM armor AS a, + misc AS m, + weapons AS w + WHERE a.code = 'axe' + OR a.normcode = 'axe' + OR a.ubercode = 'axe' + OR a.ultracode = 'axe' + OR m.code = 'axe' + OR w.code = 'axe' + OR w.ultracode = 'axe' + OR w.normcode = 'axe' + OR w.ubercode = 'axe'select item from setitems diff --git a/src/D2ItemData.php b/src/D2ItemData.php index 895dc9b..5c2919f 100755 --- a/src/D2ItemData.php +++ b/src/D2ItemData.php @@ -95,10 +95,46 @@ class D2ItemData { // val = Prop1,Prop2 etc. // for each propr, get all 7 stats in ISC // for now only get stat1, and for else, use dgrp + + + // prop funcs + /* + * 1 - Applies a value to a stat, can use SetX parameter. + 2 - defensive function only, similar to 1 ??? + 3 - Apply the same min-max range as used in the previous function block (see res-all). + 4 - not used ??? + 5 - Dmg-min related ??? + 6 - Dmg-max related ??? + 7 - Dmg% related ??? + 8 - ??? use for speed properties (ias, fcr, etc ...) + 9 - Apply the same param and value in min-max range, as used in the previous function block. + 10 - skilltab skill group ??? + 11 - event-based skills ??? + 12 - random selection of parameters for parameter-based stat ??? + 13 - durability-related ??? + 14 - inventory positions on item ??? (related to socket) + 15 - use min field only + 16 - use max field only + 17 - use param field only + 18 - Related to /time properties. + 19 - Related to charged item. + 20 - Simple boolean stuff. Use by indestruct. + 21 - Add to group of skills, group determined by stat ID, uses ValX parameter. + 22 - Individual skill, using param for skill ID, random between min-max. + 23 - ethereal + 24 - property applied to character or target monster ??? + 25--32 can be used in custom code. Check plugin documentation for syntax. + * + */ + + + + - $sql = "SELECT stat1 FROM properties WHERE code = ?"; + $sql = "SELECT func1,stat1 FROM properties WHERE code = ?"; $props[$key]['stat'] = PDO_FetchRow($sql, [$val['prop' . $counter]]); - + + // if not empty, filter props key stat if (!empty($props[$key]['stat'])) { $props[$key]['stat'] = array_filter($props[$key]['stat']); } @@ -109,14 +145,13 @@ class D2ItemData { $counter = 1; //each stat now goes into getIscStrings foreach ($props as $k => $v) { - //ddump($v); - $props[$k]['desc'] = $this->getIscStrings($v['prop' . $counter]); + $props[$k]['desc'] = $this->getIscStrings($v['prop' . $counter]); $counter++; } // Values in params, so I can get generated string for that prop $counter = 1; - foreach ($props as $k => $v) { // for each property Prop1 Prop2 + foreach ($props as $k => $v) { // for each property Prop1 Prop2 $params = [ 'string1' => $v['desc']['string1'], 'string2' => $v['desc']['string2'], @@ -137,10 +172,15 @@ class D2ItemData { * getDesc should process string1, not file guide copy pasta * */ - if (!empty($v['desc'])) { - require_once 'D2ItemDesc.php'; + if ( (!empty($v['desc'])) ) { + require_once 'D2ItemDesc.php'; $idesc = new D2ItemDesc(); $props[$k]['string'][] = ($idesc->getDesc($params)); + if ($v['stat']['func1'] == '12'){ + $props[$k]['string'] = "+{$params['par']} to a Random Skill"; + } + ddump($props[$k]['string']); + } $counter++; } diff --git a/test.php b/test.php index c06eed0..d122431 100644 --- a/test.php +++ b/test.php @@ -18,12 +18,67 @@ define('DB_FILE', $_SESSION['modname'] . ".db"); PDO_Connect("sqlite:" . DB_FILE); -$sql = "SELECT code FROM uniqueitems"; +//$sql = "SELECT code FROM uniqueitems"; +//$res = PDO_FetchAll($sql); +// +// +//foreach ($res as $code){ +// $c = $code['code']; +// +// $sql = "SELECT flippyfile FROM misc WHERE code = '$c'"; +// $ret = PDO_FetchOne($sql); +// +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM armor WHERE code = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM armor WHERE normcode = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM armor WHERE ubercode = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM armor WHERE ultracode = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM weapons WHERE code = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM weapons WHERE normcode = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM weapons WHERE ubercode = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// if(empty($ret)){ +// $sql = "SELECT flippyfile FROM weapons WHERE ultracode = '$c'"; +// $ret = PDO_FetchOne($sql); +// } +// +// $return[] = $ret; +// +// echo $ret . "_uni
"; +//} + +//dump($return) +// +// + + +$sql = "SELECT item FROM setitems"; $res = PDO_FetchAll($sql); foreach ($res as $code){ - $c = $code['code']; + $c = $code['item']; + $sql = "SELECT flippyfile FROM misc WHERE code = '$c'"; $ret = PDO_FetchOne($sql); @@ -64,7 +119,5 @@ foreach ($res as $code){ $return[] = $ret; - echo $ret . "_uni
"; -} - -//dump($return); \ No newline at end of file + echo $ret . "_set
"; +}; \ No newline at end of file