summaryrefslogtreecommitdiff
path: root/npc/024-14/utils.txt
blob: e9c8853bb37ed89be9cad3a46e814a1c194fc1b3 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// TMW2: Moubootaur Legends scripts.
// Author:
//    Jesusalva
// Description:
//    Real Estate System
//    Utils take care of NPCs - Their code, and enable/disable using check_cell
//    This file is custom to every room

// ESTATE_ID → Instance ID of the Estate (required for NPCs, expire)
// ESTATE_RENTTIME → When the rent will expire
// ESTATE_MOBILIA_2 → Bitmask of mobilia currently purchased on Monster Collision (6) (Use on walls only)
// ESTATE_MOBILIA_4 → Bitmask of mobilia currently purchased on Air Collision (2)
// ESTATE_MOBILIA_8 → Bitmask of mobilia currently purchased on Water Collision (3)
// ESTATE_MOBILIA_32 → Bitmask of mobilia currently purchased on Yellow Collision (4)
// ESTATE_MOBILIA_64 → Bitmask of mobilia currently purchased on Player Collision (5)
// ESTATE_MOBILIA_128 → Bitmask of mobilia currently purchased on Normal Collision (1)

// REAL_ESTATE_CREDITS → Credits equivalent to GP the player have. Will be used first.

// The sign is the main controller for rent system
// Doorbell is the main controller for indoor
// This is the NPC script controller
024-14,0,0,0	script	NPCs#RES_PPL	NPC_HIDDEN,{
    // load_npc ( name , map, x , y{, cell} )
    function load_npc {
        if (checknpccell(getarg(1), getarg(2), getarg(3), getarg(4, cell_chknopass))) {
            enablenpc instance_npcname(getarg(0), ESTATE_ID);
        } else {
            disablenpc instance_npcname(getarg(0), ESTATE_ID);
        }
        return;
    }
    end;

OnInit:
    // Estate Settings
    .mapa$="024-14"; // Map name

    // NPC Settings
    .sex = G_OTHER;
    .distance = 3;
    end;

// Load or unload accordingly
OnReload:
    //debugmes "[REAL ESTATE] NPC ONRELOAD";
    // load_npc ( name , map, x , y{, cell} )
    load_npc("Wardrobe#RES_PPL", .mapa$, 25, 26);
    load_npc("Cauldron#RES_PPL", .mapa$, 28, 27);
    load_npc("Piano#RES_PPL"   , .mapa$, 32, 26);
    end;

}

024-14,25,26,0	script	Wardrobe#RES_PPL	NPC_NO_SPRITE,{
    openstorage;
    end;

OnInit:
    .distance=3;
    end;
}


024-14,28,27,0	script	Cauldron#RES_PPL	NPC_NO_SPRITE,{
    mesc l("What will you brew today?");
    if (AlchemySystem(CRAFT_PLAYER))
        mesc l("Success!"), 3;
    else
        mesc l("That didn't work!"), 1;
    close;

OnInit:
    .distance=3;
    end;
}


024-14,32,26,0	script	Piano#RES_PPL	NPC_NO_SPRITE,{
    mesc l("Do you want to play a song?");
    mesc l("This is not saved.");
    select
        l("Nothing"),
        l("Default"),
        l("Indoors 1 (Peace)"),
        l("Indoors 2 (Dimonds)"),
        l("TMW Adventure"),
        l("Sailing Away!"),
        l("Magick Real"),
        l("The Forest"),
        l("Dragons and Toast"),
        l("Unforgiving Lands"),
        l("Arabesque (Action)"),
        l("No Chains (Tulimshar)"),
        l("School of Quirks (Candor)"),
        l("Cake Town (Hurnscald)"),
        l("Steam (LoF Village)"),
        l("Woodland Fantasy"),
        l("Birds in the Sunrise");

    mes "";
    .@m$="";
    switch (@menu) {
        case 1:
            close;
        case 2:
            .@m$="8bit_the_hero.ogg"; break;
        case 3:
            .@m$="peace.ogg"; break;
        case 4:
            .@m$="peace2.ogg"; break;
        case 5:
            .@m$="tmw_adventure.ogg"; break;
        case 6:
            .@m$="sail_away.ogg"; break;
        case 7:
            .@m$="magick_real.ogg"; break;
        case 8:
            .@m$="dariunas_forest.ogg"; break;
        case 9:
            .@m$="dragon_and_toast.ogg"; break;
        case 10:
            .@m$="Unforgiving_Lands.ogg"; break;
        case 11:
            .@m$="Arabesque.ogg"; break;
        case 12:
            .@m$="mvrasseli_nochains.ogg"; break;
        case 13:
            .@m$="school_of_quirks.ogg"; break;
        case 14:
            .@m$="caketown.ogg"; break;
        case 15:
            .@m$="steam.ogg"; break;
        case 16:
            .@m$="woodland_fantasy.ogg"; break;
        case 17:
            .@m$="tws_birds_in_the_sunrise.ogg"; break;

    }
    changemusic "ples@"+getcharid(0), .@m$;
    close;

OnInit:
    .distance=3;
    end;
}