mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 12:36:03 +00:00
DescFunc 14 done
This commit is contained in:
parent
efa7f8f28e
commit
3a08d8c16c
@ -1,53 +1,57 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
|
||||
This file is part of D2Modder
|
||||
This file is part of D2Modder
|
||||
|
||||
Redistribution and use in source and binary forms, with
|
||||
or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
Redistribution and use in source and binary forms, with
|
||||
or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY!
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY!
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
session_start();
|
||||
|
||||
include "../_pdo.php";
|
||||
require_once "../src/D2Functions.php";
|
||||
require_once "../src/D2ItemDesc.php";
|
||||
require_once './D2AjaxFunctions.php';
|
||||
|
||||
define('DB_FILE', $_SESSION['modname'] . ".db");
|
||||
define('TXT_PATH', $_SESSION['path']);
|
||||
|
||||
$db = dirname(getcwd()).DIRECTORY_SEPARATOR.DB_FILE;
|
||||
$db = dirname(getcwd()) . DIRECTORY_SEPARATOR . DB_FILE;
|
||||
|
||||
PDO_Connect("sqlite:" . $db);
|
||||
|
||||
PDO_Connect("sqlite:".$db);
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
include "./config.php";
|
||||
$idesc = new D2ItemDesc();
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
@ -61,7 +62,6 @@ if ($cmd == "getUniqueItem") {
|
||||
$sql = "SELECT * FROM `uniqueitems` WHERE `enabled`='1' AND `index`=\"{$_GET['index']}\"";
|
||||
$res = PDO_FetchRow($sql);
|
||||
|
||||
|
||||
if (empty($res['invfile'])) {
|
||||
|
||||
// if no invfile, get from other tables
|
||||
@ -78,18 +78,102 @@ if ($cmd == "getUniqueItem") {
|
||||
|
||||
$invfile = array_filter($invfile);
|
||||
|
||||
foreach ($invfile as $i){
|
||||
foreach ($invfile as $i) {
|
||||
$x[] = $i;
|
||||
}
|
||||
|
||||
|
||||
$invClean = array_filter($x[0]);
|
||||
|
||||
$return = array_merge($res,$invClean);
|
||||
$return = array_merge($res, $invClean);
|
||||
} else {
|
||||
$return = $res;
|
||||
}
|
||||
|
||||
// var_dump($return);
|
||||
// for all props for this unique item, get ISC strings
|
||||
|
||||
$props = array_filter([
|
||||
"Prop1" => array_filter(
|
||||
["prop1" => $return['prop1'], "par1" => $return['par1'], "min1" => $return['min1'], "max1" => $return['max1']]
|
||||
),
|
||||
"Prop2" => array_filter(
|
||||
["prop2" => $return['prop2'], "par1" => $return['par2'], "min1" => $return['min2'], "max1" => $return['max2']]
|
||||
),
|
||||
"Prop3" => array_filter(
|
||||
["prop3" => $return['prop3'], "par1" => $return['par3'], "min1" => $return['min3'], "max1" => $return['max3']]
|
||||
),
|
||||
"Prop4" => array_filter(
|
||||
["prop4" => $return['prop4'], "par1" => $return['par4'], "min1" => $return['min4'], "max1" => $return['max4']]
|
||||
),
|
||||
"Prop5" => array_filter(
|
||||
["prop5" => $return['prop5'], "par1" => $return['par5'], "min1" => $return['min5'], "max1" => $return['max5']]
|
||||
),
|
||||
"Prop6" => array_filter(
|
||||
["prop6" => $return['prop6'], "par1" => $return['par6'], "min1" => $return['min6'], "max1" => $return['max6']]
|
||||
),
|
||||
"Prop7" => array_filter(
|
||||
["prop7" => $return['prop7'], "par1" => $return['par7'], "min1" => $return['min7'], "max1" => $return['max7']]
|
||||
),
|
||||
"Prop8" => array_filter(
|
||||
["prop8" => $return['prop8'], "par1" => $return['par8'], "min1" => $return['min8'], "max1" => $return['max8']]
|
||||
),
|
||||
"Prop9" => array_filter(
|
||||
["prop9" => $return['prop9'], "par1" => $return['par9'], "min1" => $return['min9'], "max1" => $return['max9']]
|
||||
),
|
||||
"Prop10" => array_filter(
|
||||
["prop10" => $return['prop10'], "par1" => $return['par10'], "min1" => $return['min10'], "max1" => $return['max10']]
|
||||
)
|
||||
]);
|
||||
|
||||
// need par, min, max value for each prop
|
||||
// for each prop, get stat
|
||||
$counter = 1;
|
||||
foreach ($props as $key => $val) {
|
||||
// val = Prop1,Prop2 etc.
|
||||
// for each propr, get all 7 stats in ISC
|
||||
$sql = "SELECT stat1,stat2,stat3,stat4,stat5,stat6,stat7 FROM `properties` WHERE `code` = '{$val['prop' . $counter]}'";
|
||||
$props[$key]['stat'] = array_filter(PDO_FetchRow($sql));
|
||||
|
||||
$counter++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//each stat now goes into getIscStrings
|
||||
foreach ($props as $k => $v) {
|
||||
$props[$k]['desc'] = array_filter(getIscStrings($v['stat']['stat1']));
|
||||
}
|
||||
|
||||
|
||||
//var_dump($return);
|
||||
|
||||
// todo: put values in params, so I can get generated string for that prop
|
||||
|
||||
$counter = 1;
|
||||
foreach ($props as $k => $v) { // for each property Prop1 Prop2
|
||||
$value = $v['par1'] ?? $v['min1'];
|
||||
|
||||
$params = [
|
||||
'string1' => $v['desc']['string1'],
|
||||
'string2' => $v['desc']['string2'],
|
||||
'descfunc' => $v['desc']['descfunc'],
|
||||
'descval' => $v['desc']['descval'],
|
||||
"par" => $return['par'.$counter],
|
||||
"min" => $return['min'.$counter],
|
||||
"max" => $return['max'.$counter]
|
||||
];
|
||||
|
||||
if (!empty($v['desc'])) {
|
||||
$props[$k]['string'][] = $idesc->getDesc($value, $params);
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$return['props'] = $props;
|
||||
|
||||
//ddump($return);
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($return, JSON_INVALID_UTF8_IGNORE);
|
||||
|
BIN
img/items/bg.png
BIN
img/items/bg.png
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 12 KiB |
16
index.php
16
index.php
@ -113,22 +113,6 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
|
||||
|
||||
$prop = $parser->filterProps('Properties.txt');
|
||||
|
||||
foreach ($prop as $p) {
|
||||
$sql = "SELECT stat1,stat2,stat3,stat4,stat5,stat6,stat7 FROM `properties` WHERE `code` = '$p'";
|
||||
$isc[$p] = array_filter(PDO_FetchRow($sql));
|
||||
}
|
||||
|
||||
|
||||
foreach ($isc as $i) { // for each property $i
|
||||
foreach ($i as $k){
|
||||
//$params = $db->getIscStrings($k);
|
||||
|
||||
|
||||
//var_dump($idesc->getDesc(100, $params));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If there's data, process it and save
|
||||
if (!empty($_POST)) {
|
||||
|
19
res/app.js
19
res/app.js
@ -142,6 +142,25 @@ $(document).ready(function () {
|
||||
$(".item").attr("src", "/img/items/1.png");
|
||||
$.get("/ajax/uniqueitems.php?cmd=getUniqueItem&index=" + this.value, function (data) {
|
||||
|
||||
props = data.props;
|
||||
|
||||
console.log(props);
|
||||
$('.item_desc').html("<p></p>");
|
||||
$.each(props, function (i, v) {
|
||||
|
||||
if (v.par1) {
|
||||
$s1 = '';
|
||||
}
|
||||
|
||||
|
||||
if(v.string){
|
||||
$('.item_desc p').append(v.string[0]+"<br>");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
invImg = "/img/items/" + data.invfile + ".png";
|
||||
$(".item").attr("src", invImg);
|
||||
|
||||
|
@ -165,7 +165,21 @@ option {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.item {
|
||||
.item_desc {
|
||||
height: auto;
|
||||
width: 420px;
|
||||
position: absolute;
|
||||
left: 110px;
|
||||
top: 23px;
|
||||
|
||||
|
||||
text-align: center;
|
||||
background: black;
|
||||
padding: 10px;
|
||||
|
||||
}
|
||||
|
||||
.item_desc p {
|
||||
font-size: 14px;
|
||||
color: #4169E1;
|
||||
}
|
@ -127,41 +127,6 @@ class D2Database {
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getIscStrings($iscStat) {
|
||||
$sql = "
|
||||
SELECT
|
||||
(
|
||||
SELECT String
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.descstrpos = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS string1,
|
||||
(
|
||||
SELECT String
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.DescStr2 = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS string2,
|
||||
(
|
||||
SELECT descfunc
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.descstrpos = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS descfunc,
|
||||
(
|
||||
SELECT descval
|
||||
FROM itemstatcost as i
|
||||
LEFT JOIN strings AS `s` ON `i`.descstrpos = `s`.`Key`
|
||||
WHERE `Stat` = '$iscStat'
|
||||
)
|
||||
AS descval
|
||||
";
|
||||
|
||||
return PDO_FetchRow($sql);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,94 +1,95 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
|
||||
This file is part of D2Modder
|
||||
This file is part of D2Modder
|
||||
|
||||
Redistribution and use in source and binary forms, with
|
||||
or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
Redistribution and use in source and binary forms, with
|
||||
or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY!
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY!
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
class D2ItemDesc {
|
||||
/*
|
||||
|
||||
DescFunc: the function used for generating the description for this stat, this works like the descfuncs in SkillDesc.txt pretty much. See below for an explanation of individual functions, these are listed the way they would show up if DescVal is set to 1. This follows the syntax Char used in the old fileguide, but includes the functions he didn't cover.
|
||||
DescFunc: the function used for generating the description for this stat, this works like the descfuncs in SkillDesc.txt pretty much. See below for an explanation of individual functions, these are listed the way they would show up if DescVal is set to 1. This follows the syntax Char used in the old fileguide, but includes the functions he didn't cover.
|
||||
|
||||
|
||||
1 - +[value] [string1]
|
||||
2 - [value]% [string1]
|
||||
3 - [value] [string1]
|
||||
4 - +[value]% [string1]
|
||||
5 - [value*100/128]% [string1]
|
||||
6 - +[value] [string1] [string2]
|
||||
7 - [value]% [string1] [string2]
|
||||
8 - +[value]% [string1] [string2]
|
||||
9 - [value] [string1] [string2]
|
||||
10 - [value*100/128]% [string1] [string2]
|
||||
11 - Repairs 1 Durability In [100 / value] Seconds
|
||||
12 - +[value] [string1]
|
||||
13 - +[value] to [class] Skill Levels
|
||||
14 - +[value] to [skilltab] Skill Levels ([class] Only)
|
||||
15 - [chance]% to case [slvl] [skill] on [event]
|
||||
16 - Level [sLvl] [skill] Aura When Equipped
|
||||
17 - [value] [string1] (Increases near [time])
|
||||
18 - [value]% [string1] (Increases near [time])
|
||||
19 - this is used by stats that use Blizzard's sprintf implementation (if you don't know what that is, it won't be of interest to you eitherway I guess), look at how prismatic is setup, the string is the format that gets passed to their sprintf spinoff.
|
||||
20 - [value * -1]% [string1]
|
||||
21 - [value * -1] [string1]
|
||||
22 - [value]% [string1] [montype] (warning: this is bugged in vanilla and doesn't work properly, see CE forum)
|
||||
23 - [value]% [string1] [monster]
|
||||
24 - used for charges, we all know how that desc looks
|
||||
25 - not used by vanilla, present in the code but I didn't test it yet
|
||||
26 - not used by vanilla, present in the code but I didn't test it yet
|
||||
27 - +[value] to [skill] ([class] Only)
|
||||
28 - +[value] to [skill]
|
||||
1 - +[value] [string1]
|
||||
2 - [value]% [string1]
|
||||
3 - [value] [string1]
|
||||
4 - +[value]% [string1]
|
||||
5 - [value*100/128]% [string1]
|
||||
6 - +[value] [string1] [string2]
|
||||
7 - [value]% [string1] [string2]
|
||||
8 - +[value]% [string1] [string2]
|
||||
9 - [value] [string1] [string2]
|
||||
10 - [value*100/128]% [string1] [string2]
|
||||
11 - Repairs 1 Durability In [100 / value] Seconds
|
||||
12 - +[value] [string1]
|
||||
13 - +[value] to [class] Skill Levels
|
||||
14 - +[value] to [skilltab] Skill Levels ([class] Only)
|
||||
15 - [chance]% to case [slvl] [skill] on [event]
|
||||
16 - Level [sLvl] [skill] Aura When Equipped
|
||||
17 - [value] [string1] (Increases near [time])
|
||||
18 - [value]% [string1] (Increases near [time])
|
||||
19 - this is used by stats that use Blizzard's sprintf implementation (if you don't know what that is, it won't be of interest to you eitherway I guess), look at how prismatic is setup, the string is the format that gets passed to their sprintf spinoff.
|
||||
20 - [value * -1]% [string1]
|
||||
21 - [value * -1] [string1]
|
||||
22 - [value]% [string1] [montype] (warning: this is bugged in vanilla and doesn't work properly, see CE forum)
|
||||
23 - [value]% [string1] [monster]
|
||||
24 - used for charges, we all know how that desc looks
|
||||
25 - not used by vanilla, present in the code but I didn't test it yet
|
||||
26 - not used by vanilla, present in the code but I didn't test it yet
|
||||
27 - +[value] to [skill] ([class] Only)
|
||||
28 - +[value] to [skill]
|
||||
|
||||
|
||||
|
||||
DescVal: Controls whenever and if so in what way the stat value is shown,
|
||||
DescVal: Controls whenever and if so in what way the stat value is shown,
|
||||
|
||||
* 0 = doesn't show the value of the stat,
|
||||
* 1 = shows the value of the stat infront of the description,
|
||||
* 2 = shows the value of the stat after the description.
|
||||
|
||||
DescStrPos: The string used for the description when the stat value is positive.
|
||||
DescStrPos: The string used for the description when the stat value is positive.
|
||||
|
||||
DescStrNeg: The string used for the description when the stat value is negative.
|
||||
DescStrNeg: The string used for the description when the stat value is negative.
|
||||
|
||||
DescStr2: An additional string used by some DescFuncs, usually used as a suffix or for aditional info (such as per character level etc).
|
||||
DescStr2: An additional string used by some DescFuncs, usually used as a suffix or for aditional info (such as per character level etc).
|
||||
*
|
||||
*
|
||||
*
|
||||
@ -96,165 +97,446 @@ DescStr2: An additional string used by some DescFuncs, usually used as a suffix
|
||||
*
|
||||
*
|
||||
*
|
||||
array (size=174)
|
||||
'item_absorbcold' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorbcold' (length=15)
|
||||
'ID' => string '149' (length=3)
|
||||
'descfunc' => string '1' (length=1)
|
||||
'descval' => string '1' (length=1)
|
||||
'descstrpos' => string 'ModStr5n' (length=8)
|
||||
'String' => string 'Cold Absorb' (length=11)
|
||||
'item_absorbcold_percent' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorbcold_percent' (length=23)
|
||||
'ID' => string '148' (length=3)
|
||||
'descfunc' => string '2' (length=1)
|
||||
'descval' => string '2' (length=1)
|
||||
'descstrpos' => string 'ModStr5m' (length=8)
|
||||
'String' => string 'Cold Absorb' (length=11)
|
||||
'item_absorb_cold_perlevel' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorb_cold_perlevel' (length=25)
|
||||
'ID' => string '234' (length=3)
|
||||
'descfunc' => string '6' (length=1)
|
||||
'descval' => string '1' (length=1)
|
||||
'descstrpos' => string 'ModStre9p' (length=9)
|
||||
'String' => string 'Absorbs Cold Damage' (length=19)
|
||||
'item_absorbfire' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorbfire' (length=15)
|
||||
'ID' => string '143' (length=3)
|
||||
'descfunc' => string '1' (length=1)
|
||||
'descval' => string '1' (length=1)
|
||||
'descstrpos' => string 'ModStr5h' (length=8)
|
||||
'String' => string 'Fire Absorb' (length=11)
|
||||
array (size=174)
|
||||
'item_absorbcold' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorbcold' (length=15)
|
||||
'ID' => string '149' (length=3)
|
||||
'descfunc' => string '1' (length=1)
|
||||
'descval' => string '1' (length=1)
|
||||
'descstrpos' => string 'ModStr5n' (length=8)
|
||||
'String' => string 'Cold Absorb' (length=11)
|
||||
'item_absorbcold_percent' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorbcold_percent' (length=23)
|
||||
'ID' => string '148' (length=3)
|
||||
'descfunc' => string '2' (length=1)
|
||||
'descval' => string '2' (length=1)
|
||||
'descstrpos' => string 'ModStr5m' (length=8)
|
||||
'String' => string 'Cold Absorb' (length=11)
|
||||
'item_absorb_cold_perlevel' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorb_cold_perlevel' (length=25)
|
||||
'ID' => string '234' (length=3)
|
||||
'descfunc' => string '6' (length=1)
|
||||
'descval' => string '1' (length=1)
|
||||
'descstrpos' => string 'ModStre9p' (length=9)
|
||||
'String' => string 'Absorbs Cold Damage' (length=19)
|
||||
'item_absorbfire' =>
|
||||
array (size=6)
|
||||
'Stat' => string 'item_absorbfire' (length=15)
|
||||
'ID' => string '143' (length=3)
|
||||
'descfunc' => string '1' (length=1)
|
||||
'descval' => string '1' (length=1)
|
||||
'descstrpos' => string 'ModStr5h' (length=8)
|
||||
'String' => string 'Fire Absorb' (length=11)
|
||||
*
|
||||
*
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
public $str = '';
|
||||
// takes value, param.
|
||||
// value == Value to show on this stat
|
||||
//descfunc 14
|
||||
|
||||
public $skilltabsDesc;
|
||||
public $skilltabsDescClean;
|
||||
public $skilltabs = [
|
||||
//ama
|
||||
'0' => 'StrSklTabItem3',
|
||||
'1' => 'StrSklTabItem2',
|
||||
'2' => 'StrSklTabItem1',
|
||||
// sor
|
||||
'3' => 'StrSklTabItem15',
|
||||
'4' => 'StrSklTabItem14',
|
||||
'5' => 'StrSklTabItem13',
|
||||
//nec
|
||||
'6' => 'StrSklTabItem8',
|
||||
'7' => 'StrSklTabItem7',
|
||||
'8' => 'StrSklTabItem9',
|
||||
//pal
|
||||
'9' => 'StrSklTabItem6',
|
||||
'10' => 'StrSklTabItem5',
|
||||
'11' => 'StrSklTabItem4',
|
||||
//bar
|
||||
'12' => 'StrSklTabItem11',
|
||||
'13' => 'StrSklTabItem12',
|
||||
'14' => 'StrSklTabItem10',
|
||||
//dru
|
||||
'15' => 'StrSklTabItem16',
|
||||
'16' => 'StrSklTabItem17',
|
||||
'17' => 'StrSklTabItem18',
|
||||
// ass
|
||||
'18' => 'StrSklTabItem19',
|
||||
'19' => 'StrSklTabItem20',
|
||||
'20' => 'StrSklTabItem21'
|
||||
];
|
||||
|
||||
// takes value, param.
|
||||
// value == Value to show on this stat
|
||||
public function getDesc($value, $params = []) {
|
||||
if (empty($params))
|
||||
return false;
|
||||
|
||||
public function getDesc($value, $params = []){
|
||||
if (empty($params)) return false;
|
||||
|
||||
$v = $value;
|
||||
$v = '<span style="font-family: Lato; color: white; font-weight: 900">' . $value . "</span>";
|
||||
$s1 = $params['string1'];
|
||||
$s2 = $params['string2'];
|
||||
$par = $params['par'];
|
||||
$min = $params['min'];
|
||||
$max = $params['max'];
|
||||
|
||||
if ($params['descfunc'] == 1) {
|
||||
$this->str = "+$v $s1";
|
||||
foreach ($this->skilltabs as $s) {
|
||||
$sql = "SELECT `String` FROM `strings` WHERE `Key`='$s'";
|
||||
$this->skilltabsDesc[] = PDO_FetchRow($sql);
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 2) {
|
||||
$this->str = "$v% $s1";
|
||||
foreach ($this->skilltabsDesc as $s) {
|
||||
$this->skilltabsDescClean[] = str_replace('+%d', '', $s);
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 3) {
|
||||
$this->str = "$v $s1";
|
||||
//ddump($this->skilltabsDescClean);
|
||||
|
||||
|
||||
if ($params['descval'] == 1 || $params['descval'] == '') {
|
||||
|
||||
if ($params['descfunc'] == 1) {
|
||||
$this->str = "+$v $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 2) {
|
||||
$this->str = "$v% $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 3) {
|
||||
$this->str = "$v $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 4) {
|
||||
$this->str = "+$v% $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 5) {
|
||||
$this->str = ($v * 100 / 128) . " $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 6) {
|
||||
$this->str = "+$v $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 7) {
|
||||
$this->str = "$v% $s1 $s2";
|
||||
}
|
||||
if ($params['descfunc'] == 8) {
|
||||
$this->str = "+$v% $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 9) {
|
||||
$this->str = "$v $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 10) {
|
||||
$this->str = ($v * 100 / 128) . " $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 11) {
|
||||
$this->str = "Repairs 1 Durability In " . (100 / $value) . " seconds";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 12) {
|
||||
$this->str = "+$v $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 13) {
|
||||
$this->str = "+$v to [class] Skill Levels";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 14) {
|
||||
|
||||
$sql = "SELECT class
|
||||
FROM `charstats`
|
||||
WHERE `StrSkillTab1`='{$this->skilltabs[$par]}' OR
|
||||
`StrSkillTab2`='{$this->skilltabs[$par]}' OR
|
||||
`StrSkillTab3`='{$this->skilltabs[$par]}'";
|
||||
|
||||
$x = PDO_FetchOne($sql);
|
||||
|
||||
$this->str = "+$min - $max{$this->skilltabsDescClean[$par]['String']} Skill Levels ([$x] Only)";
|
||||
}
|
||||
if ($params['descfunc'] == 15) {
|
||||
$this->str = "[chance]% to case [slvl] [skill] on [event]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 16) {
|
||||
$this->str = "Level [sLvl] [skill] Aura When Equipped ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 17) {
|
||||
$this->str = "$v $s1 (Increases near [time])";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 18) {
|
||||
$this->str = "$v% $s1 (Increases near [time])";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 19) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 20) {
|
||||
$this->str = ($v * -1) . "% $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 21) {
|
||||
$this->str = ($v * -1) . " $s1";
|
||||
}
|
||||
if ($params['descfunc'] == 22) {
|
||||
$this->str = "$v% $s1 [MonType]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 23) {
|
||||
$this->str = "$v% $s1 [Monster]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 24) {
|
||||
$this->str = "+$v to Skill Charges Or Something";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 25) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 26) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 27) {
|
||||
$this->str = "+$v to [skill] ([class] Only)";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 28) {
|
||||
$this->str = "+$v to [skill] ";
|
||||
}
|
||||
} else if ($params['descval'] == 0) {
|
||||
if ($params['descfunc'] == 1) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 2) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 3) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 4) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 5) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 6) {
|
||||
$this->str = "$s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 7) {
|
||||
$this->str = "$s1 $s2";
|
||||
}
|
||||
if ($params['descfunc'] == 8) {
|
||||
$this->str = "$s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 9) {
|
||||
$this->str = "$s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 10) {
|
||||
$this->str = "$s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 11) {
|
||||
$this->str = "Repairs 1 Durability In X seconds";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 12) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 13) {
|
||||
$this->str = "to [class] Skill Levels";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 14) {
|
||||
$this->str = "to [skilltab] Skill Levels ([class] Only)";
|
||||
}
|
||||
if ($params['descfunc'] == 15) {
|
||||
$this->str = "[chance]to case [slvl] [skill] on [event]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 16) {
|
||||
$this->str = "Level [sLvl] [skill] Aura When Equipped ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 17) {
|
||||
$this->str = "$s1 (Increases near [time])";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 18) {
|
||||
$this->str = "$s1 (Increases near [time])";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 19) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 20) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 21) {
|
||||
$this->str = "$s1";
|
||||
}
|
||||
if ($params['descfunc'] == 22) {
|
||||
$this->str = "$s1 [MonType]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 23) {
|
||||
$this->str = "$s1 [Monster]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 24) {
|
||||
$this->str = "to Skill Charges Or Something";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 25) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 26) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 27) {
|
||||
$this->str = "to [skill] ([class] Only)";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 28) {
|
||||
$this->str = "to [skill] ";
|
||||
}
|
||||
} else if ($params['descval'] == 2) {
|
||||
if ($params['descfunc'] == 1) {
|
||||
$this->str = "$s1 +$v";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 2) {
|
||||
$this->str = "$s1 $v%";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 3) {
|
||||
$this->str = "$s1 $v";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 4) {
|
||||
$this->str = "$s1 +$v%";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 5) {
|
||||
$this->str = "$s1" . ($v * 100 / 128);
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 6) {
|
||||
$this->str = "$s1 $s2 +%v";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 7) {
|
||||
$this->str = "$s1 $s2 $v% ";
|
||||
}
|
||||
if ($params['descfunc'] == 8) {
|
||||
$this->str = "$s1 $s2 +$v% ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 9) {
|
||||
$this->str = "$s1 $s2 $v";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 10) {
|
||||
$this->str = "$s1 $s2" . ($v * 100 / 128);
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 11) {
|
||||
$this->str = "Repairs 1 Durability In X seconds";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 12) {
|
||||
$this->str = "$s1 +$v ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 13) {
|
||||
$this->str = "to [class] Skill Levels +$v";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 14) {
|
||||
$this->str = "to [skilltab] Skill Levels ([class] Only) +$v ";
|
||||
}
|
||||
if ($params['descfunc'] == 15) {
|
||||
$this->str = "[chance]% to case [slvl] [skill] on [event]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 16) {
|
||||
$this->str = "Level [sLvl] [skill] Aura When Equipped ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 17) {
|
||||
$this->str = "s1 (Increases near [time]) $v $";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 18) {
|
||||
$this->str = "$s1 (Increases near [time]) $v% ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 19) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 20) {
|
||||
$this->str = "% $s1" . ($v * -1);
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 21) {
|
||||
$this->str = "$s1" . ($v * -1);
|
||||
}
|
||||
if ($params['descfunc'] == 22) {
|
||||
$this->str = "$s1 [MonType] $v% ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 23) {
|
||||
$this->str = "s1 [Monster] $v% $";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 24) {
|
||||
$this->str = "to Skill Charges Or Something +$v ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 25) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 26) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 27) {
|
||||
$this->str = "+$v to [skill] ([class] Only)";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 28) {
|
||||
$this->str = "+$v to [skill] ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 4) {
|
||||
$this->str = "+$v% $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 5) {
|
||||
$this->str = ($v*100/128)." $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 6) {
|
||||
$this->str = "+$v $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 7) {
|
||||
$this->str = "$v% $s1 $s2";
|
||||
}
|
||||
if ($params['descfunc'] == 8) {
|
||||
$this->str = "+$v% $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 9) {
|
||||
$this->str = "$v $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 10) {
|
||||
$this->str = ($v*100/128)." $s1 $s2";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 11) {
|
||||
$this->str = "Repairs 1 Durability In ".(100/$value)." seconds";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 12) {
|
||||
$this->str = "+$v $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 13) {
|
||||
$this->str = "+$v to [class] Skill Levels";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 14) {
|
||||
$this->str = "+$v to [skilltab] Skill Levels ([class] Only)";
|
||||
}
|
||||
if ($params['descfunc'] == 15) {
|
||||
$this->str = "[chance]% to case [slvl] [skill] on [event]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 16) {
|
||||
$this->str = "Level [sLvl] [skill] Aura When Equipped ";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 17) {
|
||||
$this->str = "$v $s1 (Increases near [time])";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 18) {
|
||||
$this->str = "$v% $s1 (Increases near [time])";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 19) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 20) {
|
||||
$this->str = ($v* -1) ."% $s1";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 21) {
|
||||
$this->str = ($v* -1) ." $s1";
|
||||
}
|
||||
if ($params['descfunc'] == 22) {
|
||||
$this->str = "$v% $s1 [MonType]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 23) {
|
||||
$this->str = "$v% $s1 [Monster]";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 24) {
|
||||
$this->str = "+$v to Skill Charges Or Something";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 25) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 26) {
|
||||
$this->str = "";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 27) {
|
||||
$this->str = "+$v to [skill] ([class] Only)";
|
||||
}
|
||||
|
||||
if ($params['descfunc'] == 28) {
|
||||
$this->str = "+$v to [skill] ";
|
||||
}
|
||||
return $this->str;
|
||||
}
|
||||
|
||||
|
@ -2,10 +2,15 @@
|
||||
<div class="row">
|
||||
<div class="offset-6 col"><h3 style="font-family:fixed; font-size:80%;">Preview</h3>
|
||||
<div class="" style="height: 117px; background: url(/img/items/bg.png) no-repeat">
|
||||
|
||||
<img style="" class="item" src="">
|
||||
<div class="item_desc">
|
||||
<p></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row" style="margin-bottom:40px;">
|
||||
<div class="col" style="">
|
||||
@ -42,7 +47,7 @@
|
||||
<label for="sort_3" class="custom-control-label">Item Code</label>
|
||||
</div>
|
||||
<hr>
|
||||
<p style="font-family:Exocet;">View Only: </p>
|
||||
<p style="font-family:Exocet;">Filter By: </p>
|
||||
<div class="custom-control custom-radio custom-control-inline">
|
||||
<input name="view" id="view_0" type="radio" class="custom-control-input" value="rin">
|
||||
<label for="view_0" class="custom-control-label">Rings</label>
|
||||
|
Loading…
Reference in New Issue
Block a user