diff --git a/ajax/config.php b/ajax/config.php new file mode 100644 index 0000000..eb55901 --- /dev/null +++ b/ajax/config.php @@ -0,0 +1,53 @@ +{$r['index']}"; + } else { + $html .= ""; + } + } + echo $html; +} + +if ($cmd == "viewOnly") { + + $table = 'misc'; + $sql = "SELECT uniqueitems.`index`, uniqueitems.`code`, misc.`type` +FROM uniqueitems +LEFT JOIN misc ON uniqueitems.`code` = misc.`code` +WHERE `type` IS NOT NULL AND uniqueitems.`code`='$view'"; + if ($view == 'armo') { + $table = 'armor'; + $sql = "SELECT uniqueitems.`index`, uniqueitems.`code`, $table.`code` +FROM uniqueitems +LEFT JOIN $table ON uniqueitems.`code` = $table.`code` +WHERE `type` IS NOT NULL AND uniqueitems.`code`= $table.`code` AND $table.`code` != '' ORDER BY `index`"; + } + if ($view == 'weap') { + $table = 'weapons'; + $sql = "SELECT uniqueitems.`index`, uniqueitems.`code`, $table.`code` +FROM uniqueitems +LEFT JOIN $table ON uniqueitems.`code` = $table.`code` +WHERE `type` IS NOT NULL AND uniqueitems.`code`= $table.`code` AND $table.`code` != '' ORDER BY `index`"; + } + + + if ($view == "char") { + $sql .= " OR uniqueitems.`code`='cm1' OR uniqueitems.`code`='cm2' OR uniqueitems.`code`='cm3'"; + } + + $res = PDO_FetchAll($sql); + + $html = ''; + foreach ($res as $r) { + if ($sort == 'index') { + $html .= ""; + } else { + $html .= ""; + } + } + echo $html; +} diff --git a/index.php b/index.php index 03c6317..67d14be 100644 --- a/index.php +++ b/index.php @@ -69,14 +69,22 @@ if (!isset($_SESSION['modname']) $db = new D2Database(); $parser = new D2TxtParser(); - $armor = PDO_FetchAll('SELECT * FROM armor WHERE `spawnable`=1'); - $weapon = PDO_FetchAll('SELECT * FROM weapons WHERE `spawnable`=1'); + $armor = PDO_FetchAll('SELECT * FROM armor WHERE spawnable=1'); + $misc = PDO_FetchAll('SELECT * FROM misc WHERE spawnable=1'); + $weapon = PDO_FetchAll('SELECT * FROM weapons WHERE spawnable=1'); + $uniqueitems = PDO_FetchAll("SELECT `index`,`code` FROM uniqueitems WHERE `enabled`='1' ORDER BY `index` ASC"); + + $prop = $parser->filterProps('Properties.txt'); + // If there's data, process it and save if (!empty($_POST)) { + ddump($_POST); + + // save db name from post into conf file require_once './src/D2SaveFile.php'; @@ -98,6 +106,7 @@ if (!isset($_SESSION['modname']) if ($_POST['formtype'] == "uniqueitems") { + ddump($_POST); // if ladder or carry1 is 0, set empty field. if (!$post['ladder']) { diff --git a/res/app.js b/res/app.js index 1f2aa2c..5f72d51 100644 --- a/res/app.js +++ b/res/app.js @@ -1,43 +1,43 @@ /* - - Copyright (C) 2021 Hash Borgir - - 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: - - * 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. - - * 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 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. - + + Copyright (C) 2021 Hash Borgir + + 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: + + * 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. + + * 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 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. + */ $(document).ready(function () { $('.form-text').hide(); @@ -53,13 +53,13 @@ $(document).ready(function () { $('option[disabled="disabled"]').show(); } }); - + $(function () { $('[data-toggle="tooltip"]').tooltip() }) $('.w-select').change(function () { - $('.a-select').each(function (i, v) { + $('.a-select,.m-select').each(function (i, v) { v.value = ''; v.required = ''; }); @@ -71,7 +71,18 @@ $(document).ready(function () { }); $('.a-select').change(function () { - $('.w-select').each(function (i, v) { + $('.w-select,.m-select').each(function (i, v) { + v.value = ''; + v.required = ''; + }); + + + x = $(this).find(':selected').text(); + y = document.getElementById('item'); + y.value = x; + }); + $('.m-select').change(function () { + $('.w-select,.a-select').each(function (i, v) { v.value = ''; v.required = ''; }); @@ -90,7 +101,7 @@ $(document).ready(function () { $('.help').click(function () { $(".fa-help").remove(); - $(this).next().fadeToggle("slow").focus().css({ + $(this).next().fadeToggle().focus().css({ "position": "absolute", "z-index": "1000", "background": "#eee", @@ -99,9 +110,52 @@ $(document).ready(function () { "width": "300px", }) }); - + +// $('.help').prev().hover(function () { +// $(".fa-help").remove(); +// $(this).next().next().fadeToggle().focus().css({ +// "position": "absolute", +// "z-index": "1000", +// "background": "#eee", +// "color": "black !important", +// "border": "1px solid #aaa", +// "width": "300px", +// }) +// }); + + + $('.form-text').click(function () { $(this).fadeOut("slow"); }); - + + // cmd = getUniqueItem + $('.uniqueitems-select').change(function () { + $.get("/ajax/uniqueitems.php?cmd=getUniqueItem&index=" + this.value, function (data) { + $.each(data, function (i, v) { + $('*[name="' + i.replace(/\s/g, '') + '"]').val(v); + if (i == 'code') { + $('select[name="code[]"]').val(v); + $('select[name="code[]"]').prop('required', ''); + } + }) + }); + }); + + + // cmd = sortBy + $('input[name="sort"]').change(function () { + $.get("/ajax/uniqueitems.php?cmd=sortBy&sort=" + this.value, function (data) { + $('.uniqueitems-select').html(data) + }); + }); + + // cmd = viewOnly + $('input[name="view"]').change(function () { + $.get("/ajax/uniqueitems.php?cmd=viewOnly&view=" + this.value, function (data) { + $('.uniqueitems-select').html(data) + }); + }); + + }); \ No newline at end of file diff --git a/res/style.css b/res/style.css index 1d8dc9f..407823d 100644 --- a/res/style.css +++ b/res/style.css @@ -112,6 +112,7 @@ body { h1,h2,h3,h4,h5,h6, div > p { font-family: Exocet; + color: #778; } #loading { margin-top: 40px; @@ -120,4 +121,15 @@ h1,h2,h3,h4,h5,h6, div > p { .fa-question-circle { bottom: 0px; +} + +.form-group > div { + margin: 5px 0; +} + +.help{ + position: absolute; + top:0px; + right: 0px; + color: #ccc; } \ No newline at end of file diff --git a/src/D2Database.php b/src/D2Database.php index 02e14ac..6da6084 100644 --- a/src/D2Database.php +++ b/src/D2Database.php @@ -60,7 +60,7 @@ class D2Database { } else { $dataType = "VARCHAR(255)"; } - $sql .= "`$k` $dataType NOT NULL,"; + $sql .= "`$k` $dataType DEFAULT '',"; } $sql = rtrim($sql, ","); $sql .= ")"; diff --git a/src/footer.php b/src/footer.php index 352631d..bae106d 100644 --- a/src/footer.php +++ b/src/footer.php @@ -1,6 +1,6 @@
-
+ @@ -9,4 +9,5 @@ \ No newline at end of file diff --git a/src/head.php b/src/head.php index 6a1a460..4b4b317 100644 --- a/src/head.php +++ b/src/head.php @@ -45,6 +45,8 @@ + + diff --git a/src/header.php b/src/header.php index 1b7241a..38a4729 100644 --- a/src/header.php +++ b/src/header.php @@ -53,7 +53,7 @@
-

+

Active Mod: [] diff --git a/src/tabs/UniqueItems.php b/src/tabs/UniqueItems.php index 6019b3a..b03cf3c 100644 --- a/src/tabs/UniqueItems.php +++ b/src/tabs/UniqueItems.php @@ -1,19 +1,77 @@ -

Unique Item Maker

+

Unique Item Maker

+
+
+ +
+
+ Sort By: +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ View Only: +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

Index

- +
- + Index: the ID pointer that is referenced by the game in TreasureClassEx.txt and CubeMain.txt, this column also contains the string-key used in the TBL files.
-
+

Version:

@@ -27,7 +85,7 @@

- + Version: Switch, what game version was this unique item added in, 0 referes to real classic Diablo II (1.00-1.06), 1 refers to new classic Diablo II (1.07-1.11) and 100 refers to the Expansion Set. Items with 100 will be unable to drop in Classic Diablo II.
@@ -42,7 +100,7 @@

- + Ladder: Boolean, 1 = item available only on the realms (enabled), 0 = item available both in single player/open games, TCP/IP and on the realms.
@@ -58,50 +116,52 @@

- + Ladder: Boolean, 1 = item available only on the realms (ladder), 0 = item available both in single player/open games, TCP/IP and on the realms.
-
+

Rarity

- - +
- + Rarity: chance to pick this unique item if more then one unique item of the same base item exist, this uses the common rarity/total_rarity formula, so if you have two unique rings, one with a rarity of 100 the other with a rarity of 1, then the first will drop 100/101 percent of the time (99%) and the other will drop 1/101 percent of the time (1%), rarity can be anything between 1 and 255 (rarity of less then 1 will be set to 1 by the code).
-
-
+
+

No Limit:

- + NoLimit: Boolean, 0 = can drop only once per game, 1 = can drop more then once per game.
-
- - +
+

Lvl

+ + Lvl: the quality level of this unique item. Monsters, cube recipes, vendors, objects and the like most be at least this level or higher to be able to drop this item, otherwise they would drop a rare item with enhanced durability.
- - +

LvlReq

+ + Lvl Req: the character level required to use this unique item.
-
- +
+
+

Misc

+ +
-
- + ' . $a['name'] . ''; @@ -124,93 +199,102 @@ ?>
-
-
+

-
- + - + Carry1: Boolean, 0 = allow the player to hold as many of this item as he wants, 1 = allow the player to hold a single copy only. In reality this just prevents the player from picking up the item when it is dropped on the floor and it prevents the player from putting this item in the trading window.
- - +

CostMult

+ + Cost Mult: the base item's price is multiplied by this value when sold, repaired or bought from a vendor.
- - +

CostAdd

+ + Cost Add: after the price has been multiplied, this amount of gold is added to the price on top.
- - +

CharTransform

+ + ChrTransform: palette shift to apply to the the DCC component-file and the DC6 flippy-file (whenever or not the color shift will apply is determined by Weapons.txt, Armor.txt or Misc.txt). This is an ID pointer from Colors.txt.
- - +

InvTransform

+ + InvTransform: palette shift to apply to the the DC6 inventory-file (whenever or not the color shift will apply is determined by Weapons.txt, Armor.txt or Misc.txt). This is an ID pointer from Colors.txt.
- - +

Flippy File

+ + FlippyFile: overrides the flippyfile specified in Weapons.txt, Armor.txt or Misc.txt for the base item. This field contains the file name of the DC6 flippy animation.
- - +

Inv File

+ + InvFile: overrides the invfile and uniqueinvfile specified in Weapons.txt, Armor.txt or Misc.txt for the base item. This field contains the file name of the DC6 inventory graphic.
- - +

DropSound

+ + DropSound: overrides the dropsound (the sound played when the item hits the ground) specified in Weapons.txt, Armor.txt or Misc.txt for the base item. This field contains an ID pointer from Sounds.txt.
- - +

DropSFXFrame

+ + DropSfxFrame: how many frames after the flippy animation starts playing will the associated drop sound start to play. This overrides the values in Weapons.txt, Armor.txt or Misc.txt.
- -UseSound: overrides the usesound (the sound played when the item is consumed by the player) specified in Weapons.txt, Armor.txt or Misc.txt for the base item. This field contains an ID pointer from Sounds.txt. +

UseSound

+ + UseSound: overrides the usesound (the sound played when the item is consumed by the player) specified in Weapons.txt, Armor.txt or Misc.txt for the base item. This field contains an ID pointer from Sounds.txt.
- +

Prop :