summaryrefslogtreecommitdiff
path: root/npc/002-2/kps.txt
blob: bcdfb1e7d221badc334e18a11ea57c5aa5293cb8 (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
002-2,120,89,0	script	KPS Manager	NPC191,{
    @run = ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
    @run_cnt = ((QUEST_NorthTulimshar & TWOBIT_9_MASK) >> TWOBIT_9_SHIFT);
    if (QL_KYLIAN == 15)
        goto L_SeeKylian;
    if (QL_KYLIAN == 14)
        goto L_RunComplete;
    if (QL_KYLIAN == 13)
        goto L_RunStarted;
    if (QL_KYLIAN == 12) 
        goto L_JobSelect;
    if (QL_KYLIAN == 11)
        goto L_AcceptJob;
    if (QL_KYLIAN == 10)
        goto L_OfferJob;
    goto L_Default;

L_Default:
    mes "[KPS Manager]";
    mes "\"A rich salesman named Kylian bought this shop recently.\"";
    mes "\"I'm waiting for him to give the go-ahead on opening it up, but I haven't heard from him in a while.\"";
    next;
    mes "\"I wonder if he needs any help...\"";
    next;
    mes "\"If you could go over and check on him in the inn while I tend to the store, I'd really appreciate it.\"";
    goto L_close;

L_OfferJob:
    mes "[KPS Manager]";
    mes "\"Hello! How can I help you today?\"";
    menu
        "My name is " + strcharinfo(0) + ".", L_MyName,
        "Nothing.", L_close;

L_MyName:
    QL_KYLIAN = 11;
    mes "\"Ah. Kylian said you would be dropping by.\"";
    next;
    mes "\"I assume you are looking for some work?\"";
    menu
        "Yes.", L_StartJob,
        "No.", L_close;

L_AcceptJob:
    mes "[KPS Manager]";
    mes "\"Interested in some work?\"";
    menu
        "Yes.", L_StartJob,
        "No.", L_close;

L_StartJob:
    @run = 0;
    callfunc "SetKylianRun";
    @run_cnt = 0;
    callfunc "SetKylianRunCnt";
    QL_KYLIAN = 12;
    goto L_JobSelect;

L_StartJobAgain:
    @run = 0;
    callfunc "SetKylianRun";
    QL_KYLIAN = 12;
    goto L_JobSelect;

L_JobSelect:
    if ((gettimetick(2) - Kylian_Timer) < 86400)
        goto L_NoPackages;
    mes "[KPS Manager]";
    mes "\"We have a number of deliveries that need to go all over the world.\"";
    next;
    goto L_RandJob;

L_RandJob:
    @rand_quest = rand(1,3);
    goto L_JobInfo;

L_JobInfo:
    mes "\"We have a delivery for ##B" + $@random_quests$[@rand_quest] + "##b.\"";
    menu
        "I'll take it.", L_StartRun,
        "Anything else?", L_RandJob,
        "I need a break.", L_close;

L_StartRun:
    QL_KYLIAN = 13;
    @run = @rand_quest;
    callfunc "SetKylianRun";
    Kylian_Timer = gettimetick(2);
    goto L_close;

L_RunStarted:
    mes "Deliver this package to ##B" + $@random_quests$[@run] + "##b.\"";
    goto L_close;

L_RunComplete:
    @elapsed_time = (gettimetick(2) - Kylian_Timer);
    if (@elapsed_time > 600)
        goto L_Failed;
    @run_cnt = (@run_cnt + 1);
    callfunc "SetKylianRunCnt";
    // Set Kylian wants to see you reward state
    if (@run_cnt > 3)
        goto L_KylianReward;
    goto L_RunAgain;

L_SeeKylian:
    mes "\"You need to go see Kylian before I can give you any more work.\"";
    goto L_close;

L_Failed:
    mes "\"If you're faster next time, you can earn a bonus.\"";
    next;
    goto L_RunAgain;

L_KylianReward:
    Zeny = Zeny + $@delivery_money;
    getexp ($@delivery_exp_mod * BaseLevel), 0;
    callfunc "SetKylianRun";
    QL_KYLIAN = 15;
    mes "[" + $@delivery_money + " money]";
    mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
    next;
    mes "\"I've got news for you! Kylian wants me to send you over right away.\"";
    goto L_close;

L_RunAgain:
    Zeny = Zeny + $@delivery_money;
    getexp ($@delivery_exp_mod * BaseLevel), 0;
    callfunc "SetKylianRun";
    mes "[" + $@delivery_money + " money]";
    mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
    next;
    mes "\"Good job! Keep up the nice work, and I'm sure the boss will give you a bonus.\"";
    next;
    goto L_StartJobAgain;

L_NoPackages:
    mes "\"Sorry, but we don't have any more jobs open right now.\"";
    mes "\"Come back tomorrow; maybe we will have some more work then.\"";
    goto L_close;

L_close:
    close;
}
function	script	SetKylianRun	{
    QUEST_NorthTulimshar = (QUEST_NorthTulimshar & ~(TWOBIT_8_MASK)) | (@run << TWOBIT_8_SHIFT);
    return;
}
function	script	SetKylianRunCnt	{
    QUEST_NorthTulimshar = (QUEST_NorthTulimshar & ~(TWOBIT_9_MASK)) | (@run_cnt << TWOBIT_9_SHIFT);
    return;
}