I got basic spawn areas working
Here's the sql table :
Code:
CREATE TABLE `spawnarea` (
`id` int(11) NOT NULL default '0',
`spawngroupID` int(11) NOT NULL default '0',
`zone` varchar(16) NOT NULL default '',
`x1` float NOT NULL default '0',
`y1` float NOT NULL default '0',
`z1` float NOT NULL default '0',
`x2` float NOT NULL default '0',
`y2` float NOT NULL default '0',
`z2` float NOT NULL default '0',
`maxmob` int(11) NOT NULL default '0',
`respawntime` int(11) NOT NULL default '0',
`variance` tinyint(4) NOT NULL default '0',
`pause` int(11) NOT NULL default '0',
KEY `id` (`id`),
KEY `spawngroupID` (`spawngroupID`),
KEY `zone` (`zone`)
) TYPE=MyISAM;
I know it is basic but it is a start =)
spawn areas are rects, you define their bounds with the ( x1, y1, z1 ) and ( x2, y2 , z2 ) points
spawngroupID is the id of a spawngroup, add in the spawngroup the monsters you want to spawn in the area
each mob is defined by a spawn entry, ( spawngroupID, npcid, chance )
tweak the chance of each npc to tweak the population of each npc type in the area
maxpop defines the maximum numbers of npcs who can roam in the area
npcs will spawn randomly in the area and roam randomly in the area like the roaming grid type but it doesnt use grids anymore
I think it can be improved in many ways, we had already discussions, and maybe areas could be polygons instead of rects, use areas for other purposes like quests etc ...