Followers 0

Spawn & Control MOBs with a MMO server?

3 posts in this topic

Hi!

I've been thinking about how to implement a "good" mob's system in a MMO, here's my very first idea:

- Using an Admin Player, create all the fixed spawn points for each mob (just walking around and using a command to create spawn points)

- When the server starts, it loads all the mob's spawning points available.

- Once the server has loaded all the spawning points, it creates one MOB per each spawning point with a % of spawn.

//It's not code!
function spawnMob(MOB m){
r = randomNumber 1-100
if (r < m.chance%){
//SPAWN
}
}


- Then, the mobs would be loaded in the world and players would be able to see / attack them

- Once one mob dies:

1. the server simply spawns another mob (with a 100% chance of spawning) to another position
• The bad thing here is that there will always be mobs, so the player never has to wait for mobs to spawn.
2. Every mob has a "timeToReSpawn" var, so the server waits X time till spawning another mob.

But, using this implementation, everything about npc's is decided when the world is loaded, so if a mob is just spawned twice because of a bad luck in the % when loading the server, it will only appear twice in the world (till the server restarts).

Any better implementation / idea / suggestion?

Thanks!

:)

0

Share on other sites

I'll try that, thanks! I'll share how it goes :)

0

Share on other sites

In my game, i spawn creatures from a database and when one dies it notifies the 'zone' about itself the zone then forwards that to a script which handles special circumstances ( if the zone is an instance and/or only certain creatures should respawn for example). If the script doesnt handle the respawn the default routine schedules the respawn with a timer based on the creature template.

Edited by Valoo
0

Create an account

Register a new account