summaryrefslogtreecommitdiff
path: root/npc/017-1/guild.txt
blob: 6992cb3543bad28c262f609c2d31c1eb086e0587 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Moubootaur Legends Script
// Author:
//    Jesusalva
// Description:
//  Guild House

017-1,57,33,0	script	#GDoor	NPC_NO_SPRITE,0,0,{
    end;
OnTouch:
    if (getcharid(2) < 1) {
        dispbottom l("The door is locked.");
        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(3), IOT_GUILD);
    .@instanceMapName$ = instance_attachmap("guilds", .@INSTID, 0, @MAP_NAME$);

    // Instance already exists, or something went wrong
    // Let's assume it exists
    if (.@instanceMapName$ == "") {
        warp @MAP_NAME$, any(34,35), 48;
        end;
    }

    // It'll be self-destroyed eventually...
    instance_set_timeout(1000000, 1000000, .@INSTID);
    instance_init(.@INSTID);
    warp @MAP_NAME$, any(34,35), 48;
    end;

}

017-1,58,32,0	script	#GSign	NPC_NO_SPRITE,{
    mesc l("Guild Hall");
    close;

OnInit:
    .distance=3;
    end;
}