Request for new # command please
Wouldn't it be great if you could type something like...
#showdrops <itemnumber> IN game and it will tell you which mobs have it in their loot table? The output could be something like: Item 12345 drops: NPC- Yaka Razorhoof -- Loottable- 16454 NPC- a rat -- Loottable- 1055 2 NPCs found. or if it doesn't currently drop in game... Item 12345 drops: 0 NPCs found. 0 Loottables found. Imagine how incredible this would be when world building in game. You can browse items and see if they are already dropping, or not, or where and off of who. I mean it would make things so much more pleasant... Thoughts? Anyone a hell of a lot btter than me with C++ want to take a stab at this? Thanks for reading. |
Quote:
You see that would be a reverse lookup forcing the server to check every record it has for that item across every zone (as most searches and queries are just within a zone). And if you are talking about just pulling that from the database, thats another potentially huge querey. Great concept, and yes it would REALLY help in world building, but I wouldn't recommend using that kind of command on a live server or allowing too many people to use it. |
Well sure it would be a "developer only" thing... and you're right about the reverse lookup and all, but even still, if the query was given a low priority (I'd certainly trade speed for the convenience in terms of the query return) it may not be so bad.
I don't see a situation where a dozen people are all using his command at the same time or anything. I do see where those who run development servers especially would be able to generate content even faster. With anniversary support coming (hopefully) we must all look for shortcuts in world building. It can't be as slow as titanium has been, you know? IN terms of the load on the server, we'll never know until we try. I'm hoping someone out there is willing to code up a proof of concept diff so we an see if this type of thing is doable. Please also keep in mind that most servers are running on much faster hardware now then they were when titanium came out. What I am saying is that maybe at least having it would help the hardcore content builders who most likely have invested in decent hardware that could handle it without spiking the cpu (or the mysql daemon) too much. Mysql has come a long way since version 4 as well. It's actually pretty shocking how well it handles a load nowadays. Know what I mean? Thanks for responding. Definitely food for thought. I'm hoping more people respond to this as well. I truly believe that some world building features such as this (is the spawngroup addition to npcstats a godsend or what? simple yet SO useful, how could I live without it now?) would be a major step towards making content creation actually enjoyable instead of slave labor. And while I LOVE your tools George, you have to admit that when plugged into a remote server, they tend to crawl. But they do not slow down the server much. My players certainly do not notice any lag from them. And they do hit the db pretty hard. Granted, these # commands would generate queries in the server code itself... but it's just another thread, I really don't think the hit would be as hard as it may seem at first glance. |
Another possibility could be run to it (and commands like this) on a clone copy of the live db, so that it's not tearing into the live db, but actually calling another copy of it?
Can expand the eqemu_config.xml file to point to the clone. A script could be written to backup the live db and push a refresh copy to the clone on a schedule. I doubt the item tables and loot tables change SO fast that there would ever be a sync problem. Heck another # command can be added to trigger that script manually even if someone wanted to force it outside of schedule. Perl to the rescue! ;) |
This will do it out of game, and it's not a bad query at all (about 2 seconds on my machine):
Code:
select distinct n.id, lt.loottable_id, n.Name, i.Name, s.zone, lt.probability/100*ld.chance/100 Obviously, change the item number where 1001 is and you're set. Might want to output the results to a file, or change what it spits out. Eliminating the zone (and all the spawn group queries with it) will reduce the amount of results. Damn, Wildcard you and I spend too much time talking our queries are nearly identical. Not many ways to do this I guess. |
Actually, zone and the spawn queries should be removed I didn't think about it at the time, but any NPCs that are spawned via quest will not show in the results :P
So: Code:
select distinct n.id, lt.loottable_id, n.Name, i.Name, lt.probability/100*ld.chance/100 |
Fantastic! Thanks!
That's better than nothing for sure! |
Since you were so kind to post that, I'll share this. This finds all loot drops by zone...
Code:
SELECT |
Thinking about this some more, I feel even more strongly that having that command in game would be a godsend. At this point I can only hope someone more capable than I will write it.
|
My only recommendation is to have that command locked or only granted to the server-op by default, because if you have a few leads/mgmt's and admins working or just playing with that command, I can see it taking down the MySQL database really quick, even worse the server.
As Cavedude said, it took him 2 seconds to querey outside the server (assuming machine to machine) so some of that is overhead from the internet but keep in mind, a querey that takes longer than a second on a decent machine causes a decent amount of load multiply that by two or three at the same time, it could be enough to take a server on the verge of a 'strain' completely down. Again I'd suggest locking that command down and even securing it, because I'm sure that could be an exploit waiting to happen. |
Well, just make it a status 300 command.. only the serverOP would get it then.
That's fine by me. Truly. |
...but please... someone, anyone... code up a proof of concept?
Even something as simple as "yes, item drops" or "no, item does not drop in game" would be huge, even if it doesn't tell you where. Even the ability in game to be able to see if an item is being used in the loot tables at all would be better than nothing at all. |
I have begun work on this request. Will keep you posted as i progress...
Krusher |
Thank You!
|
I've coded the function the way you requested.
Shot: http://eqoffline.free.fr/showdrops.jpg Code: 1/ Add the prototype in the command.h Code:
void command_showdrops(Client *c, const Seperator *sep); 2.1/ Find the line: Code:
command_add("refundaa", "Refunds your target's AA points, will disconnect them in the process as well.", 100, command_refundaa) Code:
command_add("refundaa", "Refunds your target's AA points, will disconnect them in the process as well.", 100, command_refundaa) || Code:
void command_showdrops(Client *c, const Seperator *sep) Mag |
Thank you, Magoth! If for nothing else, a little tutorial on how to play with commands. :)
|
THANK YOU! SO MUCH!
Will play with this and if it works great, maybe it can get added to the tree :) |
Ok this is FLAT OUT incredible!
THANK YOU. And yes, I too learned something about how new commands are made. THANKS on all counts! Now, I can only pray this gets into the tree so that I do not have to diff it every build... :) You posting that like that really helps out those of us who can "read the language but not speak the language that well (yet)" understand this stuff at a whole new level. So, thank you for your time. Can you tell I am grateful? lol |
One more thing:
THANK YOU AGAIN (lol) |
Won't let me post code for some reason BUT it's bombimg out on the compile... vs. build 1052.
Will double check and see if it's me or not. |
Ok this:
Code:
command_add("showdrops"," Usage #showdrops [itemID]", 100, command_showdrops) Code:
command_add("showdrops"," Usage #showdrops [itemID]", 100, command_showdrops) || |
It's also showing the loot table name instead of the NPC name for some reason.
Please see screenshot: http://media.buttwrenching.com/loot.jpg |
If you want to see the name of the NPC showed instead of the name of the Lootable, then change the 2.3 of my previous answer to:
2.3/At the end of the file (command.cpp), add the function's code Code:
void command_showdrops(Client *c, const Seperator *sep) |
Thank you very much!!
This is perfect :) No clue how I could ever live without this now. I hope it makes it into the tree. |
Been using this for two weeks now, it's incredible, still :) SO useful.
Please, someone, stick it in the tree hehe. Just set the command for 200+ status or whatever. |
I apologize for reviving an old thread but I was hoping someone could get this to work. I added the code exactly as shown and compiled it successfully but it's not working. I very well could have compiled it incorrectly though.
Edited the command.h and the command.cpp files located in Quote:
|
Did you make sure to copy the newly created files to your server folder after you compiled?
|
I just editted the files in the "c:\EQEmuServerFiles\trunk\EQEmuServer\Zone" directory and saved them there. Should I copy them to c:\eqemu folder or something?
|
Oh what a glorious day.. I figured it out thanks to your sentence structure lol.
Quote:
|
All times are GMT -4. The time now is 11:04 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.