summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/map/maps.conf1
-rw-r--r--db/map_index.txt417
-rw-r--r--maps/re/018-5-6.mcachebin0 -> 80 bytes
-rw-r--r--maps/re/018-5.mcachebin719 -> 720 bytes
-rw-r--r--npc/018-5-6/_import.txt5
-rw-r--r--npc/018-5-6/_warps.txt3
-rw-r--r--npc/018-5-6/doorbell.txt336
-rw-r--r--npc/018-5-6/utils.txt72
-rw-r--r--npc/018-5/_import.txt1
-rw-r--r--npc/018-5/estate.txt95
-rw-r--r--npc/020-1/_mobs.txt3
-rw-r--r--npc/020-1/estate.txt2
-rw-r--r--npc/_import.txt1
-rw-r--r--npc/functions/estate2.txt4
14 files changed, 731 insertions, 209 deletions
diff --git a/conf/map/maps.conf b/conf/map/maps.conf
index da75a819f..c9fea79a5 100644
--- a/conf/map/maps.conf
+++ b/conf/map/maps.conf
@@ -216,6 +216,7 @@ map_list: (
"018-5-3",
"018-5-4",
"018-5-5",
+ "018-5-6",
"018-5-boss",
"018-5",
"018-6-0",
diff --git a/db/map_index.txt b/db/map_index.txt
index 700e0ad02..2d6bb92b1 100644
--- a/db/map_index.txt
+++ b/db/map_index.txt
@@ -213,211 +213,212 @@
018-5-3 213
018-5-4 214
018-5-5 215
-018-5-boss 216
-018-5 217
-018-6-0 218
-018-6-1 219
-018-6-2 220
-018-6-3 221
-018-7-1 222
-018-7 223
-018-8 224
-019-1-1 225
-019-1 226
-019-2 227
-019-3 228
-019-4-1 229
-019-4 230
-019-5-1 231
-019-5-2 232
-019-5-3 233
-019-5 234
-019-6 235
-020-1 236
-020-2 237
-020-3 238
-020-4 239
-020-5 240
-020-6 241
-020-7-1 242
-020-7-2 243
-020-7 244
-020-8 245
-021-0 246
-021-1 247
-021-2 248
-021-3 249
-021-4 250
-022-1 251
-023-1 252
-023-2 253
-023-3-1 254
-023-3-2 255
-023-3 256
-023-4 257
-024-1 258
-024-10 259
-024-11 260
-024-12 261
-024-13 262
-024-14 263
-024-15 264
-024-16 265
-024-2 266
-024-3 267
-024-4 268
-024-5 269
-024-6 270
-024-7 271
-024-8 272
-024-9 273
-025-1 274
-025-2-1 275
-025-2-2 276
-025-2-3 277
-025-2-4 278
-025-2 279
-025-3 280
-025-4-1 281
-025-4 282
-026-0 283
-026-1 284
-026-2 285
-026-3 286
-026-6 287
-026-7 288
-027-0 289
-027-1 290
-027-2 291
-027-3 292
-027-4 293
-027-5 294
-027-6 295
-027-7 296
-029-0 297
-029-1 298
-029-2 299
-029-3 300
-029-4 301
-029-5 302
-029-6 303
-029-7 304
-029-8 305
-029-9 306
-030-01 307
-030-02 308
-030-03 309
-030-04 310
-030-05 311
-030-06 312
-030-07 313
-030-08 314
-030-09 315
-030-10 316
-030-11 317
-030-12 318
-030-13 319
-030-14 320
-030-15 321
-030-16 322
-030-17 323
-030-18 324
-030-19 325
-030-20 326
-030-21 327
-030-22 328
-030-23 329
-030-24 330
-030-25 331
-030-26 332
-030-27 333
-030-28 334
-030-29 335
-030-30 336
-030-31 337
-030-32 338
-030-33 339
-030-34 340
-030-35 341
-030-36 342
-030-37 343
-030-38 344
-030-39 345
-030-40 346
-030-41 347
-030-42 348
-030-43 349
-030-44 350
-030-45 351
-030-46 352
-030-47 353
-030-48 354
-030-49 355
-030-50 356
-030-51 357
-030-52 358
-030-53 359
-030-54 360
-030-55 361
-030-56 362
-030-57 363
-030-58 364
-030-59 365
-030-60 366
-030-61 367
-030-62 368
-030-63 369
-030-64 370
-030-65 371
-030-66 372
-030-67 373
-030-68 374
-030-69 375
-030-70 376
-030-71 377
-030-72 378
-030-73 379
-030-74 380
-030-75 381
-031-0 382
-031-1 383
-031-2 384
-031-3 385
-031-4 386
-031-5 387
-031-6 388
-031-7 389
-031-8 390
-031-9 391
-032-1 392
-032-2 393
-032-3 394
-032-4 395
-032-5 396
-033-1 397
-033-2 398
-033-3 399
-033-4 400
-033-5 401
-034-1 402
-034-2 403
-034-3 404
-034-4 405
-042-0 406
-042-1 407
-042-10 408
-042-11 409
-042-2 410
-042-3 411
-042-4 412
-042-5 413
-042-6 414
-042-7 415
-042-8 416
-042-9 417
-boss 418
-botcheck 419
-guilds 420
-sec_pri 421
-soren-2 422
-soren 423
+018-5-6 216
+018-5-boss 217
+018-5 218
+018-6-0 219
+018-6-1 220
+018-6-2 221
+018-6-3 222
+018-7-1 223
+018-7 224
+018-8 225
+019-1-1 226
+019-1 227
+019-2 228
+019-3 229
+019-4-1 230
+019-4 231
+019-5-1 232
+019-5-2 233
+019-5-3 234
+019-5 235
+019-6 236
+020-1 237
+020-2 238
+020-3 239
+020-4 240
+020-5 241
+020-6 242
+020-7-1 243
+020-7-2 244
+020-7 245
+020-8 246
+021-0 247
+021-1 248
+021-2 249
+021-3 250
+021-4 251
+022-1 252
+023-1 253
+023-2 254
+023-3-1 255
+023-3-2 256
+023-3 257
+023-4 258
+024-1 259
+024-10 260
+024-11 261
+024-12 262
+024-13 263
+024-14 264
+024-15 265
+024-16 266
+024-2 267
+024-3 268
+024-4 269
+024-5 270
+024-6 271
+024-7 272
+024-8 273
+024-9 274
+025-1 275
+025-2-1 276
+025-2-2 277
+025-2-3 278
+025-2-4 279
+025-2 280
+025-3 281
+025-4-1 282
+025-4 283
+026-0 284
+026-1 285
+026-2 286
+026-3 287
+026-6 288
+026-7 289
+027-0 290
+027-1 291
+027-2 292
+027-3 293
+027-4 294
+027-5 295
+027-6 296
+027-7 297
+029-0 298
+029-1 299
+029-2 300
+029-3 301
+029-4 302
+029-5 303
+029-6 304
+029-7 305
+029-8 306
+029-9 307
+030-01 308
+030-02 309
+030-03 310
+030-04 311
+030-05 312
+030-06 313
+030-07 314
+030-08 315
+030-09 316
+030-10 317
+030-11 318
+030-12 319
+030-13 320
+030-14 321
+030-15 322
+030-16 323
+030-17 324
+030-18 325
+030-19 326
+030-20 327
+030-21 328
+030-22 329
+030-23 330
+030-24 331
+030-25 332
+030-26 333
+030-27 334
+030-28 335
+030-29 336
+030-30 337
+030-31 338
+030-32 339
+030-33 340
+030-34 341
+030-35 342
+030-36 343
+030-37 344
+030-38 345
+030-39 346
+030-40 347
+030-41 348
+030-42 349
+030-43 350
+030-44 351
+030-45 352
+030-46 353
+030-47 354
+030-48 355
+030-49 356
+030-50 357
+030-51 358
+030-52 359
+030-53 360
+030-54 361
+030-55 362
+030-56 363
+030-57 364
+030-58 365
+030-59 366
+030-60 367
+030-61 368
+030-62 369
+030-63 370
+030-64 371
+030-65 372
+030-66 373
+030-67 374
+030-68 375
+030-69 376
+030-70 377
+030-71 378
+030-72 379
+030-73 380
+030-74 381
+030-75 382
+031-0 383
+031-1 384
+031-2 385
+031-3 386
+031-4 387
+031-5 388
+031-6 389
+031-7 390
+031-8 391
+031-9 392
+032-1 393
+032-2 394
+032-3 395
+032-4 396
+032-5 397
+033-1 398
+033-2 399
+033-3 400
+033-4 401
+033-5 402
+034-1 403
+034-2 404
+034-3 405
+034-4 406
+042-0 407
+042-1 408
+042-10 409
+042-11 410
+042-2 411
+042-3 412
+042-4 413
+042-5 414
+042-6 415
+042-7 416
+042-8 417
+042-9 418
+boss 419
+botcheck 420
+guilds 421
+sec_pri 422
+soren-2 423
+soren 424
diff --git a/maps/re/018-5-6.mcache b/maps/re/018-5-6.mcache
new file mode 100644
index 000000000..2cae43ce3
--- /dev/null
+++ b/maps/re/018-5-6.mcache
Binary files differ
diff --git a/maps/re/018-5.mcache b/maps/re/018-5.mcache
index 89e333992..3f2591b9d 100644
--- a/maps/re/018-5.mcache
+++ b/maps/re/018-5.mcache
Binary files differ
diff --git a/npc/018-5-6/_import.txt b/npc/018-5-6/_import.txt
new file mode 100644
index 000000000..ea093fe0f
--- /dev/null
+++ b/npc/018-5-6/_import.txt
@@ -0,0 +1,5 @@
+// Map 018-5-6: Real Estate
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/018-5-6/_warps.txt",
+"npc/018-5-6/doorbell.txt",
+"npc/018-5-6/utils.txt",
diff --git a/npc/018-5-6/_warps.txt b/npc/018-5-6/_warps.txt
new file mode 100644
index 000000000..a1ec97d78
--- /dev/null
+++ b/npc/018-5-6/_warps.txt
@@ -0,0 +1,3 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 018-5-6: Real Estate warps
+018-5-6,34,34,0 warp #018-5-6_34_34 1,0,018-5,85,53
diff --git a/npc/018-5-6/doorbell.txt b/npc/018-5-6/doorbell.txt
new file mode 100644
index 000000000..985f5d4e5
--- /dev/null
+++ b/npc/018-5-6/doorbell.txt
@@ -0,0 +1,336 @@
+// TMW2: Moubootaur Legends scripts.
+// Author:
+// Jesusalva
+// Description:
+// Real Estate System
+// Doorbell allows you to purchase mobilia, besides loading it when server starts
+// Each layer can have 32 different furniture pieces because bitmask limit.
+// This file is custom to every room
+
+// ID: 7
+// $ESTATE_OWNER[.id] → Account ID owner of the Real Estate
+// $ESTATE_OWNERNAME$[.id] → Human readable name of Real Estate owner
+// $ESTATE_RENTTIME[.id] → When the rent will expire
+// $ESTATE_MOBILIA_2[.id] → Bitmask of mobilia currently purchased on Monster Collision (6) (Use on walls only)
+// $ESTATE_MOBILIA_4[.id] → Bitmask of mobilia currently purchased on Air Collision (2)
+// $ESTATE_MOBILIA_8[.id] → Bitmask of mobilia currently purchased on Water Collision (3)
+// $ESTATE_MOBILIA_32[.id] → Bitmask of mobilia currently purchased on Yellow Collision (4)
+// $ESTATE_MOBILIA_64[.id] → Bitmask of mobilia currently purchased on Normal Collision (1)
+// $ESTATE_MOBILIA_128[.id] → Bitmask of mobilia currently purchased on Player Collision (5)
+// $ESTATE_PASSWORD$[.id] → Password to enter the estate. If it is "", then no password required
+// Note: GMs and Administrators can always use super password "mouboo" to enter a locked estate
+// $ESTATE_DOORBELL[.id] → If doorbell is disabled (enabled by default)
+
+// REAL_ESTATE_CREDITS → Credits equivalent to GP the player have. Will be used first.
+
+// The sign is the main controller
+018-5-6,32,34,0 script Doorbell#RES_0185 NPC_NO_SPRITE,{
+ // Name, Layer, Price, ID, x1, y1, x2, y2,
+ function create_object {
+ array_push(.nams$, getarg(0));
+ array_push(.layer, getarg(1));
+ array_push(.price, getarg(2));
+ array_push(.objid, getarg(3));
+ array_push(.x1, getarg(4));
+ array_push(.y1, getarg(5));
+ array_push(.x2, getarg(6));
+ array_push(.y2, getarg(7));
+ return;
+ }
+
+ if ($ESTATE_OWNER[.id] == getcharid(3))
+ goto L_Manage;
+
+ mesc l("This estate currently belongs to @@.", $ESTATE_OWNERNAME$[.id]);
+ close;
+
+// When using setcells() a player could get trapped!
+// This label will slide the player back to entrance, which should be a safe spot
+OnSlide:
+ slide 33, 33;
+ end;
+
+// If someone press the doorbell from outside and doorbell is enabled
+OnDoorbell:
+ if ($ESTATE_DOORBELL[.id])
+ end;
+
+ if (.dpost < gettimetick(2)) {
+ npctalk (strcharinfo(0)+" is pressing the doorbell."); // We actually don't want l()
+ }
+ .dpost=gettimetick(2)+.delay;
+ end;
+
+// Managment Menu
+L_Manage:
+ mesc l("@@'s Estate", strcharinfo(0));
+ mesc ".:: "+ l("Managment Menu") + " ::.";
+
+ .@gp=REAL_ESTATE_CREDITS+Zeny;
+ mesc l("Rent time available: @@", FuzzyTime($ESTATE_RENTTIME[.id]));
+ mesc l("Total Credits and GP: @@", format_number(.@gp));
+ mes "";
+ mesc l("Room password: @@", $ESTATE_PASSWORD$[.id]);
+ if ($ESTATE_DOORBELL[.id])
+ mesc l("Doorbell is disabled"), 1;
+
+ next;
+ select
+ l("Leave"),
+ l("Enable/disable doorbell"),
+ l("Manage Furniture"),
+ l("Set room password");
+
+ switch (@menu) {
+ case 1:
+ close;
+ break;
+ case 2:
+ $ESTATE_DOORBELL[.id]=!$ESTATE_DOORBELL[.id];
+ break;
+ case 3:
+ goto L_Furniture;
+ break;
+ case 4:
+ mesc l("(Leave the password blank to disable)");
+ mesc l("Current Room password: @@", $ESTATE_PASSWORD$[.id]);
+ mesc l("Input new password: ");
+ input .@password$;
+ mesc l("Repeat new password: ");
+ input .@passwordc$;
+ if (.@password$ == .@passwordc$) {
+ $ESTATE_PASSWORD$[.id]=.@password$;
+ mesc l("Password changed with success!"), 3;
+ } else {
+ mesc l("The passwords doesn't match."), 1;
+ }
+ break;
+ }
+ goto L_Manage;
+
+L_Furniture:
+ mesc l("@@'s Estate", strcharinfo(0));
+ mesc ".:: "+ l("Furniture Menu") + " ::.";
+
+ .@gp=REAL_ESTATE_CREDITS+Zeny;
+ mesc l("Total Credits and GP: @@", format_number(.@gp));
+
+ next;
+ select
+ l("Finish"),
+ l("Manage Beds"),
+ l("Manage Utilities"),
+ l("Manage Luxury furniture"),
+ l("Manage Decoration"),
+ l("Manage Chairs"),
+ l("Manage Paintings");
+ mes "";
+
+ switch (@menu) {
+ case 1:
+ goto L_Manage;
+ break;
+ case 2:
+ mesc ".:: "+ l("Beds") + " ::.", 3;
+ @re_col=RES_OBJECTS;
+ break;
+ case 3:
+ mesc ".:: "+ l("Utilities") + " ::.", 3;
+ @re_col=RES_UTILITIES;
+ break;
+ case 4:
+ mesc ".:: "+ l("Luxury furniture") + " ::.", 3;
+ @re_col=RES_LUXURY;
+ break;
+ case 5:
+ mesc ".:: "+ l("Decoration") + " ::.", 3;
+ @re_col=RES_DECORATION;
+ break;
+ case 6:
+ mesc ".:: "+ l("Chairs") + " ::.", 3;
+ @re_col=RES_SITTABLE;
+ break;
+ case 7:
+ mesc ".:: "+ l("Paintings") + " ::.", 3;
+ @re_col=RES_WALLDECORATION;
+ break;
+ }
+
+// L_ContinuousLoop
+// Requires the following variables:
+// @re_col
+// Target Collision ID
+L_ContinuousLoop:
+ deletearray @valid_ids;
+
+ // Create a second array (@valid_ids) with the ID of objects within @re_col group
+ for (.@i=0; .@i < getarraysize(.layer); .@i++) {
+ //debugmes "Found object ID %d named %s on layer %s coords (%d,%d) - Looking for layer %d", .@i, .nams$[.@i], .layer[.@i], .x1[.@i], .y1[.@i], @re_col;
+ if (.layer[.@i] == @re_col)
+ array_push(@valid_ids, .@i);
+ }
+ //debugmes "Found %d valid objects", getarraysize(@valid_ids);
+
+ // Create the menu with @valid_ids - Check if you already have the item to decide if you're buying or selling
+ @menuentries$="Finish:";
+ for (.@j=0; .@j < getarraysize(@valid_ids); .@j++) {
+ .@i=@valid_ids[.@j];
+ if (realestate_hasmobilia(.id, .layer[.@i], .objid[.@i]))
+ @menuentries$+=l("Sell ")+.nams$[.@i]+l(" for ") + format_number( realestate_sellprice(.id,.price[.@i]) ) +":";
+ else
+ @menuentries$+=l("Purchase ")+.nams$[.@i]+(" for ") + format_number( .price[.@i] )+":";
+ }
+ select (@menuentries$);
+ mes "";
+
+ // First option to return to previous menu
+ if (@menu == 1)
+ goto L_Furniture;
+
+ // Otherwise, we know then that (@menu-2) is the ID in @valid_ids
+ // So we save .@id with the correct ID in object arrays.
+ // We also calculate how much aggregated money you have.
+ .@id=@valid_ids[@menu-2];
+ .@gp=REAL_ESTATE_CREDITS+Zeny;
+
+ if (realestate_hasmobilia(.id, .layer[.@id], .objid[.@id])) {
+ // If you have the mobilia, you're selling it for Mobiliary Credits
+ delcells realestate_cellname(.id, .@id);
+ realestate_togglemobilia(.id, .layer[.@id], .objid[.@id], "NPCs#RES_0128");
+ REAL_ESTATE_CREDITS+=realestate_sellprice(.id,.price[.@i]);
+ mesc l("Sale successful!");
+ next;
+ } else {
+ // Else, you're buying it, so we must check if you have the moolah first
+ .@price=.price[.@id];
+ if (.@gp > .@price) {
+ realestate_payment(.@price);
+ setcells .mapa$, .x1[.@id], .y1[.@id], .x2[.@id], .y2[.@id], .layer[.@id], realestate_cellname(.id, .@id);
+ areatimer(.mapa$, .x1[.@id], .y1[.@id], .x2[.@id], .y2[.@id], 10, "::OnSlide");
+ realestate_togglemobilia(.id, .layer[.@id], .objid[.@id], "NPCs#RES_0128");
+ mesc l("Purchase successful!");
+ next;
+ } else {
+ mesc l("Not enough funds!");
+ next;
+ }
+ }
+
+ // This loops forever
+ goto L_ContinuousLoop;
+
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 3;
+
+ // Estate Settings
+ .id=7; // Estate ID
+ .delay=15; // Forced wait between rings
+ .dpost=0; // Last doorbell ring
+ .mapa$="018-5-7";
+
+ // Arrays
+ // We go element by element on the array building the menu
+ .nams$="";
+ .layer=0;
+ .price=0;
+ .objid=0;
+ .x1=0;
+ .y1=0;
+ .x2=0;
+ .y2=0;
+
+ // Furniture Settings
+ // Name, Collision Layer, Price, ID, x1, y1, x2, y2
+ // For Collision Layer, see constants.conf ("Real Estate Collisions")
+ create_object("Placeholder" ,99,999999,99999, 99, 99, 99, 99);
+
+ create_object("Bed 01" , 5, 5000, 1, 24, 24, 25, 27);
+ create_object("Bed 02" , 5, 5000, 2, 26, 24, 27, 27);
+ create_object("Bed 03" , 5, 5000, 4, 28, 24, 29, 27);
+ create_object("Bed 04" , 5, 5000, 8, 30, 24, 31, 27);
+ create_object("Bed 05" , 5, 5000, 16, 24, 29, 25, 32);
+ create_object("Bed 06" , 5, 5000, 32, 26, 29, 27, 32);
+ create_object("Bed 07" , 5, 5000, 64, 28, 29, 29, 32);
+ create_object("Bed 08" , 5, 5000, 128, 30, 29, 31, 32);
+
+ create_object("Wardrobe" , 1, 7000, 1, 21, 23, 22, 23);
+ create_object("Cauldron" , 1, 5000, 2, 28, 24, 29, 24);
+ create_object("Shelf 01" , 1, 2000, 4, 25, 23, 25, 23);
+ create_object("Shelf 02" , 1, 2000, 8, 26, 23, 26, 23);
+ create_object("Shelf 03" , 1, 2000, 16, 27, 23, 27, 23);
+ create_object("Shelf 04" , 1, 2000, 32, 30, 23, 30, 23);
+ create_object("Shelf 05" , 1, 2000, 64, 31, 23, 31, 23);
+ create_object("Shelf 06" , 1, 2000, 128, 32, 23, 32, 23);
+ create_object("Shelf 07" , 1, 2000, 256, 33, 23, 33, 23);
+ create_object("Shelf 08" , 1, 2000, 512, 34, 23, 34, 23);
+ create_object("Shelf 09" , 1, 2000, 1024, 35, 23, 35, 23);
+ create_object("Shelf 10" , 1, 2000, 2048, 36, 23, 36, 23);
+ create_object("Shelf 11" , 1, 2000, 4096, 37, 23, 37, 23);
+ create_object("Shelf 12" , 1, 2000, 8192, 38, 23, 38, 23);
+
+ create_object("Piano" , 3, 10000, 1, 33, 25, 35, 25);
+ create_object("Stove" , 3, 40000, 2, 23, 24, 24, 24);
+
+ create_object("Left Desk" , 2, 5000, 1, 20, 25, 22, 27);
+ create_object("Right Desk" , 2, 5000, 2, 36, 30, 38, 32);
+
+ create_object("Left Chair" , 4, 2000, 1, 21, 28, 21, 28);
+ create_object("Right Chair" , 4, 2000, 2, 37, 29, 37, 29);
+
+ create_object("Painting 01" , 6, 3000, 1, 21, 20, 21, 20);
+ create_object("Painting 02" , 6, 3000, 2, 23, 21, 23, 21);
+ create_object("Painting 03" , 6, 3000, 4, 25, 20, 25, 20);
+ create_object("Painting 04" , 6, 3000, 8, 28, 21, 28, 21);
+ create_object("Painting 05" , 6, 3000, 16, 31, 20, 31, 20);
+ create_object("Painting 06" , 6, 3000, 32, 36, 20, 36, 20);
+
+ // Load Mobilia already existing
+ //debugmes "[REAL ESTATE] Now loading mobilia";
+ for (.@i=0; .@i < getarraysize(.layer); .@i++) {
+ switch (.layer[.@i]) {
+ case 1:
+ if ($ESTATE_MOBILIA_64[.id] & .objid[.@i])
+ array_push(.valid_ids, .@i);
+ break;
+ case 2:
+ if ($ESTATE_MOBILIA_4[.id] & .objid[.@i])
+ array_push(.valid_ids, .@i);
+ break;
+ case 3:
+ if ($ESTATE_MOBILIA_8[.id] & .objid[.@i])
+ array_push(.valid_ids, .@i);
+ break;
+ case 4:
+ if ($ESTATE_MOBILIA_32[.id] & .objid[.@i])
+ array_push(.valid_ids, .@i);
+ break;
+ case 5:
+ if ($ESTATE_MOBILIA_128[.id] & .objid[.@i])
+ array_push(.valid_ids, .@i);
+ break;
+ case 6:
+ if ($ESTATE_MOBILIA_2[.id] & .objid[.@i])
+ array_push(.valid_ids, .@i);
+ break;
+ default:
+ // We do nothing by default
+ //debugmes("[ERROR] [CRITICAL] [REAL ESTATE]: Object %d have Invalid Collision Type: %d (must range 1~6)", .@i, .layer[.@i]);
+ break;
+ }
+ }
+ //debugmes "Found %d valid objects", getarraysize(.valid_ids);
+ for (.@j=0; .@j < getarraysize(.valid_ids); .@j++) {
+ .@id=.valid_ids[.@j];
+ setcells .mapa$, .x1[.@id], .y1[.@id], .x2[.@id], .y2[.@id], .layer[.@id], realestate_cellname(.id, .@id);
+ //debugmes "Creating %s in %s", realestate_cellname(.id, .@id), .mapa$;
+ }
+ deletearray .valid_ids;
+ // Load NPCs
+ donpcevent "NPCs#RES_0185::OnReload";
+ end;
+
+}
+
+
diff --git a/npc/018-5-6/utils.txt b/npc/018-5-6/utils.txt
new file mode 100644
index 000000000..189bc2d55
--- /dev/null
+++ b/npc/018-5-6/utils.txt
@@ -0,0 +1,72 @@
+// TMW2: Moubootaur Legends scripts.
+// Author:
+// Jesusalva
+// Description:
+// Real Estate System
+// Utils take care of NPCs - Their code, and enable/disable using check_cell
+// This file is custom to every room
+
+// ID: 7
+// $ESTATE_OWNER[.id] → Account ID owner of the Real Estate
+// $ESTATE_OWNERNAME$[.id] → Human readable name of Real Estate owner
+// $ESTATE_RENTTIME[.id] → When the rent will expire
+// $ESTATE_MOBILIA_2[.id] → Bitmask of mobilia currently purchased on Monster Collision (6) (Use on walls only)
+// $ESTATE_MOBILIA_4[.id] → Bitmask of mobilia currently purchased on Air Collision (2)
+// $ESTATE_MOBILIA_8[.id] → Bitmask of mobilia currently purchased on Water Collision (3)
+// $ESTATE_MOBILIA_32[.id] → Bitmask of mobilia currently purchased on Yellow Collision (4)
+// $ESTATE_MOBILIA_64[.id] → Bitmask of mobilia currently purchased on Player Collision (5)
+// $ESTATE_MOBILIA_128[.id] → Bitmask of mobilia currently purchased on Normal Collision (1)
+// $ESTATE_PASSWORD$[.id] → Password to enter the estate. If it is "", then no password required
+// Note: GMs and Administrators can always use super password "mouboo" to enter a locked estate
+// $ESTATE_DOORBELL[.id] → If doorbell is disabled (enabled by default)
+
+// REAL_ESTATE_CREDITS → Credits equivalent to GP the player have. Will be used first.
+
+// Real Estate NPCs and settings
+// The sign is the main controller for rent system
+// Doorbell is the main controller for indoor
+// This is the NPC script controller
+018-5-6,0,0,0 script NPCs#RES_0185 NPC_HIDDEN,{
+ // load_npc ( name , map, x , y{, cell} )
+ function load_npc {
+ if (checknpccell(getarg(1), getarg(2), getarg(3), getarg(4, cell_chknopass))) {
+ enablenpc getarg(0);
+ //debugmes "ENABLING NPC %s", getarg(0);
+ } else {
+ disablenpc getarg(0);
+ //debugmes "Disabling NPC %s", getarg(0);
+ }
+
+ /*
+ debugmes "----- %s (%d,%d) cell report", getarg(1), getarg(2), getarg(3);
+ debugmes "cell_chknopass: %d", checknpccell(getarg(1), getarg(2), getarg(3), cell_chknopass);
+ debugmes "cell_chknoreach: %d", checknpccell(getarg(1), getarg(2), getarg(3), cell_chknoreach);
+ debugmes "cell_chkbasilica: %d", checknpccell(getarg(1), getarg(2), getarg(3), cell_chkbasilica);
+ debugmes "";
+ debugmes "cell_chkwater: %d", checknpccell(getarg(1), getarg(2), getarg(3), cell_chkwater);
+ debugmes "cell_chkwall: %d", checknpccell(getarg(1), getarg(2), getarg(3), cell_chkwall);
+ debugmes "cell_chkcliff: %d", checknpccell(getarg(1), getarg(2), getarg(3), cell_chkcliff);
+ debugmes "----- Npc Id: %s", getarg(0);
+ */
+ return;
+ }
+ end;
+
+OnInit:
+ // NPC Settings
+ .sex = G_OTHER;
+ .distance = 3;
+ end;
+
+// Load or unload accordingly
+OnReload:
+ //debugmes "[REAL ESTATE] NPC ONRELOAD";
+ // load_npc ( name , map, x , y{, cell} )
+ load_npc("Wardrobe#RES_0185", .map$, 21, 23);
+ load_npc("Cauldron#RES_0185", .map$, 28, 24);
+ load_npc("Piano#RES_0185" , .map$, 34, 25);
+ load_npc("Stove#RES_0185" , .map$, 23, 24);
+ end;
+
+}
+
diff --git a/npc/018-5/_import.txt b/npc/018-5/_import.txt
index f9fc6b3fc..feaafb3b7 100644
--- a/npc/018-5/_import.txt
+++ b/npc/018-5/_import.txt
@@ -2,6 +2,7 @@
// This file is generated automatically. All manually added changes will be removed when running the Converter.
"npc/018-5/_mobs.txt",
"npc/018-5/_warps.txt",
+"npc/018-5/estate.txt",
"npc/018-5/soul_menhir.txt",
"npc/018-5/storage.txt",
"npc/018-5/teleporter.txt",
diff --git a/npc/018-5/estate.txt b/npc/018-5/estate.txt
new file mode 100644
index 000000000..174f3d897
--- /dev/null
+++ b/npc/018-5/estate.txt
@@ -0,0 +1,95 @@
+// TMW2: Moubootaur Legends scripts.
+// Author:
+// Jesusalva
+// Description:
+// Real Estate System
+
+// ID: 7
+// $ESTATE_OWNER[.id] → Account ID owner of the Real Estate
+// $ESTATE_OWNERNAME$[.id] → Human readable name of Real Estate owner
+// $ESTATE_RENTTIME[.id] → When the rent will expire
+// $ESTATE_MOBILIA_2[.id] → Bitmask of mobilia currently purchased on Monster Collision (6) (Use on walls only)
+// $ESTATE_MOBILIA_4[.id] → Bitmask of mobilia currently purchased on Air Collision (2)
+// $ESTATE_MOBILIA_8[.id] → Bitmask of mobilia currently purchased on Water Collision (3)
+// $ESTATE_MOBILIA_32[.id] → Bitmask of mobilia currently purchased on Yellow Collision (4)
+// $ESTATE_MOBILIA_64[.id] → Bitmask of mobilia currently purchased on Normal Collision (1)
+// $ESTATE_MOBILIA_128[.id] → Bitmask of mobilia currently purchased on Player Collision (5)
+// $ESTATE_PASSWORD$[.id] → Password to enter the estate. If it is "", then no password required
+// Note: GMs and Administrators can always use super password "mouboo" to enter a locked estate
+// $ESTATE_DOORBELL[.id] → If doorbell is disabled (enabled by default)
+
+// REAL_ESTATE_CREDITS → Credits equivalent to GP the player have. Will be used first.
+
+// The sign is the main controller
+018-5,84,52,0 script Sign#RES_0185 NPC_SWORDS_SIGN,{
+ if ($ESTATE_RENTTIME[.id] < gettimetick(2))
+ goto L_RentAvailable;
+
+ if ($ESTATE_OWNER[.id] == getcharid(3))
+ goto L_Manage;
+
+ if (is_admin() && $@GM_OVERRIDE)
+ goto L_Manage;
+
+ mesc l("This estate currently belongs to @@.", $ESTATE_OWNERNAME$[.id]);
+ mesc l("Press the doorbell?");
+ next;
+ if (askyesno() == ASK_YES)
+ doevent "Doorbell#RES_0208::OnDoorbell";
+ close;
+
+L_RentAvailable:
+ realestate_rent(.id, .price);
+ close;
+
+L_Manage:
+ realestate_manage(.id, (.price*7/10));
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 3;
+
+ // Estate Settings
+ .id=7; // Estate ID
+ .price=60000; // Monthly rent price. Renew is only 70% from this value.
+ end;
+
+}
+
+// Door entrance
+018-5,85,52,0 script #RES_0185 NPC_HIDDEN,0,0,{
+ end;
+OnTouch:
+ if ($ESTATE_RENTTIME[.id] < gettimetick(2))
+ goto L_RentAvailable;
+
+ if ($ESTATE_OWNER[.id] == getcharid(3) || $ESTATE_PASSWORD$[.id] == "")
+ goto L_Warp;
+
+ mesc l("The door is locked");
+ next;
+ mesc l("However, it can be unlocked if you know the password:");
+ if (is_gm()) mesc l("You can use super password \"mouboo\" to unlock the door."), 1;
+ input .@password$;
+ // GMs can use super password "mouboo"
+ if (.@password$ == $ESTATE_PASSWORD$[.id] || (is_gm() && .@password$ == "mouboo"))
+ goto L_Warp;
+ close;
+
+L_Warp:
+ warp "018-5-6", 33, 33;
+ closeclientdialog;
+ close;
+
+L_RentAvailable:
+ dispbottom l("This estate is available for rent, talk to the sign to rent it.");
+ close;
+
+OnInit:
+ // Estate Settings
+ .id=7; // Estate ID
+ end;
+
+}
+
diff --git a/npc/020-1/_mobs.txt b/npc/020-1/_mobs.txt
index 9bafbea63..3f132ecba 100644
--- a/npc/020-1/_mobs.txt
+++ b/npc/020-1/_mobs.txt
@@ -3,3 +3,6 @@
020-1,62,75,50,51 monster Fluffy 1022,20,60000,30000
020-1,66,76,48,49 monster Squirrel 1054,5,100000,30000
020-1,68,79,48,49 monster Pollet 1219,16,90000,30000
+020-1,89,36,8,3 monster Cobalt Plant 1136,3,180000,30000
+020-1,54,119,8,5 monster Cobalt Plant 1136,2,180000,30000
+020-1,41,56,6,4 monster Cobalt Plant 1136,2,180000,30000
diff --git a/npc/020-1/estate.txt b/npc/020-1/estate.txt
index ed3c52b55..848249989 100644
--- a/npc/020-1/estate.txt
+++ b/npc/020-1/estate.txt
@@ -58,7 +58,7 @@ OnInit:
}
// Door entrance
-012-1,95,69,0 script #RES_0128 NPC_HIDDEN,0,0,{
+020-1,42,85,0 script #RES_0208 NPC_HIDDEN,0,0,{
end;
OnTouch:
if ($ESTATE_RENTTIME[.id] < gettimetick(2))
diff --git a/npc/_import.txt b/npc/_import.txt
index 060192f4e..d88e43481 100644
--- a/npc/_import.txt
+++ b/npc/_import.txt
@@ -215,6 +215,7 @@
@include "npc/018-5-3/_import.txt"
@include "npc/018-5-4/_import.txt"
@include "npc/018-5-5/_import.txt"
+@include "npc/018-5-6/_import.txt"
@include "npc/018-5-boss/_import.txt"
@include "npc/018-5/_import.txt"
@include "npc/018-6-0/_import.txt"
diff --git a/npc/functions/estate2.txt b/npc/functions/estate2.txt
index 44764b8a2..7ab1b3417 100644
--- a/npc/functions/estate2.txt
+++ b/npc/functions/estate2.txt
@@ -308,6 +308,7 @@ OnInit:
009-6,21,23,0 duplicate(Wardrobe#RES_0128) Wardrobe#RES_0096 NPC_NO_SPRITE
009-7,21,23,0 duplicate(Wardrobe#RES_0128) Wardrobe#RES_0097 NPC_NO_SPRITE
020-8,21,23,0 duplicate(Wardrobe#RES_0128) Wardrobe#RES_0208 NPC_NO_SPRITE
+018-5-6,21,23,0 duplicate(Wardrobe#RES_0128) Wardrobe#RES_0185 NPC_NO_SPRITE
////////////////////////////////////////////////////////////////////////////
@@ -325,6 +326,7 @@ OnInit:
009-6,29,24,0 duplicate(Cauldron#RES_0128) Stovetop#RES_0096 NPC_NO_SPRITE
009-7,29,24,0 duplicate(Cauldron#RES_0128) Stovetop#RES_0097 NPC_NO_SPRITE
020-8,29,24,0 duplicate(Cauldron#RES_0128) Stovetop#RES_0208 NPC_NO_SPRITE
+018-5-6,29,24,0 duplicate(Cauldron#RES_0128) Stovetop#RES_0185 NPC_NO_SPRITE
////////////////////////////////////////////////////////////////////////////
@@ -342,6 +344,7 @@ OnInit:
009-6,34,25,0 duplicate(Piano#RES_0128) Piano#RES_0096 NPC_NO_SPRITE
009-7,34,25,0 duplicate(Piano#RES_0128) Piano#RES_0097 NPC_NO_SPRITE
020-8,34,25,0 duplicate(Piano#RES_0128) Piano#RES_0208 NPC_NO_SPRITE
+018-5-6,34,25,0 duplicate(Piano#RES_0128) Piano#RES_0185 NPC_NO_SPRITE
////////////////////////////////////////////////////////////////////////////
@@ -359,5 +362,6 @@ OnInit:
009-6,23,24,0 duplicate(Stove#RES_0128) Stove#RES_0096 NPC_NO_SPRITE
009-7,23,24,0 duplicate(Stove#RES_0128) Stove#RES_0097 NPC_NO_SPRITE
020-8,23,24,0 duplicate(Stove#RES_0128) Stove#RES_0208 NPC_NO_SPRITE
+018-5-6,23,24,0 duplicate(Stove#RES_0128) Stove#RES_0185 NPC_NO_SPRITE