summaryrefslogtreecommitdiff
path: root/npc/003-4/sorfina.txt
blob: 9133baca3e17f477d7c913df6c6c68ca11e6b7b4 (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
// 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,{
    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 
    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, -1;
    next;
    goto L_Basement;

L_Basement:
    if (BaseLevel < 13) goto L_TooWeak;
    if (getq3(TulimsharQuest_Hasan) > santime() || gcsantime()) 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$ == "") debugmes "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");

    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;

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

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, NPCEyes);
    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;
}