summaryrefslogtreecommitdiff
path: root/npc/001-3-0/mundane.txt
blob: ff4d51b9965345b122071715d75d639228a268fa (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
// Evol Scripts
// Author:
//    Jesusalva
// Description:
//    Mundane (anagram of Unnamed) is Mona's father

// Note: Due technical limitations do not make Mundane move
// Note: Temporary sprite
001-3-0,161,59,0	script	Mundane	NPC_MUNDANE,{

    function quest_completed
    {
    speech(0x0,
        l("No matter how many times I come here, I can't find the reason for the strange sounds..."),
        l("It is either a huge monster, some cultists, or someone throwing strange stuff into sewers."));
    close;
    }

    function rescue_mundane
    {
    speech(S_LAST_NEXT,
        l("Scary... I am afraid of these blubs and rattos... And worse, I am lost..."),
        l("I already killed many strong monsters, but I everyone have fears, right?!"),
        l("My daughter is probably worried with me. Could you perhaps lead me out of here?"));

        switch (select(l("Yes, follow me!"), l("Not now. You see, I am also afraid of Blubs and Rattos!")))
        {
            case 1:
                mes "";
                break;
            case 2:
                speech(S_FIRST_BLANK_LINE,
                    l("That's too bad... Although I think you're lying."),
                    l("If it is the latter, please take some courage and help me!"));
                close;
                break;
        }
        .@ID=getcharid(0);
        .@MAP_NAME$="mona@"+str(.@ID);
        .@MUNDANE_INSTID = instance_create("001-3-0@a"+(.@ID), getcharid(3), IOT_CHAR);
        //debugmes "You are "+str(.@ID);

        //if (.@MUNDANE_INSTID < 0) debugmes "Error: No instance ID";
        //debugmes "new instance id: " + str(.@MUNDANE_INSTID);

        // XXX - Important Note - XXX
        // We currently have only FOUR chars to name the map. "001-3-0" or "mundane" have 7 chars, so that cannot be used.
        // Thankfully, "mona" have 4 chars, so it's the name.
        //
        // Rationale: We have only 11 chars available, but 7 are reserved. So, longest name would be "abcd" + "@" + getcharid(0)
        // Some test reported that (apparently) we have 15 whitespaces at map name start, not sure why.
        .@instanceMapName$ = instance_attachmap("001-3-0", .@MUNDANE_INSTID, 0, .@MAP_NAME$);

        //if (.@instanceMapName$ == "") debugmes "Error: Map 001-3-0 X failed";
        //debugmes "Created map: "+ str(.@instanceMapName$);

        // You have 5 minutes to complete the quest. This does not results in failure by itself, getq2 does that
        instance_set_timeout(300, 300, .@MUNDANE_INSTID);
        instance_init(.@MUNDANE_INSTID);
        dispbottom(l("Mona Father's is right behind you. You have five minutes to bring him out of sewers!"));

        // Not sure if Green Slimes are exactly what we want here - and shouldn't it be "Slime"? (mind upper-case)
        areamonster(.@MAP_NAME$, 119, 51, 162, 85, l("Green Slime"), slime, 3);
        setq ArtisQuests_MonaDad, 2;
        warp(.@MAP_NAME$, 161,59);
        close;

    }

    .@q=getq(ArtisQuests_MonaDad);
    if (.@q != 1) quest_completed();
    if (.@q == 1) rescue_mundane();

    hello;
    end;

OnInit:
    .sex = G_MALE;
    .distance = 3;
    end;

OnInstanceInit:
    disablenpc(instance_npcname(.name$));
    end;

OnPCDieEvent:
    if (getq(ArtisQuests_MonaDad) != 2) end;
    setq ArtisQuests_MonaDad, 1;
    dispbottom l("What a pity! You've died.");
    //warp("Save",0,0); // That works, but won't revive you without recovery();
    end;
}

// >>>>>>> Initial proof-of-concept version, works, but quest cannot be completed yet