d2tools/uniqueitems.php
2021-03-21 19:36:46 -06:00

365 lines
17 KiB
PHP

<!doctype html>
<html lang="en">
<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">
<style>
input {
width: 108px;
padding: 5px;
margin: 5xp;
text-align: center;
border: 0px;
background: #eef;
}
.form-text,.help {
font-size: 11px;
color: #999;
}
.form-text {
border: 1px solid #ddd;
padding: 5px;
border-radius: 4px;
}
select,input,option{
border: #ccc;
}
.row {
padding: 0 5px;
}
</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 type="text/javascript">
function val() {
d = document.getElementById("w-select");
d.value = '';
}
function val2() {
d = document.getElementById("a-select");
d.value = '';
}
$(document).ready(function(){
$('.form-text').hide();
$('.help').click(function(){
$('.form-text').slideToggle();
});
$('#op1').val(this.checked);
$('#op1').change(function() {
if(this.checked) {
$('option[disabled="disabled"]').hide();
} else {
$('option[disabled="disabled"]').show();
}
});
});
</script>
<title>Uniqe Maker</title>
</head>
<div class="container type">
<h1>Unique Maker by Hash</h1>
<body>
<?php
$u = "UniqueItems.txt";
$w = "Weapons.txt";
$a = "Armor.txt";
$p = "Properties.txt";
$u = $path.$u;
$w = $path.$w;
$a = $path.$a;
$p = $path.$p;
function toPHP($file)
{
$rows = array_map(function ($v)
{
return str_getcsv($v, "\t");
}
, file($file));
$header = array_shift($rows);
foreach ($rows as $row)
{
$csv[] = array_combine($header, $row);
}
return $csv;
}
$armor = toPHP($a);
$weapon = toPHP($w);
$prop = toPHP($p);
$uni = toPHP($u);
// echo '<pre>';
// print_r($uni);
// die();
?>
<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 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>
<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>
<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>
<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">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fa fa-american-sign-language-interpreting"></i>
</div>
</div>
<input id="rarity" name="rarity" placeholder="Rarity" type="text" aria-describedby="rarityHelpBlock" required="required" class="form-control">
</div>
<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">
<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">
<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" 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>
</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>
</div>
</body>
</html>