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
|
// TMW2 scripts.
// Authors:
// Jesusalva
// Description:
// Controls global instances and reset them when they break
- script #GlobalInstanceCore NPC_HIDDEN,{
OnInit:
.CANDOR_INSTID=-1;
end;
OnInterIfInit:
// It shouldn't be harmful if it runs a few times too many
if ($@HHMD_INSTID2 && .HURNS_INSTID && isinstance(.NIVAL_INSTID) && isinstance($@HHMD_INSTID2)) {
consolebug("Refusing to recreate instances on char server restart! Additionally: Refusing to restart Heroes Hold!");
end;
}
// Otherwise, really reload instances
OnInstRestart:
/* Nard's Ship */
// Candor Instance (we do all tests for debugmes here)
.CANDOR_INSTID = instance_create("002-1@CandorInst", 0, IOT_NONE);
if (.CANDOR_INSTID < 0) {
Exception("CANDY Instance ID failed", RB_DEBUGMES|RB_IRCBROADCAST);
} else {
//debugmes("created new instance id: %s", str(.CANDOR_INSTID));
.CANDOR1$=instance_attachmap("002-1", .CANDOR_INSTID, 0, "002-1@Candor");
if (.CANDOR1$ == "") Exception("Map 002-1 CANDY failed", RB_DEBUGMES|RB_IRCBROADCAST);
.CANDOR3$=instance_attachmap("002-3", .CANDOR_INSTID, 0, "002-3@Candor");
if (.CANDOR3$ == "") Exception("Map 002-3 CANDY failed", RB_DEBUGMES|RB_IRCBROADCAST);
debugmes "Nard's Ship in Candor instance is set.";
instance_set_timeout(0, 0, .CANDOR_INSTID);
instance_init(.CANDOR_INSTID);
}
// Tulim Instance
.TULIM_INSTID = instance_create("002-1@TulimInst", 0, IOT_NONE);
instance_attachmap("002-1", .TULIM_INSTID, 0, "002-1@Tulim");
instance_attachmap("002-3", .TULIM_INSTID, 0, "002-3@Tulim");
instance_set_timeout(0, 0, .TULIM_INSTID);
instance_init(.TULIM_INSTID);
// Artis Instance
.ARTIS_INSTID = instance_create("002-1@ArtisInst", 0, IOT_NONE);
instance_attachmap("002-1", .ARTIS_INSTID, 0, "002-1@Artis");
instance_attachmap("002-3", .ARTIS_INSTID, 0, "002-3@Artis");
instance_set_timeout(0, 0, .ARTIS_INSTID);
instance_init(.ARTIS_INSTID);
/* La Marine's Ship */
// Tulim Instance
.TULIM_INSTID = instance_create("016-1@TulimInst", 0, IOT_NONE);
instance_attachmap("016-1", .TULIM_INSTID, 0, "016-1@Tulim");
instance_set_timeout(0, 0, .TULIM_INSTID);
instance_init(.TULIM_INSTID);
// Hurns Instance
.HURNS_INSTID = instance_create("016-1@HurnsInst", 0, IOT_NONE);
instance_attachmap("016-1", .HURNS_INSTID, 0, "016-1@Hurns");
instance_set_timeout(0, 0, .HURNS_INSTID);
instance_init(.HURNS_INSTID);
// Nivalis Instance
.NIVAL_INSTID = instance_create("016-1@NivalInst", 0, IOT_NONE);
instance_attachmap("016-1", .NIVAL_INSTID, 0, "016-1@Nival");
instance_set_timeout(0, 0, .NIVAL_INSTID);
instance_init(.NIVAL_INSTID);
/* Heroes Hold Main Dungeon */
$@HHMD_INSTID1 = instance_create("018-2-2@HHMD1", 0, IOT_NONE);
instance_attachmap("018-2-2", $@HHMD_INSTID1, 0, "018-2-2@No");
instance_set_timeout(0, 0, $@HHMD_INSTID1);
instance_init($@HHMD_INSTID1);
$@HHMD_INSTID2 = instance_create("018-2-3@HHMD2", 0, IOT_NONE);
instance_attachmap("018-2-3", $@HHMD_INSTID2, 0, "018-2-3@In");
instance_set_timeout(0, 0, $@HHMD_INSTID2);
instance_init($@HHMD_INSTID2);
$@HHMD_INSTID4 = instance_create("018-2-2@HHMD4", 0, IOT_NONE);
instance_attachmap("018-2-2", $@HHMD_INSTID4, 0, "018-2-2@Ad");
instance_set_timeout(0, 0, $@HHMD_INSTID4);
instance_init($@HHMD_INSTID4);
$@HHMD_INSTID8 = instance_create("018-2-3@HHMD8", 0, IOT_NONE);
instance_attachmap("018-2-3", $@HHMD_INSTID8, 0, "018-2-3@Ex");
instance_set_timeout(0, 0, $@HHMD_INSTID8);
instance_init($@HHMD_INSTID8);
$@HHMD_INSTID16 = instance_create("018-2-5@HHMD16", 0, IOT_NONE);
instance_attachmap("018-2-5", $@HHMD_INSTID16, 0, "018-2-5@Ma");
instance_set_timeout(0, 0, $@HHMD_INSTID16);
instance_init($@HHMD_INSTID16);
debugmes("The HHMD level IDs are: %d-%d-%d-%d-%d", $@HHMD_INSTID1, $@HHMD_INSTID2, $@HHMD_INSTID4, $@HHMD_INSTID8, $@HHMD_INSTID16);
donpcevent "#HH_CONTROLLER01::OnHHInit";
end;
OnMinute18:
OnMinute47:
if (!isinstance(.HURNS_INSTID) || !isinstance(.NIVAL_INSTID) || !isinstance($@HHMD_INSTID1))
donpcevent("#GlobalInstanceCore::OnInstRestart");
end;
}
|