summaryrefslogtreecommitdiff
path: root/world/map/npc/annuals/xmas/mobmanager.txt
blob: 59f48cb79d59944fd7fd85384c4c459f33dcd4ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Spawns mobs

019-1.gat,0,0,0|script|XmasSpawnManager|400
{
    end;

OnCommandSpawnStart:
    if ($@xmas_spawn_started)
        goto L_End;
    set $@xmas_spawn_started, 1;
    goto L_InitSpawn;

L_InitSpawn:
    initnpctimer;
    set $@xmas_current_count, 0;
    set $@xmas_map_loop, 0;
    goto L_StartLoop;

L_StartLoop:
    set $@xmas_mob_lck, 1;
    set $@mob_count, mobcount($@xmas_map_spawns$[$@xmas_map_loop], "XmasSpawnCounter#" + $@xmas_map_loop + "::OnTally");
    set $@spawn_amount, ($@xmas_mob_counts[$@xmas_map_loop] - ($@mob_count + 1));
    if ($@spawn_amount)
        goto L_Spawn;
    goto L_NextMap;

L_Spawn:
    areamonster $@xmas_map_spawns$[$@xmas_map_loop], $@xmas_spawn_x1, $@xmas_spawn_y1, $@xmas_spawn_x2, $@xmas_spawn_y2, $@xmas_mob_names$[$@xmas_map_loop], $@xmas_mob_spawns[$@xmas_map_loop], $@spawn_amount, "XmasSpawnCounter#" + $@xmas_map_loop + "::OnTally";
    set $@xmas_current_count, ($@xmas_current_count + $@spawn_amount);
    goto L_NextMap;

L_NextMap:
    if (($@xmas_map_loop + 1) == getarraysize($@xmas_map_spawns$))
        goto L_End;
    set $@xmas_map_loop, ($@xmas_map_loop + 1);
    goto L_StartLoop;

OnCommandTally:
    set $@xmas_map_loop, 0;
    set $@xmas_current_count, ($@xmas_current_count - 1);
    if (($@xmas_current_count < $@xmas_respawn_count) && !($@xmas_mob_lck))
        goto L_StartLoop;
    goto L_End;

OnTimer110000:
    initnpctimer;
    goto L_StartLoop;

L_End:
    set $@mob_count, 0;
    set $@spawn_amount, 0;
    set $@xmas_mob_lck, 0;
    set $@xmas_map_loop, 0;
    end;
}

019-1.gat,0,0,0|script|XmasSpawnCounter#0|400
{
    end;

OnTally:
    cmdothernpc "XmasSpawnManager", "Tally";
    end;
}

019-3.gat,0,0,0|script|XmasSpawnCounter#1|400
{
    end;

OnTally:
    cmdothernpc "XmasSpawnManager", "Tally";
    end;
}

030-1.gat,0,0,0|script|XmasSpawnCounter#2|400
{
    end;

OnTally:
    cmdothernpc "XmasSpawnManager", "Tally";
    end;
}

030-3.gat,0,0,0|script|XmasSpawnCounter#3|400
{
    end;

OnTally:
    cmdothernpc "XmasSpawnManager", "Tally";
    end;
}