summaryrefslogtreecommitdiff
path: root/npc/017-1/townhall.txt
blob: 4251629ec4d8a41fc7af0cbf656b7a270a688c56 (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
// TMW2/LoF scripts.
// Authors:
//    Jesusalva
// Description:
//    LoF Townhall Access Control

017-1,180,20,0	script	#LoF_Townhall01	NPC_NO_SPRITE,0,0,{
    end;

OnTouch:
    // Sponsor and Main Quest 17+ - access granted
    .@q=getq(General_Narrator);
    if (.@q >= 17 || getgmlevel()) {
        warp "017-10", 56, 78;
    } else {
        npctalkonce l("The door is locked, I should come back later.");
    }
    end;

}

017-1,182,20,0	script	#LoF_Townhall02	NPC_NO_SPRITE,0,0,{
    end;

OnTouch:
    // Sponsor and Main Quest 17+ - access granted
    .@q=getq(General_Narrator);
    if (.@q >= 17 || getgmlevel()) {
        warp "017-10", 60, 78;
    } else {
        npctalkonce l("The door is locked, I should come back later.");
    }
    end;
}

017-1,171,20,0	script	#LoF_Townhall03	NPC_NO_SPRITE,0,0,{
    end;

OnTouch:
    // Sponsor and Main Quest 17+ - access granted
    .@q=getq(General_Narrator);
    if (.@q >= 17 || getgmlevel()) {
        warp "017-10", 36, 78;
    } else {
        npctalkonce l("The door is locked, I should come back later.");
    }
    end;
}

017-1,190,20,0	script	#LoF_Townhall04	NPC_NO_SPRITE,0,0,{
    end;

OnTouch:
    // Sponsor and Main Quest 17+ - access granted
    .@q=getq(General_Narrator);
    if (.@q >= 17 || getgmlevel()) {
        warp "017-10", 80, 78;
    } else {
        npctalkonce l("The door is locked, I should come back later.");
    }
    end;
}
/////////////////////////////
// Main Quest 6
// LoF Arc
/////////////////
// Check instances and rebuild if needed
// Returns map name
// BarbaraInstCheck( {submap=mines} )
// 0- Chamber ; 1 - Mines ; 2 - Hall ; 3 - Shrine
function	script	BarbaraInstCheck	{
	.@house=getarg(0, true);

	.@q2=getq2(LoFQuest_Barbara);
	// Map name limit: 4 chars (sgt1)
	.@map0$="brb0@"+getcharid(0);
	.@map1$="brb1@"+getcharid(0);
	.@map2$="brb2@"+getcharid(0);
	.@map3$="brb3@"+getcharid(0);
	if (!(isinstance(.@q2) && .@q2 != 0)) {
		.@inst = instance_create("Forgotten Shrine "+getcharid(0), getcharid(3), IOT_CHAR);
	    instance_attachmap("018-6-0", .@inst, false, .@map0$);
	    instance_attachmap("018-6-1", .@inst, false, .@map1$);
	    instance_attachmap("018-6-2", .@inst, false, .@map2$);
	    instance_attachmap("018-6-3", .@inst, false, .@map3$);
	    // Instance lasts two hours
		instance_set_timeout(7200, 7200, .@inst);
		instance_init(.@inst);
	    setq2 LoFQuest_Barbara, .@inst;
	}

    // It broke
    if (getmapinfo(MAPINFO_SIZE_X, .@map1$) <= 0) {
        setq2 LoFQuest_Barbara, 0;
        // Infinite Loop?
        return callfunc("BarbaraInstCheck", .@house);
    }

    // Return map name
    return getd(".@map"+.@house+"$");
}

017-1,32,44,0	script	#LoF_EleniumMines	NPC_NO_SPRITE,0,0,{
    end;

OnTouch:
    .@q=getq(LoFQuest_Barbara);
    if (.@q >= 1) {
        addmapmask BarbaraInstCheck(1), 2;
        warp BarbaraInstCheck(1), 80, 199;
    } else {
        warp "018-6-1", 80, 199;
    }
    end;
}