summaryrefslogtreecommitdiff
path: root/npc/010-4-1/katze.txt
blob: f750b7f7b9833496883837143e00bb9a667b480b (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// TMW2/LOF Script.
// Author:
//    Jesusalva
// Description:
//  THIS IS A PLACEHOLDER
// Variables:
//  $KATZE_DONATION = int
//  CaveQuest_Katze ( state, today_contribution, date )

010-4-1,44,30,0	script	Katze	NPC_KATZE,{
    mesn;
    mesq l("Meow.");
    next;
    mesn strcharinfo(0);
    mesq l("What is a cat doing in the middle of the desert?");
    next;
    mesn;
    mesq l("Why, I'm waiting for donors, of course. Don't you see the pot there?");
    next;
    mesn strcharinfo(0);
    mesq l("Do I gain anything by donating?");
    next;
    mesn;
    mesq l("My gratitude and the knowledge you helped to make this cave a nicer place to live?");
    compareandsetq CaveQuest_Katze, 0, 1;
    npctalk3 l("Did you knew that %s's generosity is legendary?", rand_sponsor());
    close;
    // No Cat Ears regardless of whatever you donate, no "lets play" like TMW Classic
    // Inspector Quest: You can ask her, she'll signal the pot, and THEN you start
    // giving Katze the items for the cat ears.
    // She'll, however, reward you with the information you're looking for.
    // After instructing her on how to trade, she'll reward you a Golden Apple
    // You can come back to Inspector to begin the second part.
    // Use Fairy Hat instead of Inspector Hat?
    // "It was... an itch I couldn't scratch. But I paid for it! I know Golden Apples are rare, they should have more than covered the costs for what I took."
    end;

// At some times, she goes to rob the bank... No, just kidding
OnClock1945:
    disablenpc .name$;
    end;
OnClock2015:
    enablenpc .name$;
    end;

OnInit:
    .distance=5;
    .sex = G_OTHER;

OnLoadMobilia:
    if ($KATZE_DONATION >= 5000)
        setcells "010-4-1", 44, 31, 44, 31, 2, "Katze_Books1";
    if ($KATZE_DONATION >= 10000)
        setcells "010-4-1", 43, 29, 43, 29, 2, "Katze_Hat1";
    if ($KATZE_DONATION >= 25000)
        setcells "010-4-1", 44, 22, 44, 22, 2, "Katze_Paint1";
    if ($KATZE_DONATION >= 60000)
        setcells "010-4-1", 46, 29, 46, 29, 2, "Katze_Flower1";
    if ($KATZE_DONATION >= 120000)
        setcells "010-4-1", 40, 33, 40, 33, 2, "Katze_Paint2";
    if ($KATZE_DONATION >= 250000)
        setcells "010-4-1", 40, 28, 40, 28, 2, "Katze_Books2";
    if ($KATZE_DONATION >= 500000)
        setcells "010-4-1", 46, 35, 46, 35, 2, "Katze_Flower2";
    if ($KATZE_DONATION >= 1000000)
        setcells "010-4-1", 46, 22, 46, 22, 2, "Katze_Paint3";
    if ($KATZE_DONATION >= 1500000)
        setcells "010-4-1", 41, 22, 41, 22, 2, "Katze_Cooks1";
    if ($KATZE_DONATION >= 2500000)
        setcells "010-4-1", 47, 30, 47, 30, 2, "Katze_Cooks2";
    if ($KATZE_DONATION >= 3000000)
        setcells "010-4-1", 42, 29, 42, 29, 2, "Katze_Cryst1";
    if ($KATZE_DONATION >= 3500000)
        setcells "010-4-1", 45, 31, 45, 31, 2, "Katze_Candle";
    if ($KATZE_DONATION >= 4000000)
        setcells "010-4-1", 46, 33, 46, 33, 2, "Katze_Paint4";
    if ($KATZE_DONATION >= 4500000)
        setcells "010-4-1", 47, 29, 47, 29, 2, "Katze_Desks1";
    if ($KATZE_DONATION >= 5000000)
        setcells "010-4-1", 48, 29, 48, 29, 2, "Katze_Cooks3";
    if ($KATZE_DONATION >= 6000000)
        setcells "010-4-1", 41, 28, 41, 28, 2, "Katze_Books3";
    if ($KATZE_DONATION >= 7000000)
        setcells "010-4-1", 45, 22, 45, 22, 2, "Katze_Paint5";
    if ($KATZE_DONATION >= 8000000)
        setcells "010-4-1", 37, 28, 37, 28, 2, "Katze_Flower3";
    if ($KATZE_DONATION >= 9000000)
        setcells "010-4-1", 43, 22, 43, 22, 2, "Katze_Cooks4";
    if ($KATZE_DONATION >= 1000000)
        setcells "010-4-1", 39, 33, 39, 33, 2, "Katze_Clock1";
    if ($KATZE_DONATION >= 1250000)
        setcells "010-4-1", 53, 24, 53, 24, 2, "Katze_Notes1";
    if ($KATZE_DONATION >= 1500000)
        setcells "010-4-1", 56, 25, 56, 25, 2, "Katze_Gifts1";
    if ($KATZE_DONATION >= 1750000)
        setcells "010-4-1", 40, 22, 40, 22, 2, "Katze_Cooks5";
    if ($KATZE_DONATION >= 2000000)
        setcells "010-4-1", 53, 26, 53, 26, 2, "Katze_Anvil1";
    if ($KATZE_DONATION >= 2500000)
        setcells "010-4-1", 35, 20, 35, 21, 2, "Katze_Statue1";
    end;
}

010-4-1,46,30,0	script	Pot#Katze	NPC_NO_SPRITE,{
    .@q = getq(CaveQuest_Katze);
    .@q3 = getq3(CaveQuest_Katze);
    // Quest not started
    if (!.@q) end;
    // Daily limit reset
    if (.@q3 != gettimeparam(GETTIME_DAYOFMONTH))
        setq CaveQuest_Katze, .@q, 0, gettimeparam(GETTIME_DAYOFMONTH);
    // Main loop
    mes "##B" + l("Drag and drop an item from your inventory.") + "##b";

    .@id = requestitem();

    // Check for donation restrictions
    if (.@id < 1) {
        mesc l("You give up.");
        close;
    } else if (checkbound(.@id)) {
        mesc l("You cannot donate bound items!");
        close;
    } else if ((getiteminfo(.@id, ITEMINFO_TRADE) & ITR_NOSELLTONPC)) {
        mesc l("This item cannot be given to NPCs!");
        close;
    } else if (!getiteminfo(.@id, ITEMINFO_MAXCHANCE)) {
        mesc l("This item is too precious, you cannot part with it!");
        close;
    } else if (getiteminfo(.@id, ITEMINFO_TYPE) != IT_HEALING &&
                 getiteminfo(.@id, ITEMINFO_TYPE) != IT_USABLE &&
                 getiteminfo(.@id, ITEMINFO_TYPE) != IT_ETC) {
        mesc l("You can only donate generic items to Katze.");
        close;
    }

    // Limit checks
    .@q2 = getq2(CaveQuest_Katze);
    .@gp = getiteminfo(.@id, ITEMINFO_SELLPRICE);
    if ((.@q2 + .@gp) > .limit) {
        mesc l("You cannot donate this item, as Katze is no beggar and she'll not allow you to impoverish yourself for her sake.");
        mesc l("Daily limit: %s / %s GP", fnum(.@q2 + .@gp), fnum(.limit)), 1;
        close;
    }

    // Everything went fine, so confirm & complete the donation
    mesc l("Are you sure you want to donate a %s to Katze?", getitemlink(.@id)), 1;
    if (askyesno() == ASK_YES) {
        delitem .@id, 1;
        setq2 CaveQuest_Katze, .@q2 + .@gp;
        $KATZE_DONATION += .@gp;
        npctalk l("Why %s, thank you!", strcharinfo(0)), "Katze";
        if ($@GM_OVERRIDE)
            debugmes sprintf("Katze Donations: %s", fnum($KATZE_DONATION));
        donpcevent "Katze::OnLoadMobilia";
        // TODO: INSPECTOR QUEST HANDLER = getq(LoFQuest_Inspector)
    }
    closeclientdialog;
    close;

OnInit:
    .distance=2;
    .sex = G_OTHER;
    .limit = 10000; // Max worth you can donate at once
    end;
}