summaryrefslogblamecommitdiff
path: root/npc/functions/quests.txt
blob: fcdc13eb35e885eb237f49b0def722003a9921fa (plain) (tree)




































                                                                                     





























                                                                                                                    
// 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 (QL_VALON >= 2)
        @valon_mob = (QL_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 ((QL_VALON > 1) && (QL_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;
}