summaryrefslogblamecommitdiff
path: root/npc/functions/quests.txt
blob: 4706a5179ecc4f76af71f206aa2d5bf03cf654fb (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 (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), getmonsterinfo($@ValonMob[@valon_mob], MOB_NAME) + ": " + @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;
}