From f2db0160febeca62a186b3d9e144799e50bfefa9 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 13 Oct 2019 00:20:36 -0300 Subject: Initial commit: Setup --- conf/map/maps.conf | 16 +++++++ db/constants.conf | 22 +++++++++ db/map_index.txt | 26 ++++++++-- maps/re/maze0.mcache | Bin 0 -> 58 bytes maps/re/maze1.mcache | Bin 0 -> 60 bytes maps/re/maze10.mcache | Bin 0 -> 67 bytes maps/re/maze11.mcache | Bin 0 -> 61 bytes maps/re/maze12.mcache | Bin 0 -> 63 bytes maps/re/maze13.mcache | Bin 0 -> 61 bytes maps/re/maze14.mcache | Bin 0 -> 58 bytes maps/re/maze15.mcache | Bin 0 -> 69 bytes maps/re/maze2.mcache | Bin 0 -> 58 bytes maps/re/maze3.mcache | Bin 0 -> 61 bytes maps/re/maze4.mcache | Bin 0 -> 58 bytes maps/re/maze5.mcache | Bin 0 -> 62 bytes maps/re/maze6.mcache | Bin 0 -> 62 bytes maps/re/maze7.mcache | Bin 0 -> 64 bytes maps/re/maze8.mcache | Bin 0 -> 62 bytes maps/re/maze9.mcache | Bin 0 -> 70 bytes npc/_import.txt | 16 +++++++ npc/maze0/_import.txt | 3 ++ npc/maze0/config.txt | 128 +++++++++++++++++++++++++++++++++++++++++++++++++ npc/maze1/_import.txt | 2 + npc/maze10/_import.txt | 2 + npc/maze11/_import.txt | 2 + npc/maze12/_import.txt | 2 + npc/maze13/_import.txt | 2 + npc/maze14/_import.txt | 2 + npc/maze15/_import.txt | 2 + npc/maze2/_import.txt | 2 + npc/maze3/_import.txt | 2 + npc/maze4/_import.txt | 2 + npc/maze5/_import.txt | 2 + npc/maze6/_import.txt | 2 + npc/maze7/_import.txt | 2 + npc/maze8/_import.txt | 2 + npc/maze9/_import.txt | 2 + 37 files changed, 236 insertions(+), 5 deletions(-) create mode 100644 maps/re/maze0.mcache create mode 100644 maps/re/maze1.mcache create mode 100644 maps/re/maze10.mcache create mode 100644 maps/re/maze11.mcache create mode 100644 maps/re/maze12.mcache create mode 100644 maps/re/maze13.mcache create mode 100644 maps/re/maze14.mcache create mode 100644 maps/re/maze15.mcache create mode 100644 maps/re/maze2.mcache create mode 100644 maps/re/maze3.mcache create mode 100644 maps/re/maze4.mcache create mode 100644 maps/re/maze5.mcache create mode 100644 maps/re/maze6.mcache create mode 100644 maps/re/maze7.mcache create mode 100644 maps/re/maze8.mcache create mode 100644 maps/re/maze9.mcache create mode 100644 npc/maze0/_import.txt create mode 100644 npc/maze0/config.txt create mode 100644 npc/maze1/_import.txt create mode 100644 npc/maze10/_import.txt create mode 100644 npc/maze11/_import.txt create mode 100644 npc/maze12/_import.txt create mode 100644 npc/maze13/_import.txt create mode 100644 npc/maze14/_import.txt create mode 100644 npc/maze15/_import.txt create mode 100644 npc/maze2/_import.txt create mode 100644 npc/maze3/_import.txt create mode 100644 npc/maze4/_import.txt create mode 100644 npc/maze5/_import.txt create mode 100644 npc/maze6/_import.txt create mode 100644 npc/maze7/_import.txt create mode 100644 npc/maze8/_import.txt create mode 100644 npc/maze9/_import.txt diff --git a/conf/map/maps.conf b/conf/map/maps.conf index 5abef6ff7..80adc2447 100644 --- a/conf/map/maps.conf +++ b/conf/map/maps.conf @@ -175,6 +175,22 @@ map_list: ( "boss", "botcheck", "guilds", + "maze0", + "maze1", + "maze10", + "maze11", + "maze12", + "maze13", + "maze14", + "maze15", + "maze2", + "maze3", + "maze4", + "maze5", + "maze6", + "maze7", + "maze8", + "maze9", "sec_pri", "soren-2", "soren", diff --git a/db/constants.conf b/db/constants.conf index 1703a6f33..46363deb5 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -4439,5 +4439,27 @@ constants_db: { LANG_ON_SEA: 1 LANG_IN_SHIP: 2 + comment__: "Maze Generator constants" + MAZEMAPTYPE_NULL: 0 + MAZEMAPTYPE_DEADS: 1 + MAZEMAPTYPE_DEADW: 2 + MAZEMAPTYPE_DEADN: 3 + MAZEMAPTYPE_DEADE: 4 + MAZEMAPTYPE_CURVENW: 5 + MAZEMAPTYPE_CURVENE: 6 + MAZEMAPTYPE_CURVESW: 7 + MAZEMAPTYPE_CURVESE: 8 + MAZEMAPTYPE_TNWS: 9 + MAZEMAPTYPE_TNES: 10 + MAZEMAPTYPE_TWEN: 11 + MAZEMAPTYPE_TWES: 12 + MAZEMAPTYPE_LINENS: 13 + MAZEMAPTYPE_LINEWE: 14 + MAZEMAPTYPE_CROSS: 15 + MAZENORTH: 0 + MAZE_WEST: 1 + MAZE_EAST: 2 + MAZESOUTH: 3 + @include "conf/import/constants.conf" } diff --git a/db/map_index.txt b/db/map_index.txt index 2dc2bd3ea..0d3f836ad 100644 --- a/db/map_index.txt +++ b/db/map_index.txt @@ -172,8 +172,24 @@ boss 172 botcheck 173 guilds 174 -sec_pri 175 -soren-2 176 -soren 177 -test 178 -testbg 179 +maze0 175 +maze1 176 +maze10 177 +maze11 178 +maze12 179 +maze13 180 +maze14 181 +maze15 182 +maze2 183 +maze3 184 +maze4 185 +maze5 186 +maze6 187 +maze7 188 +maze8 189 +maze9 190 +sec_pri 191 +soren-2 192 +soren 193 +test 194 +testbg 195 diff --git a/maps/re/maze0.mcache b/maps/re/maze0.mcache new file mode 100644 index 000000000..283b0f0ac Binary files /dev/null and b/maps/re/maze0.mcache differ diff --git a/maps/re/maze1.mcache b/maps/re/maze1.mcache new file mode 100644 index 000000000..d5d4296f9 Binary files /dev/null and b/maps/re/maze1.mcache differ diff --git a/maps/re/maze10.mcache b/maps/re/maze10.mcache new file mode 100644 index 000000000..16290fe26 Binary files /dev/null and b/maps/re/maze10.mcache differ diff --git a/maps/re/maze11.mcache b/maps/re/maze11.mcache new file mode 100644 index 000000000..497547205 Binary files /dev/null and b/maps/re/maze11.mcache differ diff --git a/maps/re/maze12.mcache b/maps/re/maze12.mcache new file mode 100644 index 000000000..d797ab2a4 Binary files /dev/null and b/maps/re/maze12.mcache differ diff --git a/maps/re/maze13.mcache b/maps/re/maze13.mcache new file mode 100644 index 000000000..fa525561d Binary files /dev/null and b/maps/re/maze13.mcache differ diff --git a/maps/re/maze14.mcache b/maps/re/maze14.mcache new file mode 100644 index 000000000..dbda4a6d7 Binary files /dev/null and b/maps/re/maze14.mcache differ diff --git a/maps/re/maze15.mcache b/maps/re/maze15.mcache new file mode 100644 index 000000000..7a68581e1 Binary files /dev/null and b/maps/re/maze15.mcache differ diff --git a/maps/re/maze2.mcache b/maps/re/maze2.mcache new file mode 100644 index 000000000..4d118cddd Binary files /dev/null and b/maps/re/maze2.mcache differ diff --git a/maps/re/maze3.mcache b/maps/re/maze3.mcache new file mode 100644 index 000000000..f74a50ca1 Binary files /dev/null and b/maps/re/maze3.mcache differ diff --git a/maps/re/maze4.mcache b/maps/re/maze4.mcache new file mode 100644 index 000000000..f1cef24a6 Binary files /dev/null and b/maps/re/maze4.mcache differ diff --git a/maps/re/maze5.mcache b/maps/re/maze5.mcache new file mode 100644 index 000000000..0749b84a6 Binary files /dev/null and b/maps/re/maze5.mcache differ diff --git a/maps/re/maze6.mcache b/maps/re/maze6.mcache new file mode 100644 index 000000000..401869839 Binary files /dev/null and b/maps/re/maze6.mcache differ diff --git a/maps/re/maze7.mcache b/maps/re/maze7.mcache new file mode 100644 index 000000000..5debe5807 Binary files /dev/null and b/maps/re/maze7.mcache differ diff --git a/maps/re/maze8.mcache b/maps/re/maze8.mcache new file mode 100644 index 000000000..e0212bfcd Binary files /dev/null and b/maps/re/maze8.mcache differ diff --git a/maps/re/maze9.mcache b/maps/re/maze9.mcache new file mode 100644 index 000000000..509eeb76f Binary files /dev/null and b/maps/re/maze9.mcache differ diff --git a/npc/_import.txt b/npc/_import.txt index e5596800e..69b3b3add 100644 --- a/npc/_import.txt +++ b/npc/_import.txt @@ -174,6 +174,22 @@ @include "npc/boss/_import.txt" @include "npc/botcheck/_import.txt" @include "npc/guilds/_import.txt" +@include "npc/maze0/_import.txt" +@include "npc/maze1/_import.txt" +@include "npc/maze10/_import.txt" +@include "npc/maze11/_import.txt" +@include "npc/maze12/_import.txt" +@include "npc/maze13/_import.txt" +@include "npc/maze14/_import.txt" +@include "npc/maze15/_import.txt" +@include "npc/maze2/_import.txt" +@include "npc/maze3/_import.txt" +@include "npc/maze4/_import.txt" +@include "npc/maze5/_import.txt" +@include "npc/maze6/_import.txt" +@include "npc/maze7/_import.txt" +@include "npc/maze8/_import.txt" +@include "npc/maze9/_import.txt" @include "npc/sec_pri/_import.txt" @include "npc/soren-2/_import.txt" @include "npc/soren/_import.txt" diff --git a/npc/maze0/_import.txt b/npc/maze0/_import.txt new file mode 100644 index 000000000..8bad6906c --- /dev/null +++ b/npc/maze0/_import.txt @@ -0,0 +1,3 @@ +// Map maze0: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/maze0/config.txt", diff --git a/npc/maze0/config.txt b/npc/maze0/config.txt new file mode 100644 index 000000000..9b81fa7ed --- /dev/null +++ b/npc/maze0/config.txt @@ -0,0 +1,128 @@ +// TMW2 Scripts +// Author: +// Jesusalva +// Description: +// Maze generation script +// Based on https://wiki.themanaworld.org/index.php/Archive:Afterlife#maze_generation +// Begin script, instance is required. Maze is Saved to player data. +// Scopes: MAZE_ {ID, MX, MY} or {X_Y$} or {X_Y_ALLOWEDTYPES} + +// MazeVar(x,y,param) +function script MazeVar { + return "MAZE_"+getarg(0)+"_"+getarg(1)+getarg(2, ""); + end; +} + +// ParseMaze(instanceID, mapType) +function script ParseMaze { + end; +} + +// WarpToMaze(instanceID, x, y) +function script WarpToMaze { + end; +} + +// GenerateMaze(width, height, instanceID) +function script GenerateMaze { + // Save maze configuration + MAZE_ID=getarg(2); + MAZE_MX=getarg(0); + MAZE_MY=getarg(1); + + //////////////////// + // SETUP + .@x=0; .@y=0; + + // For every column: + while (.@x < MAZE_MX) { + // For every cell: + while (.@y < MAZE_MY) { + + // Case 1: Left column + if (.@y == 0) { + + // NW edge + if (.@x == 0) + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADS, MAZEMAPTYPE_DEADE, + MAZEMAPTYPE_CURVESE; + // NE edge + else if (.@x == MAZE_MX) + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADS, MAZEMAPTYPE_DEADW, + MAZEMAPTYPE_CURVESW; + // North wall + else + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADS, MAZEMAPTYPE_DEADW, MAZEMAPTYPE_DEADE, + MAZEMAPTYPE_TWES, MAZEMAPTYPE_LINEWE, + MAZEMAPTYPE_CURVESE, MAZEMAPTYPE_CURVESW; + + + // Case 2: Right column + } else if (.@y == MAZE_MY) { + + // SW edge + if (.@x == 0) + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADN, MAZEMAPTYPE_DEADE, + MAZEMAPTYPE_CURVENE; + // SE edge + else if (.@x == MAZE_MX) + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADN, MAZEMAPTYPE_DEADW, + MAZEMAPTYPE_CURVENW; + // South wall + else + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADN, MAZEMAPTYPE_DEADW, MAZEMAPTYPE_DEADE, + MAZEMAPTYPE_TWEN, MAZEMAPTYPE_LINEWE, + MAZEMAPTYPE_CURVENE, MAZEMAPTYPE_CURVENW; + + + // Case 3: Nothing in special + } else { + setarray getd(MazeVar(.@x, .@y, "_ALLOWEDTYPES")), + MAZEMAPTYPE_DEADN, MAZEMAPTYPE_DEADW, MAZEMAPTYPE_DEADE, MAZEMAPTYPE_DEADS, + MAZEMAPTYPE_CURVENW, MAZEMAPTYPE_CURVENE, MAZEMAPTYPE_CURVESW, MAZEMAPTYPE_CURVESE, + MAZEMAPTYPE_TNWS, MAZEMAPTYPE_TNES, MAZEMAPTYPE_TWEN, MAZEMAPTYPE_TWES, + MAZEMAPTYPE_LINEWE, MAZEMAPTYPE_LINENS, MAZEMAPTYPE_CROSS; + } + + + // End the setup loop + } + } + + + //////////////////// + // BUILDING + .@x=0; .@y=0; + + // For every line: + while (.@y < MAZE_MY) { + // For every cell: + while (.@x < MAZE_MX) { + + // End the build loop + } + } + end; +} + + +// ParseMaze(instanceID, mapType) +function script ParseMaze { + end; +} + +// One warp handler per maze map +maze0,30,30,0 script #MazeMaster NPC_HIDDEN,{ + function mazeGen; + function parseConnections; + end; +} + + + diff --git a/npc/maze1/_import.txt b/npc/maze1/_import.txt new file mode 100644 index 000000000..432077154 --- /dev/null +++ b/npc/maze1/_import.txt @@ -0,0 +1,2 @@ +// Map maze1: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze10/_import.txt b/npc/maze10/_import.txt new file mode 100644 index 000000000..63222b4b0 --- /dev/null +++ b/npc/maze10/_import.txt @@ -0,0 +1,2 @@ +// Map maze10: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze11/_import.txt b/npc/maze11/_import.txt new file mode 100644 index 000000000..11592e845 --- /dev/null +++ b/npc/maze11/_import.txt @@ -0,0 +1,2 @@ +// Map maze11: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze12/_import.txt b/npc/maze12/_import.txt new file mode 100644 index 000000000..08c1110b8 --- /dev/null +++ b/npc/maze12/_import.txt @@ -0,0 +1,2 @@ +// Map maze12: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze13/_import.txt b/npc/maze13/_import.txt new file mode 100644 index 000000000..b7aaf0fe3 --- /dev/null +++ b/npc/maze13/_import.txt @@ -0,0 +1,2 @@ +// Map maze13: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze14/_import.txt b/npc/maze14/_import.txt new file mode 100644 index 000000000..fd0a904b8 --- /dev/null +++ b/npc/maze14/_import.txt @@ -0,0 +1,2 @@ +// Map maze14: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze15/_import.txt b/npc/maze15/_import.txt new file mode 100644 index 000000000..5833ba17c --- /dev/null +++ b/npc/maze15/_import.txt @@ -0,0 +1,2 @@ +// Map maze15: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze2/_import.txt b/npc/maze2/_import.txt new file mode 100644 index 000000000..bae535704 --- /dev/null +++ b/npc/maze2/_import.txt @@ -0,0 +1,2 @@ +// Map maze2: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze3/_import.txt b/npc/maze3/_import.txt new file mode 100644 index 000000000..0b54276f5 --- /dev/null +++ b/npc/maze3/_import.txt @@ -0,0 +1,2 @@ +// Map maze3: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze4/_import.txt b/npc/maze4/_import.txt new file mode 100644 index 000000000..acdfbcee2 --- /dev/null +++ b/npc/maze4/_import.txt @@ -0,0 +1,2 @@ +// Map maze4: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze5/_import.txt b/npc/maze5/_import.txt new file mode 100644 index 000000000..7649a951e --- /dev/null +++ b/npc/maze5/_import.txt @@ -0,0 +1,2 @@ +// Map maze5: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze6/_import.txt b/npc/maze6/_import.txt new file mode 100644 index 000000000..be1fd23a5 --- /dev/null +++ b/npc/maze6/_import.txt @@ -0,0 +1,2 @@ +// Map maze6: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze7/_import.txt b/npc/maze7/_import.txt new file mode 100644 index 000000000..f73cd9310 --- /dev/null +++ b/npc/maze7/_import.txt @@ -0,0 +1,2 @@ +// Map maze7: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze8/_import.txt b/npc/maze8/_import.txt new file mode 100644 index 000000000..4bbc9eb09 --- /dev/null +++ b/npc/maze8/_import.txt @@ -0,0 +1,2 @@ +// Map maze8: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. diff --git a/npc/maze9/_import.txt b/npc/maze9/_import.txt new file mode 100644 index 000000000..abccc1d00 --- /dev/null +++ b/npc/maze9/_import.txt @@ -0,0 +1,2 @@ +// Map maze9: Jesusalva's Trap +// This file is generated automatically. All manually added changes will be removed when running the Converter. -- cgit v1.2.3-60-g2f50