summaryrefslogtreecommitdiff
path: root/npc/003-1/jeric.txt
blob: 90464500011e8ac5d48afd80d9397cea8c4e3f9a (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
// Evol scripts.
// Author:
//    Reid
// Description:
//    Blacksmith's assistant of Artis
// Variables:
//    ArtisQuests_Enora
// Values:
//    0    Default.
//    1    BlackSmith quest delivered.
//    2    Chelios Quest given.
//    3    Chelios Quest done.
//    4    BlackSmith gave the sword.

003-1,93,125,0	script	Jeric	NPC_PLAYER,{

    .Item1 = RightCraftyWing;
    .Item2 = LeftCraftyWing;
    .ItemReward = FlightTalisman;
    
    function quest_beggining{
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("my name is karim can you help me?.");
        
        setq Karim_Quest, 1;
        return;
    }

    function quest_left {
        if (countitem(.Item2) > 0)
        {
            delitem .Item2, 1;
            if (rand(10) == 1)
            {
                mesq l("Yay, it worked! You get a good wing.");
                getitem .ItemReward, 1;
                setq Karim_Quest, 2;
                close;
            }
            else
            {
                mesq l("This one is useless! Give me another @@.", getitemlink(.Item2));
                return;
            }
        }
        else
        {
            mesq l("You don't have any @@, are you mocking me?", getitemlink(.Item2));
            return ;
        }
    }

    function quest_right {
        if (countitem(.Item1) > 0)
        {
            delitem .Item1, 1;
            if (rand(5) == 1)
            {
                mesq l("Yay, it worked! You get a good wing.");
                getitem .ItemReward, 1;
                setq Karim_Quest, 2;
                close;
            }
            else
            {
                mesq l("This one is useless! Give me another @@.", getitemlink(.Item1));
                next;
                return;
            }
        }
        else
        {
            mesq l("You don't have any @@, are you mocking me?", getitemlink(.Item1));
            return ;
        }
    }

    function quest_started {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("Can you give me a @@ or a @@", getitemlink(.Item1), getitemlink(.Item2));

        do
        { 
            select
            l("a Right Crafty Wing"),
            l("a Left Crafty Wing"),
            menuaction(l("Quit"));
        
        switch (@menu)
        {
            case 1:
                quest_right;
                break;
            case 2:
                quest_left;
                break;
        }
        } while (@menu != 3);
        return;
    }

    function quest_completed {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Quest completed.");
        return;
    }

    function quest_restart {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Quest restart.");
        setq Karim_Quest, 0;
        return;
    }

    speech S_LAST_NEXT, l("Can you help me?");

    do
    {
        .@karim = getq(Karim_Quest);
        select
            rif(.@karim == 2, lg("quest completed.")),
            rif(.@karim == 1, l("Hello again can you give you give me some tentacles.")),
            rif(.@karim == 0, l("Hello")),
            l("Debug"),
            menuaction(l("Quit"));

        switch (@menu)
        {
            case 1:
                quest_completed;
                break;
            case 2:
                quest_started;
                break;
            case 3:
                quest_beggining;
                break;
            case 4:
                quest_restart;
                break;
        }
    } while (@menu != 5);

    closedialog;
    goodbye;
    close;

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