// TMW2 scripts.
// Authors:
// Jesusalva
// Description:
// Part of the Doctor's Quest.
032-3,121,70,0 script #CryptEP NPC_HIDDEN,0,0,{
end;
OnTouch:
.@q = (getq(LoFQuest_EPISODE) == 15 ? getq2(LoFQuest_EPISODE) : 99);
if (.@q >= 2)
warp "032-4", 40, 74;
else
dispbottom l("This door is locked.");
end;
OnInstanceInit:
disablenpc instance_npcname(.name$);
end;
OnInit:
if (instance_id() >= 0) end;
// The Green Arena
monster("032-3", 28, 25, "Arena", GreenDragon, 1);
monster("032-3", 46, 25, "Arena", GreenDragon, 1);
monster("032-3", 64, 19, "Arena", GreenDragon, 1);
monster("032-3", 78, 19, "Arena", GreenDragon, 1);
monster("032-3", 64, 43, "Arena", GreenDragon, 1);
monster("032-3", 78, 43, "Arena", GreenDragon, 1);
monster("032-3", 102, 19, "Arena", GreenDragon, 1);
monster("032-3", 112, 19, "Arena", GreenDragon, 1);
monster("032-3", 102, 43, "Arena", GreenDragon, 1);
monster("032-3", 112, 43, "Arena", GreenDragon, 1);
// The Blue Area
monster("032-3", 130, 19, "Arena", Moonshroom, 1);
monster("032-3", 140, 19, "Arena", Moonshroom, 1);
monster("032-3", 164, 19, "Arena", Moonshroom, 1);
monster("032-3", 178, 19, "Arena", Moonshroom, 1);
monster("032-3", 196, 25, "Arena", Moonshroom, 1);
monster("032-3", 214, 25, "Arena", Moonshroom, 1);
monster("032-3", 130, 43, "Arena", Moonshroom, 1);
monster("032-3", 140, 43, "Arena", Moonshroom, 1);
monster("032-3", 164, 43, "Arena", Moonshroom, 1);
monster("032-3", 178, 43, "Arena", Moonshroom, 1);
// The Yellow Arena
monster("032-3", 64, 106, "Arena", JackO, 1);
monster("032-3", 78, 106, "Arena", JackO, 1);
monster("032-3", 102, 106, "Arena", JackO, 1);
monster("032-3", 112, 106, "Arena", JackO, 1);
monster("032-3", 28, 124, "Arena", JackO, 1);
monster("032-3", 46, 124, "Arena", JackO, 1);
monster("032-3", 64, 130, "Arena", JackO, 1);
monster("032-3", 78, 130, "Arena", JackO, 1);
monster("032-3", 102, 130, "Arena", JackO, 1);
monster("032-3", 112, 130, "Arena", JackO, 1);
// The Red Arena
monster("032-3", 130, 106, "Arena", GoboBear, 1);
monster("032-3", 140, 106, "Arena", GoboBear, 1);
monster("032-3", 164, 106, "Arena", GoboBear, 1);
monster("032-3", 178, 106, "Arena", GoboBear, 1);
monster("032-3", 196, 124, "Arena", GoboBear, 1);
monster("032-3", 214, 124, "Arena", GoboBear, 1);
monster("032-3", 130, 130, "Arena", GoboBear, 1);
monster("032-3", 140, 130, "Arena", GoboBear, 1);
monster("032-3", 164, 130, "Arena", GoboBear, 1);
monster("032-3", 178, 130, "Arena", GoboBear, 1);
end;
}
032-3,121,85,0 script Central Switch#EP NPC_SWITCH_OFFLINE,{
.@m$ = getmap();
if (mobcount(.@m$, "all")) {
dispbottom l("Clear the arena to leave!");
end;
}
setnpcdisplay instance_npcname(.name$), NPC_SWITCH_ONLINE;
sleep2(1000);
warp "032-3", 121, 86;
setnpcdisplay instance_npcname(.name$), NPC_SWITCH_OFFLINE;
.@q = (getq(LoFQuest_EPISODE) == 15 ? getq2(LoFQuest_EPISODE) : 99);
if (.@q != 1) end;
if (@ep_id)
setq3 LoFQuest_EPISODE, getq3(LoFQuest_EPISODE) | @ep_id;
@ep_id=0;
if (getq3(LoFQuest_EPISODE) == 15)
setq LoFQuest_EPISODE, getq(LoFQuest_EPISODE), 2, 0;
end;
OnInit:
disablenpc .name$;
end;
OnInstanceInit:
.distance=2;
end;
}
032-3,118,82,0 script Green Switch#EP NPC_SWITCH_OFFLINE,{
.@q = (getq(LoFQuest_EPISODE) == 15 ? getq2(LoFQuest_EPISODE) : 99);
if (.@q != 1) end;
.@x = getq3(LoFQuest_EPISODE);
if (.@x & 1) { dispbottom l("I have already completed this arena."); end; }
mesc l("This switch controls one of the four dungeons.");
mesc l("All four Dungeons must be completed.");
mes "";
mesc l("Anyone within this rug will be teleported.");
mesc l("Time limit: 10 minutes"), 3;
mes "";
mesc l("Do you want to begin the %s Dungeon?", l("Green")), 1;
if (askyesno() == ASK_NO) { closeclientdialog; close; }
closeclientdialog;
setnpcdisplay .name$, NPC_SWITCH_ONLINE;
.@mapn$="epar@"+getcharid(0);
if (instanceowner(@episode) == getcharid(3)) {
instance_set_timeout(605, 605, @episode);
} else {
@episode = instance_create("Episode Arena "+getcharid(0), getcharid(3), IOT_CHAR);
if (@episode < 0) {
mesc l("You cannot begin this now, try again later."), 1;
@episode = 0;
close;
}
instance_attachmap("032-3", @episode, false, .@mapn$);
instance_set_timeout(900, 900, @episode);
instance_init(@episode);
}
sleep2(3000);
if (!playerattached()) end;
monster(.@mapn$, 28, 27, "Arena", GreenDragon, 1);
monster(.@mapn$, 46, 27, "Arena", GreenDragon, 1);
monster(.@mapn$, 64, 21, "Arena", GreenDragon, 1);
monster(.@mapn$, 78, 21, "Arena", GreenDragon, 1);
monster(.@mapn$, 64, 45, "Arena", GreenDragon, 1);
monster(.@mapn$, 78, 45, "Arena", GreenDragon, 1);
monster(.@mapn$, 102, 21, "Arena", GreenDragon, 1);
monster(.@mapn$, 112, 21, "Arena", GreenDragon, 1);
monster(.@mapn$, 102, 45, "Arena", GreenDragon, 1);
monster(.@mapn$, 112, 45, "Arena", GreenDragon, 1);
areatimer("032-3", 112, 76, 119, 83, 10, "Green Switch#EP::OnSet");
sleep2(50);
areawarp("032-3", 112, 76, 119, 83, .@mapn$, 32, 32, 41, 41);
setnpcdisplay .name$, NPC_SWITCH_OFFLINE;
sleep2(100);
close;
OnSet:
@ep_id=1;
end;
OnInit:
.distance=2;
end;
OnInstanceInit:
disablenpc instance_npcname(.name$);
end;
}
032-3,124,82,0 script Blue Switch#EP NPC_SWITCH_OFFLINE,{
.@q = (getq(LoFQuest_EPISODE) == 15 ? getq2(LoFQuest_EPISODE) : 99);
if (.@q != 1) end;
.@x = getq3(LoFQuest_EPISODE);
if (.@x & 2) { dispbottom l("I have already completed this arena."); end; }
mesc l("This switch controls one of the four dungeons.");
mesc l("All four Dungeons must be completed.");
mes "";
mesc l("Anyone within this rug will be teleported.");
mesc l("Time limit: 10 minutes"), 3;
mes "";
mesc l("Do you want to begin the %s Dungeon?", l("Blue")), 1;
if (askyesno() == ASK_NO) { closeclientdialog; close; }
closeclientdialog;
setnpcdisplay .name$, NPC_SWITCH_ONLINE;
.@mapn$="epar@"+getcharid(0);
if (instanceowner(@episode) == getcharid(3)) {
instance_set_timeout(605, 605, @episode);
} else {
@episode = instance_create("Episode Arena "+getcharid(0), getcharid(3), IOT_CHAR);
if (@episode < 0) {
mesc l("You cannot begin this now, try again later."), 1;
@episode = 0;
close;
}
instance_attachmap("032-3", @episode, false, .@mapn$);
instance_set_timeout(900, 900, @episode);
instance_init(@episode);
}
sleep2(3000);
if (!playerattached()) end;
monster(.@mapn$, 130, 21, "Arena", Moonshroom, 1);
monster(.@mapn$, 140, 21, "Arena", Moonshroom, 1);
monster(.@mapn$, 164, 21, "Arena", Moonshroom, 1);
monster(.@mapn$, 178, 21, "Arena", Moonshroom, 1);
monster(.@mapn$, 196, 27, "Arena", Moonshroom, 1);
monster(.@mapn$, 214, 27, "Arena", Moonshroom, 1);
monster(.@mapn$, 130, 45, "Arena", Moonshroom, 1);
monster(.@mapn$, 140, 45, "Arena", Moonshroom, 1);
monster(.@mapn$, 164, 45, "Arena", Moonshroom, 1);
monster(.@mapn$, 178, 45, "Arena", Moonshroom, 1);
areatimer("032-3", 123, 76, 130, 83, 10, "Blue Switch#EP::OnSet");
sleep2(50);
areawarp("032-3", 123, 76, 130, 83, .@mapn$, 200, 32, 210, 41);
setnpcdisplay .name$, NPC_SWITCH_OFFLINE;
sleep2(100);
close;
OnSet:
@ep_id=2;
end;
OnInit:
.distance=2;
end;
OnInstanceInit:
disablenpc instance_npcname(.name$);
end;
}
032-3,118,88,0 script Yellow Switch#EP NPC_SWITCH_OFFLINE,{
.@q = (getq(LoFQuest_EPISODE) == 15 ? getq2(LoFQuest_EPISODE) : 99);
if (.@q != 1) end;
.@x = getq3(LoFQuest_EPISODE);
if (.@x & 4) { dispbottom l("I have already completed this arena."); end; }
mesc l("This switch controls one of the four dungeons.");
mesc l("All four Dungeons must be completed.");
mes "";
mesc l("Anyone within this rug will be teleported.");
mesc l("Time limit: 10 minutes"), 3;
mes "";
mesc l("Do you want to begin the %s Dungeon?", l("Yellow")), 1;
if (askyesno() == ASK_NO) { closeclientdialog; close; }
closeclientdialog;
setnpcdisplay .name$, NPC_SWITCH_ONLINE;
.@mapn$="epar@"+getcharid(0);
if (instanceowner(@episode) == getcharid(3)) {
instance_set_timeout(605, 605, @episode);
} else {
@episode = instance_create("Episode Arena "+getcharid(0), getcharid(3), IOT_CHAR);
if (@episode < 0) {
mesc l("You cannot begin this now, try again later."), 1;
@episode = 0;
close;
}
instance_attachmap("032-3", @episode, false, .@mapn$);
instance_set_timeout(900, 900, @episode);
instance_init(@episode);
}
sleep2(3000);
if (!playerattached()) end;
monster(.@mapn$, 64, 108, "Arena", JackO, 1);
monster(.@mapn$, 78, 108, "Arena", JackO, 1);
monster(.@mapn$, 102, 108, "Arena", JackO, 1);
monster(.@mapn$, 112, 108, "Arena", JackO, 1);
monster(.@mapn$, 28, 126, "Arena", JackO, 1);
monster(.@mapn$, 46, 126, "Arena", JackO, 1);
monster(.@mapn$, 64, 132, "Arena", JackO, 1);
monster(.@mapn$, 78, 132, "Arena", JackO, 1);
monster(.@mapn$, 102, 132, "Arena", JackO, 1);
monster(.@mapn$, 112, 132, "Arena", JackO, 1);
areatimer("032-3", 112, 87, 119, 94, 10, "Yellow Switch#EP::OnSet");
sleep2(50);
areawarp("032-3", 112, 87, 119, 94, .@mapn$, 32, 131, 42, 140);
setnpcdisplay .name$, NPC_SWITCH_OFFLINE;
sleep2(100);
close;
OnSet:
@ep_id=4;
end;
OnInit:
.distance=2;
end;
OnInstanceInit:
disablenpc instance_npcname(.name$);
end;
}
032-3,124,88,0 script Red Switch#EP NPC_SWITCH_OFFLINE,{
.@q = (getq(LoFQuest_EPISODE) == 15 ? getq2(LoFQuest_EPISODE) : 99);
if (.@q != 1) end;
.@x = getq3(LoFQuest_EPISODE);
if (.@x & 8) { dispbottom l("I have already completed this arena."); end; }
mesc l("This switch controls one of the four dungeons.");
mesc l("All four Dungeons must be completed.");
mes "";
mesc l("Anyone within this rug will be teleported.");
mesc l("Time limit: 10 minutes"), 3;
mes "";
mesc l("Do you want to begin the %s Dungeon?", l("Red")), 1;
if (askyesno() == ASK_NO) { closeclientdialog; close; }
closeclientdialog;
setnpcdisplay .name$, NPC_SWITCH_ONLINE;
.@mapn$="epar@"+getcharid(0);
if (instanceowner(@episode) == getcharid(3)) {
instance_set_timeout(605, 605, @episode);
} else {
@episode = instance_create("Episode Arena "+getcharid(0), getcharid(3), IOT_CHAR);
if (@episode < 0) {
mesc l("You cannot begin this now, try again later."), 1;
@episode = 0;
close;
}
instance_attachmap("032-3", @episode, false, .@mapn$);
instance_set_timeout(900, 900, @episode);
instance_init(@episode);
}
sleep2(3000);
if (!playerattached()) end;
monster(.@mapn$, 130, 108, "Arena", GoboBear, 1);
monster(.@mapn$, 140, 108, "Arena", GoboBear, 1);
monster(.@mapn$, 164, 108, "Arena", GoboBear, 1);
monster(.@mapn$, 178, 108, "Arena", GoboBear, 1);
monster(.@mapn$, 196, 126, "Arena", GoboBear, 1);
monster(.@mapn$, 214, 126, "Arena", GoboBear, 1);
monster(.@mapn$, 130, 132, "Arena", GoboBear, 1);
monster(.@mapn$, 140, 132, "Arena", GoboBear, 1);
monster(.@mapn$, 164, 132, "Arena", GoboBear, 1);
monster(.@mapn$, 178, 132, "Arena", GoboBear, 1);
areatimer("032-3", 123, 87, 130, 94, 10, "Red Switch#EP::OnSet");
sleep2(50);
areawarp("032-3", 123, 87, 130, 94, .@mapn$, 200, 131, 210, 140);
setnpcdisplay .name$, NPC_SWITCH_OFFLINE;
sleep2(100);
close;
OnSet:
@ep_id=8;
end;
OnInit:
.distance=2;
end;
OnInstanceInit:
disablenpc instance_npcname(.name$);
end;
}