|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Tools 3rd Party Tools for EQEMu (DB management tools, front ends, etc...) |
 |
|
 |

07-30-2013, 01:41 PM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
Well I feel stupid to an extent. When I woke up today I deleted every file with a change date that did not match up with the SVN, then reapplied my custom changes for misc stuff like website integration and everything works like it should.
So at some point in time I changed one of the pages and was not careful with copying from SVN to my web folder and that would explain when I was adding loot drops mindrop,droplimit,multiplier,probability were zero and also I just checked adding items and noticed that I was not careful in the past because the current revision from svn when I add items now I do have the option to change percent.
So thanks cavedude for suffering my posts. It was still nice to take a few min and look at how everything is setup and play with it.
I was able to make some personalized changes to aspects of the tool yesterday and get an idea for how it should look based on the current templates.
Anyways, thanks as always to you and everyone else from peq that keep this tool up to date.
|
 |
|
 |
 |
|
 |

07-31-2013, 09:15 PM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
Reference: http://www.peqtgc.com/phpBB3/viewtopic.php?f=29&t=14068
I think this is a good idea and decided to go mucking around inside the editor... again.
This time I am going to include some pictures of the table I tested against.

Then what the new option you clicked on brings up. I used one of the 13x13 icons included with the editor for this test.

And what the result ended up being after choosing the copy option.
You can either choose move (move and delete from old) or copy (move and retain original).
Here is a patch and I'm pretty sure I did not fubar up this time but its probably not the best way to handle it. Either way you cut it, it does work and can be made pretty as needed. IE I created a new template page but was that really the best method?
Code:
Index: lib/loot.php
===================================================================
--- lib/loot.php (revision 374)
+++ lib/loot.php (working copy)
@@ -341,6 +341,25 @@
enable_lootdrop_item();
header("Location: index.php?editor=loot&z=$z&zoneid=$zoneid&npcid=$npcid");
exit;
+ case 46: //Move Lootdrop Item page
+ check_authorization();
+ $body = new Template("templates/loot/lootdrop.move.item.tmpl.php");
+ $body->set('currzone', $z);
+ $body->set('currzoneid', $zoneid);
+ $body->set('npcid', $npcid);
+ $body->set('ldid', $_GET['ldid']);
+ $body->set('itemid', $_GET['itemid']);
+ $body->set('ldname', getLootdropName($_GET['ldid']));
+ $vars = lootdrop_info();
+ foreach ($vars as $key=>$value) {
+ $body->set($key, $value);
+ }
+ break;
+ case 47: // Move lootdrop item
+ check_authorization();
+ move_copy_lootdrop_item();
+ header("Location: index.php?editor=loot&z=$z&zoneid=$zoneid&npcid=$npcid");
+ exit;
}
function loottable_info () {
@@ -860,4 +879,30 @@
$mysql->query_no_result($query);
}
+function move_copy_lootdrop_item() {
+ check_authorization();
+ global $mysql;
+ $ldid = $_GET['ldid'];
+ $itemid = $_GET['itemid'];
+ $equip = $_POST['equip_item'];
+ $charges = $_POST['charges'];
+ $chance = $_POST['chance'];
+ $minlevel = $_POST['minlevel'];
+ $maxlevel = $_POST['maxlevel'];
+ $multiplier = $_POST['multiplier'];
+ $new_ldid = $_POST['movetolootdrop'];
+ $move_copy_item = $_POST['move_copy_item'];
+ if ($move_copy_item == 0) {
+ $query1 = "DELETE FROM lootdrop_entries WHERE lootdrop_id='$ldid' AND item_id='$itemid'";
+ $mysql->query_no_result($query1);
+
+ $query2 = "INSERT INTO lootdrop_entries SET lootdrop_id=$new_ldid, item_id=$itemid, equip_item=$equip, item_charges=$charges, chance=$chance, minlevel=$minlevel, maxlevel=$maxlevel, multiplier=$multiplier";
+ $mysql->query_no_result($query2);
+ }
+ if ($move_copy_item == 1) {
+ $query = "INSERT INTO lootdrop_entries SET lootdrop_id=$new_ldid, item_id=$itemid, equip_item=$equip, item_charges=$charges, chance=$chance, minlevel=$minlevel, maxlevel=$maxlevel, multiplier=$multiplier";
+ $mysql->query_no_result($query);
+ }
+}
+
?>
\ No newline at end of file
Index: templates/loot/lootdrop.move.item.tmpl.php
===================================================================
--- templates/loot/lootdrop.move.item.tmpl.php (revision 0)
+++ templates/loot/lootdrop.move.item.tmpl.php (working copy)
@@ -0,0 +1,35 @@
+ <table class="edit_form">
+ <tr>
+ <td class="edit_form_header">
+ <?=$ldname?>
+ </td>
+ </tr>
+ <tr>
+ <td class="edit_form_content">
+ <form name="item" method="post" action="index.php?editor=loot&z=<?=$currzone?>&zoneid=<?=$currzoneid?>&action=47&npcid=<?=$npcid?>&ldid=<?=$ldid?>&itemid=<?=$itemid?>">
+ <strong>Lootdrop:</strong> <?=$ldid?><br>
+ <strong>Item:</strong> <?=$itemid?><br><br>
+ <strong>Move to Lootdrop:</strong></br>
+ <input type="radio" name="move_copy_item" value="0"<?echo ($move_copy_item == 0) ? " checked" : ""?>>Move Item<br>
+ <input type="radio" name="move_copy_item" value="1"<?echo ($move_copy_item == 1) ? " checked" : ""?>>Copy Item<br>
+ <input class="indented" type="text" size="5" name="movetolootdrop" value="<?=$new_ldid?>"><br><br>
+ <strong>Equipped:</strong><br>
+ <input type="radio" name="equip_item" value="0"<?echo ($equip_item == 0) ? " checked" : ""?>>no<br>
+ <input type="radio" name="equip_item" value="1"<?echo ($equip_item == 1) ? " checked" : ""?>>yes<br><br>
+ <strong>Item Charges:</strong> <br>
+ <input class="indented" type="text" size="5" name="charges" value="<?=$item_charges?>"><br><br>
+ <strong>Min Level:</strong> <br>
+ <input class="indented" type="text" size="5" name="minlevel" value="<?=$minlevel?>"><br><br>
+ <strong>Max Level:</strong> <br>
+ <input class="indented" type="text" size="5" name="maxlevel" value="<?=$maxlevel?>"><br><br>
+ <strong>Multiplier:</strong> <br>
+ <input class="indented" type="text" size="5" name="multiplier" value="<?=$multiplier?>"><br><br>
+ <strong>Chance:</strong> <br>
+ <input class="indented" type="text" size="5" name="chance" value="<?=$chance?>">%<br><br>
+ <center>
+ <input type="submit" name="submit" value="Submit Changes">
+ </center>
+ </form>
+ </td>
+ </tr>
+ </table>
Index: templates/loot/loottable.tmpl.php
===================================================================
--- templates/loot/loottable.tmpl.php (revision 374)
+++ templates/loot/loottable.tmpl.php (working copy)
@@ -104,11 +104,11 @@
<?php if(isset($lootdrop['items']) && $lootdrop['items']): $x=0;?>
<tr>
<th align="center" width="8%">Item ID</th>
- <th align="center" width="35%">Item Name</th>
- <th align="center" width="8%">Equipped?</th>
- <th align="center" width="8%">Charges</th>
- <th align="center" width="8%">MinLevel</th>
- <th align="center" width="8%">MaxLevel</th>
+ <th align="center" width="36%">Item Name</th>
+ <th align="center" width="7%">Equipped?</th>
+ <th align="center" width="7%">Charges</th>
+ <th align="center" width="7%">MinLevel</th>
+ <th align="center" width="7%">MaxLevel</th>
<th align="center" width="8%">Multiplier</th>
<th align="center" width="8%">Chance</th>
<th width="13%"></th>
@@ -145,6 +145,7 @@
<?=$chance?>%
</td>
<td align="right">
+ <a href="index.php?editor=loot&z=<?=$currzone?>&zoneid=<?=$currzoneid?>&npcid=<?=$npcid?>&ldid=<?=$lootdrop['id']?>&itemid=<?=$item_id?>&action=46"><img src="images/minus.gif" border="0" title="Move Lootdrop Item"></a>
<a href="index.php?editor=loot&z=<?=$currzone?>&zoneid=<?=$currzoneid?>&npcid=<?=$npcid?>&ldid=<?=$lootdrop['id']?>&itemid=<?=$item_id?>&action=5"><img src="images/edit2.gif" border="0" title="Edit Lootdrop Item"></a>
<?php if($disabled_chance == 0 && $chance > 0):?>
<a <?=$lootdrop['id']?>?');" href="index.php?editor=loot&z=<?=$currzone?>&zoneid=<?=$currzoneid?>&npcid=<?=$npcid?>&ldid=<?=$lootdrop['id']?>&itemid=<?=$item_id?>&chance=<?=$chance?>&action=44"><img src="images/downgrade.gif" border="0" title="Disable Item"></a>
__________________
|
 |
|
 |

08-01-2013, 01:45 PM
|
 |
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Thanks for that! I'll be merging it into the next commit, it's very well done. The only thing I changed was I made copy the default option.
|

08-01-2013, 02:05 PM
|
 |
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Also, I wanted to say keep mucking! Once you get a solid grasp of the editor, I'll have no problem giving you SVN access, so you can commit your changes directly.
|

08-01-2013, 03:26 PM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
I enjoy tinkering with the tools the eqemu community uses and produces.
The peq editor has been a favorite of mine for some time since I sometimes forget to double check sql syntax and then I end up borking entire tables.
Just ask Natedog he was on vent with me the other day when I had to drop altadv_vars because I changed in range using <= and <= ... silly me.
GUI interfaces help reduce the mistakes I make
I would have posted this on the PEQ boards but for some reason I just never made a forum account there, no idea why because I monitor the forums for all gold/green and high pop white server looking for reasons to tinker with things.
I can't think of anything else the editor could use that would not step on other tools that are already well made or bloat it in size but I'll continue poking it with a spork and post .patch files for stuff to be considered.
__________________
|
 |
|
 |

08-02-2013, 05:43 AM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
Figured I would attempt to break guilds tab.
Had to tweak it a little to fit the new button and I think its kind of ugly but not sure if its really something useful so making it pretty can come later.

Grabs the next ID for you, just need to input the guild name and the name of the character that is to be the leader.
Not sure if guild names can contain characters that require escaping for sql so did not attempt to check for that in the query. So "Dan's party guild" would probably fail to insert.
Code:
Index: css/peq.css
===================================================================
--- css/peq.css (revision 376)
+++ css/peq.css (working copy)
@@ -242,4 +242,10 @@
.indented {
margin: 5px 0px 0px 10px;
+}
+
+.newgid {
+ color: darkred;
+ font-size: 12px;
+ font-weight: bold;
}
\ No newline at end of file
Index: lib/guild.php
===================================================================
--- lib/guild.php (revision 376)
+++ lib/guild.php (working copy)
@@ -70,6 +70,16 @@
delete_guild();
header("Location: index.php?editor=guild");
exit;
+ case 6: // Add new guild template
+ check_admin_authorization();
+ $body = new Template("templates/guild/guild.addnew.tmpl.php");
+ $body->set('new_guild_id', getNextGuildID());
+ break;
+ case 7: // Add new guild submission
+ check_admin_authorization();
+ add_new_guild();
+ header("Location: index.php?editor=guild");
+ exit;
}
function guild_info () {
@@ -116,4 +126,26 @@
global $mysql, $playerid;
//Delete guild info here
}
+
+function getNextGuildID () {
+global $mysql;
+$query = "SELECT MAX(id) as id FROM guilds";
+$result = $mysql->query_assoc($query);
+return ($result['id'] + 1);
+}
+
+function add_new_guild () {
+ global $mysql;
+ $guild_name = $_POST['guild_name'];
+ $new_guild_id = $_POST['new_guild_id'];
+ $leader_name = $_POST['leader_name'];
+ $query = "SELECT id FROM character_ AS id WHERE name=\"$leader_name\"";
+ $result = $mysql->query_assoc($query);
+ $char_id = $result['id'];
+ $query = "INSERT INTO guilds SET id=$new_guild_id, name=\"$guild_name\", leader=$char_id";
+ $mysql->query_no_result($query);
+ $query = "INSERT INTO guild_members SET char_id=$char_id, guild_id=$new_guild_id, rank=1";
+ $mysql->query_no_result($query);
+}
+
?>
\ No newline at end of file
Index: templates/guild/guild.addnew.tmpl.php
===================================================================
--- templates/guild/guild.addnew.tmpl.php (revision 0)
+++ templates/guild/guild.addnew.tmpl.php (working copy)
@@ -0,0 +1,27 @@
+<div style="width: 275px; margin: auto;">
+ <div style="border: 1px solid black;">
+ <div class="edit_form_header">Create a new guild</div>
+ <div class="edit_form_content">
+ <form name="guild" method="post" action="index.php?editor=guild&action=7">
+
+<table width="100%">
+ <tr>
+ <td><strong>Guild Name:</strong></td>
+ <td><strong>Leader Name:</strong></td>
+ <td><strong>New Guild ID:</strong></td>
+ </tr>
+ <tr>
+ <td><input size="8" type="text" name="guild_name" value="<?=$guild_name?>"></td>
+ <td><input size="8" type="text" name="leader_name" value="<?=$leader_name?>"></td>
+ <td align="center" class="newgid"><input type="hidden" name="new_guild_id" value="<?=$new_guild_id?>"><?=$new_guild_id?></td>
+ </tr>
+</table>
+<br>
+<center>
+ <input type="submit" value="Submit"> <input type="button" value="Cancel" onclick="history.back()">
+</center>
+
+ </form>
+ </div>
+ </div>
+</div>
\ No newline at end of file
Index: templates/searchbar/searchbar.guild.tmpl.php
===================================================================
--- templates/searchbar/searchbar.guild.tmpl.php (revision 376)
+++ templates/searchbar/searchbar.guild.tmpl.php (working copy)
@@ -1,5 +1,11 @@
<div id="searchbar">
<table width="100%">
+ <tr>
+ <th align="center">Select by menu</th>
+ <th align="center">Select by guild id or name</th>
+ <th align="center">Select by char id or name</th>
+ <th align="center">Add new</th>
+ </tr>
<tr>
<td>
<strong>1.</strong>
@@ -21,7 +27,7 @@
?>
</select>
</td>
- <td> or <strong> 2.</strong>
+ <td><strong> 2.</strong>
<form action="index.php" method="GET">
<input type="hidden" name="editor" value="guild">
<input type="hidden" name="action" value="2">
@@ -29,7 +35,7 @@
<input type="submit" value=" GO ">
</form>
</td>
- <td> or <strong> 3.</strong>
+ <td><strong> 3.</strong>
<form action="index.php" method="GET">
<input type="hidden" name="editor" value="guild">
<input type="hidden" name="action" value="3">
@@ -37,6 +43,13 @@
<input type="submit" value=" GO ">
</form>
</td>
+ <td><strong> 4.</strong>
+ <form action="index.php" method="GET">
+ <input type="hidden" name="editor" value="guild">
+ <input type="hidden" name="action" value="6">
+ <input type="submit" value=" Create ">
+ </form>
+ </td>
</tr>
</table>
</div>
__________________
|
 |
|
 |
 |
|
 |

08-27-2013, 10:12 AM
|
Fire Beetle
|
|
Join Date: Jul 2012
Posts: 9
|
|
Issues inside editor
I have the editor running and connecting to my database. I can actually make changes. But I get tons of errors on the opening page and when creating new items. (This is so far that I am aware of)
I am using the latest install of XAMPP 1.8.2.1
The first is:
Notice: Use of undefined constant c71 - assumed 'c71' in C:\xampp\htdocs\peq\lib\data.php on line 2601
*This error above is actually the last in 100 plus errors that are before the actual interface. I began manually formatting all entries in data.php that have a letter before the number with single quotes ('c71'). This seemed to fix this issue. But I am not sure what impact this has.
The second is:
Notice: Undefined variable:
*This occurs when creating a new item. Almost all selectable boxes begin with this error.
I also noticed when I create NPCs that very few are available and pull up only the human model even when say Bristlebane is selected.
I am not a programer, but I enjoy EQ and my step son and I love playing on our own home server. I am attempting to make it more fun for him by slightly customizing our server.
Volkmeer
|
 |
|
 |

08-27-2013, 12:22 PM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
Quote:
Originally Posted by volkmeer
Notice: Use of undefined constant c71 - assumed 'c71' in C:\xampp\htdocs\peq\lib\data.php on line 2601
|
\lib\data.php only has 1806 lines so I am not sure how you have a reported error on 2601
Not sure off the top of my head why you are seeing the error. I'll check this again later today when I have more time, though probably a more knowledgeable person will have responded by then, or at least I hope so.
__________________
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 04:40 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |