PDA

View Full Version : Adding a lootdrop to NPCs in level range?


Baruuk
11-20-2011, 04:25 PM
Hi guys - been banging my head on the wall on this one for the last hour. I tried following some examples I found for the defiant drop thread, but didn't have any luck. Here's what I'm trying to do...

I have created a lootdrop_id (a unique one with 5% chance drop and multiplier of 1) with the PEQ Database Editor that contains 4 items that were already in the database. I simply want to assign my new lootdrop_id to ALL npcs in a specific level range (for example lvls 5-19).

I'm guessing I have to add my lootdrop_id to all NPCs level range 5-19's loottable - but I'd like to use a SQL command to do this instead of an editor. It's probably simple - but not exactly sure how to code it.

Would anyone know how the command to insert my lootdrop_id into all mobs lvl 5-19's loottable, thereby allowing players to randomly receive these items while hunting?

Thanks in advance.

Baruuk
11-20-2011, 06:14 PM
Found my own answer. My query that I had adapted from the Defiant Armor drops (originally posted by Werebat) was the correct one. However, since I had originally created the lootdrop_id entry on an orc centurian in West commonlands, that entry already existed in a mob's loottable. Thus, when I ran the query below, it gave me an error that it already existed. I realized this after posting and removed the entry from the orc and then executed it again. It worked perfectly and after manually checking mobs lvl 5-19 in various zones, they all have the lootdrop_id in their loottable. I wanted to share the query just in case someone else wishes to accomplish the same thing. It's a regurgitation from others' scripts, but it may prove useful in certain scenarios. Please note my lootdrop_id number (100019) is from my database and would have to be replaced by your specific one. Again, it adds the lootdrop at 10% drop rate.

insert into loottable_entries select distinct loottable_id, 100019, 1, 10 from npc_types where loottable_id > 0 and level between 5 and 19;