summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-05-06 18:49:04 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-05-06 18:49:04 +0000
commit7d559cbae9c713e15ae0c943a4d571122bf29bc6 (patch)
treed3edd6921006c28c62db25621f9ad1b44d1f0e69 /data
parent832584f65adff69659181d6fc884f779a79d62a9 (diff)
downloadmanaserv-7d559cbae9c713e15ae0c943a4d571122bf29bc6.tar.gz
manaserv-7d559cbae9c713e15ae0c943a4d571122bf29bc6.tar.bz2
manaserv-7d559cbae9c713e15ae0c943a4d571122bf29bc6.tar.xz
manaserv-7d559cbae9c713e15ae0c943a4d571122bf29bc6.zip
Implemented script trigger areas which call a script function when an object steps into them.
Diffstat (limited to 'data')
-rw-r--r--data/test.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/data/test.lua b/data/test.lua
index 4b14261e..0edc15e3 100644
--- a/data/test.lua
+++ b/data/test.lua
@@ -22,8 +22,24 @@ atinit(function()
create_npc(201, 51 * 32 + 16, 25 * 32 + 16, npc4_talk, npclib.walkaround_wide)
create_npc(126, 45 * 32 + 16, 25 * 32 + 16, npc5_talk, npclib.walkaround_map)
create_npc(122, 58 * 32 + 16, 15 * 32 + 16, npc6_talk, nil)
+
+ create_npc(200, 63 * 32 + 16, 31 * 32 + 16, nil, nil)
+ tmw.trigger_create(56 * 32, 30 * 32, 64, 64, "patrol_waypoint", 1)
+ tmw.trigger_create(63 * 32, 30 * 32, 64, 64, "patrol_waypoint", 2)
+
end)
+
+function patrol_waypoint(obj, id)
+ if (id == 1) then
+ tmw.being_walk(obj, 64 * 32, 31 * 32, 400)
+ end
+ if (id == 2) then
+ tmw.being_walk(obj, 57 * 32, 31 * 32, 400)
+ end
+end
+
+
function npc1_talk(npc, ch)
do_message(npc, ch, "Hello! I am the testing NPC.")
do_message(npc, ch, "This message is just here for testing intertwined connections.")