summaryrefslogtreecommitdiff
path: root/npc/015-8-1/campaign.txt
blob: 96a94378233b9cb08ad830deb438925dece7c608 (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
// 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();
    .@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);

    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, instance_npcname(.name$, .@in)+"::OnError", Size_Medium, 2);

    unittalk(.SAGRATHA, l("Open your eyes!"));

    monster .@m$, 49, 45, "Real Monster", RedSlime, 1;
    // max AI id 4. You are in 49,39
    monster .@m$, 49, 41, "AI Tx", RedSlime, 1, instance_npcname(.name$)+"::OnError", Size_Medium, 2;
    monster .@m$, 51, 41, "AI Xt", RedSlime, 1, instance_npcname(.name$)+"::OnError", Size_Medium, 2;

    addtimer(5000, instance_npcname(.name$)+"::OnError");
    end;

// Assassin, HoodedNinja, HoodedAssassin (boss)
// Mouboo, ForestMushroom, Fluffy, Sagratha (boss)

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;

}