SetItems working. Tesing

This commit is contained in:
color.diff=auto
2021-03-23 02:13:54 -06:00
parent 03c73e8cf8
commit 3c070526f1
103 changed files with 42056 additions and 16740 deletions

View File

@@ -1,38 +1,63 @@
<?php
if (!empty($_POST)) {
// write the d2um.conf file and replace \ with \\
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$path = rtrim($_POST['path'], "\\");
$path = str_replace("\\", "\\\\", $path);
$path .= '\\\\data\\\\global\\\\excel\\\\';
file_put_contents("../d2um.conf", $path);
} else {
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR);
}
header('Location: /');
}
?>
<!doctype html>
<html lang="en">
<?php
/* Require the <head> section */
require_once "head.php";
?>
<body style="text-align: center; background: white;">
<div class="container container-top">
<h1><img src="/img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
<hr style="margin: 60px;">
<h2>Select Mod TXT folder</h2>
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
<div style="margin-top: 20px;">
<form enctype="multipart/form-data" style="font-family: Lato; font-size: 14pt;" action="" method="post">
<label for="path">Choose PATH</label>
<input id="path" style="width: 420px;" required="required" name="path" type="text">
<input type="submit" value="Write Config" name="submit">
</form>
</div>
</body>
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
if (!empty($_POST)) {
// write the d2um.conf file and replace \ with \\
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$path = rtrim($_POST['path'], "\\");
$path = str_replace("\\", "\\\\", $path);
$path .= '\\\\data\\\\global\\\\excel\\\\';
file_put_contents("../d2um.conf", $path);
} else {
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR);
}
header('Location: /');
}
?>
<!doctype html>
<html lang="en">
<?php
/* Require the <head> section */
require_once "head.php";
?>
<body style="text-align: center; background: white;">
<div class="container container-top">
<h1><img src="/img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
<a class="btn" style="color:red; font-size: 18px;float:right;" href="/">X</a>
<hr style="margin: 60px;">
<h2>Select Mod folder</h2>
<p style="font-family: lato">Example: D:\Diablo II\MODS\you-mod-name\</p>
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
<div style="margin-top: 20px;">
<form enctype="multipart/form-data" style="font-family: Lato; font-size: 14pt;" action="" method="post">
<label for="path">Choose PATH</label>
<input id="path" style="width: 420px;" required="required" name="path" type="text">
<input type="submit" value="Save" name="submit">
</form>
</div>
</body>
</html>

133
src/D2Files.php Normal file
View File

@@ -0,0 +1,133 @@
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
class D2Files {
public $files = [
"Aiparms" => "Aiparms.txt",
"Arena" => "Arena.txt",
"Armor" => "Armor.txt",
"ArmType" => "ArmType.txt",
"automagic" => "automagic.txt",
"AutoMap" => "AutoMap.txt",
"belts" => "belts.txt",
"bodylocs" => "bodylocs.txt",
"Books" => "Books.txt",
"CharStats" => "CharStats.txt",
"CharTemplate" => "CharTemplate.txt",
"colors" => "colors.txt",
"CompCode" => "CompCode.txt",
"Composit" => "Composit.txt",
"CubeMain" => "CubeMain.txt",
"CubeMod" => "CubeMod.txt",
"cubetype" => "cubetype.txt",
"DifficultyLevels" => "DifficultyLevels.txt",
"ElemTypes" => "ElemTypes.txt",
"Events" => "Events.txt",
"Experience" => "Experience.txt",
"gamble" => "gamble.txt",
"Gems" => "Gems.txt",
"hiredesc" => "hiredesc.txt",
"Hireling" => "Hireling.txt",
"HitClass" => "HitClass.txt",
"Inventory" => "Inventory.txt",
"ItemRatio" => "ItemRatio.txt",
"ItemStatCost" => "ItemStatCost.txt",
"ItemTypes" => "ItemTypes.txt",
"Levels" => "Levels.txt",
"lowqualityitems" => "lowqualityitems.txt",
"LvlMaze" => "LvlMaze.txt",
"LvlPrest" => "LvlPrest.txt",
"LvlSub" => "LvlSub.txt",
"LvlTypes" => "LvlTypes.txt",
"LvlWarp" => "LvlWarp.txt",
"MagicPrefix" => "MagicPrefix.txt",
"MagicSuffix" => "MagicSuffix.txt",
"Misc" => "Misc.txt",
"MissCalc" => "MissCalc.txt",
"Missiles" => "Missiles.txt",
"MonAi" => "MonAi.txt",
"MonEquip" => "MonEquip.txt",
"MonItemPercent" => "MonItemPercent.txt",
"MonLvl" => "MonLvl.txt",
"MonMode" => "MonMode.txt",
"MonName" => "MonName.txt",
"MonPlace" => "MonPlace.txt",
"MonPreset" => "MonPreset.txt",
"MonProp" => "MonProp.txt",
"MonSeq" => "MonSeq.txt",
"MonSounds" => "MonSounds.txt",
"MonStats2" => "MonStats2.txt",
"MonStats" => "MonStats.txt",
"MonType" => "MonType.txt",
"MonUMod" => "MonUMod.txt",
"Npc" => "Npc.txt",
"Objects" => "Objects.txt",
"objgroup" => "objgroup.txt",
"ObjMode" => "ObjMode.txt",
"ObjType" => "ObjType.txt",
"Overlay" => "Overlay.txt",
"PetType" => "PetType.txt",
"PlayerClass" => "PlayerClass.txt",
"PlrMode" => "PlrMode.txt",
"PlrType" => "PlrType.txt",
"Properties" => "Properties.txt",
"qualityitems" => "qualityitems.txt",
"RarePrefix" => "RarePrefix.txt",
"RareSuffix" => "RareSuffix.txt",
"Runes" => "Runes.txt",
"SetItems" => "SetItems.txt",
"Sets" => "Sets.txt",
"Shrines" => "Shrines.txt",
"SkillCalc" => "SkillCalc.txt",
"SkillDesc" => "SkillDesc.txt",
"Skills" => "Skills.txt",
"SoundEnviron" => "SoundEnviron.txt",
"Sounds" => "Sounds.txt",
"States" => "States.txt",
"StorePage" => "StorePage.txt",
"SuperUniques" => "SuperUniques.txt",
"TreasureClassEx" => "TreasureClassEx.txt",
"TreasureClass" => "TreasureClass.txt",
"UniqueAppellation" => "UniqueAppellation.txt",
"UniqueItems" => "UniqueItems.txt",
"UniquePrefix" => "UniquePrefix.txt",
"UniqueSuffix" => "UniqueSuffix.txt",
"UniqueTitle" => "UniqueTitle.txt",
"WeaponClass" => "WeaponClass.txt",
"Weapons" => "Weapons.txt"
];
public function __construct() {
}
public function getFiles(){
return $this->files;
}
public function getFile($name){
return $this->files[$name];
}
}

8
src/D2Functions.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
function dd($var) {
echo "<pre>";
var_dump($var);
echo "</pre>";
die();
}

263
src/D2SM.php Normal file
View File

@@ -0,0 +1,263 @@
<div style="height: 40px; margin: 40px;"><h1>Set Item Maker</h1></div>
<form action="/index.php" method="post">
<!-- First row -->
<div class="form-group row">
<div class="col-4">
<div class="input-group">
<input id="index" name="index" placeholder="Index (Item Name)" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="indexHelpBlock" class="form-text text-muted">Index: string key to item's name in a .tbl file</span>
</div>
<div class="col-4">
<div class="input-group">
<input id="set" name="set" placeholder="Set" type="text" aria-describedby="setHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="indexHelpBlock" class="form-text text-muted">
Set: string key to the index field in Sets.txt - the set the item is a part of.
</span>
</div>
<div class="col-2" style="background: #ccd;">
<label for="a-select">Armor</label>
<select class="a-select custom-select" name="code[]" id="" required="required">
<option value=""></option>
<?php
foreach ($armor 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;">
<label for="w-select">Weapon</label>
<select class="w-select custom-select" name="code[]" id="w-select" required="required">
<option value=""></option>
<?php
foreach ($weapon as $a) {
echo '<option value="' . $a['code'] . '">' . $a['name'] . '</option>';
}
?>
</select>
</div>
</div>
<input id="item" type="hidden" name="item" value="">
<!-- Second row -->
<div class="form-group row">
<div class="col-2" style="background: #dec;">
<div class="input-group">
<input id="rarity" name="rarity" placeholder="Rarity" type="text" aria-describedby="rarityHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="rarityHelpBlock" class="form-text text-muted">Rarity: Chance to pick this set item if more then one set item of the same base item exist, this uses the common rarity/total_rarity formula, so if you have two set 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 0 and 255.</span>
</div>
<div class="col-2" style="background: #edd;">
<input id="lvl" name="lvl" placeholder="Lvl" type="text" aria-describedby="lvlHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="lvlHelpBlock" class="form-text text-muted">The quality level of this set 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 magical item with twice normal durability.</span>
</div>
<div class="col-2" style="background: #edd;">
<input id="lvlreq" name="lvlreq" placeholder="Level Required" type="text" aria-describedby="lvlreqHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="lvlreqHelpBlock" class="form-text text-muted">lvl req: The character level required to use this set item.</span>
</div>
<div class="col-2">
<input id="chrtransform" name="chrtransform" placeholder="ChrTransform" type="text" aria-describedby="chrtransformHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="chrtransformHelpBlock" class="form-text text-muted">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 class="col-2">
<input id="invtransform" name="invtransform" type="text" placeholder="InvTransform" aria-describedby="invtransformHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="invtransformHelpBlock" class="form-text text-muted">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 id="invfile" name="invfile" placeholder="InvFile" type="text" aria-describedby="invfileHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="invfileHelpBlock" class="form-text text-muted">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: #eef;">
<input id="flippyfile" name="flippyfile" placeholder="Flippy File" type="text" aria-describedby="flippyfileHelpBlock" class="form-control" required="required"><span class="help">[show/hide Help]</span>
<span id="flippyfileHelpBlock" class="form-text text-muted">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: #fed;">
<input id="dropsound" name="dropsound" placeholder="DropSound" type="text" aria-describedby="dropsoundHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="dropsoundHelpBlock" class="form-text text-muted">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 id="dropsfxframe" name="dropsfxframe" placeholder="DropSfxFrame" type="text" aria-describedby="dropsfxframeHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="dropsfxframeHelpBlock" class="form-text text-muted">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 id="usesound" name="usesound" placeholder="UseSound" type="text" aria-describedby="usesoundHelpBlock" class="form-control"><span class="help">[show/hide Help]</span><span id="usesoundHelpBlock" class="form-text text-muted">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 class="col-2" style="background: #def;">
Cost Mult:
<input id="costmult" value="5" name="costmult" placeholder="Cost Mult" type="text" aria-describedby="costmultHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="costmultHelpBlock" class="form-text text-muted">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-2" style="background: #def;">
Cost Add:
<input id="costadd" value="5000" name="costadd" placeholder="Cost Add" type="text" aria-describedby="costaddHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="costaddHelpBlock" class="form-text text-muted">Cost Add: after the price has been multiplied, this amount of gold is added to the price on top.</span>
</div>
</div>
<div class="col-3" style="background: #ffc">
<p>Add Func:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="addfunc" id="addfunc_0" type="radio" aria-describedby="addfuncHelpBlock" required="required" class="custom-control-input" value="0">
<label for="addfunc_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="addfunc" id="addfunc_1" type="radio" aria-describedby="addfuncHelpBlock" required="required" class="custom-control-input" value="1">
<label for="addfunc_1" class="custom-control-label">1</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="addfunc" id="addfunc_2" type="radio" aria-describedby="addfuncHelpBlock" required="required" class="custom-control-input" value="2">
<label for="addfunc_2" class="custom-control-label">2</label>
</div><br> <span class="help">[show/hide Help]</span>
<span id="addfuncHelpBlock" class="form-text text-muted">add func: a property mode field that controls how the variable attributes will appear and be functional on a set item. See the appendix for further details about this field's effects.<ol>
<li>no green properties on item (apropxx will appear as a blue attribute on the list instead).</li>
<li>green properties (apropxx) depend on which other items from the set are equipped.</li>
<li>green properties (apropxx) depend on how many other items from the set are equipped.</li>
</ol></span>
</div>
<div class="form-group row">
<div class="col-12">
<h3 style="color: blue;">Blue Attributes</h3>
</div>
<?php
$html = '';
foreach (range(1, 9) as $p) {
?>
<div class="col-2" style="background: #D6DDFF;">
<select id="prop<?php echo $p ?>-select" name="prop<?php echo $p ?>" class="custom-select">
<option class="PropFirst" value="">Prop<?php echo $p ?></option>
<?php
foreach ($prop as $a) {
echo '<option value="' . $a['code'] . '">' . $a['code'] . '</option>';
}
?>
</select>
<input id="par<?php echo $p ?>" name="par<?php echo $p ?>" placeholder="Par<?php echo $p ?>" type="number" aria-describedby="par<?php echo $p ?>HelpBlock" class="form-control par<?php echo $p ?>">
<input id="min<?php echo $p ?>" name="min<?php echo $p ?>" placeholder="min<?php echo $p ?>" type="number" aria-describedby="min<?php echo $p ?>HelpBlock" class="form-control min<?php echo $p ?>">
<input id="max<?php echo $p ?>" name="max<?php echo $p ?>" placeholder="max<?php echo $p ?>" type="number" aria-describedby="max<?php echo $p ?>HelpBlock" class="form-control max<?php echo $p ?>">
</div>
<?php
}
?>
</div>
<div class="form-group row">
<div class="col-12">
<h3 style="color: green">Green Attributes</h3>
<p style="font-family: lato;">Note: Edit boxes in Vertical Order. <br>[aprop1a, aprop1b][aprop2a, aprop2b]</p>
</div>
<?php
$html = '';
foreach (range(1, 5) as $p) {
?>
<div class="col-2" style="background: #DDFFD6">
<select id="aprop<?php echo $p ?>a-select" name="aprop<?php echo $p ?>a" class="custom-select">
<option class="aPropFirst" value="">aProp<?php echo $p ?>a</option>
<?php
foreach ($prop as $a) {
echo '<option value="' . $a['code'] . '">' . $a['code'] . '</option>';
}
?>
</select>
<input id="apar<?php echo $p ?>a" name="apar<?php echo $p ?>a" placeholder="apar<?php echo $p ?>a" type="number" aria-describedby="apar<?php echo $p ?>aHelpBlock" class="form-control apar<?php echo $p ?>a">
<input id="amin<?php echo $p ?>a" name="amin<?php echo $p ?>a" placeholder="amin<?php echo $p ?>a" type="number" aria-describedby="amin<?php echo $p ?>aHelpBlock" class="form-control amin<?php echo $p ?>a">
<input id="amax<?php echo $p ?>a" name="amax<?php echo $p ?>a" placeholder="amax<?php echo $p ?>a" type="number" aria-describedby="amax<?php echo $p ?>aHelpBlock" class="form-control amax<?php echo $p ?>a">
<i class="fa fa-arrow-down" aria-hidden="true"></i>
<!-- b -->
<div style="margin-top: 0px;">
<i class="fa fa-arrow-down" aria-hidden="true"></i>
<select id="bprop<?php echo $p ?>b-select" name="aprop<?php echo $p ?>b" class="custom-select">
<option class="aPropFirst" value="">aProp<?php echo $p ?>b</option>
<?php
foreach ($prop as $a) {
echo '<option value="' . $a['code'] . '">' . $a['code'] . '</option>';
}
?>
</select>
<input id="apar<?php echo $p ?>b" name="apar<?php echo $p ?>b" placeholder="apar<?php echo $p ?>b" type="number" aria-describedby="apar<?php echo $p ?>aHelpBlock" class="form-control apar<?php echo $p ?>b">
<input id="amin<?php echo $p ?>b" name="amin<?php echo $p ?>b" placeholder="amin<?php echo $p ?>b" type="number" aria-describedby="amin<?php echo $p ?>aHelpBlock" class="form-control amin<?php echo $p ?>b">
<input id="amax<?php echo $p ?>b" name="amax<?php echo $p ?>b" placeholder="amax<?php echo $p ?>b" type="number" aria-describedby="amax<?php echo $p ?>aHelpBlock" class="form-control amax<?php echo $p ?>b">
</div>
</div>
<?php
}
?>
</div>
<div class="form-group row">
<span class="help">[show/hide Help]</span>
<span id="apropHelpBlock" class="form-text text-muted">
<p><strong>aprop1a,aprop1b to aprop5a,aprop5b:</strong> An ID pointer of a property from Properties.txt, these columns control each of the five pairs of different variable (green) modifiers a set item can grant you at most.</p>
<p><strong>apar1a,apar1b to apar5a,apar5b:</strong> The parameter passed on to the associated property, this is used to pass skill IDs, state IDs, monster IDs, montype IDs and the like on to the properties that require them, these fields support calculations.</p>
<p><strong>amin1a,amin1b to amin5a,amin5b:</strong> Minimum value to assign to the associated property. Certain properties have special interpretations based on stat encoding (e.g. chance-to-cast and charged skills). See the File Guide for Properties.txt and ItemStatCost.txt for further details.</p>
<p><strong>amax1a,amax1b to amax5a,amax5b:</strong> Maximum value to assign to the associated property. Certain properties have special interpretations based on stat encoding (e.g. chance-to-cast and charged skills). See the File Guide for Properties.txt and ItemStatCost.txt for further details.</p>
</span>
</div>
<input type="hidden" name="*eol" value="0">
<?php include 'optionSubmit.php'; ?>
<!-- distinguish between forms -->
<input type="hidden" name="formtype" value="setitems">
</form>
<ul>
<li><a href="https://d2mods.info/forum/kb/viewarticle?a=348">SetItems.txt</a></li>
<li><a href="https://d2mods.info/forum/kb/viewarticle?a=349">Sets.txt</a></li>
<li><a href="https://d2mods.info/forum/viewtopic.php?t=34455">Intro to the D2 Files and File Guide/Tutorial Masterlist</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=2">Armor.txt by Kingpin et al. [ex Nefarius] (accurate)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=345">Properties.txt by Joel (revised by Myhrginoc 8/22/06)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=346">Weapons.txt by Kingpin and Ric Faith (accurate)</a></li>
</ul>

View File

@@ -1,81 +1,81 @@
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
class saveFile {
public $path;
public function saveTxt($file) {
$post = $_POST;
if (!empty($post['code'])) {
array_filter($post['code']);
if (!empty($post['code'][0])) {
$post['code'] = $post['code'][0];
} else {
$post['code'] = $post['code'][1];
}
}
$fp = fopen($this->path.DIRECTORY_SEPARATOR.$file, 'a+');
$this->saveBackup($file);
fputcsv($fp, $post, "\t");
}
public function saveBackup($file){
// if dir doesn't exist, create it
if (!is_dir($this->path.DIRECTORY_SEPARATOR."backup")) mkdir($this->path."backup", 0700);
$oldfile = $this->path.$file;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// set new file location to copy to (backup)
$newfile = $this->path."\\backup\\$file";
} else {
$newfile = $this->path."/backup/$file";
}
if (!copy($oldfile, $newfile)) {
echo "Failed to create backup of $file...\n";
}
}
public function saveTblEnries() {
$post = $_POST;
if (!is_dir($this->path."tblEntries")) mkdir($this->path."tblEntries", 0700);
// write for .tbl
$str = '"'.$post['index'].'"'."\t".'"'.$post['index'].'"'.PHP_EOL;
$file = $this->path."\\tblEntries\\UniqueItemsTblEntries.txt";
file_put_contents($file, $str, FILE_APPEND);
}
public function __construct() {
$this->path = TXT_PATH;
}
}
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
class D2SaveFile {
public $path;
public function save($file) {
$post = $_POST;
if (!empty($post['code'])) {
array_filter($post['code']);
if (!empty($post['code'][0])) {
$post['code'] = $post['code'][0];
} else {
$post['code'] = $post['code'][1];
}
}
$fp = fopen($this->path.DIRECTORY_SEPARATOR.$file, 'a+');
$this->saveBackup($file);
fputcsv($fp, $post, "\t");
}
public function saveBackup($file){
// if dir doesn't exist, create it
if (!is_dir($this->path.DIRECTORY_SEPARATOR."backup")) mkdir($this->path."backup", 0700);
$oldfile = $this->path.$file;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// set new file location to copy to (backup)
$newfile = $this->path."\\backup\\$file";
} else {
$newfile = $this->path."backup/$file";
}
if (!copy($oldfile, $newfile)) {
echo "Failed to create backup of $file...\n";
}
}
public function saveTblEnries($filename) {
$post = $_POST;
if (!is_dir($this->path."tblEntries")) mkdir($this->path."tblEntries", 0700);
// write for .tbl
$str = '"'.$post['index'].'"'."\t".'"'.$post['index'].'"'.PHP_EOL;
$file = $this->path."\\tblEntries\\$filename";
file_put_contents($file, $str, FILE_APPEND);
}
public function __construct() {
$this->path = TXT_PATH;
}
}
?>

View File

@@ -1,64 +1,53 @@
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
This is a generic D2 Txt Parser
*/
class txtParser {
public $path = TXT_PATH;
// Files specific to Unique Items
public $u = "UniqueItems.txt";
public $w = "Weapons.txt";
public $a = "Armor.txt";
public $p = "Properties.txt";
public function getFiles(){
return ['u'=>$this->u, 'w'=>$this->w, 'a'=>$this->a, 'p'=>$this->p];
}
function toPHP($file) {
$file = $this->path . $file;
$rows = array_map(function ($v) {
return str_getcsv($v, "\t");
}
, file($file));
$header = array_shift($rows);
foreach ($rows as $row) {
$data[] = @array_combine($header, $row);
}
return $data;
}
public function getData() {
$data['a'] = $this->toPHP($this->a);
$data['w'] = $this->toPHP($this->w);
$data['p'] = $this->toPHP($this->p);
$data['u'] = $this->toPHP($this->u);
return $data;
}
}
?>
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
This is a generic D2 Txt Parser
*/
class D2TxtParser {
public $path = TXT_PATH;
// Files specific to Unique Items
public function __construct() {
}
public function parseFile($file){
return $this->toPHP($file);
}
function toPHP($file) {
$file = $this->path . $file;
$rows = array_map(function ($v) {
return str_getcsv($v, "\t");
}
, file($file));
$header = array_shift($rows);
foreach ($rows as $row) {
$data[] = @array_combine($header, $row);
}
return $data;
}
}
?>

View File

@@ -1,260 +1,233 @@
<!doctype html>
<html lang="en">
<?php
/*Require the <head> section*/
require_once "head.php";
?>
<body>
<div class="container container-top">
<h1><img src="img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
<form action="/index.php" method="post">
<div class="form-group row">
<div class="col-3">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fa fa-align-justify"></i>
</div>
</div>
<input id="index" name="index" placeholder="Index (Item Name)" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="indexHelpBlock" class="form-text text-muted">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-3" style="background: #ddc;">
<p>Version:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" id="version_0" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="0">
<label for="version_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" id="version_1" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="1">
<label for="version_1" class="custom-control-label">1</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" id="version_2" 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">[show/hide Help]</span>
<span id="versionHelpBlock" class="form-text text-muted">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>
<div class="col-2" style="background: #def;">
<p>Enabled:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="enabled" id="enabled_0" type="radio" class="custom-control-input" value="0" aria-describedby="enabledHelpBlock" required="required">
<label for="enabled_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="enabled" id="enabled_1" 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">[show/hide Help]</span>
<span id="enabledHelpBlock" class="form-text text-muted">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>
<div class="col-2" style="background: #dac;">
<p>Ladder:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="ladder" id="ladder_0" type="radio" class="custom-control-input" value="0" aria-describedby="ladderHelpBlock" required="required">
<label for="ladder_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="ladder" id="ladder_1" type="radio" class="custom-control-input" value="1" aria-describedby="ladderHelpBlock" required="required" checked>
<label for="ladder_1" class="custom-control-label">1</label>
</div><br><span class="help">[show/hide Help]</span>
<span id="ladderHelpBlock" class="form-text text-muted">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-2" style="background: #dec;">
<div class="input-group">
<input id="rarity" name="rarity" placeholder="Rarity" type="text" aria-describedby="rarityHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="rarityHelpBlock" class="form-text text-muted">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-3">
<p>NoLimit</p>
<select id="nolimit" name="nolimit" class="custom-select" aria-describedby="nolimitHelpBlock">
<option value="0">0</option>
<option value="1">1</option>
</select><span class="help">[show/hide Help]</span>
<span id="nolimitHelpBlock" class="form-text text-muted">NoLimit: Boolean, 0 = can drop only once per game, 1 = can drop more then once per game.</span>
</div>
<div class="col-3" style="background: #edd;">
<input id="lvl" name="lvl" placeholder="Lvl" type="text" aria-describedby="lvlHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="lvlHelpBlock" class="form-text text-muted">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 id="lvlreq" name="lvlreq" placeholder="Level Required" type="text" aria-describedby="lvlreqHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="lvlreqHelpBlock" class="form-text text-muted">Lvl Req: the character level required to use this unique item.</span>
</div>
<div class="col-2" style="background: #ccd;">
<label for="a-select">Armor</label>
<select class="custom-select" onChange="val();" name="code[]" id="a-select" required="required">
<option value=""></option>
<?php
foreach ($armor 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;">
<label for="w-select">Weapon</label>
<select class="custom-select" onChange="val2();" name="code[]" id="w-select" required="required">
<option value=""></option>
<?php
foreach ($weapon as $a) {
echo '<option value="' . $a['code'] . '">' . $a['name'] . '</option>';
}
?>
</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">
<p>Carry1</p>
<select id="carry1" name="carry1" class="custom-select" aria-describedby="carry1HelpBlock" required="required">
<option value="0">0</option>
<option value="1" selected>1</option>
</select><span class="help">[show/hide Help]</span>
<span id="carry1HelpBlock" class="form-text text-muted">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-3" style="background: #def;">
<input id="costmult" value="5" name="costmult" placeholder="Cost Mult" type="text" aria-describedby="costmultHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="costmultHelpBlock" class="form-text text-muted">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 id="costadd" value="5000" name="costadd" placeholder="Cost Add" type="text" aria-describedby="costaddHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="costaddHelpBlock" class="form-text text-muted">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">
<input id="chrtransform" name="chrtransform" placeholder="ChrTransform" type="text" aria-describedby="chrtransformHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="chrtransformHelpBlock" class="form-text text-muted">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 id="invtransform" name="invtransform" type="text" placeholder="InvTransform" aria-describedby="invtransformHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="invtransformHelpBlock" class="form-text text-muted">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 id="flippyfile" name="flippyfile" placeholder="Flippy File" type="text" aria-describedby="flippyfileHelpBlock" class="form-control" required="required"><span class="help">[show/hide Help]</span>
<span id="flippyfileHelpBlock" class="form-text text-muted">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 id="invfile" name="invfile" placeholder="InvFile" type="text" aria-describedby="invfileHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="invfileHelpBlock" class="form-text text-muted">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 id="dropsound" name="dropsound" placeholder="DropSound" type="text" aria-describedby="dropsoundHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="dropsoundHelpBlock" class="form-text text-muted">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 id="dropsfxframe" name="dropsfxframe" placeholder="DropSfxFrame" type="text" aria-describedby="dropsfxframeHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="dropsfxframeHelpBlock" class="form-text text-muted">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 id="usesound" name="usesound" placeholder="UseSound" type="text" aria-describedby="usesoundHelpBlock" class="form-control"><span class="help">[show/hide Help]</span><span id="usesoundHelpBlock" class="form-text text-muted">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">
<?php
$html = '';
foreach (range(01, 12) as $p) {
?>
<div class="col-2" style="padding: 15px;margin: 10px 0px; background: #ddd;">
<select id="prop<?php echo $p ?>-select" name="prop<?php echo $p ?>" class="custom-select">
<option class="PropFirst" value="">Prop<?php echo $p ?></option>
<?php
foreach ($prop as $a) {
echo '<option value="' . $a['code'] . '">' . $a['code'] . '</option>';
}
?>
</select>
<input id="par<?php echo $p ?>" name="par<?php echo $p ?>" placeholder="Par<?php echo $p ?>" type="number" aria-describedby="par<?php echo $p ?>HelpBlock" class="form-control par<?php echo $p ?>">
<input id="min<?php echo $p ?>" name="min<?php echo $p ?>" placeholder="min<?php echo $p ?>" type="number" aria-describedby="min<?php echo $p ?>HelpBlock" class="form-control min<?php echo $p ?>">
<input id="max<?php echo $p ?>" name="max<?php echo $p ?>" placeholder="max<?php echo $p ?>" type="number" aria-describedby="max<?php echo $p ?>HelpBlock" class="form-control max<?php echo $p ?>">
</div>
<?php
}
?>
<input type="hidden" name="*eol" value="0">
</div>
<div class="form-group row options" style="background: none;">
<div class="col-9" style="background: none;">
<p>Options: <br>
(Hide 'unspawnable' items) <input type="checkbox" id="op1" name="opt-hide-disabled" checked>
<a style="font-weight: bold;" class="btn" href="/src/config.php">Recofigure Mod Path</a>
</p>
</div>
<div class="col-3" style="background: none;">
<button name="submit" type="submit" class="btn btn-success">Save Item</button>
<button name="submit" type="reset" class="btn btn-danger">Clear</button>
</div>
</div>
</form>
<footer>
<h1 id="credits-">Credits:</h1>
<p>Thanks Phrozen Keep! My favorite mod community since 2002!</p>
<ul>
<li><a href="https://d2mods.info/forum/viewtopic.php?t=34455">Intro to the D2 Files and File Guide/Tutorial Masterlist</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=2">Armor.txt by Kingpin et al. [ex Nefarius] (accurate)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=345">Properties.txt by Joel (revised by Myhrginoc 8/22/06)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=346">Weapons.txt by Kingpin and Ric Faith (accurate)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=386">UniqueItems.txt by Nefarius (accurate)</a></li>
</ul>
</footer>
</div>
</body>
</html>
<div style="height: 40px; margin: 40px;"><h1>Unique Item Maker</h1></div>
<form action="/index.php" method="post">
<div class="form-group row">
<div class="col-3">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fa fa-align-justify"></i>
</div>
</div>
<input id="index" name="index" placeholder="Index (Item Name)" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="indexHelpBlock" class="form-text text-muted">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-3" style="background: #ddc;">
<p>Version:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" id="version_0" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="0">
<label for="version_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" id="version_1" type="radio" aria-describedby="versionHelpBlock" required="required" class="custom-control-input" value="1">
<label for="version_1" class="custom-control-label">1</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="version" id="version_2" 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">[show/hide Help]</span>
<span id="versionHelpBlock" class="form-text text-muted">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>
<div class="col-2" style="background: #def;">
<p>Enabled:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="enabled" id="enabled_0" type="radio" class="custom-control-input" value="0" aria-describedby="enabledHelpBlock" required="required">
<label for="enabled_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="enabled" id="enabled_1" 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">[show/hide Help]</span>
<span id="enabledHelpBlock" class="form-text text-muted">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>
<div class="col-2" style="background: #dac;">
<p>Ladder:</p>
<div class="custom-control custom-radio custom-control-inline">
<input name="ladder" id="ladder_0" type="radio" class="custom-control-input" value="0" aria-describedby="ladderHelpBlock" required="required">
<label for="ladder_0" class="custom-control-label">0</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input name="ladder" id="ladder_1" type="radio" class="custom-control-input" value="1" aria-describedby="ladderHelpBlock" required="required" checked>
<label for="ladder_1" class="custom-control-label">1</label>
</div><br><span class="help">[show/hide Help]</span>
<span id="ladderHelpBlock" class="form-text text-muted">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-2" style="background: #dec;">
<div class="input-group">
<input id="rarity" name="rarity" placeholder="Rarity" type="text" aria-describedby="rarityHelpBlock" required="required" class="form-control">
</div><span class="help">[show/hide Help]</span>
<span id="rarityHelpBlock" class="form-text text-muted">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-3">
<p>NoLimit</p>
<select id="nolimit" name="nolimit" class="custom-select" aria-describedby="nolimitHelpBlock">
<option value="0">0</option>
<option value="1">1</option>
</select><span class="help">[show/hide Help]</span>
<span id="nolimitHelpBlock" class="form-text text-muted">NoLimit: Boolean, 0 = can drop only once per game, 1 = can drop more then once per game.</span>
</div>
<div class="col-3" style="background: #edd;">
<input id="lvl" name="lvl" placeholder="Lvl" type="text" aria-describedby="lvlHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="lvlHelpBlock" class="form-text text-muted">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 id="lvlreq" name="lvlreq" placeholder="Level Required" type="text" aria-describedby="lvlreqHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="lvlreqHelpBlock" class="form-text text-muted">Lvl Req: the character level required to use this unique item.</span>
</div>
<div class="col-2" style="background: #ccd;">
<label for="a-select">Armor</label>
<select class="a-select custom-select" name="code[]" id="" required="required">
<option value=""></option>
<?php
foreach ($armor 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;">
<label for="w-select">Weapon</label>
<select class="w-select custom-select" name="code[]" id="" required="required">
<option value=""></option>
<?php
foreach ($weapon as $a) {
echo '<option value="' . $a['code'] . '">' . $a['name'] . '</option>';
}
?>
</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">
<p>Carry1</p>
<select id="carry1" name="carry1" class="custom-select" aria-describedby="carry1HelpBlock" required="required">
<option value="0">0</option>
<option value="1" selected>1</option>
</select><span class="help">[show/hide Help]</span>
<span id="carry1HelpBlock" class="form-text text-muted">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-3" style="background: #def;">
<input id="costmult" value="5" name="costmult" placeholder="Cost Mult" type="text" aria-describedby="costmultHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="costmultHelpBlock" class="form-text text-muted">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 id="costadd" value="5000" name="costadd" placeholder="Cost Add" type="text" aria-describedby="costaddHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="costaddHelpBlock" class="form-text text-muted">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">
<input id="chrtransform" name="chrtransform" placeholder="ChrTransform" type="text" aria-describedby="chrtransformHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="chrtransformHelpBlock" class="form-text text-muted">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 id="invtransform" name="invtransform" type="text" placeholder="InvTransform" aria-describedby="invtransformHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="invtransformHelpBlock" class="form-text text-muted">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 id="flippyfile" name="flippyfile" placeholder="Flippy File" type="text" aria-describedby="flippyfileHelpBlock" class="form-control" required="required"><span class="help">[show/hide Help]</span>
<span id="flippyfileHelpBlock" class="form-text text-muted">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 id="invfile" name="invfile" placeholder="InvFile" type="text" aria-describedby="invfileHelpBlock" required="required" class="form-control"><span class="help">[show/hide Help]</span>
<span id="invfileHelpBlock" class="form-text text-muted">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 id="dropsound" name="dropsound" placeholder="DropSound" type="text" aria-describedby="dropsoundHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="dropsoundHelpBlock" class="form-text text-muted">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 id="dropsfxframe" name="dropsfxframe" placeholder="DropSfxFrame" type="text" aria-describedby="dropsfxframeHelpBlock" class="form-control"><span class="help">[show/hide Help]</span>
<span id="dropsfxframeHelpBlock" class="form-text text-muted">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 id="usesound" name="usesound" placeholder="UseSound" type="text" aria-describedby="usesoundHelpBlock" class="form-control"><span class="help">[show/hide Help]</span><span id="usesoundHelpBlock" class="form-text text-muted">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">
<?php
$html = '';
foreach (range(01, 12) as $p) {
?>
<div class="col-2" style="padding: 15px;margin: 10px 0px; background: #ddd;">
<select id="prop<?php echo $p ?>-select" name="prop<?php echo $p ?>" class="custom-select">
<option class="PropFirst" value="">Prop<?php echo $p ?></option>
<?php
foreach ($prop as $a) {
echo '<option value="' . $a['code'] . '">' . $a['code'] . '</option>';
}
?>
</select>
<input id="par<?php echo $p ?>" name="par<?php echo $p ?>" placeholder="Par<?php echo $p ?>" type="number" aria-describedby="par<?php echo $p ?>HelpBlock" class="form-control par<?php echo $p ?>">
<input id="min<?php echo $p ?>" name="min<?php echo $p ?>" placeholder="min<?php echo $p ?>" type="number" aria-describedby="min<?php echo $p ?>HelpBlock" class="form-control min<?php echo $p ?>">
<input id="max<?php echo $p ?>" name="max<?php echo $p ?>" placeholder="max<?php echo $p ?>" type="number" aria-describedby="max<?php echo $p ?>HelpBlock" class="form-control max<?php echo $p ?>">
</div>
<?php
}
?>
<input type="hidden" name="*eol" value="0">
<!-- distinguish between forms -->
<input type="hidden" name="formtype" value="uniqueitems">
</div>
<?php require_once 'optionSubmit.php'; ?>
</form>
<ul>
<li><a href="https://d2mods.info/forum/viewtopic.php?t=34455">Intro to the D2 Files and File Guide/Tutorial Masterlist</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=2">Armor.txt by Kingpin et al. [ex Nefarius] (accurate)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=345">Properties.txt by Joel (revised by Myhrginoc 8/22/06)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=346">Weapons.txt by Kingpin and Ric Faith (accurate)</a></li>
<li><a href="https://d2mods.info/index.php?ind=reviews&amp;op=entry_view&amp;iden=386">UniqueItems.txt by Nefarius (accurate)</a></li>
</ul>

3
src/bottom.php Normal file
View File

@@ -0,0 +1,3 @@
</div>
</body>
</html>

4
src/footer.php Normal file
View File

@@ -0,0 +1,4 @@
<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>
</footer>

View File

@@ -1,10 +0,0 @@
<?php
function db() {
echo "<pre>";
var_dump($post);
foreach ($post as $p) {
echo "$p\t";
}
echo "</pre>";
}

View File

@@ -1,47 +1,47 @@
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<link rel="stylesheet" href="https://bootswatch.com/4/materia/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/res/style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap" rel="stylesheet">
<style>
</style>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<script src="/res/app.js"></script>
</script>
<title>Unique Maker</title>
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<link rel="stylesheet" href="https://bootswatch.com/4/materia/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/res/style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap" rel="stylesheet">
<style>
</style>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
<script src="/res/app.js"></script>
</script>
<title>D2 Item Maker</title>
</head>

50
src/header.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
/*
D2UniqueMaker
GPLv2 (C) <2021> <HashCasper>
This file is part of D2UM.
D2UM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
D2UM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<!doctype html>
<html lang="en">
<?php
/* Require the <head> section */
require_once "head.php";
?>
<body>
<div class="container container-top">
<div>
<img src="img/Diablo2.png" style="float:right"><h2 syle="font-weight: 900">D2 Item Maker, v3. By HashCasper</h2><br><br>
<ul class="nav nav-tabs" id="Tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="Unique-tab" data-toggle="tab" href="#Unique" role="tab" aria-controls="Unique" aria-selected="true">UniqueItems.txt</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="Set-tab" data-toggle="tab" href="#Set" role="tab" aria-controls="Set" aria-selected="false">SetItems.txt</a>
</li>
</ul>
</div>
<div class="tab-content" id="TabContent">
<div class="tab-pane fade show active" id="Unique" role="tabpanel" aria-labelledby="Unique-tab">
<?php require_once 'D2UM.php'; ?>
</div>
<div class="tab-pane fade" id="Set" role="tabpanel" aria-labelledby="Set-tab">
<?php require_once 'D2SM.php'; ?>
</div>
</div>

5
src/index.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
require_once 'header.php'; // loads head.php inside. Further loads D2UM/SM
require_once 'footer.php';
require_once 'bottom.php';

17
src/optionSubmit.php Normal file
View File

@@ -0,0 +1,17 @@
<div class="form-group row options" style="background: none;">
<div class="col-9" style="background: none;">
<p style="display:inline;">
<input style="width: 32px;" type="checkbox" id="op1" name="opt-hide-disabled" checked>
Toggle 'unspawnable' items
</p>
<p style="display:inline;margin-left: 60px;">
<a style="font-weight: bold;" class="btn" href="/src/config.php">Reconfigure Mod Path</a>
</p>
</div>
<div class="col-3" style="background: none;">
<button style="padding: 10px;font-size: 1.5rem;" name="submit" type="submit" class="btn btn-success">Save Item</button>
<button name="submit" type="reset" class="btn btn-danger">Clear</button>
</div>
</div>