summaryrefslogtreecommitdiff
path: root/npc/003-1/hasan.txt
blob: 658e4d3982272960075f77c357a9f60831770384 (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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
// TMW-2 Script
// Author:
//  Jesusalva
// Description:
//  Hasan is the city bully and steals from the player. He lost his father to a Murderer
//  Scorpion. Will respect player if they kill one. His mother is Sorfina, who
//  explains this and cries that he never touched a Soul Menhir. Allows the player
//  to kill the scorpion on Mahoud's Basement.
//
//  Player must report theft first to Dausen, who will tell the player that's
//  normal and nobody messes with Hasan, and giving player a pointer that they should
//  tell his mother, Sorfina.
//
//  Reward: Cotton Short, Hasan won't steal from you anymore.
//
//  GETQ1 Variable Value;
//  0 - Hasan has never stolen from the player
//  1 - Hasan already stole from the player
//  2 - Dausen pointed player to Sorfina
//  3 - Sorfina unlocked Mahoud's Basement
//  4 - Player killed Murderer Scorpion
//  5 - Quest is complete
//
//  $HASAN_ST
//      Number of Scorpions killed during Autumn
//  $HASAN_GP
//      Total money Hasan collected for Autumn event
//  $HASAN_LT
//      Previous collected money, for rewards calc
//
//  PS. $@GM_OVERRIDE will disable Season restrictions, but values from 20/09 and 21/12
//  must be set manually.

// Temporary sprite
003-1,62,148,0	script	Hasan	NPC_ELVEN_MAN_RED,2,2,{
    if (getq(TulimsharQuest_Hasan) == 0) goto L_Safe;
    if (getq(TulimsharQuest_Hasan) == 4) goto L_Finish;
    if (getq(TulimsharQuest_Hasan) >= 5) goto L_Complete;
    mesn strcharinfo(0);
    mesq l("Give me back what you stole, thief!");
    next;
    mesn;
    mesq l("I stole nothing from you. Do you have any proof?");
    next;
    menu
        l("I have a print screen!"), L_Print,
        l("No..."), L_Close;
    close;

L_Away:
    mesn;
    mesq l("Hey... Go bother someone else.");
    close;

L_Print:
    mes "";
    mesn;
    mesq l("Let me analyze that.");
    mesc l("Hasan takes your print screen and analyzes it.");
    next;
    mesn;
    mesq l("Photoshopped. Definitely. Good luck convincing somebody with that! %%a");
    next;
    mesn;
    mesq l("If you go to Lieutenant Dausen, he'll say that you used GIMP. Just give up.");
    close;

// TODO
L_Finish:
    mesn;
    // The scorpion and not a scorpion because of dramatic buildup.
    mesq l("Is that... Wait... Wow. You... Killed the murderer scorpion.");
    next;
    mesn;
    mesq l("I promise I'll never steal from you again. Here, take these shorts.");
    mesq l("Good job, man!");
    setq TulimsharQuest_Hasan, 5;
    getitem CottonShorts, 1;
    getexp 99, 55;
    close;

L_Complete:
    mesn;
    mesq l("Thanks for avenging my father.");
    next;
    mesn;
    mesq l("I am collecting money for the Yearly Autumn Scorpion Hunter quest.");
    mesq l("You're, of course, invited. Thus far, the total prize money I've collected is @@ GP.", $HASAN_GP);
    if (season() == AUTUMN || $@GM_OVERRIDE || is_staff()) {
        mesq l("You've killed @@ scorpions, and a total of @@ were killed this season.", fnum(getq2(SQuest_Autumn)), fnum($HASAN_ST));
        mesq l("If the event ended now, you would get @@ GP.", getq2(SQuest_Autumn)*$HASAN_GP/$HASAN_ST);
        mes "";
        mesc l("Note: Poll may increase more than total money donated depending on current date.");
        menuint
            l("Thanks."),                                       0,
            rif(Zeny >= 5, l("Donate 5 GP for prize")),         5,
            rif(Zeny >= 15, l("Donate 15 GP for prize")),       15,
            rif(Zeny >= 50, l("Donate 50 GP for prize")),       50,
            rif(Zeny >= 100, l("Donate 100 GP for prize")),     100,
            rif(Zeny >= 1000, l("Donate 1k GP for prize")),     1000,
            rif(Zeny >= 10000, l("Donate 10k GP for prize")),   10000,
            rif(Zeny >= 25000, l("Donate 25k GP for prize")),   25000,
            rif(Zeny >= 100000, l("Donate 100k GP for prize")), 100000,
            rif(Zeny >= 250000, l("Donate 250k GP for prize")), 250000;
        if (@menuret > 0) {
            Zeny=Zeny-@menuret;
            .@poll=@menuret;
            .@bonus=10000;
            .@bonus+=rand(gettime(GETTIME_MONTH) == DECEMBER ? 2000 : 4000);
            .@bonus+=(gettime(GETTIME_MONTH) == DECEMBER ? 0 : 1000);
            .@poll=.@poll*.@bonus/10000;
            $HASAN_GP=$HASAN_GP+.@poll;
        }
    }

    .@q=getq(SQuest_Autumn);
    if (season() == WINTER && (.@q == gettime(GETTIME_YEAR) || (.@q == gettime(GETTIME_YEAR)-1 && gettime(GETTIME_MONTH) <= MARCH))) {
        .@p=getq2(SQuest_Autumn)*$HASAN_LT/$HASAN_ST;
        mesn l("Summary");
        mes l("Scorpions killed: @@/@@ scorpions", getq2(SQuest_Autumn), $HASAN_ST);
        mes l("Total money collected: @@ GP", $HASAN_LT);
        mesc l("Your prize: %s GP", fnum(.@p)), 2;
        if (getq2(SQuest_Autumn) > 20)
            getexp (getq2(SQuest_Autumn)/20), 0;
        if (.@p >= 1)
            Zeny+=.@p;

        // Top 5 reward
        if (strcharinfo(0) == $@hasn_name$[0])
            getitem SupremeGift, 1;
        if (strcharinfo(0) == $@hasn_name$[1])
            getitem PrismGift, 1;
        if (strcharinfo(0) == $@hasn_name$[2])
            getitem GoldenGift, 1;
        if (strcharinfo(0) == $@hasn_name$[3])
            getitem SilverGift, 1;
        if (strcharinfo(0) == $@hasn_name$[4])
            getitem BronzeGift, 1;

        // Quest is closed
        setq1 SQuest_Autumn, 1970;
        next;
        mes ".:: Scoreboards ::.";
    	mesf("1. %s (%d)", $@hasn_name$[0], $@hasn_value[0]);
    	mesf("2. %s (%d)", $@hasn_name$[1], $@hasn_value[1]);
    	mesf("3. %s (%d)", $@hasn_name$[2], $@hasn_value[2]);
    	mesf("4. %s (%d)", $@hasn_name$[3], $@hasn_value[3]);
    	mesf("5. %s (%d)", $@hasn_name$[4], $@hasn_value[4]);
    }
    close;

L_TouchComplete:
    if (@hasan_antiflood < gettimetick(2)) {
        npctalkonce l("Hey there, @@! Good luck killing monsters!", strcharinfo(0)), 3;
        @hasan_antiflood=gettimetick(2)+600;
    }
    end;

L_Close:
    close;

OnTouch:
    if (getq(TulimsharQuest_Hasan) >= 5) goto L_TouchComplete;
    if (Zeny > 15) goto L_Steal;
    end;

L_Steal:
    npctalkonce(l("*whistles*"));
    if (getq(TulimsharQuest_Hasan) == 0) goto L_DoSteal;
    if (getq(TulimsharQuest_Hasan) <= 4 && rand(0,100) < 20) goto L_DoSteal;
    end;

L_DoSteal:
    .@s=rand(3,12);
    $HASAN_GP=$HASAN_GP+.@s;
    Zeny=Zeny-.@s;
    if (getq(TulimsharQuest_Hasan) == 0)
        setq TulimsharQuest_Hasan, 1;
    dispbottom l("##BYou were robbed##b by an evil NPC.");
    end;

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

    //npcspeed(150);
    //npcwalkto(<x>, <y>);
    end;

// Restart hasan status on 20/09 (double-sure)
OnDay0920:
    $HASAN_ST=0;
    end;

// Once autumn is over (21/12) restart GP poll and send value to backup
OnDay1221:
    $HASAN_LT=0+$HASAN_GP;
    $HASAN_GP=2000+(TOP3AVERAGELVL()*100);
    end;
}

function	script	SQuest_Hasan	{
    if (season() != AUTUMN && !$@GM_OVERRIDE)
        return;
    if (getq(SQuest_Autumn) != gettime(GETTIME_YEAR))
        setq SQuest_Autumn, gettime(GETTIME_YEAR), 0;

    // All scorpions are counting for Hasan Autumn Quest
    if (
        killedrid == Scorpion ||
        killedrid == RedScorpion ||
        killedrid == BlackScorpion ||
        killedrid == CandorScorpion ||
        killedrid == AngryScorpion ||
        killedrid == AngryRedScorpion ||
        killedrid == NightScorpion ||
        killedrid == GoldenScorpion ||
        killedrid == MurdererScorpion) {
            setq2 SQuest_Autumn, getq2(SQuest_Autumn)+1;
            $HASAN_ST=$HASAN_ST+1;
    }
    return;
}