|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc. |
09-03-2007, 12:50 PM
|
Developer
|
|
Join Date: Apr 2003
Posts: 589
|
|
List All Items In a Specified Zone Query
Someone in the #eqemu room asked me to write a query to dump all items in a specified zone. Enjoy!
Disclaimer: Made this on MySQL v5.0.26
Code:
select distinct i.id, i.Name
from npc_types n
inner join spawnentry se on n.id = se.npcID
inner join spawn2 s on se.spawngroupID = s.spawngroupID
inner join loottable_entries lte on n.loottable_id = lte.loottable_id
inner join lootdrop_entries lde on lte.lootdrop_id = lde.lootdrop_id
inner join items i on lde.item_id = i.id
where s.zone = 'vexthal'
order by i.Name
__________________
Read my developer notes at my blog.
Quote:
If it's not on IRC, it ain't l33t!
|
Last edited by WildcardX; 09-03-2007 at 08:58 PM..
|
09-04-2007, 01:13 PM
|
Fire Beetle
|
|
Join Date: Sep 2006
Posts: 21
|
|
Works awesome thank you WildcardX
|
09-04-2007, 06:39 PM
|
Demi-God
|
|
Join Date: Jul 2006
Posts: 1,552
|
|
Now that is truly scarey. I was building one of these exact queries not 5 minutes ago, and it looked damn near identical (including every one of your aliases lol).
I knew I liked you for a reason.
|
09-04-2007, 08:52 PM
|
Developer
|
|
Join Date: Apr 2003
Posts: 589
|
|
lol yeah thats funny.
__________________
Read my developer notes at my blog.
Quote:
If it's not on IRC, it ain't l33t!
|
|
09-08-2007, 05:21 AM
|
Discordant
|
|
Join Date: Aug 2006
Posts: 394
|
|
Very helpful, thanks!
I had a query written that could do this, but it was, well let's just say I'd be too embarrassed to share it
This one is much better.
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
|
09-11-2007, 03:38 PM
|
The Solo Server
|
|
Join Date: May 2007
Posts: 416
|
|
That's a much easier way, but might be nice to include a sub query/result of what mobs/zones also spawn the same items. Granted you don't care about how many places brigadine tunics drop, but it does help sometimes.
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
|
09-16-2007, 08:19 AM
|
Discordant
|
|
Join Date: Aug 2006
Posts: 394
|
|
It would absolutely be great to know which mobs drop what easily, by item.
Another neat thing would be to compare to item tables from two databases and see only items in one database that are not in another.
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
|
09-17-2007, 02:30 AM
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
I suppose this query like what drops in each zone might be nice to be added into my npc/loot editor, as well as a few others like gernblan mentioned.
These sql are easy to write, but when they involve >1 subquery, I must use vb/net. In any event, would these type of tools be useful for server admins?
Perhaps, this would require a brand new tool, which displays item or npc drop stats...
GeorgeS
|
09-19-2007, 11:08 PM
|
Discordant
|
|
Join Date: Aug 2006
Posts: 394
|
|
OH definitely. Definitely useful.
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
|
03-01-2019, 06:31 PM
|
Sarnak
|
|
Join Date: Oct 2009
Posts: 52
|
|
Sorry for the bump on such an old thread but as I didn't see this elsewhere, it looked best to put this here.
If you are like me, the aforementioned query takes a long time. As such, please try the following, which seemed to perform better for me:
Code:
select distinct i.id, i.Name
from spawnentry se
inner join (select * from spawn2 where zone = 'vexthal') as A on se.spawngroupID = A.spawngroupID
inner join npc_types n on n.id = se.npcID
inner join (select distinct lte.lootdrop_id, lte.loottable_id from loottable_entries lte) as B on n.loottable_id = B.loottable_id
inner join (select distinct lde.item_id, lde.lootdrop_id from lootdrop_entries lde) as C on B.lootdrop_id = C.lootdrop_id
inner join items i on C.item_id = i.id
order by i.Name
Basically a lil reordering to limit join results and a few distinct queries to limit redundant matches. Hope it helps someone.
|
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 11:55 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|