Latest working copy, needs testing on windows

This commit is contained in:
color.diff=auto 2021-03-29 18:47:21 -06:00
parent f166a2df67
commit c868e47245
12 changed files with 439 additions and 107 deletions

53
ajax/config.php Normal file
View File

@ -0,0 +1,53 @@
<?php
/*
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.
*/
session_start();
include "../_pdo.php";
require_once "../src/D2Functions.php";
define('DB_FILE', $_SESSION['modname'] . ".db");
define('TXT_PATH', $_SESSION['path']);
$db = dirname(getcwd()).DIRECTORY_SEPARATOR.DB_FILE;
PDO_Connect("sqlite:".$db);

113
ajax/uniqueitems.php Normal file
View File

@ -0,0 +1,113 @@
<?php
include "./config.php";
/*
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.
*/
if (!empty($_GET['cmd']))
$cmd = $_GET['cmd'];
if (!empty($_GET['sort']))
$sort = $_GET['sort'];
if (!empty($_GET['view']))
$view = $_GET['view'];
if ($cmd == "getUniqueItem") {
$sql = "SELECT * FROM `uniqueitems` WHERE `enabled`='1' AND `index`=\"{$_GET['index']}\"";
$res = PDO_FetchRow($sql);
header('Content-Type: application/json');
echo json_encode($res, JSON_INVALID_UTF8_IGNORE);
}
if ($cmd == "sortBy") {
$sql = "SELECT `index`,`$sort` FROM `uniqueitems` WHERE `enabled`='1' ORDER BY `$sort`";
$res = PDO_FetchAll($sql);
$html = '';
foreach ($res as $r) {
if ($sort == 'index') {
$html .= "<option value=\"{$r['index']}\">{$r['index']}</option>";
} else {
$html .= "<option value=\"{$r['index']}\">{$r['index']} ($r[$sort])</option>";
}
}
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 .= "<option value=\"{$r['index']}\">{$r['index']}</option>";
} else {
$html .= "<option value=\"{$r['index']}\">{$r['index']}</option>";
}
}
echo $html;
}

View File

@ -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']) {

View File

@ -1,42 +1,42 @@
/*
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.
*/
$(document).ready(function () {
@ -59,7 +59,7 @@ $(document).ready(function () {
})
$('.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",
@ -100,8 +111,51 @@ $(document).ready(function () {
})
});
// $('.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)
});
});
});

View File

@ -112,6 +112,7 @@ body {
h1,h2,h3,h4,h5,h6, div > p {
font-family: Exocet;
color: #778;
}
#loading {
margin-top: 40px;
@ -121,3 +122,14 @@ 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;
}

View File

@ -60,7 +60,7 @@ class D2Database {
} else {
$dataType = "VARCHAR(255)";
}
$sql .= "`$k` $dataType NOT NULL,";
$sql .= "`$k` $dataType DEFAULT '',";
}
$sql = rtrim($sql, ",");
$sql .= ")";

View File

@ -1,6 +1,6 @@
<div class="container">
<div class=" row" style="background: none;">
<div class="col" style="background: none;">
<div class="offset-9 col-3" style="background: none;">
<a style="font-weight: bold;" class="btn btn-info" href="/src/D2Config.php">Setup New Mod</a>
<a style="font-weight: bold;" class="btn btn-warning" href="/switchMods.php">Switch Mods</a>
</div>
@ -9,4 +9,5 @@
<footer>
<h1 id="credits-">Credits:</h1>
<p><a target="_blank" href="https://d2mods.info">Thanks Phrozen Keep! My favorite mod community since 2002!</a></p>
<p>Copyright HashCasper 2021 - All Rights Reserved</p>
</footer>

View File

@ -45,6 +45,8 @@
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="/res/bootstrap.min.css">
<link rel="stylesheet" href="/res/font-awesome.min.css">

View File

@ -53,7 +53,7 @@
<div class="row">
<div class="col">
<img src="/img/Diablo2.png" style="float:right"><h1 syle="display:inline; font-weight: 900"><?php echo $title . " " . $version; ?><span style="font-family: Lato !important; font-size: 14px;"> <?php echo " By" . $author ?></span></h1>
<img src="/img/Diablo2.png" style="float:right"><h1 syle="display:inline; font-weight: 900;"><?php echo $title . " " . $version; ?><span style="font-family: Lato !important; font-size: 14px;"> <?php echo " By" . $author ?></span></h1>
<div style="font-family: Lato !important; text-align:right; color: tomato">
Active Mod: <span style="color: purple"><?php echo $_SESSION['modname'] ?></span>
<span style="color: #8888FF">[<?php echo $_SESSION['path'] ?>]</span>

View File

@ -1,19 +1,77 @@
<div style="height: 40px; margin: 40px;"><h1>Unique Item Maker</h1></div>
<div style="height: 40px; margin: 40px 10px;"><h2>Unique Item Maker</h2></div>
<div class="row" style="">
<div class="col-3">
<select name="uniqueitems" class="custom-select uniqueitems-select">
<option value=""></option>
<?php foreach ($uniqueitems as $u) { ?>
<option value="<?php echo $u['index'] ?>"><?php echo $u['index'] ?></option>
<?php } ?>
</select>
</div>
<div class="col">
<span style="font-family:Exocet;">Sort By: </span>
<div class="custom-control custom-radio custom-control-inline">
<input name="sort" id="sort_0" type="radio" class="custom-control-input" value="lvl">
<label for="sort_0" class="custom-control-label">Level</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="sort" id="sort_1" type="radio" class="custom-control-input" value="index">
<label for="sort_1" class="custom-control-label">Name</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="sort" id="sort_2" type="radio" class="custom-control-input" value="*type">
<label for="sort_2" class="custom-control-label">Type</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="sort" id="sort_3" type="radio" class="custom-control-input" value="code">
<label for="sort_3" class="custom-control-label">Item Code</label>
</div>
</div>
</div>
<div class="row" style="margin-bottom: 40px;">
<div class="offset-3 col">
<span style="font-family:Exocet;">View Only: </span>
<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>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="view" id="view_1" type="radio" class="custom-control-input" value="amu">
<label for="view_1" class="custom-control-label">Amulets</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="view" id="view_2" type="radio" class="custom-control-input" value="weap">
<label for="view_2" class="custom-control-label">Weapons</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="view" id="view_3" type="radio" class="custom-control-input" value="armo">
<label for="view_3" class="custom-control-label">Armors</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="view" id="view_4" type="radio" class="custom-control-input" value="jew">
<label for="view_4" class="custom-control-label">Jewels</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="view" id="view_5" type="radio" class="custom-control-input" value="char">
<label for="view_5" class="custom-control-label">Charms</label>
</div>
</div>
</div>
<form action="/index.php" method="post">
<div class="form-group row">
<div class="col-2" style="background: #fec;">
<p>Index</p>
<div class="input-group">
<input name="index" placeholder="Item Name" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control">
<input name="index" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control">
</div><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #ddc;">
<div class="col-2" style="background: #eed;">
<p>Version:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="0">
@ -27,7 +85,7 @@
<input name="version" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="100" checked>
<label for="version_2" class="custom-control-label">100</label>
</div><br><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">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.</span>
</div>
@ -42,7 +100,7 @@
<input name="enabled" type="radio" class="custom-control-input" value="1" aria-describedby="enabledHelpBlock" required="required" checked>
<label for="enabled_1" class="custom-control-label">1</label>
</div><br><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">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.</span>
</div>
@ -58,50 +116,52 @@
<input name="ladder" type="radio" class="custom-control-input" value="1" aria-describedby="ladderHelpBlock" required="required">
<label for="ladder_1" class="custom-control-label">1</label>
</div><br><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-4" style="background: #dec;">
<div class="col-2" style="background: #dec;">
<p>Rarity</p>
<div class="input-group">
<input name="rarity" placeholder="Rarity" type="text" aria-describedby="rarityHelpBlock" required="required" class="form-control">
<input name="rarity" type="text" aria-describedby="rarityHelpBlock" required="required" class="form-control">
</div><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">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).</span>
</div>
</div>
<div class="form-group row">
<div class="col-2" style="background: #fde;">
<p>No Limit:</p>
<select name="nolimit" class="custom-select" aria-describedby="nolimitHelpBlock">
<option value="" selected>No Limit</option>
<option value="" selected></option>
<option value="0">0</option>
<option value="1">1</option>
</select><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">NoLimit: Boolean, 0 = can drop only once per game, 1 = can drop more then once per game.</span>
</div>
<div class="col-4" style="background: #edd;">
<input name="lvl" placeholder="Lvl" type="text" aria-describedby="lvlHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<div class="col-2" style="background: #edd;">
<p>Lvl</p>
<input name="lvl" type="text" aria-describedby="lvlHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #edd;">
<input name="lvlreq" placeholder="LvlReq" type="text" aria-describedby="lvlreqHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>LvlReq</p>
<input name="lvlreq" type="text" aria-describedby="lvlreqHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">Lvl Req: the character level required to use this unique item.</span>
</div>
<div class="col-2" style="background: #ccd;">
<select class="a-select custom-select" name="code[]" required="required">
<option value="">Armor</option>
<div class="col-2" style="background: #bbb;">
<p>Armor</p>
<select class="a-select custom-select code" name="code[]" required="required">
<option value=""></option>
<?php
foreach ($armor as $a)
if ($a['spawnable']) {
@ -113,10 +173,25 @@
</select>
</div>
<div class="col-2" style="background: #bbb;">
<p>Misc</p>
<select class="m-select custom-select code" name="code[]" required="required">
<option value=""></option>
<?php
foreach ($misc as $a)
if ($a['spawnable']) {
echo '<option value="' . $a['code'] . '">' . $a['name'] . '</option>';
} else {
echo '<option disabled value="' . $a['code'] . '">' . $a['name'] . '</option>';
}
?>
</select>
</div>
<div class="col-2" style="background: #ddc;">
<select class="w-select custom-select" name="code[]" required="required">
<option value="">Weapon</option>
<div class="col-2" style="background: #bbb;">
<p>Weapon</p>
<select class="w-select custom-select code" name="code[]" required="required">
<option value=""></option>
<?php
foreach ($weapon as $a) {
echo '<option value="' . $a['code'] . '">' . $a['name'] . '</option>';
@ -124,81 +199,90 @@
?>
</select>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="type" value=""> <br>
<input type="hidden" name="uber" value=""><br>
<div class="col-3" style="background: #edf;">
<select name="carry1" class="custom-select" aria-describedby="carry1HelpBlock" required="required">
<option value="" selected>Carry 1</option>
<div class="col-2" style="background: #edf;">
<p>Carry 1</p>
<select name="carry1" class="custom-select" aria-describedby="carry1HelpBlock">
<option value="" selected></option>
<option value="0">0</option>
<option value="1">1</option>
</select><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #def;">
<input value="" name="costmult" placeholder="Cost Mult" type="text" aria-describedby="costmultHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>CostMult</p>
<input value="" name="costmult" type="text" aria-describedby="costmultHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">Cost Mult: the base item's price is multiplied by this value when sold, repaired or bought from a vendor.</span>
</div>
<div class="col-3" style="background: #def;">
<input value="" name="costadd" placeholder="Cost Add" type="text" aria-describedby="costaddHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>CostAdd</p>
<input value="" name="costadd" type="text" aria-describedby="costaddHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">Cost Add: after the price has been multiplied, this amount of gold is added to the price on top.</span>
</div>
<div class="col-3" style="background: #fde;">
<input name="chrtransform" placeholder="ChrTransform" type="text" aria-describedby="chrtransformHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>CharTransform</p>
<input name="chrtransform" type="text" aria-describedby="chrtransformHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
</div>
<div class="form-group row">
<div class="col-2">
<input name="invtransform" type="text" placeholder="InvTransform" aria-describedby="invtransformHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>InvTransform</p>
<input name="invtransform" type="text" aria-describedby="invtransformHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #eef;">
<input name="flippyfile" placeholder="Flippy File" type="text" aria-describedby="flippyfileHelpBlock" class="form-control" required="required"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>Flippy File</p>
<input name="flippyfile" type="text" aria-describedby="flippyfileHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #eef;">
<input name="invfile" placeholder="InvFile" type="text" aria-describedby="invfileHelpBlock" required="required" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>Inv File</p>
<input name="invfile" type="text" aria-describedby="invfileHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #fed;">
<input name="dropsound" placeholder="DropSound" type="text" aria-describedby="dropsoundHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>DropSound</p>
<input name="dropsound" type="text" aria-describedby="dropsoundHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #fed;">
<input name="dropsfxframe" placeholder="DropSfxFrame" type="text" aria-describedby="dropsfxframeHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<p>DropSFXFrame</p>
<input name="dropsfxframe" type="text" aria-describedby="dropsfxframeHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">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.</span>
</div>
<div class="col-2" style="background: #fed;">
<input name="usesound" placeholder="UseSound" type="text" aria-describedby="usesoundHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span><span class="form-text">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.</span>
<p>UseSound</p>
<input name="usesound" type="text" aria-describedby="usesoundHelpBlock" class="form-control"><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span><span class="form-text">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.</span>
</div>
</div>
<div class="form-group row">
@ -208,9 +292,9 @@
foreach (range(01, 12) as $p) {
?>
<div class="col-2" style="padding: 15px;margin: 10px 0px; background: #ddd;">
<p>Prop <?php echo $p ?>:</p>
<select class="custom-select prop<?php echo $p ?>-select" name="prop<?php echo $p ?>">
<option class="PropFirst" value="">Prop<?php echo $p ?></option>
<option class="PropFirst" value=""></option>
<?php
foreach ($prop as $a) {
echo '<option value="' . $a . '">' . $a . '</option>';

View File

@ -1,7 +1,7 @@
<div class="form-group row options" style="background: none;">
<div class="row options" style="background: none;">
<div class="offset-10 col-2" style="background: none;">
<button style="" name="submit" type="submit" class="btn btn-success">Save Item</button>
<button name="submit" type="reset" class="btn btn-danger">Clear</button>
<button style="" name="submit" type="submit" class="btn btn-success">SAVE</button>
<button name="submit" type="reset" class="btn btn-danger">CLEAR</button>
</div>
</div>

View File

@ -50,6 +50,10 @@ if (file_exists(APP_DB)) {
$sql = "SELECT * FROM D2Modder";
$mods = PDO_FetchAll($sql);
if (empty($mods)){
header("Location: /src/D2Config.php");
}
if (!empty($_POST)) {
$sql = "SELECT * FROM D2Modder WHERE `modname`='{$_POST['modname']}'";
$mod = PDO_FetchRow($sql);