summaryrefslogtreecommitdiff
path: root/npc/019-5/episode.txt
blob: 7264a53f083483c3401442d40dca5e65213f7e6d (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
// TMW2 scripts.
// Authors:
//    Jesusalva <jesusalva@tmw2.org>
// Description:
//    The Episode

019-5,128,39,0	script	#EpisodeDoor	NPC_HIDDEN,0,0,{
    end;
OnTouch:
    if (getq(LoFQuest_EPISODE) != 11) {
        dispbottom l("This door is locked. A warning sign is on the door: \"do not enter!\".");
        end;
    }
    // The Episode
    setq3 LoFQuest_EPISODE, 0;
	.@q2=getq2(LoFQuest_EPISODE);
	.@mapn$="ep01@"+getcharid(0);
	.@mape$="ep02@"+getcharid(0);
    if (instanceowner(.@q2) == getcharid(3)) {
		instance_set_timeout(900, 900, .@q2);
    } else {
		.@q2 = instance_create("Episode "+getcharid(0), getcharid(3), IOT_CHAR);
	    instance_attachmap("019-5-3", .@q2, false, .@mapn$);
	    instance_attachmap("004-3-1", .@q2, false, .@mape$);
		instance_set_timeout(900, 900, .@q2);
		instance_init(.@q2);
	    setq2 LoFQuest_EPISODE, .@q2;
    }
    // Warp to instance
    warp .@mapn$, 30, 32;
    end;
}