summaryrefslogblamecommitdiff
path: root/npc/026-3/ctrl.c
blob: 820c50bb901ad8e49357a87cc2b30a5a43c25cc8 (plain) (tree)
1
2
3
4
5
6
7





                                           
                                    













                                                                           
                                                     




                    
                                                        


        
                                                                                                       
                                                

                                                                            
                                                                                                

                                                                                
          















                                                                     



                                                          


        



                                                                            
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//   The Impregnable Fortress Control Files
// Quest: General_Fortress
//  (MaxFloor+2, internal, internal)

// 0263Event(switchID)
function	script	0263Event	{
    // Terminate the script if you already flipped it (also to stop trolls)
    if (getq(General_Fortress) != 4) end;
    if (getq2(General_Fortress) & getarg(0)) {
        dispbottom l("I have already flipped this switch earlier.");
        end;
    }
    // Flip it for good
    setq2 General_Fortress, getq2(General_Fortress) | getarg(0);
    // And if all switches are flipped...!
    if (getq2(General_Fortress) == 15) {
        setq General_Fortress, 5, 0, 0;
        specialeffect(FX_MGWARP, SELF, getcharid(3));
    }
    return;
}

// The main entrance
026-3,55,128,0	script	Impregnable#B3F	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    dispbottom l("From this point forward, you'll no longer be able to return to the previous floor.");
    if (getq(General_Fortress) > 4) goto L_Warp;
    mesc l(".:: Impregnable Fortress, %sF ::.", "B3"), 3;
    msObjective(getq(General_Fortress) == 5, l("* Flip all four switches"));
    msObjective($MK_TEMPVAR >= MKIF_LV_B3F, l("Minimum wins: %d/%d", $MK_TEMPVAR, MKIF_LV_B4F));
    mes "";
    mesc l("Hint: You cannot unflip a switch, but they unflip every 12 hours.");
    close;

L_Warp:
    // Not unlocked
    if ($GAME_STORYLINE >= 3 && $MK_TEMPVAR < MKIF_LV_B4F) {
        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_B4F), 1;
        close;
    }
    //warp "026-4", X, Y;
    dispbottom l("Coming Soon, in Moubootaur Legends!");
    end;

// Reset the switches
OnClock0500:
OnClock1700:
	setnpcdisplay "#026-3_129_38", NPC_SWITCH_OFFLINE;
	setnpcdisplay "#026-3_59_86",  NPC_SWITCH_OFFLINE;
	setnpcdisplay "#026-3_94_80",  NPC_SWITCH_OFFLINE;
	setnpcdisplay "#026-3_53_59",  NPC_SWITCH_OFFLINE;
    end;
}


// TODO: Miller system (otherwise, you can't reach the switches & platforms)