summaryrefslogtreecommitdiff
path: root/npc/functions/quests.txt
blob: 657b7eff4c35743c18a083da90fc97b3b48531e5 (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
// The Mana World quest functions script

function	script	QuestSagathaHappy	{
    .@value = getarg(0, @value);
    .@unhappiness = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
    if (.@unhappiness < .@value)
        .@unhappiness = 0;

    .@unhappiness = .@unhappiness - .@value;

    QUEST_MAGIC = (QUEST_MAGIC & ~NIBBLE_3_MASK) | (.@unhappiness << NIBBLE_3_SHIFT);
    return;
}

function	script	QuestSagathaAnnoy	{
    .@value = getarg(0, @value);
    .@unhappiness = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
    if ((.@unhappiness + .@value) > 15)
        .@unhappiness = 15;

    .@unhappiness = .@unhappiness + .@value;
    QUEST_MAGIC = (QUEST_MAGIC & ~NIBBLE_3_MASK) | (.@unhappiness << NIBBLE_3_SHIFT);
    return;
}

function	script	elanore_decrease_exp	{
    .@heal_exp = getq2(MagicQuest_Healing);

    if (.@heal_exp < 8)
        .@heal_exp = 0;
    else
        .@heal_exp -= 8;

    setq2(MagicQuest_Healing, .@heal_exp);
    return;
}

function	script	ValonCount	{
    @valon_mob = 0;
    if (getq(CandorQuest_Valon) >= 2)
        @valon_mob = (getq(CandorQuest_Valon) - 2);
    @valon_count = ((STARTAREA & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
    return;
}

function	script	ResetValonCntMask	{
    STARTAREA = (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
    return;
}

function	script	ValonProgress	{
    ValonCount();
    if ((getq(CandorQuest_Valon) > 1) && (getq(CandorQuest_Valon) < 6))
        message strcharinfo(0), $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob];
    return;
}

function	script	AddValonCntMask	{
    @valon_tmp = (@valon_count + 1);
    if (@valon_tmp > $@ValonMobCnt[@valon_mob])
        @valon_tmp = $@ValonMobCnt[@valon_mob];
    STARTAREA = (STARTAREA & ~(NIBBLE_2_MASK) | (@valon_tmp << NIBBLE_2_SHIFT));
    @valon_tmp = 0;
    ValonProgress();
    return;
}