diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-01-15 19:38:15 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-01-15 19:38:15 -0300 |
commit | 729402190413df0e5c80c835f1737573eb29750b (patch) | |
tree | 71f79f9b4b15e0454b9d1c979cc901076c23f639 /npc/functions/maze.txt | |
parent | c700473d29da75fe2b90b4329e4771f283056ee3 (diff) | |
download | serverdata-729402190413df0e5c80c835f1737573eb29750b.tar.gz serverdata-729402190413df0e5c80c835f1737573eb29750b.tar.bz2 serverdata-729402190413df0e5c80c835f1737573eb29750b.tar.xz serverdata-729402190413df0e5c80c835f1737573eb29750b.zip |
Allow CreateMaze to specify ranges, so 030 domain can have different sizes.
Diffstat (limited to 'npc/functions/maze.txt')
-rw-r--r-- | npc/functions/maze.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/npc/functions/maze.txt b/npc/functions/maze.txt index 8fd9c438e..b2dde03b4 100644 --- a/npc/functions/maze.txt +++ b/npc/functions/maze.txt @@ -14,13 +14,15 @@ // 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 > MAZE_MAX) - MAZE_ID = MAZE_MIN; - if (MAZE_ID < MAZE_MIN) - MAZE_ID = MAZE_MIN; + if (MAZE_ID > .@max) + MAZE_ID = .@min; + if (MAZE_ID < .@min) + MAZE_ID = .@min; .@MAZEMP$=sprintf("030-%02d", MAZE_ID); MAZE_MAP$=sprintf("mz%02d@"+getcharid(0), MAZE_ID); |