mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
Processing custom strings for some properties, like skill-rand. https://d2mods.info/forum/kb/viewarticle?a=345
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user