Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2015, 06:09 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default Removing NPCs

Pretty straightforward question:

I want to remove certain npc_types from the DB I use, we'll call it live_db because I would make blanket changes to the main DB.

Is it better to delete the npc_types I want to remove or to change whether or not they spawn?

I understand the issues with sharing a spawngroupid. My concern is if there are continual queries searching for an npc that doesn't exist.

For expample, those filthy iksars:

Code:
use live_db;
delete from npc_types where race = 128; 

or

use live_db;
update spawnentry set chance = 0 select spawnentry.* from npc_types join spawnentry 
     where spawnentry.npcid = npc_types.id and npc_types.race = 128;
My application of this idea is a little different.

If there is an even more efficient way to do this, please divulge.
Reply With Quote
  #2  
Old 08-13-2015, 06:22 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

IIRC, you can log in with a GM account, target the NPC, and type #npcspawn delete.

Removes the npc_type and all spawning references to it.

Alternatively, #npcspawn remove clears all spawns for the npc_type, but leaves the npc_type in the database.
Reply With Quote
  #3  
Old 08-13-2015, 07:43 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Thanks Shendare.

That will be useful to me for immediate resolution.

I build expansions from a main DB with a set of queries to isolate rows based on various criteria. In a few tables, I added a column to assist with isolation.

Here is a specific example for what I am doing with anything before Luclin; I don't update every time:

Code:
use main_db;
update npc_types set expansion = 3 where race = 130;

run all expansion_build queries

use live_db;
update spawnentry set chance = 0 select spawnentry.* from npc_types join spawnentry 
     where spawnentry.npcid = npc_types.id and npc_types.race = 130;

ALTER TABLE  npc_types DROP column  `expansion`;
This won't remove the npc_types entries for the zones where race = 130 but, it will disable the spawn from occuring. My concern/question was if there is a better or more efficient way.
Reply With Quote
  #4  
Old 08-13-2015, 07:58 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Ahh, bulk removal/deactivation of a bunch of npc_types by certain criteria, and the spawns associated with them. Gotcha. I'd likely go about it like this:

1. Remove the spawnentry records for the npc_types that fit the criteria.

Quote:
DELETE * FROM spawnentry WHERE npcid IN (SELECT id FROM npc_types WHERE race=130);
2. Delete any spawngroups that are now empty:

Quote:
DELETE FROM spawngroup WHERE (SELECT COUNT(*) FROM spawnentry WHERE spawnentry.spawngroupid=spawngroup.id)=0;
I'd also look for references to the doomed npc_types in other tables to be cleared out similarly to the first query before deleting the npc_types altogether.
Reply With Quote
  #5  
Old 08-13-2015, 08:07 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Thanks again.

I've thought about doing it that way. My concern with doing that is: if I want to add an expansion later, progression-style, it would be more difficult or less efficient to isolate the removed entries from the zone in the main_db than it would be to turn them off in the live_db * based on the extra column, `expansion`.

* My queries are set up to take the spawn2 from the zone, the spawnentry and spawngroup from the spawn2 and finally the npc_types from the spawnentry.

I could simply replace everything in that table, which I think would work.

Quick response, I may have other thoughts momentarily.
Reply With Quote
  #6  
Old 08-13-2015, 09:05 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Aha, you want to be able to undo it. I would think easiest would be to change the spawns all to, say, instance 99. Then when you want them back in, you could reset them to instance 0 and they'd *poof* back in at the next repop.
Reply With Quote
  #7  
Old 08-13-2015, 09:24 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

A switch would be nice for spawnentry. I'm kinda creating one in a roundabout way.

Fabled creatures, for example, usually have the same spawngroupid as their weaker counterparts. Some spawngroups, as you know, have a half dozen or more npc_types associated with it.

Disabling these spawngroups is not ideal. Desired is disabling the single npc associated with the spawngroup while being efficient about it.

Thanks Shendare.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:01 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3