summaryrefslogtreecommitdiff
path: root/npc/033-1/misc.txt
blob: 4537c80a0c3f85c53f1bea79e00e9454a3af73c7 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Moubootaur Legends Script
// Author:
//    Jesusalva
// Description:
//  Guild House & Warps

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;

}






function	script	SetPorthosPortal	{
    .@id = getarg(0);
        mesn l("Portal %02d", .@id);
        mes l("Do you want to activate an event?");
        next;
        select
            l("Cancel");
        mes "";
        switch (@menu) {
        default:
            mes l("Ok.");
            break;
        }
        close;
    return;
}


033-1,72,190,0	script	#Porthos01	NPC_NO_SPRITE,0,0,{
    end;
OnTouch:
    if ($@EVENT_01 == PORTHOS_BUSY) {
        dispbottom l("This portal is currently busy - an event must be in progress.");
        end;
    }
    if ($@EVENT_01 == PORTHOS_UNUSED) {
        if (is_admin() || is_master())
            SetPorthosPortal(1);
        dispbottom l("This portal is not currently active.");
        end;
    }
    warp $@EVENT_01_M$, $@EVENT_01_X, $@EVENT_01_Y;
    end;
}

033-1,44,160,0	script	#Porthos02	NPC_NO_SPRITE,0,0,{
    end;
OnTouch:
    if ($@EVENT_02 == PORTHOS_BUSY) {
        dispbottom l("This portal is currently busy - an event must be in progress.");
        end;
    }
    if ($@EVENT_02 == PORTHOS_UNUSED) {
        if (is_admin() || is_master())
            SetPorthosPortal(2);
        dispbottom l("This portal is not currently active.");
        end;
    }
    warp $@EVENT_02_M$, $@EVENT_02_X, $@EVENT_02_Y;
    end;
}