summaryrefslogblamecommitdiff
path: root/npc/023-3/logic.txt
blob: 0c6d7f85279c3d1e4981ab09e400620744a06f1a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                        
                    











































                                                        
                    







                                                                 












                                                                                       
 















                                                                       
                                                                 
























                                                                
 
                                                         















                                                                                                                                                                      
 



                                               
 
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//    023-3 Abandoned Ice Caves Configuration File

023-3	mapflag	zone	MMO

023-3,63,220,0	script	#Exit0233	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    .@q=getq(General_Narrator);
    .@q2=getq2(General_Narrator);
    // Cheater Detected
    if (.@q < 15) { 
        warp "Save", 0, 0;
        percentheal -100, -100;
        return false;
    }

	mesc l("Return to Frostia's Castle?");
	if (askyesno() == ASK_YES) {
		.@mapn$="024-16";
	    warp .@mapn$, 30, 26;
	}
	closeclientdialog;
	close;
}

023-3,48,22,0	script	#Finish0233	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    .@q=getq(General_Narrator);
    .@q2=getq2(General_Narrator);
    // Cheater Detected
    if (.@q < 13) { 
        warp "Save", 0, 0;
        percentheal -100, -100;
        return false;
    }

	.@mapn$="001-7";
    warp .@mapn$, 91, 90;
    end;
}

001-7,91,89,0	script	#Init0233	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    .@q=getq(General_Narrator);
    .@q2=getq2(General_Narrator);
    // Cheater Detected
    if (.@q < 13) { 
        warp "Save", 0, 0;
        percentheal -100, -100;
        return false;
    }
    if (.@q == 15) {
        dispbottom lg("I'm not a coward! I must press forward!");
        end;
    }
	.@mapn$="023-3";
    warp .@mapn$, 48, 23;
    end;
}

// A simple random treasure chest - to be sure players were introduced to this
// awesome system. Same rules as any treasure box still applies.
023-3,94,212,0	script	#chest_02330	NPC_CHEST,{

    TreasureBox();
    specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
    close;

OnInit:
    .distance = 2;
    end;
}


// Miniboss fight must be enabled on right npc. No passing before that.
023-3,120,103,0	script	#MiniBossTrap0233	NPC_HIDDEN,0,2,{
    end;

OnTouch:
    .@q=getq(FrostiaQuest_Homunculus);
    if (!.@q) {
        dispbottom l("A powerful magic barrier repels you!");
        getmapxy(.@m$, .@x, .@y, 0);
        slide .@x-2, .@y;
        sit();
    }
    end;
}


// TODO: The scout which went ahead of you (+ miniboss mechanics)
023-3,86,88,0	script	Elite Scout#MB0233	NPC_DARKSABER,{
    mesn;
    mesq l("Uhm, I'm looking for a way out...");
    close;

OnInit:
    .distance = 5;
    end;
}


// Cannot flee from Miniboss Fight
023-3,80,84,0	script	#MiniBossTrapB0233	NPC_HIDDEN,5,0,{
    end;

OnTouch:
    .@q=getq(FrostiaQuest_Homunculus);
    .@q2=getq(FrostiaQuest_Homunculus);
    if (!.@q && .@q2) {
        dispbottom l("A powerful magic barrier repels you!");
        slide 81, 86;
        sit();
    }
    end;
}

// A not-so-simple treasure chest from Sagratha's Dungeon
023-3,0,0,0	script	#0233ChestCtrl	NPC_HIDDEN,{
    end;

OnDelay:
    initnpctimer;
    end;

OnTimer180000:
    stopnpctimer;
OnInit:
    setarray .@x, 189, 191, 193, 186;
    setarray .@y,  44,  42,  43,  45;
    .@r=rand2(getarraysize(.@x));
    monster "023-3", .@x[.@r], .@y[.@r], "Treasure Chest", any(BronzeChest,BronzeMimic,SilverChest,SilverMimic,GoldenChest,GoldenMimic), 1, "#0233ChestCtrl::OnDelay";
    end;
}

// TODO: Spike traps and etc. at the corritor
// TODO: Monsters natural presence in this cave
// TODO: Rolling Stone Trap