summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-10-13 00:20:36 -0300
committerJesusaves <cpntb1@ymail.com>2019-10-13 00:20:36 -0300
commitf2db0160febeca62a186b3d9e144799e50bfefa9 (patch)
treeff68782fad67ee0cbcfcb996f28460986a395667 /npc
parent713715ac7a5e72683d7601a22cc6ca481dcd34cf (diff)
downloadserverdata-f2db0160febeca62a186b3d9e144799e50bfefa9.tar.gz
serverdata-f2db0160febeca62a186b3d9e144799e50bfefa9.tar.bz2
serverdata-f2db0160febeca62a186b3d9e144799e50bfefa9.tar.xz
serverdata-f2db0160febeca62a186b3d9e144799e50bfefa9.zip
Initial commit: Setup
Diffstat (limited to 'npc')
-rw-r--r--npc/_import.txt16
-rw-r--r--npc/maze0/_import.txt3
-rw-r--r--npc/maze0/config.txt128
-rw-r--r--npc/maze1/_import.txt2
-rw-r--r--npc/maze10/_import.txt2
-rw-r--r--npc/maze11/_import.txt2
-rw-r--r--npc/maze12/_import.txt2
-rw-r--r--npc/maze13/_import.txt2
-rw-r--r--npc/maze14/_import.txt2
-rw-r--r--npc/maze15/_import.txt2
-rw-r--r--npc/maze2/_import.txt2
-rw-r--r--npc/maze3/_import.txt2
-rw-r--r--npc/maze4/_import.txt2
-rw-r--r--npc/maze5/_import.txt2
-rw-r--r--npc/maze6/_import.txt2
-rw-r--r--npc/maze7/_import.txt2
-rw-r--r--npc/maze8/_import.txt2
-rw-r--r--npc/maze9/_import.txt2
18 files changed, 177 insertions, 0 deletions
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.