summaryrefslogtreecommitdiff
path: root/world/map/npc/029-1/valon.txt
blob: 20cbbcf8ae7e9f3c68c9f3077a6871e374d3023b (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
// This file is part of the Tutorial
// Author: Jenalya, Wushin
-|script|#ValonConfig|32767
{
    end;

OnInit:
    setarray $@ValonMob, 1002,1050,1046,1003;
    setarray $@ValonMobName$, "Maggots","House Maggots","Tame Scorpions","Scorpion";
    setarray $@ValonMobCnt, 10,5,3,1;
    end;
}
function|script|ValonCount
{
    set @valon_mob, 0;
    if (QL_VALON >= 2)
        set @valon_mob, (QL_VALON - 2);
    set @valon_count, ((STARTAREA & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
    return;
}
function|script|ResetValonCntMask
{
    set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
    return;
}
function|script|AddValonCntMask
{
    set @valon_tmp, (@valon_count + 1);
    if (@valon_tmp > $@ValonMobCnt[@valon_mob])
        set @valon_tmp, $@ValonMobCnt[@valon_mob];
    set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (@valon_tmp << NIBBLE_2_SHIFT));
    set @valon_tmp, 0;
    callfunc "ValonProgress";
    return;
}
function|script|ValonProgress
{
    callfunc "ValonCount";
    if ((QL_VALON > 1) && (QL_VALON < 6))
        message strcharinfo(0), $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob];
    return;
}
029-1,74,86,0|script|ValonDebug|156
{
    mes "[Valon Debug]";
    mes "Reset?";
    menu
        "Yes.", L_Reset,
        "No.", L_Close;

L_Reset:
    set QL_VALON, 0;
    set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
    mes "Reset!";
    goto L_Close;

L_Close:
    close;

OnInit:
    if (!debug)
        disablenpc "ValonDebug";
    end;
}
029-1,72,86,0|script|Valon|156
{
    callfunc "PCtoNPCRange";
    if(@npc_check) end;

    callfunc "ValonCount";
    if (QL_VALON >= 6)
        goto L_QuestComplete;
    if (QL_VALON == 1)
        goto L_QuestAskAgain;
    if (@valon_count >= $@ValonMobCnt[@valon_mob])
        goto L_NextMob;
    if ((QL_VALON >= 2) && (QL_VALON < 6))
        goto L_QuestStarted;
    goto L_QuestAsk;

L_QuestAskAgain:
    mes "[Valon]";
    mes "\"Hello, Adventurer! Have you come back to help?\"";
    menu
        "Yes. I will help with the island beasts.", L_Accept,
        "Maybe some other time.", L_Close;

L_QuestAsk:
    mes "[Valon]";
    mes "\"Hello!";
    mes "You're looking for adventures, right?\"";
    mes "\"But you shouldn't underestimate this island, it is dangerous.\"";
    mes "\"It's crawling with scorpions, and the heat has overcome adventurers tougher than you are.\"";
    mes "\"I should know I guard this gate from all manner of island beasts.\"";
    mes "\"Maybe you would like help and earn your stripes?\"";
    mes "\"The Council of Wizard's does offer a reward for helping...\"";
    set QL_VALON, 1;
    callfunc "ResetValonCntMask";
    menu
        "YES!!! let me at them!", L_Accept,
        "Maybe some other time.", L_Close;

L_Accept:
    set QL_VALON, 2;
    callfunc "ValonCount";
    goto L_NewMob;

L_NextMob:
    getexp 40, 0;
    mes "\"I see you killed all the " + $@ValonMobName$[@valon_mob] + " needed.\"";
    mes "\"The Wizard's thank thee as well.\"";
    set Zeny, Zeny + 25;
    set QL_VALON, (QL_VALON + 1);
    callfunc "ResetValonCntMask";
    callfunc "ValonCount";
    if (@valon_mob == getarraysize($@ValonMob))
        goto L_QuestOver;
    goto L_NewMob;

L_NewMob:
    mes "\"Let's see whats on the list. Ah ok, I need you to kill me " + $@ValonMobCnt[@valon_mob] + " " + $@ValonMobName$[@valon_mob] + "\"";
    mes "\"I'll be waiting here, come back and see after you've killed those mobs.\"";
    goto L_Close;

L_QuestStarted:
    mes "[Valon]";
    mes "Hail adventurer! You are well on your way to mastering the beasts of the island.\"";
    mes "\"You need to kill " + $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob] + "\"";
    mes "\"Come back and see me when the job is done.\"";
    goto L_Close;

L_QuestOver:
    mes "[Valon]";
    mes "\"Thanks once again for helping with the monsters in the island.\"";
    getexp 50, 0;
    set QL_VALON, (QL_VALON + 1);
    goto L_Close;

L_QuestComplete:
    mes "[Valon]";
    mes "\"Thanks once again for helping with the monsters in the island.\"";
    goto L_Close;

L_Close:
    close;
}