View Single Post
  #1  
Old 12-31-2014, 02:34 PM
Bohbo
Hill Giant
 
Join Date: Dec 2012
Posts: 116
Default Populate Goallist for all npc in zone (sql expression)

Hi,

I was trying to figure out this sql expression and figured someone else might find it useful in the future.

I am trying to create an expression where i can type in goallist say 997 and have it fill all mobs in a zone, say "kurn's tower".

The first and last lines work its the middle section of inserting 997 as the listid and then pulling the npc_type.id via the inner join.

Code:
INSERT INTO goallists(listid, entry)
VALUES (997, SELECT id
FROM npc_types 
INNER JOIN spawnentry ON npc_types.id = spawnentry.npcID AND spawnentry.spawngroupID = spawn2.spawngroupID)
WHERE spawn2.zone = 'kurn'
Reply With Quote