// TMW2 scripts.
// Author:
// Jesusalva
// Description:
// The Impregnable Fortress Control Files
// Quest: General_Fortress
// (MaxFloor+2, internal, internal)
// The antechamber has some traps you should avoid, but beyond the Blood Pact map
// effect, it only has some support NPCs (banker and healer) if you completed the
// Moubootaur Showdown earlier.
// TODO: The main NPC which lets you get in here
// TODO: The boss chamber (also, are mapflags working? This should be a Blood Pact)
// TODO: Storage master, healer, etc.
026-6,21,70,0, script #026-6Gate NPC_FANCY_CIRCLE,1,0,{
if (getq(General_Fortress) < 6) { die(); end; }
mesc l(".:: Impregnable Fortress, %sF ::.", "B6"), 3;
msObjective($MK_TEMPVAR >= MKIF_LV_B7F, l("Minimum wins: %d/%d", $MK_TEMPVAR, MKIF_LV_B7F));
mes "";
mesc l("Hint: The Boss Chamber lies herein ahead.");
close;
L_Warp:
// Not unlocked
if ($GAME_STORYLINE >= 3 && $MK_TEMPVAR < MKIF_LV_B7F) {
mesc l("The gate is sealed shut."), 1;
mesc l("The monster army is still strong on this floor!"), 1;
mesc l("Minimum wins: %d/%d", $MK_TEMPVAR, MKIF_LV_B7F), 1;
close;
}
if (!$@MK_CHALLENGE && !islegendary() && strcharinfo(0) != $MOST_HEROIC$) {
dispbottom l("I should wait for %s or one of the heroes to challenge the Monster King.", $MOST_HEROIC$);
end;
}
doevent "#DungeonCore::OnBlood";
slide any(21, 22), 63;
end;
OnGoto:
slide 46, 114;
end;
OnInit:
.distance=3;
end;
}
026-6,22,40,0, script #MKBossFightFire NPC_HIDDEN,0,0,{
end;
OnTouch:
warp "026-7", 21, 28;
if (!$@MK_CHALLENGE) {
$@MK_CHALLENGE=true;
kamibroadcast(strcharinfo(0)+" has CHALLENGED the MONSTER KING to a SHOWDOWN!", "WORLD HEART");
sleep(2500);
kamibroadcast("The teleporter is now enabled... Get to positions!", "WORLD HEART");
sleep(5000);
kamibroadcast("It is... SHOWDOWN TIME!", "WORLD HEART");
sleep(2500);
donpcevent "Impregnable#B7F::OnBegin";
}
end;
}
// Room Traps, only against players
026-6,0,0,0 script #0266_Trap01 NPC_TRAP_ONLINE,0,0,{
end;
OnTouch:
OnTouchNPC:
WorldHeartTrap();
sleep(500); // Wait 500ms for animation
setnpcdisplay .name$, NPC_TRAP_ONLINE;
// Move the trap away after it disarms (up to 30 attempts)
OnInit:
.@e=0;
do {
if (.@e >= 30)
break;
.@x = rand2(21, 60);
.@y = rand2(21, 60);
.@e+=1;
} while (!checknpccell("026-6", .@x, .@y, cell_chkpass));
movenpc .name$, .@x, .@y;
end;
}
// Create more traps
026-6,0,0,0 duplicate(#0266_Trap01) #0266_Trap02 NPC_TRAP,0,0
026-6,0,0,0 duplicate(#0266_Trap01) #0266_Trap03 NPC_TRAP,0,0
026-6,0,0,0 duplicate(#0266_Trap01) #0266_Trap04 NPC_TRAP,0,0
026-6,0,0,0 duplicate(#0266_Trap01) #0266_Trap05 NPC_TRAP,0,0
026-6,0,0,0 duplicate(#0266_Trap01) #0266_Trap06 NPC_TRAP,0,0
026-6,0,0,0 duplicate(#0266_Trap01) #0266_Trap07 NPC_TRAP,0,0