summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2016-02-26 00:51:24 +0100
committerReid <reidyaro@gmail.com>2016-02-26 00:51:24 +0100
commitd60eea65b37bc0c5c2ed3f428a4285ef6e7b4fa8 (patch)
tree24f9bd5030c45d30d2867e2c7c38668ad5c32808
parentb6565a398c76332a8734d9027ed98158fddb42f1 (diff)
downloadserverdata-d60eea65b37bc0c5c2ed3f428a4285ef6e7b4fa8.tar.gz
serverdata-d60eea65b37bc0c5c2ed3f428a4285ef6e7b4fa8.tar.bz2
serverdata-d60eea65b37bc0c5c2ed3f428a4285ef6e7b4fa8.tar.xz
serverdata-d60eea65b37bc0c5c2ed3f428a4285ef6e7b4fa8.zip
Add improved mouboos (they now walk!).
-rw-r--r--npc/001-1/mouboo.txt52
-rw-r--r--npc/functions/mouboofunc.txt97
-rw-r--r--npc/functions/moubootalk.txt26
-rw-r--r--npc/scripts.conf2
4 files changed, 144 insertions, 33 deletions
diff --git a/npc/001-1/mouboo.txt b/npc/001-1/mouboo.txt
index e4bfde4a..bcb80031 100644
--- a/npc/001-1/mouboo.txt
+++ b/npc/001-1/mouboo.txt
@@ -6,16 +6,56 @@
001-1,67,79,4 script Mouboo#Artis0 NPC_MOUBOO,{
- if (Repeat_NPC_lock <= gettimetick (2))
- {
- Repeat_NPC_lock = gettimetick (2) + 1;
- moubootalk;
- }
+ mouboochecklock;
+ close;
+
+OnTimer2000:
+ moubootimer;
+
+OnInit:
+ .distance = 2;
+ .sex = G_OTHER;
+ mouboograph;
+}
+001-1,67,80,4 script Mouboo#Artis1 NPC_MOUBOO,{
+
+ mouboochecklock;
close;
+OnTimer2000:
+ moubootimer;
+
+OnInit:
+ .distance = 2;
+ .sex = G_OTHER;
+ mouboograph;
+}
+
+001-1,67,81,4 script Mouboo#Artis2 NPC_MOUBOO,{
+
+ mouboochecklock;
+ close;
+
+OnTimer2000:
+ moubootimer;
+
+OnInit:
+ .distance = 2;
+ .sex = G_OTHER;
+ mouboograph;
+}
+
+001-1,67,82,4 script Mouboo#Artis3 NPC_MOUBOO,{
+
+ mouboochecklock;
+ close;
+
+OnTimer2000:
+ moubootimer;
+
OnInit:
.distance = 2;
.sex = G_OTHER;
- end;
+ mouboograph;
}
diff --git a/npc/functions/mouboofunc.txt b/npc/functions/mouboofunc.txt
new file mode 100644
index 00000000..f01e4847
--- /dev/null
+++ b/npc/functions/mouboofunc.txt
@@ -0,0 +1,97 @@
+// Evol functions.
+// Author:
+// Reid
+// Description:
+// Various scripts used in walking mouboo NPCs.
+
+function script moubootalk {
+ switch (rand (4))
+ {
+ case 0:
+ npctalk3 l("Moooooo!");
+ break;
+ case 1:
+ npctalk3 l("Moo!");
+ break;
+ case 2:
+ npctalk3 l("Moooooooooooo!");
+ break;
+ case 3:
+ npctalk3 l("Moooo!");
+ break;
+ }
+ return;
+}
+
+function script mouboocheckxy {
+ setarray .nearnpc$[0], "Mouboo#Artis0",
+ "Mouboo#Artis1",
+ "Mouboo#Artis2",
+ "Mouboo#Artis3",
+ "Taree";
+ for (.@size = 0; .@size < getarraysize(.nearnpc$); .@size++)
+ {
+ if (strcmp (.name$, .nearnpc$[.@size]) == 0)
+ {
+ continue;
+ }
+
+ .@npc_x = getvariableofnpc (.x, .nearnpc$[.@size]);
+ .@npc_y = getvariableofnpc (.y, .nearnpc$[.@size]);
+
+ if (.@npc_x == .x && .@npc_y == .y)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+function script moubootimer {
+ if (mouboocheckxy () && !isunitwalking ())
+ {
+ movetonextpoint;
+ }
+ else if (rand (0,6) == 5)
+ {
+ if (!isunitwalking ())
+ {
+ movetonextpoint;
+ }
+ }
+ initnpctimer;
+ end;
+}
+
+function script mouboograph {
+ initmovegraph "down_pos", 66, 79, 75, 86,
+ "left_pos", 66, 79, 75, 86,
+ "up_pos", 66, 79, 75, 86,
+ "right_pos", 66, 79, 75, 86;
+
+ setmovegraphcmd "down_pos", "left_pos", 1, "dir 2",
+ "down_pos", "up_pos", 1, "dir 4",
+ "down_pos", "right_pos", 1, "dir 6",
+ "left_pos", "down_pos", 1, "dir 0",
+ "left_pos", "up_pos", 1, "dir 4",
+ "left_pos", "right_pos", 1, "dir 6",
+ "up_pos", "down_pos", 1, "dir 0",
+ "up_pos", "left_pos", 1, "dir 2",
+ "up_pos", "right_pos", 1, "dir 6",
+ "right_pos", "down_pos", 1, "dir 0",
+ "right_pos", "left_pos", 1, "dir 2",
+ "right_pos", "up_pos", 1, "dir 4";
+
+ firstmove "wait 2", "down_pos";
+ initnpctimer;
+ end;
+}
+
+function script mouboochecklock {
+ if (Repeat_NPC_lock <= gettimetick (2))
+ {
+ Repeat_NPC_lock = gettimetick (2) + 1;
+ moubootalk;
+ }
+}
diff --git a/npc/functions/moubootalk.txt b/npc/functions/moubootalk.txt
deleted file mode 100644
index 0d6fb539..00000000
--- a/npc/functions/moubootalk.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-// Evol functions.
-// Author:
-// Reid
-// Description:
-// Tell a random sentence.
-// Variables:
-// .@rand = Random number between the number of sentence choice.
-
-function script moubootalk {
- switch (rand (4))
- {
- case 0:
- npctalk3 l("Moooooo!");
- break;
- case 1:
- npctalk3 l("Moo!");
- break;
- case 2:
- npctalk3 l("Moooooooooooo!");
- break;
- case 3:
- npctalk3 l("Moooo!");
- break;
- }
- return;
-}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index d7d0935c..84053fde 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -25,7 +25,7 @@ npc: npc/functions/shops.txt
npc: npc/functions/villagertalk.txt
npc: npc/functions/npcmovegraph.txt
npc: npc/functions/fishing.txt
-npc: npc/functions/moubootalk.txt
+npc: npc/functions/mouboofunc.txt
// Maps specific scripts
import: npc/_import.txt