NPC SpawnGroup ID Bug
For dynamic zones (not static), whenever I enter the zone, the NPCs lose their spawngroup IDs... it's really annoying since I work off of those : p. They get them back with a #repop, but eh..
Right now, I'm planning to just track the amount of players in every zone. When it hits 0 and the first player comes back in, I do a repop of the zone so that the NPCs get their proper spawngroup IDs. Is there any way to fix this? Or should I just keep doing what I'm doing :\. Yes, static zones work fine. Any dynamic zones, whether they hold their state or not, do not work fine -.-. Thank you in advance ^_^. |
What do you mean that they lose their spawngroup IDs? I have no problems at all with running Dynamic zones on my server. The only difference I see from running static is that if a zone goes down because no players are in it, NPC corpses or any quest spawned NPCs from when the zone was last up won't be up anymore. Also, loot changes because it is the same as doing a repop of the zone when the zone restarts from a player zoning into it and causing the zone to boot up.
There definitely shouldn't be any reason to have to do a repop to fix anything on dynamic zones. Can you explain your issue in more detail? |
Try just having a zone as a dynamic zone with hold state equal to true in the database. Try adding a spawn to the db and what not. Do #npcstats and look at the SpawnGroupID, not the NPC ID. After that, leave the zone. When you go back in, do #npcstats on them again. There SpawnGroupID (if they are the only one in the zone) will be at 0. Doing a #repop will set their SpawnGroupID to the proper SpawnGroupID in the db.
However, now it looks like I'm running into more issues because spawning another NPC with an NPC requires the NPC ID and not the SpawnGroup ID. The SpawnGroupID is the only ID you can access in PERL via a var. Also, when spawning a new NPC, in that NPC under the sub EVENT_SPAWN, there is no way for them to retrieve the spawngroup ID or the NPC ID (meaning there is no way to tell what the NPC is). You can retrieve names, but all NPCs on my server have no name (i'm testing out a special design), so I need to be able to either access the NPC ID at all times or the SpawnGroupID at all times (I prefer the NPC ID) because the spawn function and most of the functions that access NPCs require the NPC ID but the only thing u can get via variables with PERL is the SpawnGroupID. So, right now, there is no way for me to detect what type of NPC an NPC is if it's newly spawned and has no spawn group =/=. Please add code to retrieve an NPC's ID and not their SpawnGroupID or something ^_^, unless you can tell me another way to do it ;p. |
Ahh, so it sounds like your issue is with holdzones, not just dynamic zones in general. I haven't tried messing with hold zones yet, so I don't really know much about it or how well it works.
What perl stuff are you running to get the spawngroup ID? To get the NPC ID, you should be able to run something like this: $npc->GetNPCTypeID(); But, you may have to get the NPC using another command first. You probably won't be able to run any commands to get the spawnID in the EVENT_SPAWN, because all of that stuff is being built as it spawns, so it won't be able to get it until after the spawning is completed. You should be able to start a timer when it spawns and then get the NPC ID later. But, timers probably can't get NPC too easily to run commands on. Not using NPC names will probably complicate things though :P What exactly are you trying to do with these spawnIDs and spawngroups? |
nvm... look at the guide.. GetNPCTypeID() is in the wrong area.. it should be under NPC and it's under Mob. I spent one day trying to figure out what was wrong and that was it : P.
Now I don't have to use spawn group IDs ^^ |
I had a ton of problems when I was using Hold State. The respawn timers remain regardless of the save state, the only issue is existing corpses disappear and PLAYER corpses remain indefinitely pretty much.
|
I guess I'll just use pure static and instance : p
|
All times are GMT -4. The time now is 09:19 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.