I'm trying to create a kind-of waves. In each wave, different amount of zombies of each type spawn. It looks like this:
PHP Code:
enum CLASSES //list of classes
{
class_1,
class_2
}
new Total_Npcs[ 11 ][ CLASSES ] = // total zombies at each wave
{
{ 0, 0 }, // wave 0 (0 of each type spawn)
{ 0, 1 }, // wave 1 (0 of the first class, one of the second class spawns)
{ 1, 2 }, // wave 2 (one of the first class, two of the second class spawn)
{ 2, 3 }, // ...
{ 3, 4 },
{ 4, 5 },
{ 5, 6 },
{ 6, 7 },
{ 7, 8 },
{ 8, 9 },
{ 9, 10 }
}
new Spawn_At_Once[ 11 ] =
{
0, // 0 max zombies spawn at once
1, // one zombie spawns
3, // three zombies spawn
5, // ...
7,
7,
7,
7, // wave 7 - maximum of 7 zombies spawn at the first point, though total amount of zombies is 13
7,
7,
7
}
The problem is I have no clue how to do this. Let's say a zombie is spawned with this stock:
spawn_zombie( class ). It is non-existant, but should be enough for an example of doing this.
It should spawn 7 zombies at the initial moment, then one extra zombie whenever one dies until the total amount is reached (a forward
zombie_death( class ) get's called). The amount of each class should be similar in the ratio (for example, if it is { 10, 12 } and it should create 7 zombies at the initial moment, spawn 3 of the first type, 4 of the second at once (10/3, 12/3) ). The order in which zombies are spawned after one dies doesn't matter and can be left random.
It probably is a lot, but if you manage to find some time to do this, I would greatly appreciate it. I at least need to have a basic idea of doing this, since I'm really stuck right now.
Thanks in advance. It is a bit complicated, so if you couldn't understand something, let me know.