EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Does quest::disable_spawn2 work? (https://www.eqemulator.org/forums/showthread.php?t=30835)

MNWatchdog 03-17-2010 01:09 PM

Does quest::disable_spawn2 work?
 
I'm trying to depop a area of a zone of it's current mobs and prevent those mobs from respawning using quest::disable_spawn2(#####); and the mobs still continue to spawn.

I want these mobs to stay down until I use quest::enable_spawn2.

I've tried using the disable both before and after depopping the mobs.

Am I using this wrong? Did a search and there's no examples I can find of it being used and of course the Wiki has no information other than this function exists.

trevius 03-17-2010 04:33 PM

I haven't really messed with those commands much yet, so I am not sure, but that is another one that KLS made examples for. Here are the examples she made:

Code:

sub EVENT_SAY {
        if($text=~/despawn/i)
        {
                quest::disable_spawn2(10842);
                quest::say("Yes sir!");
        }
        elsif($text=~/enable/i)
        {
                quest::enable_spawn2(10842);
                quest::say("Yes sir!");
        }
        elsif($text=~/spawn/i)
        {
                quest::spawn_from_spawn2(10842);
                quest::say("Yes sir!");
        }
}

I believe you use the spawn group ID, NOT the NPCID, but I could be wrong about that. I also believe that disabling it should depop it for you, so you shouldn't have to use a depop on them as well.

MNWatchdog 03-17-2010 06:14 PM

Shouldn't it be called disable_spawn_group then? ;-)

I guess that makes sense it would be groups, but the command name definitely should be changed if it is, if for nothing else, because there's almost no documentation other than the command itself.

Why didn't search not show that there we examples?

Well, anyways, I'll try group IDs.

Thanks.

nenelan 03-17-2010 07:44 PM

Spawn groups are stored in the dbtable, spawn2. Makes sense to me.

joligario 03-17-2010 08:00 PM

@nenelan: No, spawn groups are in spawngroup and spawnentry. Individual spawn points are in spawn2.

@MNW: Have you thought about using spawn conditions instead?

MNWatchdog 03-18-2010 01:31 AM

Quote:

Originally Posted by joligario (Post 185407)
@nenelan: No, spawn groups are in spawngroup and spawnentry. Individual spawn points are in spawn2.

@MNW: Have you thought about using spawn conditions instead?

Spawn conditions? Not sure what ya mean. I just started putzing around with scripts 2 days ago.

Examples always appreciated. ;-)

OK, found what you're talking about....and learning continues.

KLS 03-18-2010 03:53 AM

It takes the spawn2 id. Ex:

Code:

mysql> select * from spawn2 where id=10842;
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
| id    | spawngroupID | zone    | version | x          | y          | z        | heading  | respawntime | variance | pathgrid | _condition | cond_value | enabled |
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
| 10842 |        7667 | qeynos2 |      0 | 139.699997 | 312.700012 | 3.100000 | 0.000000 |        640 |        0 |        0 |          0 |          1 |      1 |
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
1 row in set (0.00 sec)


MNWatchdog 03-18-2010 08:05 AM

How do I get the Spawn2 ID from NPCs ID then?

Example please.

KLS 03-18-2010 04:09 PM

Code:

mysql> select * from spawn2 where spawngroupID=(select spawngroupID from spawnentry where npcID=2093);
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
| id    | spawngroupID | zone    | version | x          | y          | z        | heading  | respawntime | variance | pathgrid | _condition | cond_value | enabled |
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
| 10842 |        7667 | qeynos2 |      0 | 139.699997 | 312.700012 | 3.100000 | 0.000000 |        640 |        0 |        0 |          0 |          1 |      1 |
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
1 row in set (0.18 sec)

Keep in mind these are spawn points you don't turn them all on and off at once, they're one at a time.

trevius 03-18-2010 05:16 PM

Hmm, I think this may have been mentioned before, but maybe we can add spawn2 ID to #showstats or something next to spawngroup in that output. That will make it easier to figure out what you want in your script without having to query the DB.

KLS 03-18-2010 07:53 PM

Heck even a command with the simple sql I posted might be highly useful just as a quick lookup tool.

MNWatchdog 03-18-2010 08:39 PM

Talk to Rude/Reno. We chatted about this this morning and about what I think should be done and he was thinking about it.

Basically, you could add a Disable_Spawn using the NPC ID number and also allow a proximity setting, so say ya wanted no NPCs of id 200 in the zone, ya do quest::Disable_Spawn(200).

Using proximity type settings ya could do.

quest::Disable_Spawn(NPCID, minX, maxX, minY, maxY, minZ, maxZ)

And if the NPCID was 0 and the X,Ys and possibly Z, it would disable any spawns/groups in that area.

and of course Enable_Spawn to reverse then setting.

MNWatchdog 03-21-2010 10:48 AM

Nevermind - Really need a way to delete post!

MNWatchdog 03-21-2010 11:57 AM

Quote:

Originally Posted by KLS (Post 185431)
Code:

mysql> select * from spawn2 where spawngroupID=(select spawngroupID from spawnentry where npcID=2093);
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
| id    | spawngroupID | zone    | version | x          | y          | z        | heading  | respawntime | variance | pathgrid | _condition | cond_value | enabled |
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
| 10842 |        7667 | qeynos2 |      0 | 139.699997 | 312.700012 | 3.100000 | 0.000000 |        640 |        0 |        0 |          0 |          1 |      1 |
+-------+--------------+---------+---------+------------+------------+----------+----------+-------------+----------+----------+------------+------------+---------+
1 row in set (0.18 sec)

Keep in mind these are spawn points you don't turn them all on and off at once, they're one at a time.

This query doesn't work when there are multiple spawnentrys for npcID which I'm sure there often will be.

I'll give ya a dollar to impliment DIsable/Enable_Spawn like I posted above. ;-)

KLS 03-21-2010 04:38 PM

Yeah it wont work out of the box without an expensive join for multiple spawn entries.

We are not adding another quest command that does the same thing for lazy people.


All times are GMT -4. The time now is 12:00 AM.

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