View Single Post
  #2  
Old 01-08-2014, 08:58 AM
jsr
Hill Giant
 
Join Date: Aug 2008
Location: melbourne
Posts: 187
Default

You can use 'loottable_id between x and y' but I don't think that's what you're after, as it will replace the existing loot table ID's.

There are 3 tables involved:
[NPC_Types] has the NPC info and a key (loottable_id) for the loottable_entries table
[Loottable_entries] holds "list ID's" for one or more items you want an NPC to be able to drop, along with some extra info (e.g. number of items to drop from each list). The list ID is a key (lootdrop_id) for the lootdrop_entries table..
[Lootdrop_entries] holds the item_id's and some extra info

So the process is more like:
1. Create a list of item ID's in [Lootdrop_entries] which you want NPC's to be able to drop, assigning the same lootdrop_id for each item in the list.
2. Add the newly created lootdrop_id to the lootdrop_entries table for each loot table you want to contain these items (in your case, all loot tables for mobs between level 1 and 5)

Once you do step 1, you can complete step 2 by writing a query to update loottable_entries with your new lootdrop_id's.

The query would look something like this (UNTESTED):
Code:
insert into loottable_entries
(loottable_entries.loottable_id, 
loottable_entries.lootdrop_id, 
loottable_entries.multiplier, 
loottable_entries.probability)

select distinct npc_types.loottable_id,[your new loot drop id], 1, 100 from npc_types where npc_types.`level` between 1 and 5
...But it would be much easier to use one of the existing tools to do loot, that way the queries are pre-written and you don't need to worry about making a mistake Pretty sure george's npc_loot_editor app has this functionality if the emu operations center doesn't.

Last edited by jsr; 01-08-2014 at 09:10 AM.. Reason: edited for clarity
Reply With Quote