summaryrefslogtreecommitdiff
path: root/npc/001-10/scripts.txt
blob: 305b298876689d5eb342c754144c224fd67bc1de (plain) (blame)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// TMW2 scripts.
// Authors:
//    Jesusalva
//    Dusty in a Bottle (aka. Dustynator, Dustman, mr. willbelz)
// Description:
//    Scripts for 001-10: Snipers, Bottles and Warps

// Boss room
001-10,89,43,0	script	#COD_BossRoomCheck	NPC_NO_SPRITE,0,0,{
    end;
OnTouch:
    if (!@COD_CHECKPOINT) {
        dispbottom l("Magic Barrier is active. You must give a whole circle on the desert to break it.");
    } else {
        deltimer("#COD_BossRoomCheck::OnTimeDefeat");
        addtimer(300000,"#COD_BossManager::OnTimeDefeat");
        // You can't return now!
        warp "001-10-1", any(57, 58, 59), any(74, 75);
        dispbottom l("A dangerous boss room, keep your guard up!");
    }
    end;

OnTimeDefeat:
    @COD_CHECKPOINT=0;
    if (getmap() ~= "001-10") {
        warp "018-2-1", 24, 29;
        dispbottom l("COD: Ran out of time!");
    }
    end;

}

// Magic Barrier
001-10,132,106,0	script	#COD_Checkpoint106	NPC_NO_SPRITE,0,0,{
    end;
OnTouch:
    getmapxy(.@m$, .@x, .@y, 0);
    slide .@x+2, .@y;
    if (!@COD_CHECKPOINT)
        dispbottom l("Checkpoint! Magic Barrier went down!");
    @COD_CHECKPOINT=1;
    end;
}

001-10,132,107,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint107	NPC_NO_SPRITE,0,0
001-10,132,108,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint108	NPC_NO_SPRITE,0,0
001-10,132,109,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint109	NPC_NO_SPRITE,0,0
001-10,132,110,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint110	NPC_NO_SPRITE,0,0
001-10,132,111,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint111	NPC_NO_SPRITE,0,0
001-10,132,112,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint112	NPC_NO_SPRITE,0,0
001-10,132,113,0	duplicate(#COD_Checkpoint106)	#COD_Checkpoint113	NPC_NO_SPRITE,0,0

001-10,0,0,0	script	#CODMASTER	NPC_NO_SPRITE,{
    end;
    function spawner { // (Event, x1, y1, x2, y2, Amount, modifier)
        .@ev$=getarg(0, "#CODMASTER::OnDeath");
        .@x1=getarg(1,0);
        .@y1=getarg(2,0);
        .@x2=getarg(3,200);
        .@y2=getarg(4,150);
        .@am=getarg(5,1);
        freeloop(true);
	    for (.@i = 0; .@i < .@am; ++.@i) {
            if (!getarg(6,0))
                .@monsterId=any(DustRifle, DustGatling, DustRevolver);
            else
                .@monsterId=any(AngryBat, Snake, AngryBat, DesertBandit, AngryBat, Sarracenus);
            areamonster("001-10", .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@monsterId), .@monsterId, 1, .@ev$);

        }
    }

// Death handlers
OnWLDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 20)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnWLDeath", 0, 0, 200, 150, 1, 1);
    end;

OnNDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 40)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnNDeath", 0, 10, 200, 25);
    end;

OnSDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 40)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnSDeath", 0, 129, 200, 150);
    end;

OnCDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 40)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnCDeath", 73, 45, 132, 86);
    end;

OnWDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 40)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnWDeath", 10, 25, 72, 122);
    end;

OnEDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 40)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnEDeath", 160, 45, 190, 130);
    end;

OnDeath:
    if (playerattached()) {
        if (rand2(0,1000) <= 40)
            getitem BottledDust, 1;
    }
    spawner("#CODMASTER::OnDeath");
    end;

/////////////////////////////////////////////////////////////////////////////////
///              on init block                 ////    on init block      //////
/////////////////////////////////////////////////////////////////////////////////
OnInit:
    // Spawn Wildlife
    spawner("#CODMASTER::OnWLDeath", 0, 0, 200, 150, 12, 1);

    // Spawn other monsters
    spawner("#CODMASTER::OnDeath", 0, 0, 200, 150, 3);
    spawner("#CODMASTER::OnNDeath", 0, 10, 200, 25, 5);
    spawner("#CODMASTER::OnSDeath", 0, 129, 200, 150, 3);
    spawner("#CODMASTER::OnCDeath", 73, 45, 132, 86, 4);
    spawner("#CODMASTER::OnWDeath", 10, 25, 72, 122, 5);
    spawner("#CODMASTER::OnEDeath", 160, 45, 190, 130, 4);

    end;
}