summaryrefslogtreecommitdiff
path: root/npc/003-4/sorfina.txt
blob: be0dbb4a0a17e32f449adb656446e2d6eb8fd9b6 (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
// TMW2 Script.
// Author:
//    Saulc
//    Jesusalva
// Description:
//    Sorfina is Hasan's mother.
//
//  GETQ1 Variable Value;
//  0 - Never stolen by Hasan
//  1 - Already stolen by Hasan
//  2 - Dausen pointed player to Sorfina
//  3 - Sorfina unlocked Mahoud's Basement
//  4 - Player killed Murderer Scorpion
//  5 - Quest is complete

003-4,39,33,0	script	Sorfina	NPC_FEMALE_ARGAES,{
    if (getq(TulimsharQuest_Hasan) == 2) goto L_Trouble;
    if (getq(TulimsharQuest_Hasan) == 3) goto L_Basement;
    if (getq(TulimsharQuest_Hasan) == 4) goto L_Finished;
    // Status 5 returns to default message
    if (getq(TulimsharQuest_Hasan) == 5) goto L_Reward2;
    mesn;
    mesq l("Hello, darling!");
    close;

L_Trouble:
    mesn strcharinfo(0);
    mesq l("Your son, Hasan, has stolen me!");
    next;
    mesn;
    mesq l("Oh, he has been a little rascal since his father died.");
    mesc l("*cries*");
    next;
    mesn;
    mesq l("You see, after a monster attack... My husband went to the desert, to check how things were...");
    mesc l("*cries*");
    next;
    mesn;
    mesq l("He never touched the Soul Menhir... He died... For real...");
    mesc l("*cries*");
    next;
    mesn;
    mesc l("Sorfina recomposes herself.");
    mesq l("There is a rare kind of scorpion, the Murderer Scorpion. Very dangerous.");
    setq TulimsharQuest_Hasan, 3, 0;
    next;
    goto L_Basement;

L_Basement:
    if (BaseLevel < 13) goto L_TooWeak;
    .@q3=getq3(TulimsharQuest_Hasan);
    if (.@q3 > santime()) goto L_Wait;
    mesn;
    mesq l("There's one on the basement of this house. If you kill it, Hasan will think on you as a hero and won't steal you anymore.");
    next;
    menu
        l("I will kill one."), L_OpenDoors,
        l("Maybe later."), L_Close;

L_OpenDoors:
    .@ID=getcharid(0);
    .@MAP_NAME$="hasn@"+str(.@ID); // Max 4 chars for map name
    .@INSTID = instance_create("003-4-1@a"+(.@ID), getcharid(3), IOT_CHAR);
    .@instanceMapName$ = instance_attachmap("003-4-1", .@INSTID, 0, .@MAP_NAME$);
    setq TulimsharQuest_Hasan, 3, .@INSTID, santime()+300;

    // Debug
    if (.@instanceMapName$ == "") consolewarn "Error: Map 003-4-1 X failed";
    debugmes "Created map: "+ str(.@instanceMapName$);

    // You have 5 minutes to complete the quest.
    instance_set_timeout(300, 300, .@INSTID);
    instance_init(.@INSTID);

    .@x=34;//rand(29, 45);
    .@y=33;//rand(29, 41);
    monster(.@MAP_NAME$, .@x, .@y, l("Murderer Scorpion"), MurdererScorpion, 1, "Sorfina::OnKillMurderer");
    addtimer(60000, "Sorfina::OnWarn");

    mesn;
    mesq l("Just go to the basement, past this door. Good luck, @@!", strcharinfo(0));
    close;

L_Wait:
    mesn;
    mesq l("Good luck killing it! And don't forget to touch the Soul Menhir before you go!");
    close;

L_TooWeak:
    mesn;
    mesq l("You are too weak to kill one and impress him, so please, bear my son.");
    close;

L_Close:
    close;

L_Finished:
    mesn;
    mesq l("Please, show Hasan the claw. Just talk to him.");
    close;

L_Reward2:
    mesn;
    mesq l("Thanks for helping my son. Here, take 300 GP for your troubles.");
    setq1 TulimsharQuest_Hasan, 6;
    Zeny=Zeny+300;
    close;

OnKillMurderer:
    setq TulimsharQuest_Hasan, 4;
    dispbottom l("I will take a claw and show Hasan.");
    end;

OnWarn:
    /* removed: not in map. You can leave the map.
    if (!compare(getmap(), "hasn@"))
        end;
    */
    // Quest state is invalid
    .@q=getq(TulimsharQuest_Hasan);
    if (.@q != 3)
        end;

    .@q3=getq3(TulimsharQuest_Hasan);
    dispbottom l("Time left: @@ remaining", FuzzyTime(.@q3));
    if (.@q3-gettimetick(2) > 60)
        addtimer(60000, "Sorfina::OnWarn");
    else if (.@q3-gettimetick(2) > 15)
        addtimer(15000, "Sorfina::OnWarn");
    end;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, NPCEyesD);
    setunitdata(.@npcId, UDT_HEADMIDDLE, ValentineDress); //TODO
    setunitdata(.@npcId, UDT_HEADBOTTOM, CottonTrousers);
    setunitdata(.@npcId, UDT_WEAPON, DeepBlackBoots); // Boots
    setunitdata(.@npcId, UDT_HAIRSTYLE, 16);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);

    .sex = G_FEMALE;
    .distance = 5;
    end;
}