View Full Version : Spawning mobs every x amount of steps a person takes?
Astal
08-16-2011, 06:28 PM
Would this be possible using emus perl scripting?
Like an old Final Fantasy RPG. Every so many steps a random NPC type is spawned.
Would it also be possible to add arguements to make it so they only spawn if another npc isnt near, or sometimes 2 spawn ect...., or so only the group leaders steps count towards spawning npcs, it could get messy if each player in the group spawned em.
Akkadius
08-16-2011, 07:07 PM
Would this be possible using emus perl scripting?
Like an old Final Fantasy RPG. Every so many steps a random NPC type is spawned.
Would it also be possible to add arguements to make it so they only spawn if another npc isnt near, or sometimes 2 spawn ect...., or so only the group leaders steps count towards spawning npcs, it could get messy if each player in the group spawned em.
You could achieve this in the player.pl.
On EVENT_ENTERZONE you can start a timer to start counting the units of distance a player has moved, and then add the if checks and arguments appropriately.
trevius
08-16-2011, 08:25 PM
Yeah, it would be possible, but it may be tough to tweak it to work exactly as you intend. Spawning an NPC or 2 if no others are near shouldn't be too hard if you just do an NPC List search and check a set distance around the player to see if any NPCs are already within that range.
You will also need to consider stuff like NPCs spawning inside walls. If you are picky (like me), you would need to also make sure NPCs don't spawn facing a wall or in an awkward looking position. You can do a FindGroundZ() and CheckLoS() from the player to make sure the NPCs aren't spawned inside of a wall, but they may still be spawned close enough to a wall that they look like they are partially in it. You can also set the heading of the NPC to face toward the player so they aren't at a bad heading, but it might look a bit odd having all NPCs spawn facing the character.
I have some scripts I recently created to spawn an entire dungeon and it works pretty well. I made some plugins that can move the NPCs away from walls and also make them face away from walls as well. It isn't perfect yet, but it looks decent enough. I may submit the scripts here sometime after I get them tweaked enough. They are a bit complex though and are pretty resource intensive so I wouldn't really recommend them for regular use. I mostly created them for development purposes so I could do something like spawn an entire LDoN zone and save the spawns to the DB after for permanent use. Then with a little cleanup (mostly #spawnfix and pathing) we could have a fully spawned zone from scratch with minimal effort and time.
Astal
08-16-2011, 09:02 PM
Yeah, it would be possible, but it may be tough to tweak it to work exactly as you intend. Spawning an NPC or 2 if no others are near shouldn't be too hard if you just do an NPC List search and check a set distance around the player to see if any NPCs are already within that range.
You will also need to consider stuff like NPCs spawning inside walls. If you are picky (like me), you would need to also make sure NPCs don't spawn facing a wall or in an awkward looking position. You can do a FindGroundZ() and CheckLoS() from the player to make sure the NPCs aren't spawned inside of a wall, but they may still be spawned close enough to a wall that they look like they are partially in it. You can also set the heading of the NPC to face toward the player so they aren't at a bad heading, but it might look a bit odd having all NPCs spawn facing the character.
I have some scripts I recently created to spawn an entire dungeon and it works pretty well. I made some plugins that can move the NPCs away from walls and also make them face away from walls as well. It isn't perfect yet, but it looks decent enough. I may submit the scripts here sometime after I get them tweaked enough. They are a bit complex though and are pretty resource intensive so I wouldn't really recommend them for regular use. I mostly created them for development purposes so I could do something like spawn an entire LDoN zone and save the spawns to the DB after for permanent use. Then with a little cleanup (mostly #spawnfix and pathing) we could have a fully spawned zone from scratch with minimal effort and time.
That would be very nice, I HATE spawning npcs, its my most hated thing ever lol
trevius
08-16-2011, 11:22 PM
I went ahead and posted the plugins and scripts as I currently have them. They could probably use some tweaks, but they should be good enough to help with what you are trying to do already.
http://www.eqemulator.org/forums/showthread.php?p=202329#post202329
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.