summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-04-28 00:35:02 -0300
committerJesusaves <cpntb1@ymail.com>2022-04-28 00:35:02 -0300
commit17fecb4277df1effb7177096314797e5e43dc857 (patch)
tree30883082020cf0775a9aeb80b09c869b53e68e4b
parent917104fdcbf583d1ac73ee5758a5e1d8b17e52cf (diff)
downloadserverdata-17fecb4277df1effb7177096314797e5e43dc857.tar.gz
serverdata-17fecb4277df1effb7177096314797e5e43dc857.tar.bz2
serverdata-17fecb4277df1effb7177096314797e5e43dc857.tar.xz
serverdata-17fecb4277df1effb7177096314797e5e43dc857.zip
Prepare for maze system expansion (we'll go from 24 mazes to 75 mazes)
-rw-r--r--db/constants.conf7
-rw-r--r--db/re/exp_group_db.conf20
-rw-r--r--npc/functions/maze.txt52
3 files changed, 47 insertions, 32 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 4b3d10ea0..2f245aa12 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -2380,8 +2380,11 @@ constants_db: {
INT_MAX: 2147483647
comment__: "Maze Domain constants"
- MAZE_MIN: 1
- MAZE_MAX: 24
+ MAZE_SIZE_S: 1
+ MAZE_SIZE_M: 2
+ MAZE_SIZE_G: 4
+ MAZE_SIZE_X: 8
+ MAZE_SIZE_A: 16
comment__: "Aurora Event constants"
FY_MISC: 0
diff --git a/db/re/exp_group_db.conf b/db/re/exp_group_db.conf
index 742490852..67b5a2dad 100644
--- a/db/re/exp_group_db.conf
+++ b/db/re/exp_group_db.conf
@@ -93,25 +93,7 @@ EvolClasses: {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// These spaces are so EXP table starts at line 200, making easier to calc max level positions. Max level: 180
+// These spaces are so EXP table starts at line 100, making easier to calc max level positions. Max level: 180
job_exp_group_db: {
EvolClasses: {
MaxLevel: 140
diff --git a/npc/functions/maze.txt b/npc/functions/maze.txt
index b2dde03b4..8867f09b8 100644
--- a/npc/functions/maze.txt
+++ b/npc/functions/maze.txt
@@ -9,20 +9,50 @@
// MAZE_INST → Instance ID of the Maze
/////////////////////////////////////////////////////////////////////////////////
-// CreateMaze(scope=IOT_CHAR)
+// CreateMaze(scope=IOT_CHAR{, size=MAZE_SIZE_S})
// Creates the maze instances so they can be configured
-// But does not initializes anything
+// But does not initializes anything.
function script CreateMaze {
.@scope = getarg(0, IOT_CHAR);
- .@min = getarg(1, MAZE_MIN);
- .@max = getarg(2, MAZE_MAX);
- // Pseudo-random maze ID
- // (It is not random at all; But two mazes won't repeat)
- MAZE_ID += 1;
- if (MAZE_ID > .@max)
- MAZE_ID = .@min;
- if (MAZE_ID < .@min)
- MAZE_ID = .@min;
+ .@size = getarg(1, MAZE_SIZE_S);
+
+ // Small mazes (30x30 average) (24 total)
+ if (.@size & MAZE_SIZE_S) {
+ .@p = getarraysize(.@ids);
+ setarray .@ids[.@p], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24;
+ }
+ // Medium mazes (45x45 average) (15 total)
+ if (.@size & MAZE_SIZE_M) {
+ .@p = getarraysize(.@ids);
+ setarray .@ids[.@p], 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39;
+ }
+ // Great mazes (60x60 average) (20 total)
+ if (.@size & MAZE_SIZE_G) {
+ .@p = getarraysize(.@ids);
+ setarray .@ids[.@p], 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59;
+ }
+ // Xtra mazes (75x75 average) (10 total)
+ if (.@size & MAZE_SIZE_X) {
+ .@p = getarraysize(.@ids);
+ setarray .@ids[.@p], 60, 61, 62, 63, 64, 65, 66, 67, 68, 69;
+ }
+ // Abs. mazes (90x90 average) (6 total)
+ if (.@size & MAZE_SIZE_A) {
+ .@p = getarraysize(.@ids);
+ setarray .@ids[.@p], 70, 71, 72, 73, 74, 75;
+ }
+
+ // Get a random maze, but it must not be repeated
+ do
+ {
+ .@r = any_of(.@ids);
+ if (MAZE_ID == .@r)
+ continue;
+ MAZE_ID = .@r;
+ break;
+ } while (true);
.@MAZEMP$=sprintf("030-%02d", MAZE_ID);
MAZE_MAP$=sprintf("mz%02d@"+getcharid(0), MAZE_ID);