// The following auxiliary function is used both by appropriate magic and within the regular script:
function script QuestMoubooHeal {
set @Q_MASK, NIBBLE_2_MASK;
set @Q_SHIFT, NIBBLE_2_SHIFT;
set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
set @Q_status_upper, @Q_status & 12;
set @Q_status, @Q_status & 3;
set @STATE_INITIAL, 0;
set @STATE_HEALED_MOUBOO, 3;
if (@Q_status != @STATE_INITIAL)
goto L_nothing;
set @Q_status, @STATE_HEALED_MOUBOO;
callsub S_update_var;
mes "[Injured Mouboo]";
mes "A soft white glow surrounds the mouboo's leg, which slowly shifts back into place.";
mes "As the glow subsides, the mouboo gets up, carefully, and takes a few steps. It seems to be fully healed!";
mes "[5000 experience points]";
getexp 5000, 0;
next;
mes "[Injured Mouboo]";
mes "Visibly happy, the mouboo lies down on the ground and snuggles with a black piece of cloth it had been lying on.";
mes "The healing process must have been exhausting, for it is asleep in an instant.";
next;
set @value, 15;
callfunc "QuestSagathaHappy";
close;
L_nothing:
mes "Your spell has no effect.";
next;
close;
S_update_var:
set @Q_wr_status, @Q_status | @Q_status_upper;
set QUEST_MAGIC,
(QUEST_MAGIC & ~(@Q_MASK)
| (@Q_wr_status << @Q_SHIFT));
return;
}
012-1.gat,57,153,0 script Mouboo 171,{
set @Q_MASK, NIBBLE_2_MASK;
set @Q_SHIFT, NIBBLE_2_SHIFT;
set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
set @Q_status_upper, @Q_status & 12;
set @Q_status, @Q_status & 3;
set @STATE_INITIAL, 0;
set @STATE_KILLED_MOUBOO, 1;
set @STATE_TOOK_KILL_REWARD, 2;
set @STATE_HEALED_MOUBOO, 3;
if (@Q_status == @STATE_KILLED_MOUBOO)
goto L_dead;
if (@Q_status == @STATE_TOOK_KILL_REWARD)
goto L_took_reward;
if (@Q_status == @STATE_HEALED_MOUBOO)
goto L_healed;
mes "[Injured Mouboo]";
mes "You notice a mouboo lying on the ground, groaning, as if in pain.";
next;
L_menu:
menu
"Examine the mouboo", L_examine,
"Give the mouboo something", L_give,
"Kill the mouboo", L_kill,
"Leave", -;
close;
L_examine:
mes "[Injured Mouboo]";
mes "Looking closer, you notice that the mouboo's left hind leg is bent in a very unnatural angle-- that seems to be the cause for its pain.";
next;
mes "[Injured Mouboo]";
mes "You also notice that the mouboo is lying on top of what appears to be a black turtleneck sweater.";
mes "Do you want to pick up the sweater?";
next;
menu
"Yes.", L_pickup_alive,
"No.", L_menu;
goto L_menu;
L_pickup_alive:
mes "[Injured Mouboo]";
mes "The Mouboo groans and pushes your hand away. It seems to be rather fond of the sweater.";
next;
goto L_menu;
L_give:
set @items_nr, 12;
setarray @items, 501, 502, 509, 527, 534, 535, 539, 541, 684, 685, 686, 687;
setarray @itemeat, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0;
setarray @choice$, "", "", "", "", "", "", "", "", "", "", "", "";
set @choices_nr, 0;
setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
setarray @choice_eat, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
set @n, 0;
L_nloop:
set @k, @items[@n];
if (countitem(@k) == 0)
goto L_nloop_skip;
set @name$, getitemname(@k);
set @choice$[@n], @name$;
set @choice_idx[@n], @k;
set @choice_eat[@n], @itemeat[@n];
L_nloop_skip:
set @n, @n+1;
if (@n < @items_nr)
goto L_nloop;
menu
@choice$[0], -
@choice$[1], -
@choice$[2], -
@choice$[3], -
@choice$[4], -
@choice$[5], -
@choice$[6], -
@choice$[7], -
@choice$[8], -
@choice$[9], -
@choice$[10], -
@choice$[11], -;
set @menu, @menu - 1;
set @choice, @choice_idx[@menu];
set @choice_e, @choice_eat[@menu];
set @verb$, "drinks";
if (@choice_e)
set @verb$, "eats";
if (@choice && countitem(@choice))
goto L_consume;
goto L_menu;
L_consume:
mes "[Injured Mouboo]";
mes "The mouboo " + @verb$ + " your " + getitemname(@choice) + ".";
delitem @choice, 1;
next;
if (@choice == 687)
goto L_do_heal;
mes "[Injured Mouboo]";
mes "Unfortunately, it seems to have had no effect.";
goto L_menu;
L_do_heal:
callfunc "QuestMoubooHeal";
L_kill:
mes "[Injured Mouboo]";
if (BaseLevel > 44)
goto L_kill_success;
mes "The mouboo deflects your attack and counterattacks!";
mes "It misses you only barely.";
mes "Injured though it may be, this mouboo is still more than a match for you!";
next;
goto L_menu;
L_kill_success:
mes "After some wrestling, the mouboo succumbs to your attacks.";
mes "[100 experience points]";
getexp 100, 0;
set @Q_status, @STATE_KILLED_MOUBOO;
callsub S_update_var;
next;
L_dead:
mes "[Dead Mouboo]";
mes "The dead mouboo is lying on top of a black T-neck sweater.";
getinventorylist;
if (@inventorylist_count == 100)
goto L_nopickup;
getitem 2076, 1;
mes "You pull out the sweater and stuff it into your backpack.";
set @Q_status, @STATE_TOOK_KILL_REWARD;
callsub S_update_var;
next;
close;
L_took_reward:
mes "[Dead Mouboo]";
mes "You see a dead mouboo.";
next;
close;
L_nopickup:
mes "Unfortunately, you can't carry any more.";
next;
close;
L_healed:
mes "[Mouboo]";
mes "The mouboo is sleeping soundly, smiling in its dreams.";
next;
close;
S_update_var:
set @Q_wr_status, @Q_status | @Q_status_upper;
set QUEST_MAGIC,
(QUEST_MAGIC & ~(@Q_MASK)
| (@Q_wr_status << @Q_SHIFT));
return;
}