summaryrefslogtreecommitdiff
path: root/npc/functions/mouboofunc.txt
blob: 6129c083e0a2c1358b315bc6dd9301aae6816ff3 (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
// Evol functions.
// Author:
//    Reid
// Description:
//    Various scripts used in walking mouboo NPCs.

function	script	moubootalk	{
    switch (rand(4))
    {
        case 0:
            npctalkonce(l("Moooooo!"));
            break;
        case 1:
            npctalkonce(l("Moo!"));
            break;
        case 2:
            npctalkonce(l("Moooooooooooo!"));
            break;
        case 3:
            npctalkonce(l("Moooo!"));
            break;
    }
    return;
}

function	script	mouboocheckxy	{
    setarray .nearnpc$[0], "Mouboo#Artis0",
                           "Mouboo#Artis1",
                           "Mouboo#Artis2",
                           "Mouboo#Artis3",
                           "Taree";
    for (.@size = 0; .@size < getarraysize(.nearnpc$); .@size++)
    {
        if (strcmp(.name$, .nearnpc$[.@size]) == 0)
        {
            continue;
        }

        .@npc_x = getvariableofnpc(.x, .nearnpc$[.@size]);
        .@npc_y = getvariableofnpc(.y, .nearnpc$[.@size]);

        if (.@npc_x == .x && .@npc_y == .y)
        {
            return 1;
        }
    }

    return 0;
}

function	script	moubootimer	{
    if (mouboocheckxy() && !isunitwalking())
    {
        movetonextpoint;
    }
    else if (rand(0,6) == 5)
    {
        if (!isunitwalking())
        {
            movetonextpoint;
        }
    }
    initnpctimer;
    end;
}

function	script	mouboograph	{
    initmovegraph   "down_pos",    66, 79,     75,  86,
                    "left_pos",    66, 79,     75,  86,
                    "up_pos",      66, 79,     75,  86,
                    "right_pos",   66, 79,     75,  86;

    setmovegraphcmd "down_pos",    "left_pos",      1,  "dir 2",
                    "down_pos",    "up_pos",        1,  "dir 4",
                    "down_pos",    "right_pos",     1,  "dir 6",
                    "left_pos",    "down_pos",      1,  "dir 0",
                    "left_pos",    "up_pos",        1,  "dir 4",
                    "left_pos",    "right_pos",     1,  "dir 6",
                    "up_pos",      "down_pos",      1,  "dir 0",
                    "up_pos",      "left_pos",      1,  "dir 2",
                    "up_pos",      "right_pos",     1,  "dir 6",
                    "right_pos",   "down_pos",      1,  "dir 0",
                    "right_pos",   "left_pos",      1,  "dir 2",
                    "right_pos",   "up_pos",        1,  "dir 4";

    firstmove "wait 2", "down_pos";
    initnpctimer;
    end;
}