summaryrefslogtreecommitdiff
path: root/npc/033-1/misc.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/033-1/misc.txt')
-rw-r--r--npc/033-1/misc.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/npc/033-1/misc.txt b/npc/033-1/misc.txt
new file mode 100644
index 0000000..50fc9de
--- /dev/null
+++ b/npc/033-1/misc.txt
@@ -0,0 +1,38 @@
+// Moubootaur Legends Script
+// Author:
+// Jesusalva
+// Description:
+// Guild House
+
+033-1,134,79,0 script #GDoor NPC_NO_SPRITE,0,0,{
+ end;
+OnTouch:
+ if (getcharid(2) < 1) {
+ dispbottom l("You do not belong to a guild.");
+ end;
+ }
+ // Warp you to your guild house if exist.
+ // Build the instance otherwise.
+
+ // Well, "checking if instance exist by mapname" is an illusion.
+ // So we try to build and if we fail, we warp the player to the instance.
+ .@ID=getcharid(2);
+ @MAP_NAME$="guild@"+str(.@ID); // Max 4 chars for map name
+
+ .@INSTID = instance_create("guilds@a"+(.@ID), getcharid(2), IOT_GUILD);
+
+ // Instance already exists - .@INSTID returns "-4"
+ if (.@INSTID == -4) {
+ warp @MAP_NAME$, any(34,35), 48;
+ end;
+ }
+
+ .@instanceMapName$ = instance_attachmap("guilds", .@INSTID, 0, @MAP_NAME$);
+
+ instance_set_timeout(0, 0, .@INSTID);
+ instance_init(.@INSTID);
+ warp @MAP_NAME$, any(34,35), 48;
+ end;
+
+}
+