Log in

View Full Version : Select or Update Query to Adjust Loot Based on Zone?


Hateborne
03-09-2012, 11:53 PM
Evening Ladies and Gents,

I am trying to find a way to edit the drops based on zone, instead of individual mob(s). For example: if I wanted to double the coin drops from lakeofillomen, the only way I can find to do it is manually look up all the mobs in the zone and then hop through a variety of table to get to each mob.

Am I missing something here or is there some table relationship that I am missing?

Currently referencing: http://eqemu.psend.com/schema.html

Thank You in Advance!

-Hate

Hateborne
03-10-2012, 04:33 PM
The very poorly constructed query I have come across to do this is:
update loottable set loottable.mincash = 0, loottable.maxcash = 0, loottable.avgcoin = 0 in (select npc_types.loottable_id from npc_types where id in (select spawnentry.npcID from spawnentry inner join spawn2 on spawnentry.spawngroupID = spawn2.spawngroupID where spawn2.zone = 'ruji'));
However, it is a bit large and seems to possibly cause either infinite loop or simply causes too much recursive nonsense to make it a viable command.

Can anyone else suggest something a bit cleaner?

-Hate

Hateborne
03-10-2012, 05:34 PM
Final, working query:

UPDATE loottable INNER JOIN npc_types ON loottable.id=npc_types.loottable_id INNER JOIN spawnentry ON npc_types.id=spawnentry.npcID INNER JOIN spawn2 ON spawnentry.spawngroupID=spawn2.spawngroupID SET loottable.mincash = 0, loottable.maxcash = 0, loottable.avgcoin = 0 WHERE spawn2.zone = 'ruji';


-Hate