Trying to understand ore and herb spawning

I was trying to bump up all ore and herb spawns but It seems to me that there are entire areas that have no ore spawns listed:

SELECT * FROM pool_template WHERE description LIKE ‘%darkshore%’;

Returns only MASTER Herbs Darkshore zone 148

SELECT * FROM pool_template WHERE description LIKE ‘%ashen%’;

Returns only MASTER Herbs Ashenvale zone 331 (but I’m standing in front of a Silver Deposit in Ashenvale…)

I took a look at this ancient thread (from 2011) but I’m not sure it’s entirely relevant today. It seems like the DB is missing a bunch of spawn info even though there are nodes on the map.

I’ve read and read again the table descriptions on the wiki but I simply can’t understand how a Silver Deposit is spawning without a database entry for it, let alone how to make it more frequent.

Edit:

I actually ran around Darkshore and the surrounding area and found only two herb nodes. There are a crap ton of herb spawns in the water which, if I understand the tables, means that those take up all the “allowed” spawns for that map preventing anything else from spawning in the forest.

Based on the description of the tables, the reason people see so few spawns is that the database might be populated wrong.

For example, the following seems to spawn properly:

SELECT * FROM pool_template WHERE description LIKE ‘%elwynn%’;

The result is:

entry: 2011
desc: Master Mineral Pool - Elwynn Forest
max_limit = 13

entry: 993
desc: MASTER Herbs Elwynn Forest zone 12
max_limit = 15

SELECT * FROM pool_gameobject WHERE pool_entry = 2011;

Returns 115 rows, each with chance = 0 and per the DB description, these seem to spawn properly

because max_limit > 1:

If the pool spawns more than one gameobject, the chance is ignored and all the gameobjects in the pool are rolled in one step with equal chance

However, if you take a look at Ashenvale the spawns are almost nonexistant even though there are over 400 rows:

SELECT * FROM pool_template WHERE description LIKE ‘%ashen%’;

entry: 960
desc: MASTER Herbs Elwynn Forest zone 12
max_limit = 1

SELECT * FROM pool_gameobject WHERE pool_entry = 960;

Returns 465 rows, each with a chance of 0. This is where I think things fall apart

because max_limit = 1:

If the pool spawns just one gameobject (max_limit = 1 in the respective pool_template), the core selects the gameobject to be spawned in a two-step process: First, only the explicitly-chanced (chance > 0) gameobjects of the pool are rolled. If this roll does not produce any gameobject, all the gameobjects without explicit chance (chance = 0) are rolled with equal chance.

The problem here is that the 465 rows are unique nodes so there is nothing to pick from

SELECT * FROM pool_gameobject WHERE pool_entry = 960 AND description LIKE ‘%node 1%’;

You see that for “node 1” there is only “mageroyal” and “node 100” only has “bruiseweed” but they’re all in zone 331 so rather than the core deciding if “node 1” should either be “mageroyal” or “bruiseweed” it doesn’t seem to spawn anything.

Well IMO this appears to be a bug either with core implementation or DB data so I will post it on the bug tracker for discussion.

Using the following SQL will increase spawns in areas that have none:

– Make a backup of the entries we’re going to modify
CREATE TABLE IF NOT EXISTS pool_template_herb_backup AS (SELECT * FROM pool_template WHERE max_limit = 1 AND (description LIKE ‘%herb%’));

– Increases the max spawn limit based on the count of possible spawns from pool_gameobject
– This seems to increase spawns in zones that have max_limit = 1 but zones are empty
UPDATE pool_template pt
INNER JOIN (
SELECT pool_entry,
COUNT(*) AS cnt
FROM pool_gameobject
WHERE pool_entry IN (SELECT entry FROM pool_template_herb_backup)
GROUP BY pool_gameobject.pool_entry
) ijn
ON pt.entry = ijn.pool_entry
SET pt.max_limit = ijn.cnt;

https://github.com/TrinityCore/TrinityCore/issues/11141

Please redirect further conversation to the bug report. Thanks