summaryrefslogtreecommitdiff
path: root/npc/020-1/guards.txt
blob: 4d33beecd58fed7c3f986571058c219c04c44ccd (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
92
93
94
95
96
97
98
99
100
101
102
103
104
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Protect Nivalis

020-1,49,48,0	script	Lieutenant Joshua	NPC_PLAYER,{
    // The Monster King guild have a special menu
    if (strcharinfo(2) == "Monster King") goto L_MKControl;

    if ($NIVALIS_LIBDATE) {
        mesn;
        mesq l("Nivalis was liberated @@ ago.", FuzzyTime($NIVALIS_LIBDATE));
        close;
    } else {
        legiontalk; end;
    }

L_MKControl:
    mesn;
    mes "Oh noes! You've found the Nivalis control panel!";
    next;
    select
        l("Abort"),
        l("Initiate a siege");
    mes "";
    if (@menu == 2) {
        doevent "Lieutenant Joshua::OnStartSiege";
        closedialog;
    }
    close;


OnMKSiege:
    $@SIEGE_ABORTED = false;
OnStartSiege:
    kamibroadcast(col("WARNING! WARNING! Monster Army is moving towards Nivalis!!",1));
    do_siege("020-1", "019-2", "NIVAL", TP_NIVAL, .name$, .siegetime);
    initnpctimer;
    end;

// Timers
OnTimer5000:
    .siegetime+=5;
    do_siege("020-1", "019-2", "NIVAL", TP_NIVAL, .name$, .siegetime);
    switch (.siegetime) {
    // Monster Army arrives in town
    case 60:
        disablenpc "Serge";
        disablenpc "Knox The Traveler";
        disablenpc "Camilot";
        disablenpc "Mede";
        disablenpc "Gambler#020-4";
        disablenpc "Gambling Xan";
        disablenpc "Baktar";
        disablenpc "Bracco";
        disablenpc "Agostine";
        break;
    // Monster Army deployed in town
    case 90:
        disablenpc "Ben#NivBanker";
        break;
    // Monster army have withdrawn completly
    case MK_SIEGE_DURATION:
        .siegetime=0;
        announce(("Nivalis siege is over!"), bc_all);
        enablenpc "Serge";
        enablenpc "Knox The Traveler";
        enablenpc "Camilot";
        enablenpc "Mede";
        enablenpc "Gambler#020-4";
        enablenpc "Gambling Xan";
        enablenpc "Baktar";
        enablenpc "Bracco";
        enablenpc "Agostine";
        enablenpc "Ben#NivBanker";
        stopnpctimer;
        end;
        break;
    }

    // Loop again
    initnpctimer;
    end;

OnInit:
    .siegetime=0;
    .sex = G_MALE;
    .distance = 4;

    // Check items.xml for info about this.
    .@npcId = getnpcid();
    setunitdata(.@npcId, UDT_HEADTOP, BullHelmet);
    setunitdata(.@npcId, UDT_HEADMIDDLE, LieutenantArmor);
    setunitdata(.@npcId, UDT_HEADBOTTOM, RaidTrousers);
    setunitdata(.@npcId, UDT_SHIELD, LousyMoccasins);    // TODO FIXME: Display Boots
    setunitdata(.@npcId, UDT_WEAPON, Backsword);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 12);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 15);
    end;


}