summaryrefslogtreecommitdiff
path: root/npc/001-1/eventmaster.txt
blob: f7630802a69f030d7b41a8719475da7f75ee32a5 (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  This GM NPC controls spawns and item drops on Aeros

001-1,250,20,0	script	Mana Being#001-1	NPC_ALIGE_OUTSIDE_BARREL,{
    function spawner { // (name, ID, amount)
        areamonster("001-1", 171, 0, 339, 158, getarg(0), getarg(1), getarg(2), "Mana Being#001-1::OnAerosMobDeath");
    }

    if (!is_gm()) goto L_Unauthorized;

    @log_spawns=0;
    @log_ratio=.coins_rate;

    mesn;
    mes "Tired of walking the whole Aeros to spawn monsters, I was brought to existence.";

L_Menu:
    mes "";
    mes "Please select operation.";
    menu
        "Abort",L_Close,
        "Start/End Event", L_EventHandler,
        "Spawn",L_Spawn,
        rif(countitem(StrangeCoin) >= 10, "Drop a Toothbrush! (10x Coins)"),L_Drop,
        "Adjust coins drop rate",L_Rate;

L_Unauthorized:
    dispbottom l("I am too far away to talk. Weird floating thingy...");
    end;

L_Close:
    if (@log_spawns > 0) logmes "spawned "+str(@log_spawns)+" beigns at Aeros.", LOGMES_ATCOMMAND;
    if (@log_ratio != .coins_rate) logmes "set aeros ratio from "+str(@log_ratio)+" to "+str(.coins_rate), LOGMES_ATCOMMAND;
    close;

L_Spawn:
    mes "";
    mes "Spawn from a preset (with intended levels) from this menu. Otherwise, use @aeros with same syntax.";
    mes "(agr) means Agressive Monsters on the set, DO NOT ABUSE.";
    next;
    select
        "Abort",                                                        // 1
        "20x Piou, Piousee, Ratto, 10x Croc",                           // 2
        "20x Little Blub, 10x Plushroom Field",                         // 3
        "(agr) 10x Tipiu, 10x Cave Maggot, 10x Bat",                    // 4
        "20x Scorpion, 10x Duck, 10x Maggot",                           // 5
        "10x Red Scorpion, 20x Fire Goblin, 5x Mana Ghost",             // 6
        "(agr) 1x Saxso Ghost, 20x House Maggot",                       // 7
        "(agr) 5x Slime Blast, 5x Red Slime, 10x White Slime",          // 8

        "(agr) 5x Mouboo, 4x Bandit, 2x Black Scorpion",                // 9
        "10x Giant Maggot, 10x Cave Snake, 10x Mana Bug",               // 10
        "1x Golden/Night Scorpion, 2x Santa Slime, 5x Copper Slime",    // 11
        "(agr) 2x Fallen Guards",                                       // 12

        "10x Clover Path, 5 groups of 5 random Bifs",                   // 13
        "5x Bifs, 4 groups of 5 random Bifs";                           // 14

    switch (@menu) {
        case 1:
            break;
        case 2:
            spawner(l("Piou"), 1002, 20);
            spawner(l("Piousee"), 1003, 20);
            spawner(l("Ratto"), 1005, 20);
            spawner(l("Croc"), 1006, 10);
            @log_spawns=@log_spawns+70;
            break;
        case 3:
            spawner(l("Little Blub"), 1007, 20);
            spawner(l("Plushroom Field"), 1011, 10);
            @log_spawns=@log_spawns+30;
            break;
        case 4:
            spawner(l("Tipiu"), 1015, 10);
            spawner(l("Cave Maggot"), 1027, 10);
            spawner(l("Bat"), 1039, 10);
            @log_spawns=@log_spawns+30;
            break;
        case 5:
            spawner(l("Scorpion"), 1071, 20);
            spawner(l("Duck"), 1029, 10);
            spawner(l("Maggot"), 1030, 10);
            @log_spawns=@log_spawns+40;
            break;
        case 6:
            spawner(l("Red Scorpion"), 1002, 10);
            spawner(l("Fire Goblin"), 1067, 20);
            spawner(l("Mana Ghost"), 1068, 5);
            @log_spawns=@log_spawns+35;
            break;
        case 7:
            spawner(l("Saxso Ghost"), 1076, 1);
            spawner(l("House Maggot"), 1084, 20);
            @log_spawns=@log_spawns+21;
            break;
        case 8:
            spawner(l("Slime Blast"), 1090, 5);
            spawner(l("Red Slime"), 1092, 5);
            spawner(l("White Slime"), 1094, 10);
            @log_spawns=@log_spawns+20;
            break;

        case 9:
            spawner(l("Mouboo"), 1023, 5);
            spawner(l("Bandit"), 1024, 4);
            spawner(l("Black Scorpion"), 1074, 2);
            @log_spawns=@log_spawns+11;
            break;
        case 10:
            spawner(l("Giant Maggot"), 1031, 10);
            spawner(l("Cave Snake"), 1035, 10);
            spawner(l("Mana Bug"), 1075, 10);
            @log_spawns=@log_spawns+30;
            break;
        case 11:
            spawner(l("Golden Scorpion"), 1078, 1);
            spawner(l("Night Scorpion"), 1077, 1);
            spawner(l("Santa Slime"), 1096, 5);
            spawner(l("Copper Slime"), 1088, 10);
            @log_spawns=@log_spawns+17;
            break;
        case 12:
            spawner(l("Frostia Guard"), 1081, 1);
            spawner(l("Halinarzo Guard"), 1082, 1);
            @log_spawns=@log_spawns+2;
            break;

        //"10x Clover Path, 5 groups of 5 random Bifs",                   // 13
        //"5x Bifs, 4 groups of 5 random Bifs";                           // 14
        case 13:
            spawner(l("Clover Field"), 1028, 10);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            @log_spawns=@log_spawns+35;
            break;
        case 14:
            spawner(l("Bif"), 1058, 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            spawner(l("Mysterious Bif"), rand(1098,1118), 5);
            @log_spawns=@log_spawns+25;
            break;
    }

    if (@menu == 1) goto L_Menu;
    mes "";
    mes "Completed.";
    mes "Total spawns: "+str(@log_spawns);
    next;
    goto L_Spawn;

L_Drop:
    delitem(StrangeCoin,10);
    makeitem(Toothbrush, 1, "001-1", rand(171,319), rand(20,138));
    mes "";
    mes "Dropped.";
    next;
    goto L_Menu;

L_Rate:
    mes "";
    mes "Current drop rate: " + str(.coins_rate);
    mes "Insert drop rate (from 0 to 10000, capped at 5000 or 50%). Use -1 to disable.";
    input .coins_rate;
    if (.coins_rate > 5000)
        .coins_rate=5000;
    mes "";
    mes "Ratio adjusted.";
    next;
    goto L_Menu;

L_EventHandler:
    if($@GM_EVENT) {
        announce l("The event is over!"), bc_all|bc_npc; // I haven't tested this yet.
        $@GM_EVENT=0;
    } else {
        announce l("The mana bridge to Aeros is open! To participate on event, talk to ##BSoul Menhir##b!"), bc_all|bc_npc;
        $@GM_EVENT=1;
    }
    close;

OnAerosMobDeath:
    if (.coinsrate < 0) end;
    // A level 100 monster can have a 4% drop bonus against a level 0 monster.
    // .coins_rate acts stablishing a basic drop value. Advised value: 600 (up to 10% for normal mobs)
    if (rand(10000) <= .coins_rate + (atoi(strmobinfo(3,killedrid))*4))
        getitem StrangeCoin, 1;
    end;

OnInit:
    .coins_rate=600; // Default value is 6% + mob str bonus
    end;
}



-	script	@aeros	32767,{
    end;

OnCall:
    if (!is_admin())
        end;
    if (getmapname() != "001-1") {
        dispbottom "This command can only be used at aeros.";
        end;
    }
    //.@atcmd_parameters$ = strtoupper(strip( // nah

    if (.@atcmd_numparameters != 2) {
        dispbottom "Use the numeric ID provided by the wiki. This is a safeguard to ensure you are not overkilling players.";
        dispbottom "Talk to Mana Being for a less fine-grained but much more optimized control over monsters.";
        dispbottom "This command takes exactly this syntax: Mob ID <space> amount.";
        end;
    }

    areamonster("001-1", 171, 0, 339, 158, "Monster", atoi(.@atcmd_parameters$[0]), atoi(.@atcmd_parameters$[1]), "Mana Being#001-1::OnAerosMobDeath");
    logmes "@aeros "+.@atcmd_parameters$, LOGMES_ATCOMMAND;
    dispbottom "All monsters summoned.";

    end;

OnInit:
    bindatcmd "aeros", "@aeros::OnCall", 99, 99, 0;
}