summaryrefslogtreecommitdiff
path: root/npc/001-1/juscare.txt
blob: 84fdae3374bbe99545fec6e0980abfec1a5b2617 (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
// Evol scripts.
// Author:
//    Reid
//    Travolta
// Description:
//    Juscare, walking NPC of the legion of Aemil on the right part of the Agora of Artis.


function	script	JuscareTurnTo	{
    .@x = atoi(getarg(0));
    .@y = atoi(getarg(1));
    npc_turntoxy(.@x, .@y);
    return 0;
}


001-1,78,114,0	script	Juscare#001-1	NPC_HUMAN_MALE_LEGION_ARTIS,{

    function localClose {
        .dir = @Juscar_old_dir;
        npc_resumemove;
        close;
    }

    npc_pausemove;
    getmapxy(.@map$, .@cx, .@cy, 0);
    @Juscar_old_dir = .dir;
    npc_turntoxy(.@cx, .@cy);

    speech
        l("It is a foggy day, don't you think?");

    localClose;

OnTimer100:
    if (!isunitwalking())
        movetonextpoint;
    initnpctimer;
    end;

OnInit:
    .sex = G_MALE;
    .distance = 4;
    // .debug = 1;
    initmovegraph
        "sector_1",     75,   111, 88,  117,
        "sector_2",     90,   110, 100, 116,
        "market_r",     68,   119, 73,  120,
        "market_m",     61,   115, 65,  121,
        "market_l",     49,   116, 57,  122,
        "secret",       36,   122, 40,  129;

    // flags: 0x1 -- moving from right to left, 0x2 -- moving from left to right

    // this is not very obvious stuff
    setmovegraphcmd
        "sector_1",     "sector_2",  1,  0x2,   "flags_0 2; flags_1 1; wait 50",
        "sector_2",     "sector_1",  1,  0x1,   "wait 50",
        "sector_1",     "market_r",  2,  0x1,   "flags_0 2; flags_1 1",
        "market_r",     "market_m",  1,  0x1,   "flags_1 3; wait 10; call JuscareTurnTo 57 117; wait 10",
        "market_r",     "sector_1",  1,  0x2,   "flags_1 3; dir 0; wait 50",
        "market_m",     "market_l",  1,  0x1,   "flags_0 2; wait 20; call JuscareTurnTo 57 117; wait 50",
        "market_m",     "market_r",  1,  0x2,   "flags_0 1; flags_1 2",
        "market_l",     "market_m",  5,  0x2,   "wait 10; call JuscareTurnTo 57 117; wait 30",
        "market_l",     "secret",    1,  0x1,   "flags_0 1; flags_1 2; wait 70",
        "secret",       "market_l",  1,  0x2,   "wait 10; call JuscareTurnTo 57 117; wait 40";

    firstmove "wait 1", "sector_1";
    initnpctimer;
}