SpawnMob()

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

SpawnMob()

Post by Scatman » Fri Feb 27, 2009 7:49 pm

Hey LE,
I am using SpawnMob() to spawn a groundspawn but once it gets spawned in the world, it's not treated as a groundspawn in the game. If the groundspawn is spawned by world (it has a zonespawnentry), then it can be harvested fine. I took a look at what SpawnMob() does exactly, and it just calls AddSpawn to the zone, so I'm assuming somehow we need to do what AddGroundSpawn() does too? I'm not too familiar with exactly how spawns work yet, so I wanted to see if you had an easy or good way of letting the LUA function SpawnMob() spawn groundspawns.

Thanks!

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: SpawnMob()

Post by LethalEncounter » Fri Feb 27, 2009 10:05 pm

I'm surprised it even added the groundspawn to the zone. I can't see a reason why it would. EQ2Emu_lua_Spawn calls World::GetSpawn and there isn't an entry type for ground spawns. Are you sure the ID is a ground spawn? I just added an entry in that function for ground spawns, so it should fix the issue.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: SpawnMob()

Post by Scatman » Fri Feb 27, 2009 11:36 pm

Yep. I just double checked. The spawn is actually an object which has a groundspawn_id. If the groundspawn is spawned by world, I can harvest it. If spawned by LuaFunctions::SpawnMob, I can't.

Sweet, I'll test it out once it's on the SVN, thanks.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: SpawnMob()

Post by John Adams » Sat Feb 28, 2009 12:46 am

Not sure if this pertains to your situation, Scat... but as I am converting some "npc" or "object" spawns to spawn_ground, I may forget to remove the old record in spawn_objects. When curious, check spawn, spawn_npcs, spawn_objects, and spawn_grounds to make sure only spawn + 1 type has the spawn record.

I honestly do not know how world would handle a spawn with an object -and- a ground record.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: SpawnMob()

Post by Scatman » Sat Feb 28, 2009 1:01 am

Okay cool, I'll check that out too.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests