EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Removing Spawns from a specific zone based on npc_types criteria (Advice - Not crit) (https://www.eqemulator.org/forums/showthread.php?t=39393)

Bohbo 02-19-2015 04:37 PM

Removing Spawns from a specific zone based on npc_types criteria (Advice - Not crit)
 
I wanted to do some zone cleanups of certain mobs.

I was trying to come up with an elegant way of dealing with it. My question is about my method and what I need to delete and what should be left behind.

Code:

SELECT *
FROM spawn2
JOIN spawngroup ON spawngroup.id = spawn2.spawngroupID
JOIN spawnentry ON spawngroup.id = spawnentry.spawngroupID
JOIN npc_types ON spawnentry.npcID = npc_types.id
WHERE spawn2.zone LIKE 'gfaydark' AND npc_types.name LIKE '%bat%'

Give me all the spawn2 locations I want and i can do the same for spawnentries (not sure how to combine the two).

Code:

SELECT *
FROM spawnentry
JOIN npc_types ON spawnentry.npcID = npc_types.id
JOIN spawngroup ON spawnentry.spawngroupID = spawngroup.id
JOIN spawn2 ON spawn2.spawngroupID = spawngroup.id
WHERE spawn2.zone LIKE 'gfaydark' AND npc_types.name LIKE '%bat%'

I can do the same for spawngroupid. My quest has to do with what exactly should i delete just the spawn2 and the spawnentry? The spawngroup COULD include other animals or named is there a way to account for that? Like combine the two statements above, change select * to delete and then check to see if the spawngroupid is shared and if not delete it? I am not sure the best way to bulk remove spawns meeting a certain criteria on the npc_types table.


All times are GMT -4. The time now is 08:17 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.