summaryrefslogtreecommitdiff
path: root/npc/015-8-1/campaign.txt
blob: 352432db7dd95325ee9b25e8519b98cd9888a66c (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Sagratha Quest (field 3)

015-8-1,49,38,0	script	#SaggyDungeonCore	NPC_NO_SPRITE,{
    // Not in instance, we don't care.
    if (instance_id() < 0)
        end;

    end;

// There is no instance init
OnBegin:
    .@m$=getmap();
    .@n$=instance_npcname(.name$);

    //.@in=getq2(HurnscaldQuest_Sagratha);
    //debugmes "Initialized - Inst ID %d", .@in;
    //debugmes "Map %s.gat - NPC Name %s", .@m$, .name$;
    //debugmes "NPC UUID %s (%s)", instance_npcname(.name$), instance_npcname(.name$, .@in);

    setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_COMMANDS|PCBLOCK_SITSTAND|PCBLOCK_IMMUNE|PCBLOCK_CHAT|PCBLOCK_MOVE, true); // Same as 255
    setq3 HurnscaldQuest_Sagratha, 1;
    // We're in an instance, ofc. Here we still have player attached.
    //npctalk3 l("Open your eyes!");
    //npctalk("Sagratha: Open your eyes!", instance_npcname(.name$, .@in), false);
    //npctalk("Sagratha: Open your eyes!");
    //mapannounce(.@m$, l("Sagratha: Open your eyes!"), 0);

    .SAGRATHA=monster(.@m$, 52, 40, "Sagratha", Sagratha, 1, .@n$+"::OnSagrathaDie", Size_Medium, 2);
    .BOSS=monster(.@m$, 52, 40, l("Masked Assassin"), HoodedAssassin, 1, .@n$+"::OnSagrathaWin");

    unitstop(.SAGRATHA);
    unitstop(.BOSS);

    unittalk(.SAGRATHA, l("What are you doing here, @@!", get_race()));

    addtimer(1000, .@n$+"::OnS02");
    end;

OnS02:
    .@m$=getmap();
    .@n$=instance_npcname(.name$);

    unitstop(.SAGRATHA);
    unitstop(.BOSS);

    unittalk(.SAGRATHA, l("I don't need help!"));
    unittalk(.BOSS, l("Die already!"));

    addtimer(1500, .@n$+"::OnS03");
    end;

OnS03:
    .@m$=getmap();
    .@n$=instance_npcname(.name$);

    unitstop(.SAGRATHA);
    unitstop(.BOSS);

    unittalk(.SAGRATHA, l("If you don't want to die, fight!"));
    unittalk(.BOSS, lg("Murder her too!", "Murder him too!"));

    addtimer(1500, .@n$+"::OnS04");
    end;

OnS04:
    .@m$=getmap();
    .@n$=instance_npcname(.name$);

    // Assassin's Army
    areamonster .@m$, 44, 40, 55, 50, strmobinfo(1, HoodedNinja), HoodedNinja, 4;
    areamonster .@m$, 44, 40, 55, 50, strmobinfo(1, Assassin), Assassin, 7;

    // Sagratha's Army
    areamonster .@m$, 44, 40, 55, 50, strmobinfo(1, Mouboo), Mouboo, 2, .@n$+"::OnError", Size_Medium, 2;
    areamonster .@m$, 44, 40, 55, 50, strmobinfo(1, ForestMushroom), ForestMushroom, 2, .@n$+"::OnError", Size_Medium, 2;

    // Heal them because you should not be fighting (yet).
    setunitdata(.BOSS,     UDT_HP,    getunitdata(.BOSS,     UDT_MAXHP));
    setunitdata(.SAGRATHA, UDT_HP,    getunitdata(.SAGRATHA, UDT_MAXHP));

    // Objective announce
    mapannounce(.@m$, "##2"+l("Victory Conditions: Defeat the assassin!"), 0);
    mapannounce(.@m$, "##1"+l("Defeat Conditions: Sagratha gets killed!"), 0);

    // Status cleanup
    setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_COMMANDS|PCBLOCK_SITSTAND|PCBLOCK_IMMUNE|PCBLOCK_CHAT|PCBLOCK_MOVE, false);
    end;

// Assassin, HoodedNinja, HoodedAssassin (boss)
// Mouboo, ForestMushroom, Fluffy, Sagratha (boss)
OnSagrathaDie:
    npctalk "Defeat";
    end;

OnSagrathaWin:
    npctalk "Victory";
    end;

OnError:
    //unittalk(.SAGRATHA, l("Watch out!"));
    //debugmes "Error";
    //npctalk "Error";
    end;

OnInit:
    .SAGRATHA=0;
    end;

}

// Dummy NPC to fire #SaggyDungeonCore when you get close to battle scene
015-8-1,49,39,0	script	#SaggyDungeonFire	NPC_HIDDEN,1,0,{
    end;

OnTouch:
    if (instance_id() < 0)
        end;

    if (!getq3(HurnscaldQuest_Sagratha)) {
        .@in=getq2(HurnscaldQuest_Sagratha);
        doevent(instance_npcname("#SaggyDungeonCore", .@in)+"::OnBegin");
    }
    end;

OnInit:
    .distance=0;
    end;

}