From 729402190413df0e5c80c835f1737573eb29750b Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 15 Jan 2022 19:38:15 -0300 Subject: Allow CreateMaze to specify ranges, so 030 domain can have different sizes. --- npc/functions/maze.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'npc/functions') 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); -- cgit v1.2.3-60-g2f50